Skip to content

Shared Flow to YAML

This command takes an Apigee shared flow bundle and converts it into an editable YAML document.

Usage

The sharedflow-to-yaml command takes two parameters -input and -output.

  • --input is either from a bundle zip file or an existing bundle directory.

  • --output is the path for the YAML document to create

  • --output full path is created if it does not exist (like mkdir -p)

Bundle resources are created in the same location as the --output

Examples

Below are a few examples for using the sharedflow-to-yaml command.

From zip

Reading bundle from a zip file

apigee-go-gen transform sharedflow-to-yaml \
  --input ./examples/sharedflows/owasp/owasp.zip \
  --output ./out/yaml-first/owasp/sharedflow.yaml

From dir

Reading bundle from a directory

apigee-go-gen transform sharedflow-to-yaml \
  --input ./examples/sharedflows/owasp/ \
  --output ./out/yaml-first/owasp2/sharedflow.yaml

YAML Document Structure

The YAML document created by sharedflow-to-yaml contains all the elements from the bundle in a single file.

The structure looks like this

# From ./sharedflowbundle/flow-name.xml
SharedFlowBundle:
  .name: hello-world
  .revision: 1
  #...

# From ./sharedflowbundle/policies/*
Policies: 
  - AssignMessage: 
      .name: AM-SetTarget
      #...
  - RaiseFault:
      .name: RF-Set500
      #...

# From ./sharedflowbundle/sharedflows/*
SharedFlows: 
  - SharedFlow: 
      .name: proxy1
      #...

# From ./sharedflowbundle/resources/*/* 
Resources: 
  - Resource:
      Type: "properties"
      Path: "./path/to/resource.properties"
  - Resource: 
      Type: "jsc"
      Path: "./path/to/script.js"