Layer7 API Management

 View Only
  • 1.  Create an API Plan through Portalman

    Posted Mar 07, 2024 12:19 PM

    I am trying to create an API PLAN through the CURL request below.
    The API request returns a response saying that it was executed normally, but when I go into the Policy manager and look at the API Plans Fragment, all existing plans are gone and only at least one assertion is shown. (All of those subs were deleted) Does anyone know why?

    @Request:

    PUT /portalman/1/api/plans HTTP/1.1
    Host: 127.0.0.1:8443
    content-type: application/xml
    Authorization: Basic YWRtaW46N2xheWVy
    Content-Length: 1287
     
    <?xml version="1.0" encoding="UTF-8"?>
    <l7:ApiPlans xmlns:l7="http://ns.l7tech.com/2012/04/api-management">
        <l7:ApiPlan>
            <l7:PlanId>examplePlanId123</l7:PlanId>
            <l7:PlanName>Example API Plan</l7:PlanName>
            <l7:DefaultPlan>false</l7:DefaultPlan>
            <l7:LastUpdate>2024-02-27T12:00:00</l7:LastUpdate>
            <l7:PlanDetails>
                <l7:ThroughputQuota l7:enabled="true">
                    <l7:Quota>10000</l7:Quota>
                    <l7:TimeUnit>1</l7:TimeUnit>
                    <l7:CounterStrategy>1</l7:CounterStrategy>
                </l7:ThroughputQuota>
                <l7:RateLimit l7:enabled="true">
                    <l7:MaxRequestRate>100</l7:MaxRequestRate>
                    <l7:WindowSizeInSeconds>3600</l7:WindowSizeInSeconds>
                    <l7:HardLimit>true</l7:HardLimit>
                </l7:RateLimit>
                <l7:Monetization l7:enabled="true">
                    <l7:OneTimeFee>100.0</l7:OneTimeFee>
                    <l7:RecurringFee>20.0</l7:RecurringFee>
                    <l7:RecurringSchedule>Monthly</l7:RecurringSchedule>
                    <l7:FeePerHit>0.01</l7:FeePerHit>
                </l7:Monetization>
            </l7:PlanDetails>
            <l7:PlanPolicy>ExamplePolicy</l7:PlanPolicy>
        </l7:ApiPlan>
    </l7:ApiPlans>

    @Response:

    <l7:ApiPlans xmlns:l7="http://ns.l7tech.com/2012/04/api-management">
        <l7:Method>PUT</l7:Method>
        <l7:Resource>/1/api/plans</l7:Resource>
        <l7:ResourceId/>
        <l7:Timestamp>Thu Mar 07 16:18:47 KST 2024</l7:Timestamp>
        <l7:Status>200</l7:Status>
        <l7:Details>success</l7:Details>
        <l7:ApiPlan>
            <l7:PlanId>examplePlanId124</l7:PlanId>
            <l7:PlanName>Example API Plan</l7:PlanName>
            <l7:DefaultPlan>false</l7:DefaultPlan>
            <l7:LastUpdate>2024-03-07T16:18:47.756+09:00</l7:LastUpdate>
            <l7:PlanPolicy>ExamplePolicy123</l7:PlanPolicy>
        </l7:ApiPlan>
        <l7:ApiPlan>
            <l7:PlanId>examplePlanId125</l7:PlanId>
            <l7:PlanName>Example API Plan</l7:PlanName>
            <l7:DefaultPlan>false</l7:DefaultPlan>
            <l7:LastUpdate>2024-03-07T16:18:47.756+09:00</l7:LastUpdate>
            <l7:PlanPolicy>ExamplePolicy123</l7:PlanPolicy>
        </l7:ApiPlan>
    </l7:ApiPlans>
    API Plans Fragment:


  • 2.  RE: Create an API Plan through Portalman

    Broadcom Employee
    Posted Mar 13, 2024 04:57 PM

    API Plans are meant to be managed by the API Portal and will be overwritten by the portal. Can you provide more information about what you are trying to do and why so we can make sure we point you in the right direction?



    ------------------------------
    Greg Thompson
    Layer7 Product Management
    ------------------------------



  • 3.  RE: Create an API Plan through Portalman

    Posted Mar 14, 2024 10:23 AM
    Dear Greg Thompso
     
    I hope this message finds you well. I am currently utilizing the Layer7 API Gateway without the API Portal due to the simplicity of my service requirements, which do not necessitate the extensive features offered by the API Portal. My aim is to manage API creation, app creation, and API plans in a streamlined manner through portalman.
     
    I am pleased to report that API and app creation (with the transmission of apiId and planId parameters) via portalman has been successful, enabling API calls as intended. However, I am encountering challenges when attempting to add or modify API plans. Upon creation of a new API plan, there appears to be an issue where existing API Plan Fragments become corrupted.
     
    For the development of the specific API Plan, I referred to the Broadcom api gateway manual. The precise HTTP specifications I followed are as outlined below. I would greatly appreciate your assistance in resolving this issue.
     
    Thank you for your time and consideration.
     
    Best regards,
    daesik park
     
     
    PUT /portalman/1/api/plans HTTP/1.1
    Host: 210.134.xxx,xxx:8443
    content-type: application/xml
    Authorization: Basic YWRta____xheWVy
    Content-Length: 948
     
    <?xml version="1.0" encoding="UTF-8"?>
    <l7:ApiPlans xmlns:l7="http://ns.l7tech.com/2012/04/api-management">
        <l7:ApiPlan>
            <l7:PlanId>a751fd0f-2ed3-4e01-b69a-0a7c659d1333</l7:PlanId>
            <l7:PlanName>API Plans Fragment</l7:PlanName>
            <l7:DefaultPlan>false</l7:DefaultPlan>
            <l7:LastUpdate>2024-02-19T17:34:30.875-07:00</l7:LastUpdate>
            <l7:PlanDetails>
                <l7:ThroughputQuota l7:enabled="false">
                    <l7:Quota>1001</l7:Quota>
                    <l7:TimeUnit>4</l7:TimeUnit>
                    <l7:CounterStrategy>0</l7:CounterStrategy>
                </l7:ThroughputQuota>
                <l7:RateLimit l7:enabled="true">
                    <l7:MaxRequestRate>100</l7:MaxRequestRate>
                    <l7:WindowSizeInSeconds>0</l7:WindowSizeInSeconds>
                    <l7:HardLimit>false</l7:HardLimit>
                </l7:RateLimit>
            </l7:PlanDetails>
        </l7:ApiPlan>
    </l7:ApiPlans>



  • 4.  RE: Create an API Plan through Portalman

    Broadcom Employee
    Posted Mar 14, 2024 10:50 AM

    Sorry, but as I mentioned, it is not recommended to use portalman in this way. This use is not supported and is likely to cause issues with upgrades and maintenance down the road. If you really do not want to leverage the portal directly, then you really should create some framework that you will manage yourself. I know this is not the answer you're looking for, but I'm trying to help you avoid problems in the future as you will not be able to get support using portalman like this.

    I'd really recommend you use the portal even if the use case is ****. The portal will provide quick and easy ways to manage this and also has the "Portal API" which is fully documented and supported to allow you to automate all of this if that's what you need to do.



    ------------------------------
    Greg Thompson
    Layer7 Product Management
    ------------------------------