Adding a new default tier on API Manager












1















I'm using API Manager 2.2.0



By default WSO2 API Manager comes with some Subscription Throttling Policies, such as Gold, Silver, and Bronze. I want to add a new one called Diamond.



I added this new tier using the Admin webpage (e.g. https://localhost:9443/admin) on all the existing tenants.



What I want to to now is to make this Diamond tier be generated by default when new tenants are created.



I edited the file default-tiers.xml adding the following code:



<wsp:Policy>
<throttle:ID throttle:type="ROLE">Diamond</throttle:ID>
<wsp:Policy>
<throttle:Control>
<wsp:Policy>
<throttle:MaximumCount>2000</throttle:MaximumCount>
<throttle:UnitTime>1000</throttle:UnitTime>
<wsp:Policy>
<throttle:Attributes>
<throttle:x-wso2-BillingPlan>FREE</throttle:x-wso2-BillingPlan>
<throttle:x-wso2-StopOnQuotaReach>true</throttle:x-wso2-StopOnQuotaReach>
</throttle:Attributes>
</wsp:Policy>
</wsp:Policy>
</throttle:Control>
</wsp:Policy>
</wsp:Policy>


When I create a new tenant and access the Admin webpage the tier isn't there. If I browse the resources on Carbon for that tenant I can see the file tiers.xml has the code above.



Since news tenants don't have it when I subscribe to an API using this Diamond tier it always returns 403 to me. If I use the other ones (e.g. Gold) everything work as expected.



How can I add a new tier to the list of default ones?



Any help is highly appreciated.










share|improve this question



























    1















    I'm using API Manager 2.2.0



    By default WSO2 API Manager comes with some Subscription Throttling Policies, such as Gold, Silver, and Bronze. I want to add a new one called Diamond.



    I added this new tier using the Admin webpage (e.g. https://localhost:9443/admin) on all the existing tenants.



    What I want to to now is to make this Diamond tier be generated by default when new tenants are created.



    I edited the file default-tiers.xml adding the following code:



    <wsp:Policy>
    <throttle:ID throttle:type="ROLE">Diamond</throttle:ID>
    <wsp:Policy>
    <throttle:Control>
    <wsp:Policy>
    <throttle:MaximumCount>2000</throttle:MaximumCount>
    <throttle:UnitTime>1000</throttle:UnitTime>
    <wsp:Policy>
    <throttle:Attributes>
    <throttle:x-wso2-BillingPlan>FREE</throttle:x-wso2-BillingPlan>
    <throttle:x-wso2-StopOnQuotaReach>true</throttle:x-wso2-StopOnQuotaReach>
    </throttle:Attributes>
    </wsp:Policy>
    </wsp:Policy>
    </throttle:Control>
    </wsp:Policy>
    </wsp:Policy>


    When I create a new tenant and access the Admin webpage the tier isn't there. If I browse the resources on Carbon for that tenant I can see the file tiers.xml has the code above.



    Since news tenants don't have it when I subscribe to an API using this Diamond tier it always returns 403 to me. If I use the other ones (e.g. Gold) everything work as expected.



    How can I add a new tier to the list of default ones?



    Any help is highly appreciated.










    share|improve this question

























      1












      1








      1








      I'm using API Manager 2.2.0



      By default WSO2 API Manager comes with some Subscription Throttling Policies, such as Gold, Silver, and Bronze. I want to add a new one called Diamond.



      I added this new tier using the Admin webpage (e.g. https://localhost:9443/admin) on all the existing tenants.



      What I want to to now is to make this Diamond tier be generated by default when new tenants are created.



      I edited the file default-tiers.xml adding the following code:



      <wsp:Policy>
      <throttle:ID throttle:type="ROLE">Diamond</throttle:ID>
      <wsp:Policy>
      <throttle:Control>
      <wsp:Policy>
      <throttle:MaximumCount>2000</throttle:MaximumCount>
      <throttle:UnitTime>1000</throttle:UnitTime>
      <wsp:Policy>
      <throttle:Attributes>
      <throttle:x-wso2-BillingPlan>FREE</throttle:x-wso2-BillingPlan>
      <throttle:x-wso2-StopOnQuotaReach>true</throttle:x-wso2-StopOnQuotaReach>
      </throttle:Attributes>
      </wsp:Policy>
      </wsp:Policy>
      </throttle:Control>
      </wsp:Policy>
      </wsp:Policy>


      When I create a new tenant and access the Admin webpage the tier isn't there. If I browse the resources on Carbon for that tenant I can see the file tiers.xml has the code above.



      Since news tenants don't have it when I subscribe to an API using this Diamond tier it always returns 403 to me. If I use the other ones (e.g. Gold) everything work as expected.



      How can I add a new tier to the list of default ones?



      Any help is highly appreciated.










      share|improve this question














      I'm using API Manager 2.2.0



      By default WSO2 API Manager comes with some Subscription Throttling Policies, such as Gold, Silver, and Bronze. I want to add a new one called Diamond.



      I added this new tier using the Admin webpage (e.g. https://localhost:9443/admin) on all the existing tenants.



      What I want to to now is to make this Diamond tier be generated by default when new tenants are created.



      I edited the file default-tiers.xml adding the following code:



      <wsp:Policy>
      <throttle:ID throttle:type="ROLE">Diamond</throttle:ID>
      <wsp:Policy>
      <throttle:Control>
      <wsp:Policy>
      <throttle:MaximumCount>2000</throttle:MaximumCount>
      <throttle:UnitTime>1000</throttle:UnitTime>
      <wsp:Policy>
      <throttle:Attributes>
      <throttle:x-wso2-BillingPlan>FREE</throttle:x-wso2-BillingPlan>
      <throttle:x-wso2-StopOnQuotaReach>true</throttle:x-wso2-StopOnQuotaReach>
      </throttle:Attributes>
      </wsp:Policy>
      </wsp:Policy>
      </throttle:Control>
      </wsp:Policy>
      </wsp:Policy>


      When I create a new tenant and access the Admin webpage the tier isn't there. If I browse the resources on Carbon for that tenant I can see the file tiers.xml has the code above.



      Since news tenants don't have it when I subscribe to an API using this Diamond tier it always returns 403 to me. If I use the other ones (e.g. Gold) everything work as expected.



      How can I add a new tier to the list of default ones?



      Any help is highly appreciated.







      wso2 wso2-am wso2carbon






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 2 at 17:40









      Daniel PereiraDaniel Pereira

      2,28212138




      2,28212138
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Since Tenants are isolated entities there is no OOTB way to achieve this. However, you can use a TenantMgtListener (implement onTenantCreate) [1] and call subscription add API[2].



          [1] https://docs.wso2.com/display/Carbon4411/TenantMgtListener
          [2] https://docs.wso2.com/display/AM260/apidocs/admin/#!/operations#SubscriptionPolicyCollection#throttlingPoliciesSubscriptionPost



          p.s. default-tiers.xml nor tiers.xml is used in the new throttling implementation.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010786%2fadding-a-new-default-tier-on-api-manager%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Since Tenants are isolated entities there is no OOTB way to achieve this. However, you can use a TenantMgtListener (implement onTenantCreate) [1] and call subscription add API[2].



            [1] https://docs.wso2.com/display/Carbon4411/TenantMgtListener
            [2] https://docs.wso2.com/display/AM260/apidocs/admin/#!/operations#SubscriptionPolicyCollection#throttlingPoliciesSubscriptionPost



            p.s. default-tiers.xml nor tiers.xml is used in the new throttling implementation.






            share|improve this answer




























              1














              Since Tenants are isolated entities there is no OOTB way to achieve this. However, you can use a TenantMgtListener (implement onTenantCreate) [1] and call subscription add API[2].



              [1] https://docs.wso2.com/display/Carbon4411/TenantMgtListener
              [2] https://docs.wso2.com/display/AM260/apidocs/admin/#!/operations#SubscriptionPolicyCollection#throttlingPoliciesSubscriptionPost



              p.s. default-tiers.xml nor tiers.xml is used in the new throttling implementation.






              share|improve this answer


























                1












                1








                1







                Since Tenants are isolated entities there is no OOTB way to achieve this. However, you can use a TenantMgtListener (implement onTenantCreate) [1] and call subscription add API[2].



                [1] https://docs.wso2.com/display/Carbon4411/TenantMgtListener
                [2] https://docs.wso2.com/display/AM260/apidocs/admin/#!/operations#SubscriptionPolicyCollection#throttlingPoliciesSubscriptionPost



                p.s. default-tiers.xml nor tiers.xml is used in the new throttling implementation.






                share|improve this answer













                Since Tenants are isolated entities there is no OOTB way to achieve this. However, you can use a TenantMgtListener (implement onTenantCreate) [1] and call subscription add API[2].



                [1] https://docs.wso2.com/display/Carbon4411/TenantMgtListener
                [2] https://docs.wso2.com/display/AM260/apidocs/admin/#!/operations#SubscriptionPolicyCollection#throttlingPoliciesSubscriptionPost



                p.s. default-tiers.xml nor tiers.xml is used in the new throttling implementation.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 3 at 17:44









                BeeBee

                8,05053458




                8,05053458
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010786%2fadding-a-new-default-tier-on-api-manager%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith