Layer7 API Management

  • 1.  RESTMAN /bundle params

    Posted May 17, 2017 04:31 AM

    Hi,

     

    When trying to export a bundle containing only one service (and dependencies), mapping about parent folder id show up but not folder definition (which is normal as not requested).

     

    <l7:Item>
    <l7:Name>PingFederate_STS</l7:Name>
    <l7:Id>c630da68059b12c41a24f8f9df4dc70f</l7:Id>
    <l7:Type>SERVICE</l7:Type>
    <l7:TimeStamp>2017-05-16T11:26:17.797+02:00</l7:TimeStamp>
    <l7:Resource>
    <l7:Service id="c630da68059b12c41a24f8f9df4dc70f" version="52">
    <l7:ServiceDetail folderId="d3dfe996ca7aba6eea79e7cf2dd9df90" id="c630da68059b12c41a24f8f9df4dc70f" version="52">

    ....

    <l7:Mapping action="NewOrExisting" srcId="d3dfe996ca7aba6eea79e7cf2dd9df90" srcUri="https://xsnl50b491a.pharma.aventis.com:7443/restman/1.0/folders/d3dfe996ca7aba6eea79e7cf2dd9df90" type="FOLDER">
    <l7:Properties>
    <l7:Property key="FailOnNew">
    <l7:BooleanValue>true</l7:BooleanValue>
    </l7:Property>
    </l7:Properties>
    </l7:Mapping>

     

    As we can't "MapByName" this folder, becuase folder definition is not included, if we then add "requireFolder" along with "service" query params, the mentioned folder does not show up in resulting bundle.

    This is the command initiated:

     

    /usr/bin/curl -k -X GET -H "L7-key-passphrase: foobar" -H "Accept: application/xml" -H "Content-Type: application/xml" -u "username:password" --cacert /etc/pki/tls/private/CA_chain.pem "https://apidev-eu-int.sanofi.com:7443/restman/1.0/bundle?requireFolder=d3dfe996ca7aba6eea79e7cf2dd9df90&service=c630da68059b12c41a24f8f9df4dc70f&includeDependencies=true&encassAsPolicyDependency=true&encryptSecrets=true" --output "/var/tmp/restapi_comm31404.xml"

     

    What are we doing wrong here ?



  • 2.  Re: RESTMAN /bundle params

    Broadcom Employee
    Posted May 17, 2017 05:44 PM

    Good afternoon,

     

    The restman command you included has the "requireFolder" which is not a valid option and is ignored. If you are looking for the folder you have to use "folder".

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 3.  Re: RESTMAN /bundle params

    Posted May 18, 2017 05:08 AM

    HI,

     

    Restman documentation mention this parameter:

     

    https://apisbox1-eu.sanofi.com:7443/restman/1.0/doc/restDoc.html#1.0/bundle 

     



  • 4.  Re: RESTMAN /bundle params
    Best Answer

    Broadcom Employee
    Posted May 18, 2017 12:38 PM

    Try adding:

    folder=d3dfe996ca7aba6eea79e7cf2dd9df90

    to the request url.

     

    The require folder parameter will only take effect if the folder is already included in the bundle export. By having the following in your bundle parameters: 

    folder=d3dfe996ca7aba6eea79e7cf2dd9df90&requireFolder=d3dfe996ca7aba6eea79e7cf2dd9df90&service=c630da68059b12c41a24f8f9df4dc70f

    • The folder parameter will include the folder and all its contents in the bundle export.
    • The requireFolder parameter tells the bundle exporter to only include the folder and not any of its contents (except those explicitly requested).
    • The service parameter tells to bundle exported to also export the service and all its dependencies.


  • 5.  Re: RESTMAN /bundle params

    Broadcom Employee
    Posted May 18, 2017 01:10 PM

    Thank you Victor for the insight.

     

    Phillipe, I've tested it in our lab and it should accomplish what you are looking for. Please let us know if it does.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 6.  Re: RESTMAN /bundle params

    Posted May 19, 2017 08:09 AM

    Hi,

     

    Thanks. It Works

     

    Deep inside our administration framework it now does:

     

    callGETService -h "L7-key-passphrase: zepass" "/bundle?service=c630da68059b12c41a24f8f9df4dc70f&folder=d3dfe996ca7aba6eea79e7cf2dd9df90&requireFolder=d3dfe996ca7aba6eea79e7cf2dd9df90&includeDependencies=true&encassAsPolicyDependency=true&encryptSecrets=true"

     

    Single service is exported along with Folder mapping and definition. Just had to "MapByName" folder and it does the job.

     

    Kindly suggest to amend the RESTman documentation on this one



  • 7.  Re: RESTMAN /bundle params

    Broadcom Employee
    Posted May 19, 2017 01:19 PM

    That is great to hear. We will definitely look to outline this in our documentation.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support