Article ID: 127663, created on Dec 2, 2015, last review on Dec 2, 2015

  • Applies to:
  • Operations Automation 5.5

Question

How to add web hosting with document root at wwwroot/domain.tld using API ?

Answer

When using pem.addDomain API method, path parameter can be specified, as in the following example:

# cat pem.addDomain.xml
<?xml version="1.0"?>
<methodCall>
  <methodName>pem.addDomain</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>subscription_id</name>
            <value><int>106</int></value>
          </member>
          <member>
            <name>domain_name</name>
            <value><string>sub106test.tld</string></value>
          </member>
          <member>
            <name>path</name>
            <value><string>/sub106test.tld</string></value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>
# curl -d@pem.addDomain.xml http://localhost:8440
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><param><value><struct><member><name>result</name><value><struct><member><name>domain_id</name><value><i4>135</i4></value></member></struct></value></member><member><name>status</name><value><i4>0</i4></value></member></struct></value></param></params></methodResponse>

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 5b048d9bddf8048a00aba7e0bdadef37 2554725ed606193dd9bbce21365bed4e

Email subscription for changes to this article
Save as PDF