Published Solutions
-
Application Package Import size
Original Publishing Date: 2020-01-22 Symptoms We need to import POA application with more than 10MB. How can we do that? It seems that POA import wizard has a 10.8MB limitation for local files: "size of uploaded file must be less than 10.8MB" Cause POA limitations. Resolution Large packets should be imported via a URL. You can put your package to some server that allows files to be downloaded via direct links and then import your package via URL. Simplest solution - make use of Apache installed on your endpoint server. You have ssh access to all servers in your sandbox, root password is the same as initial one for 'admin' user in POA panel. If you have an early dropbox account with 'Public' folder which allows direct downloads or any other service with similar functionality that will also work. Internal content
-
What options do I have if I want to send a notification from my APS package to a customer/user?
Original Publishing Date: 2020-01-22 Symptoms What options do I have if I want to send a notification from my APS package to a customer/user? Resolution You can pass the environment variable 'SETTINGS_user_email' to configuration script. Such variable can be defined by service settings declaration in APP-META.xml as follows: Primary email address You can review the sample application SampleAPS1.2Package-1.2-1.app.zip. This package has defined 'user_email' setting. In the same manner you can pass the SETTINGS_admin_email variable. Or in APS 1.x we have classes to tell APS controller which data should be used to automatically populate a setting, for example class="login" provides service user's e-mail, class="given-name" provided the name from the contact. Internal content
-
Is it possible to upgrade sandbox instead of reinstalling it?
Original Publishing Date: 2020-01-22 Problem I need to urgently upgrade to latest PA version but do not wish to reinstall everything right now, is it possible to update the installation without resetting the whole environment? Resolution While it is highly recommended to reset the environment avoid cluttering it with unnecessary data there are times when an update is needed but an ISV is not ready to wipe all data yet. It is possible to install updates but APS support does not assist in troubleshooting and fixing update issues so you should be ready to perform a reset anyways: backup all data if needed (changed UI files in /usr/local/pem/APS/packages/PACKAGE_GUID/ui, back-end scripts on endpoint server) to install POA update run these commands on main POA server (the one whose hostname begins with 'mn.'): pa_updates_installer --prepare pa_updates_installer --install to install PBA update: /usr/local/bm/updater/pa_updates_installer.sh --install if update fails you should reinstall the sandbox from Development Portal http://dev.apsstandard.org/develop/ Internal content Link on internal Article
-
How to receive sub-service limits in APS 1.2 applications
Original Publishing Date: 2020-01-22 Symptoms Application needs to receive limits of sub-services in subscription. Resolution Limits on sub-services can be received in top service via list settings with special classes, for instances: Limits for subservices IDs for subservices Names of subservice settings Default values of subservice settings If subscription has 'Application Service' resource types, for example resource type for 'account' sub-service, these setting lists contain sub-service limits, ids, and hidden settings, that are defined in 'Application Service' resource types. Application script receives these settings as in the following example: SETTINGS_subservice_ids_1=65 SETTINGS_subservice_ids_2=66, 67 SETTINGS_subservice_limits_1=3 SETTINGS_subservice_limits_2=34, 10 SETTINGS_subservice_setting_names_1=65_filequota SETTINGS_subservice_setting_names_2=66_service_level, 67_service_level SETTINGS_subservice_setting_values_1=3456 SETTINGS_subservice_setting_values_2=default, premium SETTINGS_subservice_ids_1 corresponds to the first sub-service, SETTINGS_subservice_ids_2 - second sub-service, and so on. Order is NOT necessary the same as services appear in APP-META.xml. Rely on setting names (SETTINGS_subservice_setting_names) to identify sub-service Each of the settings contain comma separated list of values. SETTINGS_subservice_ids_N - internal resource type ids for sub-service N, SETTINGS_subservice_limits_N - corresponding limits, SETTINGS_subservice_setting_names_N - hidden settings that are defined in sub-service resource type. In the example above, there is service_level setting, in resource type 66 it is set to 'default', in resource type 67 - premium. So, if sub-service #2 is a mailbox, we can see that customer purchased 34 'default' and 10 'premium' mailboxes. Internal content
-
[How-to] Getting subscription limits.
Original Publishing Date: 2020-01-22 Symptoms How do I get limits for resources available for end-user? Does POA prevent the provisioning of more resources when the user hits the limit? Do I have to handle the checking? Resolution APS controller will not allow to create more objects that are allowed by limits, but without proper handling the following error message will be shown to end-user on attempt to overuse the resource: RequestError: Unable to load /aps/2/resources/587f8be5-4390-4d80-b760-69c6660af876/users/ status: 403 Creation of resource with type 'http://aps.com/app/user/1.0'; is not allowed. You can draw UI items depending on limits and current usage, for example if you know that the object will not be able to be created you disable UI items that allow to create that. To get the limits you have to get subscription resources GET /aps/2/resources/fdf042f5-2808-4c24-b0f4-f1d3debefca5/resources where fdf042f5-2808-4c24-b0f4-f1d3debefca5 is the id of resource of type http://aps-standard.org/types/core/subscription/1.0 [ { "title": "Customer", "apsType": "http://application.com/customers/1.0", "id": 1000437, "usage": 1, "unit": "unit" }, { "title": "Users", "apsType": "http://application.com/users/1.0", "id": 1000443, "usage": 1, "limit": 1, "unit": "unit" }, { "title": "Application", "apsId": "8d6ac7b5-8cf2-4367-9c69-3c34e635326d", "apsType": "http://application.com/context/1.0", "id": 1000435, "usage": 0, "unit": "unit" } ] Note: if limit for resource is set to 'unlimited' in subscription/serivce template/serivice plan 'limit' property is not returned at all. See also how to get the subscription limit with PHP runtime in this KB article. Internal content
-
How to debug APS packages in Plesk?
Original Publishing Date: 2020-01-22 Symptoms How to enable debug output in Parallels Plesk Panel to troubleshoot APS packages? Resolution Log level can be increased in Plesk's panel.ini file: Unix: /usr/local/psa/admin/conf/panel.ini Windows: C:\Program Files (x86)\Parallels\Plesk\admin\conf\panel.ini Set the maximum verbosity as follows: [log] filter.priority = 7 The resulting log file can be found: Unix: /usr/local/psa/admin/logs/panel.log Windows: C:\Program Files (x86)\Parallels\Plesk\admin\logs\panel.log If APS operations should fail, resulting output from APS package script can be found in this log. Internal content Link on internal Article
-
How to fetch resources linked to my resource via a certain relationship
Original Publishing Date: 2020-01-22 Question I have a resource that has a one to many relationship with some other resource. How do I fetch all resources linked to my resource? Answer You can fetch resources linked to your resource if you query the relationship. For example, you have a resource 'tenant' that has a one to many relationship with users type, it can look in schema like this: "relations": { .... "users": { "type": "http://owncloud.org/users/1.0", "collection": true } } Then, you can query users linked to your tenant using this REST query: GET /aps/2/resources/[tenant_resource_id]/users If my tenant resource has ID of caeb15e1-289f-4e48-8c6c-db6c86cc4378, I can run it like this: GET /aps/2/resources/caeb15e1-289f-4e48-8c6c-db6c86cc4378/users ---- [ { "aps": { "type": "http://owncloud.org/users/1.0", "id": "befc7596-e86d-4ae7-ac02-7fc5ee73313c", "status": "aps:ready", "revision": 3, "modified": "2014-04-25T00:23:47Z" }, "homedir": "/var/www/html/owncloudsite/data/user03@example101.local", "owncloudusername": "user03@example101.local", "quota": null, "serviceUserId": "47dd69f9-2e45-421f-af6a-73b91ff3d048", "userstatus": "Ready", "userusage": 0 }, { .... Internal content
-
Can the same server be used to provision both APS 1.x and APS 2 applications?
Original Publishing Date: 2020-01-22 Question Can I provision APS 1.x and APS 2 applications on the same server? Will they conflict with each other? Answer It is possible to use the same server for both APS 1.x and APS 2 applications. They use completely different mechanisms, for APS 1.x provisioning scripts are executed via POA agent installed on the host. For APS 2 POA agent is not used at all, APS 2 enpoints are RESTful services and only require is a web server to be hosted on. Internal content
-
[APS1 to APS2] In APS1 the hierarchy of the sevices was specified in APP-META.xml, how should it be done in APS2?
Original Publishing Date: 2020-01-22 Symptoms In APS1 I could define services hierarchy in APP-META.xml: How it should be done in APS2? Resolution APS2 services are now linked based on relations node specified in schema of each resource For example for main customer service (aka tenant) to be able to read settings from main provider service (aka globals) there should be the following relations: in globals.schema: "relations": { "tenant": { "type": "http://application.com/tenant/1.0", "collection": true }} in tenant.schema: "relations": { "globals": { "type": "http://application.com/globals/1.0", "required": true, "collection": false }} Internal content
-
Exception: Unauthorized request in endpoint log when you work with an APS2 application
Original Publishing Date: 2020-01-22 Problem When I work with custom UI of my APS 2 application, I see requests failing with error 500. When I check apache error log on endpoint server, I see error that look like this: ERROR Exception: code=500, type=Rest\RestException, message=Failed to parse aps object: Request to APS controller failed: APS::Util::Exception: Unauthorized request#0 /usr/share/aps/php/aps/2/rest.php(343) Cause Endpoint cannot authenticate to APS controller Resolution Most likely cause is lost or incorrect application certificate stored on the endpoint server. Endpoint uses these certificates to authenticate its requests to APS controller. If the certificate is lost, the endpoint has no way of proving its identity to the controller. With PHP runtime library, the certificates are stored in config subfolder of your endpoint folder. They are stored in two files: [application_instance_id] [application_instance_id].pem , where application_instance_id is the ID of an APS application instance (in UID format, you can find it in APS-Instance-ID header of outgoing request from Operations Automation to your endpoint, more information on headers available here). If these files are missing, the application certificate is lost. There is no mechanism to recover it, you should either retrieve the files from backup or destroy an application instance and create a new one which will get a new certificate. If only .pem file is missing, you can recover the certificate from the remaining file (the one without extension), this is a config in JSON format and application certificate is stored in appCertificate property. You can retrieve the value, replace \n with newline characters and save the result into a file with .pem extension. For development or testing environments recreating an application instance will be a faster solution in most cases. Internal content