{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Apigee-127 /
avatar image
0
Question by Rohit Karadi · May 05, 2020 at 08:06 AM · 45 Views maven plugin

Update single policy for bulk proxies using Maven Tool.

Hi Team,

We are using Maven Build Plugins for creataing and deploying proxies in bulk. We are deploying the proxies using maven command. While deploying, we are not adding relative path in SLM logging policy, so we can test it and update the realtive path in SLM logging after testing.

Could you please let us know, How we can update the SLM logging relative path for all proxies after the deployment, Is there any plugin or maven command present to just update the single policy of deployed proxies.

Regards,

Rohit Karadi

Comment
Add comment Show 2
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sai Saran Vaidyanathan ♦   · May 05, 2020 at 08:26 PM 0
Link

HI @Rohit Karadi

Can you provide an example ? What are you trying to change ?

avatar image Rohit Karadi Sai Saran Vaidyanathan ♦ · May 08, 2020 at 04:14 AM 0
Link

Hi Sai,

Below is the code snippet from Api_SLM_Logger policy.

While deploying the proxy we are keeping SLM policy like below (Without relative path)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<MessageLogging async="false" continueOnError="true" enabled="true" name="Api_SLM_Logger">

<DisplayName>Api_SLM_Logger</DisplayName>

<FaultRules/>

<Properties/>

<BufferMessage>false</BufferMessage>

<File async="true"> <FileName>api_SLM_mpgOPSSoapV1_AuthenticationService_new.log</FileName>

After the deployment, we want to update the SLM policy with relative path so logs can be generated to one specific folder only


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<MessageLogging async="false" continueOnError="true" enabled="true" name="Api_SLM_Logger">

<DisplayName>Api_SLM_Logger</DisplayName>

<FaultRules/>

<Properties/>

<BufferMessage>false</BufferMessage>

<File async="true"><FileName>../../../../../../logs/api/wsm/api_SLM_mpgOPSSoapV1_AuthenticationService_new.log</FileName>


Here we are using maven plugin to create the bundle in bulk , and we want to update the this single policy after the deployment and testing for each deployed proxy.

Regards,

Rohit Karadi

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Sai Saran Vaidyanathan   · May 12, 2020 at 06:12 PM

@Rohit Karadi

Yes you can do this using the config.json file which will have the configuration for updating policy while building the package and deploying. Check out this sample. You will find the config.json that has some configuration. Depending on the Maven profile you call, it pulls the appropriate values and updates the file.

Let's say you have two pom profile - "test" and "prod", then your config.json will look like this

{
    "configurations": [
        {
            "name": "test",
            "policies": [
                {
                    "name": "Api_SLM_Logger.xml",
                    "tokens": [
                        {
                            "xpath": "/MessageLogging/File/FileName",
                            "value": "../../../../../../logs/api/wsm/api_SLM_mpgOPSSoapV1_AuthenticationService_new.log"
                        }
                    ]
                }
            ],
            "proxies": [],
            "targets": []
        },
        {
            "name": "prod",
            "policies": [
                {
                    "name": "Api_SLM_Logger.xml",
                    "tokens": [
                        {
                            "xpath": "/MessageLogging/File/FileName",
                            "value": "../../../../../../logs/api/wsm/api_SLM_mpgOPSSoapV1_AuthenticationService_prod.log"
                        }
                    ]
                }
            ],
            "proxies": [],
            "targets": []
        }
    ]
}

So when you call "mvn install -Ptest", then the deploy plugin will pick this config.json and apply it. So in the target directory, you will see that the policy value will be updated to what you have in this config.json.

With this you can then externalize the values in the config.json and have the plugin pick and apply while packaging. Hope this helps !

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sai Saran Vaidyanathan ♦   · May 18, 2020 at 05:29 AM 0
Link

@Rohit Karadi - did you try this ? Did it work ?

Follow this Question

Answers Answers and Comments

55 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges