Skip to content

XML Config files deployments

  • As already discussed, Apiro is a GitOps based platform.
  • Any configuration files you create or modify using an IDE like Intellij instead of using the Apiro UI, need to be pushed to the associated GIT repository.
  • Once the files are pushed the following steps must be followed to deploy the configuration files, to enable the Apiro engine to use them.
  • You need to instruct Apiro to deploy these config files into its engine. This is achieved by making an API call or via the UI as explained below:
[OPTION 1] Manual GIT push and config files deployment via the UI
  • Login to Apiro.
    raw login_page
  • Click on Tools and then Source Config Management
    config_source_manager
  • Click on the magnifying glass to view the specific configuration source. config_source_manager
  • Click on the Reload button to reload all the configuration files from the GIT repository you specified.
  • You will be able to see if the reload was successful.

    config_deploy_success

[OPTION 2] Completed automated config files push and deployment
  • Apiro allows you to update config files directly in the UI.
  • If you chose this option you do not have to manually push files to GIT and deploy them. The engine will do that for you when you click save.
  • You may want to update the config files using Intellij and then copy the contents in the window shown below to avoid the manual tasks listed in OPTION 1 above. raw config_update_via_ui
[OPTION 3] Deploy config files using the API

https://[apiro_address]/rest/cfgsource/trigger/[config_source] Please note this option will not work for the current compose script because you will need a valid token

The above GET HTTP request is used to trigger an Apiro config source which will deploy any config files pushed into the associated GIT repository.

If the config source is successfully deployed it will return in its response body:

1
2
3
{
"success": true
}

If the config source encounters an error when deploying it will give the location and description of the error as well as the fragment of config which caused the error:

1
2
3
4
5
6
7
{
"success": false,
"errorMessage": "exception unexpected element (uri:\"\", local:\"genDoc\"). Expected elements are <{}apiroConf>",
"cfgSrc": "ROOT",
"cfgSrcPath": "/dataSources/ASX200LIST_DOT_COM_HTML.xml",
"frag": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<genDoc>\n    <loadOrder>10</loadOrder>\n    <dataSources>\n        <dataSource definition=\"REST\" execPriority=\"10\" name=\"ASX200LIST_DOT_COM_HTML\">\n            <metaData>\n                <item name=\"KEY\">\n                    <value>VAL_A</value>\n                    <value>VAL_B</value>\n                </item>\n            </metaData>\n            <description/>\n            <config>\n                <![CDATA[\n                {\n                          \"url\": \"https://www.asx200list.com/\",\n                          \"method\": \"GET\"\n                }\n]]>\n            </config>\n            <abstract>false</abstract>\n            <inheritable>true</inheritable>\n            <execPredicate>#GRV{ true }</execPredicate>\n        </dataSource>\n    </dataSources>\n</genDoc>"
}

here are 3 examples of valid deploy config request: NOTE: in order successfully deploy you must provide a valid Apiro token under the header name: "token"

Description
https://demo3.apiro.com.au/rest/cfgsource/trigger/apiro_examples This will deploy all fields recursively for every schema in the "apiro_examples" configuration
https://demo3.apiro.com.au/rest/cfgsource/trigger/SCHEMA_CUSTOMERS.xml This will deploy all config fields recursively within the "CUSTOMERS" schema