Overview

CLI commandadd-domain-mapping
DescriptionAdd domain mappings for the subscribed cartridge.
Command format

add-domain-mappings <APPLICATION-ID> -p <JSON_FILE_PATH>

The path to the JSON file that defines the domain mapping needs to be defined as the <JSON_FILE_PATH> value.

Parameter definitions

Short option
Long option
Description
Required
Example value
N/AN/AID of the application.Yes

single-cartridge-app

-p

--resource-path

Folder path where the JSON file that defines the domain mappings is stored.Yes<STRATOS_SOURCE_HOME>/samples/applications/single-cartridge/domain-mappings.json

Sample domain mapping JSON

{
  "domainMappings": [
    {
      "cartridgeAlias": "tomcat",
      "domainName": "abc.com",
      "contextPath": "/abc/app"
    }
  ]
}

For information on all the properties that can be used in a domain mapping definition, see the Domain Mapping Resource Definition.

Example

Use case: Add the domain mappings defined in the <STRATOS_SOURCE_HOME>/samples/applications/single-cartridge/domain-mappings.json file to the application with the ID: single-cartridge-app.

 add-domain-mappings single-cartridge-app -p <STRATOS_SOURCE_HOME>/samples/applications/single-cartridge/domain-mappings.json

Sample output

Successfully added domain mappings.
  • No labels