Article ID: 114974, created on Oct 18, 2012, last review on Aug 12, 2014

  • Applies to:
  • Operations Automation

Symptoms


APS application has to allow the following configuration of services: customer should be able to create users in POA CP who will use the application and assign disk quota to them.

Resolution


Create the following services and resources in the application APP-META.xml file. The article provides example of corresponding entities below.

1. Define service with class 'account' - it will define personal user accounts in application: <service id="User" class="account">
2. Define application setting for disk quota: <setting type="string" id="quota">
  <name>Disk Usage</name>
</setting>

POA will call application configuration script and pass values of all settings via environment variables like 'SETTING_<id>' where <id> is ID of setting defined in the application APP-META.xml file.

3. Define application resource which will limit disk quota for users: <resource class="gb" id="quota" limiting-setting="quota">
  <name>User disk quota</name>
</resource>

4. Define script which will report resource (disk) usage: <resource-script name="report-resources.php">
  <script-language>php</script-language>
</resource-script>

Application may define how often resource usage should be collected in the poll-interval attribute of the resource-script tag. It may be specified in minutes (like 30m), hours (like 3h) or days (like 1d). 

POA periodic task Synchronize resource usage for instances of APS applications executes resource usage collection scripts for APS application instances in the proper time. Resource script reports resource usage to POA which will be stored in POA database and shown in control panel.

Resource script should provide output matching schema. Use the Knowledgebase article #115854 APS: How to verify provisioning script output to check if script provides correct output.

Important: the attribute'limiting-setting' of the resource must contain ID of the corresponding setting. In the example above setting which define disk quota for users has ID "quota" and exactly this ID is used in the resource definition.

Refer to the APS Package Format Specification Guide for more details:

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF