Logz.io · Arazzo Workflow

Logz.io Verify Token And Discover Accounts

Version 1.0.0

Confirm which account a token belongs to, then list its associated accounts.

1 workflow 1 source API 1 provider
View Spec View on GitHub ObservabilityLoggingMetricsTracingSIEMELKElasticsearchOpenSearchPrometheusGrafanaOpenTelemetryAIOpsCloud ObservabilityManaged ELKCost ManagementArazzoWorkflows

Provider

logz-io

Workflows

verify-account
Confirm the token's account and list its related accounts.
Calls whoami to confirm the token's account, then retrieves all related accounts, branching on whether more than one account was returned.
2 steps inputs: apiToken outputs: accountId, accountName
1
whoAmI
whoAmI
Confirm which account the token belongs to by reading the account name and id.
2
relatedAccounts
getRelatedAccounts
List all accounts derived from the token's account. If the token belongs to an owner account, all sub accounts are returned.

Source API Descriptions

Arazzo Workflow Specification

logz-io-account-verify-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Logz.io Verify Token And Discover Accounts
  summary: Confirm which account a token belongs to, then list its associated accounts.
  description: >-
    Validates an API token and discovers the accounts it can reach. The
    workflow calls whoami to confirm the token's account name and id, then
    fetches all accounts derived from that account and branches on whether any
    associated sub accounts were returned. 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: logzioApi
  url: ../openapi/logz-io-api-openapi.yml
  type: openapi
workflows:
- workflowId: verify-account
  summary: Confirm the token's account and list its related accounts.
  description: >-
    Calls whoami to confirm the token's account, then retrieves all related
    accounts, branching on whether more than one account was returned.
  inputs:
    type: object
    required:
    - apiToken
    properties:
      apiToken:
        type: string
        description: Logz.io API token sent in the X-API-TOKEN header.
  steps:
  - stepId: whoAmI
    description: >-
      Confirm which account the token belongs to by reading the account name and
      id.
    operationId: whoAmI
    parameters:
    - name: X-API-TOKEN
      in: header
      value: $inputs.apiToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      accountName: $response.body#/accountName
      accountId: $response.body#/accountId
  - stepId: relatedAccounts
    description: >-
      List all accounts derived from the token's account. If the token belongs
      to an owner account, all sub accounts are returned.
    operationId: getRelatedAccounts
    parameters:
    - name: X-API-TOKEN
      in: header
      value: $inputs.apiToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstAccountId: $response.body#/0/accountId
    onSuccess:
    - name: hasSubAccounts
      type: end
      criteria:
      - context: $response.body
        condition: $.length > 1
        type: jsonpath
    - name: standaloneAccount
      type: end
      criteria:
      - context: $response.body
        condition: $.length == 1
        type: jsonpath
  outputs:
    accountId: $steps.whoAmI.outputs.accountId
    accountName: $steps.whoAmI.outputs.accountName