Google Cloud Platform · Arazzo Workflow

Google Cloud Platform Walk Resource Hierarchy

Version 1.0.0

Find an organization, list its folders, then list the projects directly under it.

1 workflow 1 source API 1 provider
View Spec View on GitHub API ManagementCloud ComputingInfrastructurePlatform as a ServiceArazzoWorkflows

Provider

google-cloud-platform

Workflows

walk-resource-hierarchy
Resolve an organization and enumerate its child folders and projects.
Searches for an organization by query, then lists its child folders and projects.
3 steps inputs: query outputs: folders, organizationName, projects
1
findOrganization
cloudresourcemanager.organizations.search
Search for the organization and capture the first matching organization resource name.
2
listFolders
cloudresourcemanager.folders.list
List the folders that are direct children of the resolved organization.
3
listProjects
cloudresourcemanager.projects.list
List the projects that are direct children of the resolved organization.

Source API Descriptions

Arazzo Workflow Specification

google-cloud-platform-walk-resource-hierarchy-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Google Cloud Platform Walk Resource Hierarchy
  summary: Find an organization, list its folders, then list the projects directly under it.
  description: >-
    Discovers the top of a resource hierarchy. The workflow searches for an
    organization by domain, lists the folders that are direct children of that
    organization, and lists the projects that are direct children of the same
    organization, giving a one-pass view of the first hierarchy level. 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: walk-resource-hierarchy
  summary: Resolve an organization and enumerate its child folders and projects.
  description: >-
    Searches for an organization by query, then lists its child folders and
    projects.
  inputs:
    type: object
    required:
    - query
    properties:
      query:
        type: string
        description: Organization search query, e.g. domain:example.com.
  steps:
  - stepId: findOrganization
    description: >-
      Search for the organization and capture the first matching organization
      resource name.
    operationId: cloudresourcemanager.organizations.search
    parameters:
    - name: query
      in: query
      value: $inputs.query
    - name: pageSize
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      organizationName: $response.body#/organizations/0/name
  - stepId: listFolders
    description: >-
      List the folders that are direct children of the resolved organization.
    operationId: cloudresourcemanager.folders.list
    parameters:
    - name: parent
      in: query
      value: $steps.findOrganization.outputs.organizationName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      folders: $response.body#/folders
  - stepId: listProjects
    description: >-
      List the projects that are direct children of the resolved organization.
    operationId: cloudresourcemanager.projects.list
    parameters:
    - name: parent
      in: query
      value: $steps.findOrganization.outputs.organizationName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      projects: $response.body#/projects
  outputs:
    organizationName: $steps.findOrganization.outputs.organizationName
    folders: $steps.listFolders.outputs.folders
    projects: $steps.listProjects.outputs.projects