This bundle migration example will work through the following work flow:
The are two Gateways running. A development (source) Gateway, and a production (target) Gateway. Both Gateways are licensed and have the Gateway REST Management Service installed. The production Gateway is otherwise empty.
The development Gateways contains the following:
To create the migration bundle we will export the folder from above. In order to export the folder we first need to get its id. In order to do that send a request to list folders and filter by the folder name, "Migration":
| Request | |
| Uri | |
| Http Method | GET |
| Response | |
| Http Status | 200 |
| Message Body |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:List xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>FOLDER List</l7:Name>
<l7:Type>List</l7:Type>
<l7:TimeStamp>2014-07-14T15:53:10.941-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders?name=Migration"/>
<l7:Link rel="template" uri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/template"/>
<l7:Item>
<l7:Name>Migration</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d736</l7:Id>
<l7:Type>FOLDER</l7:Type>
<l7:TimeStamp>2014-07-14T15:53:10.941-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736"/>
<l7:Resource>
<l7:Folder folderId="0000000000000000ffffffffffffec76" id="6b52de26ef82cc4df397d1909490d736" version="0">
<l7:Name>Migration</l7:Name>
</l7:Folder>
</l7:Resource>
</l7:Item>
</l7:List>
|
The folder id is "6b52de26ef82cc4df397d1909490d736" from above. Export the bundle using the folder id:
| Request | |
| Uri | |
| Http Method | GET |
| Response | |
| Http Status | 200 |
| Message Body |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>Bundle</l7:Name>
<l7:Type>BUNDLE</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.399-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/bundle?folder=6b52de26ef82cc4df397d1909490d736"/>
<l7:Resource>
<l7:Bundle>
<l7:References>
<l7:Item>
<l7:Name>Migration</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d736</l7:Id>
<l7:Type>FOLDER</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.387-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Folder folderId="0000000000000000ffffffffffffec76" id="6b52de26ef82cc4df397d1909490d736" version="0">
<l7:Name>Migration</l7:Name>
</l7:Folder>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7ee</l7:Id>
<l7:Type>SECURE_PASSWORD</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.387-07:00</l7:TimeStamp>
<l7:Resource>
<l7:StoredPassword id="6b52de26ef82cc4df397d1909490d7ee" version="2">
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Properties>
<l7:Property key="usageFromVariable">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="description">
<l7:StringValue></l7:StringValue>
</l7:Property>
<l7:Property key="lastUpdated">
<l7:DateValue>2014-05-13T17:21:45.137-07:00</l7:DateValue>
</l7:Property>
<l7:Property key="type">
<l7:StringValue>Password</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:StoredPassword>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalJDBC</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7d9</l7:Id>
<l7:Type>JDBC_CONNECTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.388-07:00</l7:TimeStamp>
<l7:Resource>
<l7:JDBCConnection id="6b52de26ef82cc4df397d1909490d7d9" version="2">
<l7:Name>LocalJDBC</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:Properties>
<l7:Property key="maximumPoolSize">
<l7:IntegerValue>15</l7:IntegerValue>
</l7:Property>
<l7:Property key="minimumPoolSize">
<l7:IntegerValue>3</l7:IntegerValue>
</l7:Property>
</l7:Properties>
<l7:Extension>
<l7:DriverClass>com.mysql.cj.jdbc.Driver</l7:DriverClass>
<l7:JdbcUrl>jdbc:mysql://localhost:3306/</l7:JdbcUrl>
<l7:ConnectionProperties>
<l7:Property key="EnableCancelTimeout">
<l7:StringValue>true</l7:StringValue>
</l7:Property>
<l7:Property key="password">
<l7:StringValue>${secpass.localhostDBPassword.plaintext}</l7:StringValue>
</l7:Property>
<l7:Property key="user">
<l7:StringValue>root</l7:StringValue>
</l7:Property>
</l7:ConnectionProperties>
</l7:Extension>
</l7:JDBCConnection>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>encassPolicy</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7bf</l7:Id>
<l7:Type>POLICY</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.390-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Policy guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="2">
<l7:PolicyDetail folderId="6b52de26ef82cc4df397d1909490d736" guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="2">
<l7:Name>encassPolicy</l7:Name>
<l7:PolicyType>Include</l7:PolicyType>
<l7:Properties>
<l7:Property key="revision">
<l7:LongValue>3</l7:LongValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:PolicyDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:AuditDetailAssertion>
<L7p:Detail stringValue="Policy Fragment: encassPolicy"/>
</L7p:AuditDetailAssertion>
<L7p:JdbcQuery>
<L7p:ConnectionName stringValue="LocalJDBC"/>
<L7p:ConvertVariablesToStrings booleanValue="false"/>
<L7p:SqlQuery stringValue="select &quot;test&quot;"/>
</L7p:JdbcQuery>
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="VGhpcyBkb2VzIG5vdCBkbyBhbnl0aGluZyB5ZXQh"/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Policy>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d802</l7:Id>
<l7:Type>ENCAPSULATED_ASSERTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.391-07:00</l7:TimeStamp>
<l7:Resource>
<l7:EncapsulatedAssertion id="6b52de26ef82cc4df397d1909490d802" version="0">
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Guid>405c790d-35f3-4f7d-8dfe-57f6647ab5b4</l7:Guid>
<l7:PolicyReference id="6b52de26ef82cc4df397d1909490d7bf" resourceUri="http://ns.l7tech.com/2010/04/gateway-management/policies"/>
<l7:EncapsulatedArguments/>
<l7:EncapsulatedResults>
<l7:EncapsulatedAssertionResult>
<l7:ResultName>jdbcQuery.queryresult.count</l7:ResultName>
<l7:ResultType>int</l7:ResultType>
</l7:EncapsulatedAssertionResult>
</l7:EncapsulatedResults>
<l7:Properties>
<l7:Property key="paletteFolder">
<l7:StringValue>internalAssertions</l7:StringValue>
</l7:Property>
<l7:Property key="policyGuid">
<l7:StringValue>945a4a17-a9b3-44c4-92a9-1dc2f09bb430</l7:StringValue>
</l7:Property>
<l7:Property key="allowTracing">
<l7:StringValue>false</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:EncapsulatedAssertion>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>SimpleService</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d77b</l7:Id>
<l7:Type>SERVICE</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.399-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Service id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:ServiceDetail folderId="6b52de26ef82cc4df397d1909490d736" id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:Name>SimpleService</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:ServiceMappings>
<l7:HttpMapping>
<l7:UrlPattern>/SimpleService</l7:UrlPattern>
<l7:Verbs>
<l7:Verb>GET</l7:Verb>
<l7:Verb>POST</l7:Verb>
<l7:Verb>PUT</l7:Verb>
<l7:Verb>DELETE</l7:Verb>
</l7:Verbs>
</l7:HttpMapping>
</l7:ServiceMappings>
<l7:Properties>
<l7:Property key="policyRevision">
<l7:LongValue>2</l7:LongValue>
</l7:Property>
<l7:Property key="wssProcessingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="internal">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="tracingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:ServiceDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy" version="1"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:Encapsulated>
<L7p:EncapsulatedAssertionConfigGuid stringValue="405c790d-35f3-4f7d-8dfe-57f6647ab5b4"/>
<L7p:EncapsulatedAssertionConfigName stringValue="MyJDBCEncass"/>
</L7p:Encapsulated>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Service>
</l7:Resource>
</l7:Item>
</l7:References>
<l7:Mappings>
<l7:Mapping action="NewOrExisting" srcId="0000000000000000ffffffffffffec76" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/0000000000000000ffffffffffffec76" type="FOLDER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d736" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736" type="FOLDER"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7d9" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" type="JDBC_CONNECTION"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7bf" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" type="POLICY"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d802" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" type="ENCAPSULATED_ASSERTION"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d77b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/services/6b52de26ef82cc4df397d1909490d77b" type="SERVICE"/>
</l7:Mappings>
</l7:Bundle>
</l7:Resource>
</l7:Item>
|
If we try to import this bundle as is it will fail with the following mapping:
<l7:Mapping action="NewOrExisting" errorType="TargetNotFound" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="https://productionGateway/restman/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD">
<l7:Properties>
<l7:Property key="ErrorMessage">
<l7:StringValue>Could not locate entity: Fail on new specified and could not locate existing target.. Source Entity: EntityHeader. Name=null, id=6b52de26ef82cc4df397d1909490d7ee, description=null, type = SECURE_PASSWORD</l7:StringValue>
</l7:Property>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
We can solve this by either creating a password on the production Gateway and mapping to it. Create one on the Production Gateway using the API with the same ID as the one on the development Gateway:
| Request | |
| Uri | |
| Http Method | PUT |
| Content-Type | application/xml |
| Message Body |
<l7:StoredPassword id="6b52de26ef82cc4df397d1909490d7ee" version="2" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management" >
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Password>password</l7:Password>
<l7:Properties>
<l7:Property key="usageFromVariable">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="description">
<l7:StringValue></l7:StringValue>
</l7:Property>
<l7:Property key="lastUpdated">
<l7:DateValue>2014-05-13T17:21:45.137-07:00</l7:DateValue>
</l7:Property>
<l7:Property key="type">
<l7:StringValue>Password</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:StoredPassword>
|
| Response | |
| Http Status | 201 |
| Message Body |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7ee</l7:Id>
<l7:Type>SECURE_PASSWORD</l7:Type>
<l7:TimeStamp>2014-07-14T17:16:05.337-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://productionGateway/restman/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee"/>
<l7:Link rel="template" uri="https://productionGateway/restman/1.0/passwords/template"/>
<l7:Link rel="list" uri="https://productionGateway/restman/1.0/passwords"/>
</l7:Item>
|
Once the password is created you can import the bundle:
| Request | |
| Uri | |
| Http Method | PUT |
| Content-Type | application/xml |
| Message Body |
<l7:Bundle xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:References>
<l7:Item>
<l7:Name>Migration</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d736</l7:Id>
<l7:Type>FOLDER</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.387-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Folder folderId="0000000000000000ffffffffffffec76" id="6b52de26ef82cc4df397d1909490d736" version="0">
<l7:Name>Migration</l7:Name>
</l7:Folder>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7ee</l7:Id>
<l7:Type>SECURE_PASSWORD</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.387-07:00</l7:TimeStamp>
<l7:Resource>
<l7:StoredPassword id="6b52de26ef82cc4df397d1909490d7ee" version="2">
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Password>password</l7:Password>
<l7:Properties>
<l7:Property key="usageFromVariable">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="description">
<l7:StringValue></l7:StringValue>
</l7:Property>
<l7:Property key="lastUpdated">
<l7:DateValue>2014-05-13T17:21:45.137-07:00</l7:DateValue>
</l7:Property>
<l7:Property key="type">
<l7:StringValue>Password</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:StoredPassword>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalJDBC</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7d9</l7:Id>
<l7:Type>JDBC_CONNECTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.388-07:00</l7:TimeStamp>
<l7:Resource>
<l7:JDBCConnection id="6b52de26ef82cc4df397d1909490d7d9" version="2">
<l7:Name>LocalJDBC</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:Properties>
<l7:Property key="maximumPoolSize">
<l7:IntegerValue>15</l7:IntegerValue>
</l7:Property>
<l7:Property key="minimumPoolSize">
<l7:IntegerValue>3</l7:IntegerValue>
</l7:Property>
</l7:Properties>
<l7:Extension>
<l7:DriverClass>com.mysql.cj.jdbc.Driver</l7:DriverClass>
<l7:JdbcUrl>jdbc:mysql://localhost:3306/</l7:JdbcUrl>
<l7:ConnectionProperties>
<l7:Property key="EnableCancelTimeout">
<l7:StringValue>true</l7:StringValue>
</l7:Property>
<l7:Property key="password">
<l7:StringValue>${secpass.localhostDBPassword.plaintext}</l7:StringValue>
</l7:Property>
<l7:Property key="user">
<l7:StringValue>root</l7:StringValue>
</l7:Property>
</l7:ConnectionProperties>
</l7:Extension>
</l7:JDBCConnection>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>encassPolicy</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7bf</l7:Id>
<l7:Type>POLICY</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.390-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Policy guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="2">
<l7:PolicyDetail folderId="6b52de26ef82cc4df397d1909490d736" guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="2">
<l7:Name>encassPolicy</l7:Name>
<l7:PolicyType>Include</l7:PolicyType>
<l7:Properties>
<l7:Property key="revision">
<l7:LongValue>3</l7:LongValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:PolicyDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:AuditDetailAssertion>
<L7p:Detail stringValue="Policy Fragment: encassPolicy"/>
</L7p:AuditDetailAssertion>
<L7p:JdbcQuery>
<L7p:ConnectionName stringValue="LocalJDBC"/>
<L7p:ConvertVariablesToStrings booleanValue="false"/>
<L7p:SqlQuery stringValue="select &quot;test&quot;"/>
</L7p:JdbcQuery>
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="VGhpcyBkb2VzIG5vdCBkbyBhbnl0aGluZyB5ZXQh"/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Policy>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d802</l7:Id>
<l7:Type>ENCAPSULATED_ASSERTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.391-07:00</l7:TimeStamp>
<l7:Resource>
<l7:EncapsulatedAssertion id="6b52de26ef82cc4df397d1909490d802" version="0">
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Guid>405c790d-35f3-4f7d-8dfe-57f6647ab5b4</l7:Guid>
<l7:PolicyReference id="6b52de26ef82cc4df397d1909490d7bf" resourceUri="http://ns.l7tech.com/2010/04/gateway-management/policies"/>
<l7:EncapsulatedArguments/>
<l7:EncapsulatedResults>
<l7:EncapsulatedAssertionResult>
<l7:ResultName>jdbcQuery.queryresult.count</l7:ResultName>
<l7:ResultType>int</l7:ResultType>
</l7:EncapsulatedAssertionResult>
</l7:EncapsulatedResults>
<l7:Properties>
<l7:Property key="paletteFolder">
<l7:StringValue>internalAssertions</l7:StringValue>
</l7:Property>
<l7:Property key="policyGuid">
<l7:StringValue>945a4a17-a9b3-44c4-92a9-1dc2f09bb430</l7:StringValue>
</l7:Property>
<l7:Property key="allowTracing">
<l7:StringValue>false</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:EncapsulatedAssertion>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>SimpleService</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d77b</l7:Id>
<l7:Type>SERVICE</l7:Type>
<l7:TimeStamp>2014-07-14T16:01:51.399-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Service id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:ServiceDetail folderId="6b52de26ef82cc4df397d1909490d736" id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:Name>SimpleService</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:ServiceMappings>
<l7:HttpMapping>
<l7:UrlPattern>/SimpleService</l7:UrlPattern>
<l7:Verbs>
<l7:Verb>GET</l7:Verb>
<l7:Verb>POST</l7:Verb>
<l7:Verb>PUT</l7:Verb>
<l7:Verb>DELETE</l7:Verb>
</l7:Verbs>
</l7:HttpMapping>
</l7:ServiceMappings>
<l7:Properties>
<l7:Property key="policyRevision">
<l7:LongValue>2</l7:LongValue>
</l7:Property>
<l7:Property key="wssProcessingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="internal">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="tracingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:ServiceDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy" version="1"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:Encapsulated>
<L7p:EncapsulatedAssertionConfigGuid stringValue="405c790d-35f3-4f7d-8dfe-57f6647ab5b4"/>
<L7p:EncapsulatedAssertionConfigName stringValue="MyJDBCEncass"/>
</L7p:Encapsulated>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Service>
</l7:Resource>
</l7:Item>
</l7:References>
<l7:Mappings>
<l7:Mapping action="NewOrExisting" srcId="0000000000000000ffffffffffffec76" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/0000000000000000ffffffffffffec76" type="FOLDER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d736" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736" type="FOLDER"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7d9" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" type="JDBC_CONNECTION"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7bf" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" type="POLICY"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d802" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" type="ENCAPSULATED_ASSERTION"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d77b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/services/6b52de26ef82cc4df397d1909490d77b" type="SERVICE"/>
</l7:Mappings>
</l7:Bundle>
|
| Response | |
| Http Status | 201 |
| Message Body |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>Bundle mappings</l7:Name>
<l7:Type>BUNDLE MAPPINGS</l7:Type>
<l7:TimeStamp>2014-07-14T16:13:48.452-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://productionGateway/restman/1.0/bundle/"/>
<l7:Resource>
<l7:Mappings>
<l7:Mapping action="NewOrExisting" actionTaken="UsedExisting" srcId="0000000000000000ffffffffffffec76" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/0000000000000000ffffffffffffec76" targetId="0000000000000000ffffffffffffec76" targetUri="https://productionGateway/restman/1.0/folders/0000000000000000ffffffffffffec76" type="FOLDER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" actionTaken="CreatedNew" srcId="6b52de26ef82cc4df397d1909490d736" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736" targetId="6b52de26ef82cc4df397d1909490d736" targetUri="https://productionGateway/restman/1.0/folders/6b52de26ef82cc4df397d1909490d736" type="FOLDER"/>
<l7:Mapping action="NewOrExisting" actionTaken="UsedExisting" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" targetId="6b52de26ef82cc4df397d1909490d7ee" targetUri="https://productionGateway/restman/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD"/>
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
<l7:Mapping action="NewOrExisting" actionTaken="CreatedNew" srcId="6b52de26ef82cc4df397d1909490d7d9" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" targetId="6b52de26ef82cc4df397d1909490d7d9" targetUri="https://productionGateway/restman/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" type="JDBC_CONNECTION"/>
<l7:Mapping action="NewOrExisting" actionTaken="CreatedNew" srcId="6b52de26ef82cc4df397d1909490d7bf" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" targetId="6b52de26ef82cc4df397d1909490d7bf" targetUri="https://productionGateway/restman/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" type="POLICY"/>
<l7:Mapping action="NewOrExisting" actionTaken="CreatedNew" srcId="6b52de26ef82cc4df397d1909490d802" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" targetId="6b52de26ef82cc4df397d1909490d802" targetUri="https://productionGateway/restman/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" type="ENCAPSULATED_ASSERTION"/>
<l7:Mapping action="NewOrExisting" actionTaken="CreatedNew" srcId="6b52de26ef82cc4df397d1909490d77b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/services/6b52de26ef82cc4df397d1909490d77b" targetId="6b52de26ef82cc4df397d1909490d77b" targetUri="https://productionGateway/restman/1.0/services/6b52de26ef82cc4df397d1909490d77b" type="SERVICE"/>
</l7:Mappings>
</l7:Resource>
</l7:Item>
|
The production Gateway should now have the same folder, service, encapsulated assertion, policy JDBC connection and secure password that the development Gateway has.
Assume that there was some development on the SimpleService that was exported above from the development Gateway. Some authentication security is added to restrict usage of the service. The Require SSL assertion is added and a simple service user must be authenticated using Basic http credentials.
Export the bundle from the development Gateway again, but this time with default action NewOrUpdate. This will change the mapping so that it will update existing entities on the production Gateway when it is importing them.
| Request | |
| Uri | |
| Http Method | GET |
| Response | |
| Http Status | 200 |
| Message Body |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>Bundle</l7:Name>
<l7:Type>BUNDLE</l7:Type>
<l7:TimeStamp>2014-07-14T17:20:53.700-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/bundle?folder=6b52de26ef82cc4df397d1909490d736&defaultAction=NewOrUpdate"/>
<l7:Resource>
<l7:Bundle>
<l7:References>
<l7:Item>
<l7:Name>Migration</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d736</l7:Id>
<l7:Type>FOLDER</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.546-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Folder folderId="0000000000000000ffffffffffffec76" id="6b52de26ef82cc4df397d1909490d736" version="0">
<l7:Name>Migration</l7:Name>
</l7:Folder>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7ee</l7:Id>
<l7:Type>SECURE_PASSWORD</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.549-07:00</l7:TimeStamp>
<l7:Resource>
<l7:StoredPassword id="6b52de26ef82cc4df397d1909490d7ee" version="2">
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Properties>
<l7:Property key="usageFromVariable">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="description">
<l7:StringValue></l7:StringValue>
</l7:Property>
<l7:Property key="lastUpdated">
<l7:DateValue>2014-05-13T17:21:45.137-07:00</l7:DateValue>
</l7:Property>
<l7:Property key="type">
<l7:StringValue>Password</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:StoredPassword>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalJDBC</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7d9</l7:Id>
<l7:Type>JDBC_CONNECTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.549-07:00</l7:TimeStamp>
<l7:Resource>
<l7:JDBCConnection id="6b52de26ef82cc4df397d1909490d7d9" version="2">
<l7:Name>LocalJDBC</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:Properties>
<l7:Property key="maximumPoolSize">
<l7:IntegerValue>15</l7:IntegerValue>
</l7:Property>
<l7:Property key="minimumPoolSize">
<l7:IntegerValue>3</l7:IntegerValue>
</l7:Property>
</l7:Properties>
<l7:Extension>
<l7:DriverClass>com.mysql.cj.jdbc.Driver</l7:DriverClass>
<l7:JdbcUrl>jdbc:mysql://localhost:3306/</l7:JdbcUrl>
<l7:ConnectionProperties>
<l7:Property key="EnableCancelTimeout">
<l7:StringValue>true</l7:StringValue>
</l7:Property>
<l7:Property key="password">
<l7:StringValue>${secpass.localhostDBPassword.plaintext}</l7:StringValue>
</l7:Property>
<l7:Property key="user">
<l7:StringValue>root</l7:StringValue>
</l7:Property>
</l7:ConnectionProperties>
</l7:Extension>
</l7:JDBCConnection>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>encassPolicy</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7bf</l7:Id>
<l7:Type>POLICY</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Policy guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="3">
<l7:PolicyDetail folderId="6b52de26ef82cc4df397d1909490d736" guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="3">
<l7:Name>encassPolicy</l7:Name>
<l7:PolicyType>Include</l7:PolicyType>
<l7:Properties>
<l7:Property key="revision">
<l7:LongValue>4</l7:LongValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:PolicyDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:JdbcQuery>
<L7p:ConnectionName stringValue="LocalJDBC"/>
<L7p:ConvertVariablesToStrings booleanValue="false"/>
<L7p:GenerateXmlResult booleanValue="true"/>
<L7p:NamingMap mapValue="included">
<L7p:entry>
<L7p:key stringValue="current_version"/>
<L7p:value stringValue="current_version"/>
</L7p:entry>
</L7p:NamingMap>
<L7p:SqlQuery stringValue="select * from ssg.ssg_version;"/>
</L7p:JdbcQuery>
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="U1NHIFZlcnNpb246ICR7amRiY1F1ZXJ5LmN1cnJlbnRfdmVyc2lvbn0="/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Policy>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>Internal Identity Provider</l7:Name>
<l7:Id>0000000000000000fffffffffffffffe</l7:Id>
<l7:Type>ID_PROVIDER_CONFIG</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:IdentityProvider id="0000000000000000fffffffffffffffe" version="0">
<l7:Name>Internal Identity Provider</l7:Name>
<l7:IdentityProviderType>Internal</l7:IdentityProviderType>
</l7:IdentityProvider>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>SimpleServiceUser</l7:Name>
<l7:Id>a71d2733b59a6360e8134b6e32c1fb6b</l7:Id>
<l7:Type>USER</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:User providerId="0000000000000000fffffffffffffffe" id="a71d2733b59a6360e8134b6e32c1fb6b">
<l7:Login>SimpleServiceUser</l7:Login>
</l7:User>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d802</l7:Id>
<l7:Type>ENCAPSULATED_ASSERTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:EncapsulatedAssertion id="6b52de26ef82cc4df397d1909490d802" version="0">
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Guid>405c790d-35f3-4f7d-8dfe-57f6647ab5b4</l7:Guid>
<l7:PolicyReference id="6b52de26ef82cc4df397d1909490d7bf" resourceUri="http://ns.l7tech.com/2010/04/gateway-management/policies"/>
<l7:EncapsulatedArguments/>
<l7:EncapsulatedResults>
<l7:EncapsulatedAssertionResult>
<l7:ResultName>jdbcQuery.queryresult.count</l7:ResultName>
<l7:ResultType>int</l7:ResultType>
</l7:EncapsulatedAssertionResult>
</l7:EncapsulatedResults>
<l7:Properties>
<l7:Property key="paletteFolder">
<l7:StringValue>internalAssertions</l7:StringValue>
</l7:Property>
<l7:Property key="policyGuid">
<l7:StringValue>945a4a17-a9b3-44c4-92a9-1dc2f09bb430</l7:StringValue>
</l7:Property>
<l7:Property key="allowTracing">
<l7:StringValue>false</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:EncapsulatedAssertion>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>SimpleService</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d77b</l7:Id>
<l7:Type>SERVICE</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.558-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Service id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:ServiceDetail folderId="6b52de26ef82cc4df397d1909490d736" id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:Name>SimpleService</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:ServiceMappings>
<l7:HttpMapping>
<l7:UrlPattern>/SimpleService</l7:UrlPattern>
<l7:Verbs>
<l7:Verb>GET</l7:Verb>
<l7:Verb>POST</l7:Verb>
<l7:Verb>PUT</l7:Verb>
<l7:Verb>DELETE</l7:Verb>
</l7:Verbs>
</l7:HttpMapping>
</l7:ServiceMappings>
<l7:Properties>
<l7:Property key="policyRevision">
<l7:LongValue>3</l7:LongValue>
</l7:Property>
<l7:Property key="wssProcessingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="internal">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="tracingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:ServiceDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy" version="2"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:SslAssertion>
<L7p:RequireClientAuthentication booleanValue="true"/>
</L7p:SslAssertion>
<L7p:HttpBasic/>
<L7p:SpecificUser>
<L7p:IdentityProviderOid goidValue="0000000000000000fffffffffffffffe"/>
<L7p:UserLogin stringValue="SimpleServiceUser"/>
<L7p:UserName stringValue="SimpleServiceUser"/>
<L7p:UserUid stringValue="a71d2733b59a6360e8134b6e32c1fb6b"/>
</L7p:SpecificUser>
<L7p:Encapsulated>
<L7p:EncapsulatedAssertionConfigGuid stringValue="405c790d-35f3-4f7d-8dfe-57f6647ab5b4"/>
<L7p:EncapsulatedAssertionConfigName stringValue="MyJDBCEncass"/>
</L7p:Encapsulated>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Service>
</l7:Resource>
</l7:Item>
</l7:References>
<l7:Mappings>
<l7:Mapping action="NewOrExisting" srcId="0000000000000000ffffffffffffec76" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/0000000000000000ffffffffffffec76" type="FOLDER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d736" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736" type="FOLDER"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d7d9" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" type="JDBC_CONNECTION"/>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d7bf" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" type="POLICY"/>
<l7:Mapping action="NewOrExisting" srcId="0000000000000000fffffffffffffffe" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/identityProviders/0000000000000000fffffffffffffffe" type="ID_PROVIDER_CONFIG">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" srcId="a71d2733b59a6360e8134b6e32c1fb6b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/identityProviders/0000000000000000fffffffffffffffe/users/a71d2733b59a6360e8134b6e32c1fb6b" type="USER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d802" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" type="ENCAPSULATED_ASSERTION"/>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d77b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/services/6b52de26ef82cc4df397d1909490d77b" type="SERVICE"/>
</l7:Mappings>
</l7:Bundle>
</l7:Resource>
</l7:Item>
|
If we try and import the bundle as is above it will fail because it expects the simple service user to exist on the target Gateway. The following mapping is returned:
<l7:Mapping action="NewOrExisting" errorType="TargetNotFound" srcId="a71d2733b59a6360e8134b6e32c1fb6b" srcUri="https://productionGateway/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/a71d2733b59a6360e8134b6e32c1fb6b" type="USER">
<l7:Properties>
<l7:Property key="ErrorMessage">
<l7:StringValue>Could not locate entity: Fail on new specified and could not locate existing target.. Source Entity: EntityHeader. Name=SimpleServiceUser, id=a71d2733b59a6360e8134b6e32c1fb6b, description=null, type = USER</l7:StringValue>
</l7:Property>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
Create a user on the production Gateway in the internal identity provider called "ProductionSimpleServiceUser". Map the Simple service user by name to the "ProductionSimpleServiceUser" and import the bundle:
| Request | |
| Uri | |
| Http Method | PUT |
| Content-Type | application/xml |
| Message Body |
<l7:Bundle xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:References>
<l7:Item>
<l7:Name>Migration</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d736</l7:Id>
<l7:Type>FOLDER</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.546-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Folder folderId="0000000000000000ffffffffffffec76" id="6b52de26ef82cc4df397d1909490d736" version="0">
<l7:Name>Migration</l7:Name>
</l7:Folder>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7ee</l7:Id>
<l7:Type>SECURE_PASSWORD</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.549-07:00</l7:TimeStamp>
<l7:Resource>
<l7:StoredPassword id="6b52de26ef82cc4df397d1909490d7ee" version="2">
<l7:Name>LocalhostDBPassword</l7:Name>
<l7:Properties>
<l7:Property key="usageFromVariable">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="description">
<l7:StringValue></l7:StringValue>
</l7:Property>
<l7:Property key="lastUpdated">
<l7:DateValue>2014-05-13T17:21:45.137-07:00</l7:DateValue>
</l7:Property>
<l7:Property key="type">
<l7:StringValue>Password</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:StoredPassword>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>LocalJDBC</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7d9</l7:Id>
<l7:Type>JDBC_CONNECTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.549-07:00</l7:TimeStamp>
<l7:Resource>
<l7:JDBCConnection id="6b52de26ef82cc4df397d1909490d7d9" version="2">
<l7:Name>LocalJDBC</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:Properties>
<l7:Property key="maximumPoolSize">
<l7:IntegerValue>15</l7:IntegerValue>
</l7:Property>
<l7:Property key="minimumPoolSize">
<l7:IntegerValue>3</l7:IntegerValue>
</l7:Property>
</l7:Properties>
<l7:Extension>
<l7:DriverClass>com.mysql.cj.jdbc.Driver</l7:DriverClass>
<l7:JdbcUrl>jdbc:mysql://localhost:3306/</l7:JdbcUrl>
<l7:ConnectionProperties>
<l7:Property key="EnableCancelTimeout">
<l7:StringValue>true</l7:StringValue>
</l7:Property>
<l7:Property key="password">
<l7:StringValue>${secpass.localhostDBPassword.plaintext}</l7:StringValue>
</l7:Property>
<l7:Property key="user">
<l7:StringValue>root</l7:StringValue>
</l7:Property>
</l7:ConnectionProperties>
</l7:Extension>
</l7:JDBCConnection>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>encassPolicy</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d7bf</l7:Id>
<l7:Type>POLICY</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Policy guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="3">
<l7:PolicyDetail folderId="6b52de26ef82cc4df397d1909490d736" guid="945a4a17-a9b3-44c4-92a9-1dc2f09bb430" id="6b52de26ef82cc4df397d1909490d7bf" version="3">
<l7:Name>encassPolicy</l7:Name>
<l7:PolicyType>Include</l7:PolicyType>
<l7:Properties>
<l7:Property key="revision">
<l7:LongValue>4</l7:LongValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:PolicyDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:JdbcQuery>
<L7p:ConnectionName stringValue="LocalJDBC"/>
<L7p:ConvertVariablesToStrings booleanValue="false"/>
<L7p:GenerateXmlResult booleanValue="true"/>
<L7p:NamingMap mapValue="included">
<L7p:entry>
<L7p:key stringValue="current_version"/>
<L7p:value stringValue="current_version"/>
</L7p:entry>
</L7p:NamingMap>
<L7p:SqlQuery stringValue="select * from ssg.ssg_version;"/>
</L7p:JdbcQuery>
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="U1NHIFZlcnNpb246ICR7amRiY1F1ZXJ5LmN1cnJlbnRfdmVyc2lvbn0="/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Policy>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>Internal Identity Provider</l7:Name>
<l7:Id>0000000000000000fffffffffffffffe</l7:Id>
<l7:Type>ID_PROVIDER_CONFIG</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:IdentityProvider id="0000000000000000fffffffffffffffe" version="0">
<l7:Name>Internal Identity Provider</l7:Name>
<l7:IdentityProviderType>Internal</l7:IdentityProviderType>
</l7:IdentityProvider>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>SimpleServiceUser</l7:Name>
<l7:Id>a71d2733b59a6360e8134b6e32c1fb6b</l7:Id>
<l7:Type>USER</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:User providerId="0000000000000000fffffffffffffffe" id="a71d2733b59a6360e8134b6e32c1fb6b">
<l7:Login>SimpleServiceUser</l7:Login>
</l7:User>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d802</l7:Id>
<l7:Type>ENCAPSULATED_ASSERTION</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.551-07:00</l7:TimeStamp>
<l7:Resource>
<l7:EncapsulatedAssertion id="6b52de26ef82cc4df397d1909490d802" version="0">
<l7:Name>MyJDBCEncass</l7:Name>
<l7:Guid>405c790d-35f3-4f7d-8dfe-57f6647ab5b4</l7:Guid>
<l7:PolicyReference id="6b52de26ef82cc4df397d1909490d7bf" resourceUri="http://ns.l7tech.com/2010/04/gateway-management/policies"/>
<l7:EncapsulatedArguments/>
<l7:EncapsulatedResults>
<l7:EncapsulatedAssertionResult>
<l7:ResultName>jdbcQuery.queryresult.count</l7:ResultName>
<l7:ResultType>int</l7:ResultType>
</l7:EncapsulatedAssertionResult>
</l7:EncapsulatedResults>
<l7:Properties>
<l7:Property key="paletteFolder">
<l7:StringValue>internalAssertions</l7:StringValue>
</l7:Property>
<l7:Property key="policyGuid">
<l7:StringValue>945a4a17-a9b3-44c4-92a9-1dc2f09bb430</l7:StringValue>
</l7:Property>
<l7:Property key="allowTracing">
<l7:StringValue>false</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:EncapsulatedAssertion>
</l7:Resource>
</l7:Item>
<l7:Item>
<l7:Name>SimpleService</l7:Name>
<l7:Id>6b52de26ef82cc4df397d1909490d77b</l7:Id>
<l7:Type>SERVICE</l7:Type>
<l7:TimeStamp>2014-07-14T16:35:58.558-07:00</l7:TimeStamp>
<l7:Resource>
<l7:Service id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:ServiceDetail folderId="6b52de26ef82cc4df397d1909490d736" id="6b52de26ef82cc4df397d1909490d77b" version="2">
<l7:Name>SimpleService</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:ServiceMappings>
<l7:HttpMapping>
<l7:UrlPattern>/SimpleService</l7:UrlPattern>
<l7:Verbs>
<l7:Verb>GET</l7:Verb>
<l7:Verb>POST</l7:Verb>
<l7:Verb>PUT</l7:Verb>
<l7:Verb>DELETE</l7:Verb>
</l7:Verbs>
</l7:HttpMapping>
</l7:ServiceMappings>
<l7:Properties>
<l7:Property key="policyRevision">
<l7:LongValue>3</l7:LongValue>
</l7:Property>
<l7:Property key="wssProcessingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="internal">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="tracingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:ServiceDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy" version="2"><?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:SslAssertion>
<L7p:RequireClientAuthentication booleanValue="true"/>
</L7p:SslAssertion>
<L7p:HttpBasic/>
<L7p:SpecificUser>
<L7p:IdentityProviderOid goidValue="0000000000000000fffffffffffffffe"/>
<L7p:UserLogin stringValue="SimpleServiceUser"/>
<L7p:UserName stringValue="SimpleServiceUser"/>
<L7p:UserUid stringValue="a71d2733b59a6360e8134b6e32c1fb6b"/>
</L7p:SpecificUser>
<L7p:Encapsulated>
<L7p:EncapsulatedAssertionConfigGuid stringValue="405c790d-35f3-4f7d-8dfe-57f6647ab5b4"/>
<L7p:EncapsulatedAssertionConfigName stringValue="MyJDBCEncass"/>
</L7p:Encapsulated>
</wsp:All>
</wsp:Policy>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Service>
</l7:Resource>
</l7:Item>
</l7:References>
<l7:Mappings>
<l7:Mapping action="NewOrExisting" srcId="0000000000000000ffffffffffffec76" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/0000000000000000ffffffffffffec76" type="FOLDER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d736" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736" type="FOLDER"/>
<l7:Mapping action="NewOrExisting" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d7d9" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" type="JDBC_CONNECTION"/>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d7bf" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" type="POLICY"/>
<l7:Mapping action="NewOrExisting" srcId="0000000000000000fffffffffffffffe" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/identityProviders/0000000000000000fffffffffffffffe" type="ID_PROVIDER_CONFIG">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" srcId="a71d2733b59a6360e8134b6e32c1fb6b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/identityProviders/0000000000000000fffffffffffffffe/users/a71d2733b59a6360e8134b6e32c1fb6b" type="USER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="MapBy">
<l7:StringValue>name</l7:StringValue>
</l7:Property>
<l7:Property key="MapTo">
<l7:StringValue>ProductionSimpleServiceUser</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d802" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" type="ENCAPSULATED_ASSERTION"/>
<l7:Mapping action="NewOrUpdate" srcId="6b52de26ef82cc4df397d1909490d77b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/services/6b52de26ef82cc4df397d1909490d77b" type="SERVICE"/>
</l7:Mappings>
</l7:Bundle>
|
| Response | |
| Http Status | 201 |
| Message Body |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>Bundle mappings</l7:Name>
<l7:Type>BUNDLE MAPPINGS</l7:Type>
<l7:TimeStamp>2014-07-14T17:29:32.042-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://productionGateway/restman/1.0/bundle/"/>
<l7:Resource>
<l7:Mappings>
<l7:Mapping action="NewOrExisting" actionTaken="UsedExisting" srcId="0000000000000000ffffffffffffec76" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/0000000000000000ffffffffffffec76" targetId="0000000000000000ffffffffffffec76" targetUri="https://productionGateway/restman/1.0/folders/0000000000000000ffffffffffffec76" type="FOLDER">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" actionTaken="UpdatedExisting" srcId="6b52de26ef82cc4df397d1909490d736" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/folders/6b52de26ef82cc4df397d1909490d736" targetId="6b52de26ef82cc4df397d1909490d736" targetUri="https://productionGateway/restman/1.0/folders/6b52de26ef82cc4df397d1909490d736" type="FOLDER"/>
<l7:Mapping action="NewOrExisting" actionTaken="UsedExisting" srcId="6b52de26ef82cc4df397d1909490d7ee" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" targetId="6b52de26ef82cc4df397d1909490d7ee" targetUri="https://productionGateway/restman/1.0/passwords/6b52de26ef82cc4df397d1909490d7ee" type="SECURE_PASSWORD">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" actionTaken="UpdatedExisting" srcId="6b52de26ef82cc4df397d1909490d7d9" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" targetId="6b52de26ef82cc4df397d1909490d7d9" targetUri="https://productionGateway/restman/1.0/jdbcConnections/6b52de26ef82cc4df397d1909490d7d9" type="JDBC_CONNECTION"/>
<l7:Mapping action="NewOrUpdate" actionTaken="UpdatedExisting" srcId="6b52de26ef82cc4df397d1909490d7bf" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" targetId="6b52de26ef82cc4df397d1909490d7bf" targetUri="https://productionGateway/restman/1.0/policies/6b52de26ef82cc4df397d1909490d7bf" type="POLICY"/>
<l7:Mapping action="NewOrExisting" actionTaken="UsedExisting" srcId="0000000000000000fffffffffffffffe" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/identityProviders/0000000000000000fffffffffffffffe" targetId="0000000000000000fffffffffffffffe" targetUri="https://productionGateway/restman/1.0/identityProviders/0000000000000000fffffffffffffffe" type="ID_PROVIDER_CONFIG">
<l7:Properties>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrExisting" actionTaken="UsedExisting" srcId="a71d2733b59a6360e8134b6e32c1fb6b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/identityProviders/0000000000000000fffffffffffffffe/users/a71d2733b59a6360e8134b6e32c1fb6b" targetId="959c06d8af08a8cb2a568915e0314d89" targetUri="https://productionGateway/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/959c06d8af08a8cb2a568915e0314d89" type="USER">
<l7:Properties>
<l7:Property key="MapTo">
<l7:StringValue>ProductionSimpleServiceUser</l7:StringValue>
</l7:Property>
<l7:Property key="FailOnNew">
<l7:BooleanValue>true</l7:BooleanValue>
</l7:Property>
<l7:Property key="MapBy">
<l7:StringValue>name</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:Mapping>
<l7:Mapping action="NewOrUpdate" actionTaken="UpdatedExisting" srcId="6b52de26ef82cc4df397d1909490d802" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" targetId="6b52de26ef82cc4df397d1909490d802" targetUri="https://productionGateway/restman/1.0/encapsulatedAssertions/6b52de26ef82cc4df397d1909490d802" type="ENCAPSULATED_ASSERTION"/>
<l7:Mapping action="NewOrUpdate" actionTaken="UpdatedExisting" srcId="6b52de26ef82cc4df397d1909490d77b" srcUri="$#{scheme}://$#{host}:$#{port}/$#{service-url}/1.0/services/6b52de26ef82cc4df397d1909490d77b" targetId="6b52de26ef82cc4df397d1909490d77b" targetUri="https://productionGateway/restman/1.0/services/6b52de26ef82cc4df397d1909490d77b" type="SERVICE"/>
</l7:Mappings>
</l7:Resource>
</l7:Item>
|
The service is now updated on the target Gateway to match the one from the development Gateway, except it uses the "ProductionSimpleServiceUser" instead.