You can add domain mappings using the CLI tool or REST API as shown below:
Note |
---|
As the signup process takes place automatically when a single tenant application is deployed, domain mapping can be added straight after the application is deployed. However, if domain mapping is being added to a multi-tenant application, after the application is deployed, ensure to first carryout the application sign up process before adding the domain mappings. |
Localtabgroup |
---|
Localtab |
---|
| Adding domain mappings via the CLIOverviewCLI command | list-domain-mappings | Description | Retrieve domain mapping details of an application. | Command format | Code Block |
---|
list-domain-mappings <APPLICATION-ID> |
|
Parameter definitionShort option | Long option | Description | Required | Example value |
---|
N/A | N/A | ID of the application. | Yes | wso2am-190-application |
ExampleRetrieve domain mapping details of the application with the ID: wso2am-190-application. Code Block |
---|
list-domain-mappings wso2am-190-application |
Sample output |
Localtab |
---|
| Adding domain mappings via the REST APIOverviewDescription | Add one or more domain mappings for a cluster. | Resource Path | /applications/{applicationId}/domainMappings
| HTTP Method | POST | Request/Response Format | | Command format | Code Block |
---|
curl -X POST -H "Content-Type: application/json" -d @'<JSON_PAYLOAD>' -k -v -u <USERNAME>:<PASSWORD> https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/applications/{applicationId}/domainMappings |
Info |
---|
- The path to the JSON file that defines the application needs to be defined as the
<JSON_PAYLOAD> value. - By default,
<USERNAME>:<PASSWORD> is admin:admin. - By default,
<PRIVATE_PAAS_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified. - By default,
<PRIVATE_PAAS_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n , the default port value needs to be incremented by n .
|
|
ExampleAdd the domain mappings defined in the <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/domainmappings.json file to the application with the ID: wso2am-190-application. Code Block |
---|
cd <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/applications/wso2am-190-application/artifacts/
curl -X POST -H "Content-Type: application/json" -d @'domain-mappings.json' -k -v -u admin:admin https://localhost:9443/api/applications/wso2am-190-application/domainMappings |
Sample outputYou will come across the following HTTP status codes while adding an application: HTTP status code | 200, 500 See the descriptions of the HTTP status codes here. | Location header URL | https://<STRATOS_HOST>:<STRATOS_HTTPS_PORT>/api/applications/<APPLICATION_ID>/domainMappings
|
|
Localtab |
---|
title | Private PaaS console |
---|
| Adding an application via the Private PaaS console |
|
...
Excerpt |
---|
Panel |
---|
title | Sample application JSON |
---|
| Code Block |
---|
{
"domainMappings": [
{
"cartridgeAlias": "tomcat",
"domainName": "abc.com",
"contextPath": "/abc/app"
}
]
} |
|
|