Layer7 API Management

  • 1.  Schedule Service Execution in Layer7

    Posted Nov 26, 2015 05:21 AM

    I am trying to schedule a service to run every 5 minutes inLayer7 (usind its Schedule Service Execution option) but the "Basic" doesn't allow that option. How does it get configured under "Advanced" where the policy is executed every 5 minutes?



  • 2.  Re: Schedule Service Execution in Layer7

    Posted Nov 26, 2015 05:56 PM

    Hi.

     

    In the Policy Manager --> Tasks --> Manage Scheduled Tasks --> Add.

    For the Execution Time, select "Recurring".

    In the "Every" row, change the value from "1" to "5", and use the dropdown menu to change the option from "Second" to "Minute".

     

    --Gary



  • 3.  Re: Schedule Service Execution in Layer7

    Posted Nov 27, 2015 06:11 AM

    Hi Gary,

     

    Thanks for your response. In our Policy Manager version, i.e. 8.3.0, the options are:

    Tasks --> Additional Actions --> Schedule Service Execution

    When I select Schedule Service Execution,and select Schedule Recurring Job, it can either be created as a Basic, which is allowed to every Second/Minute/hour/day/month/week. Or as Advanced, under which Second, Minute, Hour, Day, and Month all are set to * (which means "every" I reckon?) and Weekday has "?" as default values. Now to run the service every 5 minutes, what values need to go for all these 6 parameters of "Advanced"?

     

    Thanks,

    Mukti



  • 4.  Re: Schedule Service Execution in Layer7
    Best Answer

    Posted Jun 08, 2016 05:06 PM

    Hi Mukti12. You just have to leave all the fields except minutes to have the default value of '*', and set the minutes field to '5'. Please note that manage scheduled tasks feature did not exist before version 9.0, so I assume you are using version 9.0 or higher. If that is not the case, and you want to schedule a task using cron, you could see format of crontab and some examples at http://www.adminschoice.com/crontab-quick-reference.

     

    Regards

     

    Arash Eftekhari

    Support Engineer, Global Customer Success

    Email: CATechnicalSupport@ca.com

    Phone: +1 800 225 5224

    Outside of North America - ca.com/us/worldwide.aspx

    CA API Management Community: ca.com/talkapi



  • 5.  Re: Schedule Service Execution in Layer7

    Posted Jan 14, 2019 10:17 AM

    Hi,

    I am currently trying to modify the value of a cluster-wide property (CWP) via a Scheduled Task.
    The CWP I am trying to modify is audit.detailThreshold, which is a built-in CWP, not a custom made, and thus, I can't seem to be able to modify it via a Scheduled Task.
    Is there a different sequence of steps of achieving this, versus a custom CWP?
    Any reference on how to accomplish this, either via a Scheduled Task or a cron job, will be greatly appreciated.



  • 6.  Re: Schedule Service Execution in Layer7

    Broadcom Employee
    Posted Jan 14, 2019 07:09 PM

    Hi,

    You may manually add audit.detailThreshold on Manage Cluster-Wide properties window. (policy manager -> Tasks -> Global Settings -> Manage Cluster-Wide Properties.

     

    And then in your schedule task, you call the /restman interface to update the cwp.

     

    /restman document is on your gateway (publish it first from internal service)

    https://<your gateway host>:8443/restman/1.0/doc/restDoc.html#1.0/clusterProperties 

     

    You would need GET first  

    https://localhost:9443/restman/1.0/clusterProperties?name=<cwp name>

    and then use xpath to get the ID of the cwp

    And then you PUT to update the cwp

     

    example of PUT,
    URL: https://<gateway>:8443/restman/1.0/clusterProperties/45f1f2e528887e575244b39ec6034f87
    Content-Type: application/xml
    body:
    <l7:ClusterProperty version="0" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Name>cwpbymark</l7:Name>
    <l7:Value>value</l7:Value>
    </l7:ClusterProperty>

     

    ( if you hard coded the cwp ID, you don't need to GET it in schedule task)

     

    Regards,

    Mark

     



  • 7.  Re: Schedule Service Execution in Layer7

    Posted Jan 21, 2019 12:16 PM

    Hi Mark,

     

    Thanks a lot for your prompt response.

    If I may be so bold to ask a further question, would it be possible to run the restman command in the command line to set a CWP given its Name and ID?

     

    I am currently running the following command with not a lot of luck:

     

    $ ./GatewayMigrationUtility.sh restman –-argFile commonarguments.properties --method POST --path '1.0/clusterProperties' --request setCWP.xml

     

    Where my setCWP.xml file contains the following:

     

    <l7:Resource>

      <l7:ClusterProperty id="edf8c76261d259d6c7a8b02971b4ae4c" version="0">

         <l7:Name>#myCWPName#</l7:Name>

         <l7:ID>#myCWPID#</l7:ID>

         <l7:Value>#valueImTryingToSet#</l7:Value>

      </l7:ClusterProperty>

    </l7:Resource>

     

    Looking forward to hearing back.

     

    Thanks beforehand,

     

    Carlos R.

     

     

    Message Input



  • 8.  Re: Schedule Service Execution in Layer7

    Broadcom Employee
    Posted Jan 21, 2019 05:10 PM

    Yes, we can call /restman via a command line, with curl command.

    An example for update (you know the ID),

    1. create file mycwp.xml as below,

    <l7:ClusterProperty version="0" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">

         <l7:Name>#myCWPName#</l7:Name>

         <l7:Value>#valueImTryingToSet#</l7:Value>

     </l7:ClusterProperty>

     

    2. call restman
    curl -X PUT -k -H 'Content-Type: application/xml' -u admin:7layer 'https://localhost:9443/restman/1.0/clusterProperties/edf8c76261d259d6c7a8b02971b4ae4c' -d @mycwp.xml

    (you may change the hostname, username/password accordingly)

     

    if to create new cwp, the payload is the same, but use POST method and the url doesn't need the /{id}

    curl -X POST -k -H 'Content-Type: application/xml' -u admin:7layer 'https://localhost:9443/restman/1.0/clusterProperties' -d @mycwp.xml

     

    The gmu should work as well, but the payload is the same as calling the /restman directly, ie. you don't need the <l7:Resource> element, and in <l7:ClusterProperty> element, you need to define the namespace.

     

    (in fact, the gmu will call /restman to do its job)