You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
A shared flow is reusable functionality similar to an API proxy. Much of the content of this reference will be familiar if you're already acquainted with API proxies.
If you are learning how to build shared flow, begin with the topic Reusable shared flows.
Shared flow bundle structure
A shared flow bundle consists of the following configuration:
Base Configuration | Primary configuration settings. See Base Configuration. |
Policies | XML-formatted configuration files that conform to the Apigee Edge policy schemas. See Policies. |
Resources | Scripts, JAR files, and XSLT files referenced by policies to execute custom logic. See Resources. |
SharedFlows | Shared flows included in this bundle. See Shared flows. |
The components in the table above are defined by configuration files in the following directory structure:
Configuration files and directory structure of a shared flow bundle
This section explain the configuration files and directory structure of a shared flow bundle.
Base Configuration
The base configuration file is located at the bundle's root directory. Its name is the name of the bundle.
/sharedflowbundle/traffic-management-shared.xml
The base configuration defines the contents of the shared flow bundle, along with information for tracking the bundle's revision history.
<SharedFlowBundle revision="2" name="traffic-management-shared"> <ConfigurationVersion majorVersion="4" minorVersion="0"/> <CreatedAt>1478637529218</CreatedAt> <CreatedBy>gladys@example.com</CreatedBy> <Description>Shared flow to moderate API traffic</Description> <DisplayName>traffic-management-shared</DisplayName> <LastModifiedAt>1481573374023</LastModifiedAt> <LastModifiedBy>gladys@example.com</LastModifiedBy> <Policies> <Policy>Auth-Flow-Callout</Policy> <Policy>Extract-Token</Policy> <Policy>Spike-Arrest</Policy> </Policies> <Resources> <Resource>jsc://extract-token.js</Resource> </Resources> <SharedFlows> <SharedFlow>default</SharedFlow> </SharedFlows> </SharedFlowBundle>
Base Configuration Attributes
Name | Description | Default | Required? |
---|---|---|---|
SharedFlowBundle |
|||
name |
The name of the shared flow bundle, which must be unique within an organization. The
characters you are allowed to use in the name are restricted to the following:
A-Za-z0-9_- |
N/A | Yes |
revision |
The revision number of the shared flow bundle configuration. You do not need to explicitly set the revision number, since Apigee Edge automatically tracks the current revision of the shared flow. | N/A | No |
Base Configuration Elements
Name | Description | Default | Required? |
---|---|---|---|
SharedFlowBundle |
|||
ConfigurationVersion |
The version of the shared flow bundle configuration schema to which this shared flow conforms. The only supported value currently is majorVersion 4 and minorVersion 0. This setting may be used in the future to enable evolution of the shared flow bundle format. | 4.0 | No |
CreatedAt and CreatedBy |
The date/time (in epoch time) that the shared flow bundle was created, along with the email of the user who created it. | ||
Description |
A textual description of the shared flow. If provided, the description will display in the Edge management UI. | N/A | No |
DisplayName |
A user-friendly name that may be different from the name attribute of the
shared flow configuration. |
N/A | No |
LastModifiedAt and LastModifiedBy |
The date/time (in epoch time) that the shared flow bundle was last modified, along with the email of the user who modified it. | ||
Policies |
A list of policies in the /policies directory of this shared flow. You
will normally only see this element when the shared flow was created using the Edge
management UI. This is simply a 'manifest' setting, designed to provide visibility into the
contents of the shared flow. |
N/A | No |
Resources |
A list of resources (JavaScript, Python, Java, XSLT) in the /resources
directory of this shared flow. You will normally only see this element when the shared flow
was created using the Edge management UI. This is simply a 'manifest' setting, designed to
provide visibility into the contents of the shared flow. |
N/A | No |
SharedFlows |
Specifies the shared flow that this bundle contains.
Note that currently, this element supports only one child <SharedFlow>. Only one shared flow may be added to a shared flow bundle. |
N/A | Yes |
Shared flows
/sharedflowbundle/sharedflows/default.xml
The SharedFlow configuration defines the sequence in which flow elements should be executed. The <SharedFlow> element's <Step> child elements each specify a part of the sequence, such as a call to a policy.
The following SharedFlow configuration specifies three policies to be executed in a top-to-bottom sequence (left to right in the management console), with the Spike Arrest policy first and a Flow Callout policy last.
<SharedFlow name="default"> <Step> <Name>Spike-Arrest</Name> </Step> <Step> <Name>Extract-Token</Name> </Step> <Step> <Name>Auth-Flow-Callout</Name> </Step> </SharedFlow>
Shared flow configuration attributes
Name | Description | Default | Required? |
---|---|---|---|
SharedFlow |
|||
name |
The name of the shared flow, which must be unique within an organization. The
characters you are allowed to use in the name are restricted to the following:
A-Za-z0-9_- |
N/A | Yes |
revision |
The revision number of the shared flow configuration. You do not need to explicitly set the revision number, since Apigee Edge automatically tracks the current revision of the shared flow. | N/A | No |
Shared flow configuration elements
Name | Description | Default | Required? |
---|---|---|---|
SharedFlow |
Defines the sequence of policies in the shared flow. | N/A | Yes |
Step |
Defines a step -- a stage in the flow's sequence. | N/A | Yes |
Name |
Specifies the name of the item referenced by the step. This element's value should be the same as the item's unique identifier, such as a policy's name attribute value. | N/A | Yes |
Policies
/sharedflowbundle/policies
As in an API proxy, in a shared flow bundle the /policies
directory contains
configuration XML for all policies available to be attached to the shared flow in the bundle.
Policies share a subset of elements, though this subset is augment with elements that are
specific to the policy. For more about how to configure a policy, see the topic about the policy
you want. You can also reach these from Policy reference
overview.
Resources
/sharedflowbundle/resources
Resources are scripts, code, and XSL transformations that can be attached to shared flows using policies. These appear in the Scripts section of the shared flow editor in the management UI.
See Resource files for the supported resource types.
Post questions to the Apigee Developer Forum.