Published Solutions
-
How do I fetch subscription resources from PHP runtime?
Original Publishing Date: 2020-01-22 Symptoms In my application I have a reference to Operations Automation subscription, in custom UI it is possible to fetch subscription resources related to my application with a GET request: GET https://:6308/aps/2/resources//resources When I try to fetch the same URL from PHP runtime like this: $resources = \APS\Request::getController()->GetResources(null, 'aps/2/resources/'.$this->subscription->aps->id.'/resources'); , I get an empty array. Cause GetResources method can only work with children of 'APS::ResourceBase' class, and 'SubscriptionResource' is not descended from it. Resolution Starting from PHP runtime aps-php-runtime-2.0-287 you can fetch subscription resources like this: If you do not have a link to subscription in your application resource: $subscrResource = $apsc->getResource($subscr_resource_id); $resources = $subscrResource->resources(); If your application resource has a link to subscription: $resources = $this->subscription->resources(); Properties of the 'SubscriptionResource' structure are described in documentation Internal content Link on internal Article
-
Is it possible in POA to filter APS 2 resources by subscription?
Original Publishing Date: 2020-01-22 Question I would like to apply a filter for resources from a particular subscription. I.e. only get service users which belong to a given POA subscription, or webspaces from that subscription only, etc. Answer This is not possible. POA starting with 5.5.4 has account wide service users, it does not make sense to filter them by subscription anymore. Services from multiple subscriptions can be consumed by any user. If you need to associate your resource with a certain subscription, you can add a relation to the POA subscription resource in it. Internal content
-
Messages which have dots (.) in their msgid are not localized
Original Publishing Date: 2020-01-22 Symptoms I have several messages with dots in their msgid defined in my .po file. However, when these messages appear on the UI, only their msgid is shown instead of the translation I've defined. How do I fix that? Cause Messages with dots in their ID are not always translated properly. Resolution This issue is fixed in POA 6.0. Remove dots from your msgids. Internal content Link on internal Article
-
Is there a way to customize the UI used on new application instance creation?
Original Publishing Date: 2020-01-22 Question When I create a new application instance, POA allows to fill in some certain fields necessary to create my application resource. Is there a way to customize this UI, change the type of input fields, etc.? Answer When a new application instance is created auto-generated UI is used. It does not allow customization of input fields. The only things that you can change are field titles, they are taken from 'title' attribute in resource schema: "properties": { "apphost": { "type": "string", "title": "Host domain or IP", "description": "Cloud management server IP or domain name" }, "cloudadmin": { "type": "string", "title": "Cloud Admin", "description": "Cloud administrator" ... , or in PHP runtime: /** * @type(string) * @title("Host domain or IP") * @description("Cloud management server IP or domain name") */ public $apphost; /** * @type(string) * @title("Cloud Admin") * @description("Cloud administrator") */ public $cloudadmin; Internal content
-
How to get APS resources limits from custom UI
Original Publishing Date: 2020-01-22 Symptoms Is it possible from Custom UI app to get the resource limit for the resource type in the subscription? For instance now if customer is out of resources defined in subscription and tries to provision new one he gets 403 error. I'd like to add some message saying that we're out of resources, for that I'd need to know how many customer is allowed to have. Resolution You can query controller to get subscription resources structure "SubscriptionResource" via the /resources operation: GET /aps/2/resources/SUBSCRIPTION_RESOURCE_ID/resources More on subscription schema can be found on the APS types in PA page. Internal content
-
How can I populate aps/Grid with my data?
Original Publishing Date: 2020-01-22 Symptoms What sort of data can be used for aps/Grid? How can I use specific data to be displayed in a grid? Resolution You can use both aps/Store and aps/Memory to populate aps/Grid. If you need to display only some of the resources you can create a Memory and fill it with needed data, here is an example that shows only domains that were not yet added into application. // create a store to fill with all domains available for account var allDomainsStore = new ResourceStore({ target: "/aps/2/resources/", apsType: "http://aps-standard.org/types/dns/zone/1.0" }); // create a store to fill with domains that were added into application, they should not be displayed to the user in this view var alreadyAddedDomainsStore = new ResourceStore({ target: "/aps/2/resources/", apsType: "http://vendor.com/application/domain/1.0" }); // comparing two stores when(allDomainsStore.query(), function(allDomains) { when(alreadyAddedDomainsStore.query(), function(addedDomains) { var addedDomainsHash = {}; for (var i = 0; i < addedDomains.length; i++) { addedItem = addedDomains[i]; addedDomainsHash[addedItem.name] = true } var domainList = []; for (var i = 0; i < allDomains.length; i++) { domain = allDomains[i]; if (addedDomainsHash[domain.name]) { continue; } domainList.push({ id: domain.aps.id, label: domain.name, value: domain.aps.id}); } // domainList now contains a list of all domains that were not added into application yet domainList.sort(function(a, b) {return a.label >= b.label}); }); }); Then you can create a Memory from domainList: var freeDomainList = new Memory({data: domainList, idProperty: "id"}); and use it for Grid: store: freeDomainList Internal content
-
How to upgrade php from 5.4 to 5.5 on CentOS 7?
Original Publishing Date: 2020-01-22 Question How to upgrade php from 5.4 to 5.5 on CentOS 7? Answer Create a file with sh extension, put the following contents to it, make the file executable with chmod +x file_name , launch the file #!/bin/bash -x set -e rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install yum-plugin-replace -y yum replace php-common --replace-with=php55w-common -y service httpd restart php -v Internal content
-
"Users" tab is missing in CCP
Original Publishing Date: 2020-01-22 Symptoms I'm testing application that has services that bind to core/service-user but "Users" tab is not shown in customer panel. Cause Relation to service user lacks the "required": "true" attribute: "relations": { "user": { "type": "http://aps-standard.org/types/core/service-user/1.0", "collection": false }, Resolution Correct declaration: "relations": { "user": { "type": "http://aps-standard.org/types/core/service-user/1.0", "required": true, "collection": false }, More on properties and their attributes here. Internal content Link on internal Article
-
How do I fetch information about POA subscription from custom UI?
Original Publishing Date: 2020-01-22 Question I would like to get access to information about POA subscription from my custom UI, like subscription ID and available resources. How can it be done? Answer From custom UI with customer's token you can see information about all subscriptions, and it is not possible to say which one contains your application. If you need to know POA subscription associated with your tenant-level resource, you will need to add a strong relationship with "http://aps-standard.org/types/core/subscription/1.0" resource to it, it can look like this in resource schema: "relations": { "subscription": { "type": "http://aps-standard.org/types/core/subscription/1.0", "required": true, "collection": false }, ... Or, if you use PHP runtime, it can be declared like this: /** * @link("http://aps-standard.org/types/core/subscription/1.0") * @required */ public $subscription; Then, you query the subscription relationship of your tenant resource: GET /aps/2/resources/caeb15e1-289f-4e48-8c6c-db6c86cc4378/subscription [ { "aps": { "type": "http://parallels.com/aps/types/pa/subscription/1.0", "id": "fdd7f1d3-d401-4c89-a9d3-ebd6a703b84c", "status": "aps:ready", "revision": 3, "modified": "2014-04-25T00:21:59Z" }, "trial": false, "disabled": false, "subscriptionId": 5 } ] This way you get the APS resource ID of POA subscription, as well as a conventional POA subscription ID. You can also fetch information about APS resources that are included into this subscription as described in this article. Note that if you add a strong relation to subscription resource, you can fetch the same information from your endpoint as well, see details in this article. Additional information on "http://parallels.com/aps/types/pa/subscription/1.0" resource type is available in documentation. As an example of an application which implements a link to POA subscription resource you can check the Basic Demo Project. There the context resource contains a link to POA subscription. Internal content
-
I have an account on demo.apsstandard.org but it does not work anymore
Original Publishing Date: 2020-01-22 Question I had an account on a shared POA environment at http://demo.apsstandard.org , this environment is not accessible anymore. How to I get access to it? Answer This environment was replaced with a new shared one that is only accessible through a VPN connection. To get access to it, please follow three steps below: register at dev.apsstandard.org as described with the instructions; wait when your request will be confirmed by moderator; get VPN certificate and setup VPN connection according to the article. Internal content