Layer7 API Management

  • 1.  Need to update cluster wide properties for service with RESTman service

    Posted May 17, 2017 06:46 AM

    Hi All,

    we have requirement to update cluster wide properties for service, providing with service name or service URL with REST man service, is it possible?, if yes, please help me with configuration.

     

    thanks a lot.



  • 2.  Re: Need to update cluster wide properties for service with RESTman service
    Best Answer

    Broadcom Employee
    Posted May 17, 2017 12:20 PM

    Create a Cluster Property
    URL: https://<gateway name>:8443/restman/1.0/clusterProperties
    HTTP Method: Post
    Headers:
    Authorization
    Content-Type: application/xml
    Payload;
    <l7:ClusterProperty xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
                    <l7:Name>foo</l7:Name>
                    <l7:Value>1234</l7:Value>
    </l7:ClusterProperty>

     

    Update a Cluster Property

     

    URL: https://<gateway name>:8443/restman/1.0/clusterProperties/5db1321e3a29ddaf67d501c6f8f19709
    HTTP Method: Put
    Headers:
    Authorization
    Content-Type: application/xml
    Payload:
    <l7:ClusterProperty xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management" id="5db1321e3a29ddaf67d501c6f8f19709" version="1">
                    <l7:Name>foo</l7:Name>
                    <l7:Value>123</l7:Value>
    </l7:ClusterProperty>

     

    Note: When you are updating a cluster property you need to know the GOID for the URI and the payload along with version needs to be incremented. The GOID will be returned during a Get to review all the cluster properties or the response when the cluster wide properties is created through restman.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 3.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 06, 2020 06:17 AM
    Hi Stephen,

    Thank you for the answer, is it possible to create multiple cluster properties in a single POST call? if so what would be the correct request format?

    Regards,
    Arjun


  • 4.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 06, 2020 07:49 AM
    Hi Arjun, 

    You could use a bundle for this. This is documented in the restman documentation on your gateway:
    https://yourIP:8443/restman/1.0/doc/migration.html

    BTW: Your tool APIIDA API Gateway Manager can help you with this case as well. 

    Best,
    Waldemar

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 5.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 06, 2020 08:05 AM
    Thank you Waldemar,

    Looking at the migration documentation. it only talks about folders/services/policy. Do you may be have idea on how do i export cluster wide properties or listen ports and import in another gateway.


    Regards,
    Arjun


  • 6.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 06, 2020 08:20 AM
    Just don't use the resourceType parameter, instead the clusterProperty parameter, like defined in the documentation of a bundle:
    https://yourIP:8443/restman/1.0/doc/restDoc.html#1.0/bundle

    Examle would be:
    https://yourIP:8443/restman/1.0/bundle?clusterProperty=0000000000000000fffffffffff5519f&clusterProperty=17228ed6b1117a597853019558e52c8b

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 7.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 07, 2020 08:22 AM
    Thank you Waldemar,

    I have exported the cluster props bundle from our QA environment and trying to import in TEST environmnet same XML as payload but i am getting below error. Restman debugger doesn't show any inforamtion on why it failed. Do you have any idea, please ?

    Request body
    Using PUT on URI /restman/1.0/bundle
     
    <?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>2020-02-07T13:18:32.029Z</l7:TimeStamp>
    <l7:Link rel="self" uri="https://i10752.dsv.com:9443/restman/1.0/bundle?clusterProperty=4be8b29c51bbb1cadcd381d1f2f7ec9c"/>
    <l7:Resource>
    <l7:Bundle>
    <l7:References>
    <l7:Item>
    <l7:Name>trustedCert.expiryFineAge</l7:Name>
    <l7:Id>4be8b29c51bbb1cadcd381d1f2f7ec9c</l7:Id>
    <l7:Type>CLUSTER_PROPERTY</l7:Type>
    <l7:TimeStamp>2020-02-07T13:18:32.029Z</l7:TimeStamp>
    <l7:Resource>
    <l7:ClusterProperty id="4be8b29c51bbb1cadcd381d1f2f7ec9c" version="0">
    <l7:Name>trustedCert.expiryFineAge</l7:Name>
    <l7:Value>30d</l7:Value>
    </l7:ClusterProperty>
    </l7:Resource>
    </l7:Item>
    </l7:References>
    <l7:Mappings>
    <l7:Mapping action="NewOrExisting" srcId="4be8b29c51bbb1cadcd381d1f2f7ec9c" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/4be8b29c51bbb1cadcd381d1f2f7ec9c" type="CLUSTER_PROPERTY">
    <l7:Properties>
    <l7:Property key="MapBy">
    <l7:StringValue>name</l7:StringValue>
    </l7:Property>
    </l7:Properties>
    </l7:Mapping>
    </l7:Mappings>
    </l7:Bundle>
    </l7:Resource>
    </l7:Item>

    Response 
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
        <soapenv:Body>
            <soapenv:Fault>
                <faultcode>soapenv:Server</faultcode>
                <faultstring>Policy Falsified</faultstring>
                <faultactor>https://i18709.dsv.com:9443/restman/1.0/bundle</faultactor>
                <detail>
                    <l7:policyResult status="Error in Assertion Processing" xmlns:l7="http://www.layer7tech.com/ws/policy/fault"/>
                </detail>
            </soapenv:Fault>
        </soapenv:Body>
    </soapenv:Envelope>

    Regards,
    Arjun


  • 8.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 10, 2020 02:30 AM
    Thank you for your assistance. it worked now just be changing the object to start from 
    <l7:Bundle xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">

    Thank you.
    Arjun


  • 9.  RE: Re: Need to update cluster wide properties for service with RESTman service

    Posted Feb 10, 2020 04:52 AM
    Hi All,

    i am trying import cluster-wide properties as a bundle and i see below error. can anyone suggest how to do resolve this error? when i send single cluster property it is working fine, when there is a multiple i see error.

    <?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>2020-02-10T09:50:31.300Z</l7:TimeStamp>
        <l7:Link rel="self" uri="https://i18709.dsv.com:9443/restman/1.0/bundle"/>
        <l7:Resource>
            <l7:Mappings>
                <l7:Mapping action="AlwaysCreateNew" errorType="ImproperMapping" srcId="4be8b29c51bbb1cadcd381d1f2f7ec9c" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/4be8b29c51bbb1cadcd381d1f2f7ec9c" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>Incorrect mapping instructions: Mapping by NAME but could not deduce a target NAME to map to from the given bundle. Please specify a target NAME to map to. Mapping for: EntityHeader. Name=null, id=4be8b29c51bbb1cadcd381d1f2f7ec9c, description=null, type = CLUSTER_PROPERTY</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="4be8b29c51bbb1cadcd381d1f2f7eca3" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/4be8b29c51bbb1cadcd381d1f2f7eca3" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="4be8b29c51bbb1cadcd381d1f2f7ecb0" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/4be8b29c51bbb1cadcd381d1f2f7ecb0" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="4be8b29c51bbb1cadcd381d1f2f7ecbd" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/4be8b29c51bbb1cadcd381d1f2f7ecbd" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="54722077efcb07266c25dd1682eaa028" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/54722077efcb07266c25dd1682eaa028" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="dec40198635e27f6fe46ca12794ed896" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/dec40198635e27f6fe46ca12794ed896" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="dec40198635e27f6fe46ca12794ed89e" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/dec40198635e27f6fe46ca12794ed89e" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e638954a0b7297f26798e0a3bff5b644" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e638954a0b7297f26798e0a3bff5b644" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e638954a0b7297f26798e0a3bff5b650" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e638954a0b7297f26798e0a3bff5b650" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e9d8906e7633dbacd972a443a6fdfeec" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e9d8906e7633dbacd972a443a6fdfeec" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e9d8906e7633dbacd972a443a6ff6644" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e9d8906e7633dbacd972a443a6ff6644" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e9d8906e7633dbacd972a443a6ff664a" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e9d8906e7633dbacd972a443a6ff664a" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e9d8906e7633dbacd972a443a6ff6650" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e9d8906e7633dbacd972a443a6ff6650" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e9d8906e7633dbacd972a443a6ff669d" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e9d8906e7633dbacd972a443a6ff669d" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
                <l7:Mapping action="AlwaysCreateNew" errorType="Unknown" srcId="e9d8906e7633dbacd972a443a703d72f" srcUri="https://i10752.dsv.com:9443/restman/1.0/clusterProperties/e9d8906e7633dbacd972a443a703d72f" type="CLUSTER_PROPERTY">
                    <l7:Properties>
                        <l7:Property key="ErrorMessage">
                            <l7:StringValue>java.lang.NullPointerException</l7:StringValue>
                        </l7:Property>
                        <l7:Property key="MapBy">
                            <l7:StringValue>name</l7:StringValue>
                        </l7:Property>
                    </l7:Properties>
                </l7:Mapping>
            </l7:Mappings>
        </l7:Resource>
    </l7:Item>