Layer7 API Management

  • 1.  Question on RestMan service for Migration

    Posted Mar 09, 2016 01:21 PM

    Hi, I have below scenarios which I want to address.

    1. I want to get the Specific folder content including dependencies. I will convert the xml into proper folder structure and place them or I can use GMU to get folder structure.

    2. Now durring migration I want to migrate in by overriding some of the contexts of xml like cluseterproperties- I might change some of them and I want to retain some of them. how can I do it?

    3. None of API has any examples for RESTMan like what is input and expected out xmls? Can I get them

    4. I definetly need xsd schema file for the xml what I am retriving. Can you provide me the same?

    5. Passwords and security xml from gateway I dont want to export them durring export is there anyway I can do it?



  • 2.  Re: Question on RestMan service for Migration

    Broadcom Employee
    Posted Mar 14, 2016 01:21 PM

    Hi AnandBadiger,

    Here are some quick answers to your questions:

    1) You can export into a folder structure using GMU. The command is:

    ./GatewayMigrationUtility.sh migrateOut --folderName "myFolder" --format directory
    

    Note you will still need to add other connection parameters.

    2) You can override some of the contexts of entities by using templating. Using the template command:

    ./GatewayMigrationUtility.sh template -b myBundle
    

    This will create a template properties file where you can override values of entities.

    3) The best way to get examples for restman is to use the "/template" endpoint also look at the documentation as: "/restman/1.0/doc/". For example "/restman/1.0/policies/template" returns:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
        <l7:Name>POLICY Template</l7:Name>
        <l7:Type>POLICY</l7:Type>
        <l7:TimeStamp>2016-03-13T13:35:17.703-07:00</l7:TimeStamp>
        <l7:Link rel="self" uri="https://192.168.171.129:8443/restman/1.0/policies/template"/>
        <l7:Link rel="list" uri="https://192.168.171.129:8443/restman/1.0/policies"/>
        <l7:Resource>
            <l7:Policy guid="guid-8757cdae-d1ad-4ad5-bc08-b16b2d370759">
                <l7:PolicyDetail folderId="FolderID" guid="guid-8757cdae-d1ad-4ad5-bc08-b16b2d370759">
                    <l7:Name>Policy Name</l7:Name>
                    <l7:PolicyType>Include</l7:PolicyType>
                    <l7:Properties>
                        <l7:Property key="PropertyKey">
                            <l7:StringValue>PropertyValue</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:PolicyDetail>
                <l7:Resources>
                    <l7:ResourceSet tag="policy">
                        <l7:Resource type="policy">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
    &lt;exp:Export Version=&quot;3.0&quot;
        xmlns:L7p=&quot;http://www.layer7tech.com/ws/policy"
        xmlns:exp=&quot;http://www.layer7tech.com/ws/policy/export" xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2002/12/policy">
        &lt;exp:References/&gt;
        &lt;wsp:Policy xmlns:L7p=&quot;http://www.layer7tech.com/ws/policy" xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2002/12/policy">
            &lt;wsp:All wsp:Usage=&quot;Required&quot;&gt;
            &lt;/wsp:All&gt;
        &lt;/wsp:Policy&gt;
    &lt;/exp:Export&gt;
    </l7:Resource>
                    </l7:ResourceSet>
                </l7:Resources>
            </l7:Policy>
        </l7:Resource>
    </l7:Item>
    

    Another good way to see examples of restman requests is to export or get an existing entity. In nearly all cases you can just import that same entity.

    4) You can get both the wald and the schema from the "/restman/1.0/rest.wadl" and "/restman/1.0/gateway-management.xsd" endpoints.

    5) By default restman does not export passwords or private keys. When it does export them it exports them in an encrypted format.



  • 3.  Re: Question on RestMan service for Migration

    Posted Mar 16, 2016 11:34 AM

    Hi Victor,

    Thanks for the reply, however I am looking here for importing the policies into Gateway by calling RESTMAN put/ update services. But I need the schema defination of the T7 elements like services, policies, cluster properties, fragments etc.

    Can you please provide me the different schema definition for the same above.?

    I would be converting the xml into java and java to xml for this I definitely need schema definition. Please provide me the same



  • 4.  Re: Question on RestMan service for Migration
    Best Answer

    Posted May 18, 2016 08:32 AM

    Hello,

    You can find the .wadl that describes the RESTMAN API by calling /restman/1.0/rest.wadl, and the XSD schema for the RESTMAN API by using /restman/1.0/gateway-management.xsd.

    Both links are accessible from the documentantion's landing page, found at /restman/1.0/doc/home.html.



  • 5.  Re: Question on RestMan service for Migration

    Broadcom Employee
    Posted May 19, 2016 02:41 AM

    Hi,

    GMU(gateway migration utility) is exactly using RESTMAN, but much easier to use.

    Please refer to

    Migrate Gateways - CA API Gateway - 9.0 - CA Technologies Documentation

     

    Regards,

    Mark