[
https://issues.apache.org/jira/browse/STRATOS-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13992975#comment-13992975
]
Nirmal Fernando commented on STRATOS-628:
-----------------------------------------
Here's the new API:
1. Add subscription domains:
Send a POST request to the following URL with tenant credentials to add
subscription domains:
POST https://sm-ip:sm-port/stratos/
admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/
* If you want to map a single domain:
{
"domains": {
"domainName": "stratos.gov",
"applicationContext": "abc"
}
}
* If you want to map a collection of domains:
{
"domains": [
{
"domainName": "stratos.com"
},
{
"domainName": "stratos.org",
"applicationContext": "abc"
}
]
}
Sample Curl request:
curl -X POST -H "Content-Type: application/json" -d @request.json -k -v -u
admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/
2. Get All subscription domains:
Send a GET get request to the following URL with tenant credentials to get
existing subscription domains:
GET https://sm-ip:sm-port/stratos/
admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/
Sample Curl request:
curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains
Sample response:
{"domains":[{"domainName":"stratos.com"},{"domainName":"stratos.org","applicationContext":"abc"}]}
3. Get a subscription domain/Validate a subscription domain:
Send a GET get request to the following URL with tenant credentials and with
the domain name to get existing subscription domain/ to check the validity of
the domain.
GET https://sm-ip:sm-port/stratos/
admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/{domainName}
Sample Curl request:
curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/stratos.com
Sample response:
* If the domain exists:
200 OK
{"domains":{"domainName":"stratos.com"}}
* If the domain does not exist:
404 Not Found
{"Error":{ "errorCode": " 404", "errorMessage": " Could not find a subscription
[domain] stratos.com for Cartridge [type] php and [alias] nirmal"}
4. Remove subscription domains:
Send a DELETE request to the following URL with tenant credentials to remove a
given domain
DELETE
https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/{domainName}
Sample Curl request:
curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/stratos.com
> Support to Map Custom Domains to Service Subscriptions
> ------------------------------------------------------
>
> Key: STRATOS-628
> URL: https://issues.apache.org/jira/browse/STRATOS-628
> Project: Stratos
> Issue Type: Task
> Components: Eventing, Load Balancer, Stratos Manager
> Reporter: Imesh Gunaratne
> Assignee: Nirmal Fernando
> Fix For: 4.1.0
>
>
> Currently tenants cannot map custom domain names to subscriptions. The only
> possibility is to use hostnames generated by Stratos Manager for accessing
> applications deployed in Stratos via the load balancers. This functionality
> would be a great addition to allow tenants to map custom domain names to
> their subscriptions so that load balancers could delegate request accordingly.
--
This message was sent by Atlassian JIRA
(v6.2#6252)