Files
doc-exports/docs/cfw/api-ref/AddDomains.html
qiaoli 9776db0ee8 First version of the CFW API
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qiaoli <qiaoli@huawei.com>
Co-committed-by: qiaoli <qiaoli@huawei.com>
2025-01-21 07:59:01 +00:00

274 lines
20 KiB
HTML

<a name="AddDomains"></a><a name="AddDomains"></a>
<h1 class="topictitle1">Adding a Domain Name List</h1>
<div id="body1708331107508"><div class="section" id="AddDomains__section6254182714328"><h4 class="sectiontitle">Function</h4><p id="AddDomains__p5255427153211">This API is used to add a domain name list.</p>
</div>
<div class="section" id="AddDomains__section15256827183214"><h4 class="sectiontitle">URI</h4><p id="AddDomains__p5257172773211">POST /v1/{project_id}/domain-set/domains/{set_id}</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__table13258112715324" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="AddDomains__row2258112713215"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="AddDomains__p142582271329">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="AddDomains__p16259827123212">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="AddDomains__p12591277329">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="AddDomains__p9260102710325">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row12258122773212"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="AddDomains__p4260192773217">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="AddDomains__p132611827103213">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="AddDomains__p226118271326">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="AddDomains__p626252783211">Project ID, which can be obtained by calling an API or from the console. For details, see <a href="cfw_02_0015.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="AddDomains__row7258122718327"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="AddDomains__p202624272327">set_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="AddDomains__p5263152711327">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="AddDomains__p19263182793218">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="AddDomains__p132641027143219">Domain name group ID, which can be obtained by calling the <a href="ListDomainSets.html">API for querying the domain name group list</a>. Find the value in <strong id="AddDomains__b826410278323">data.records.set_id</strong> (The period [.] is used to separate different levels of objects).</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__table1426512718323" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="AddDomains__row1626452719321"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="AddDomains__p1226502763213">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="AddDomains__p226672723218">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="AddDomains__p14266162714322">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="AddDomains__p1726752733217">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row15264152719326"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="AddDomains__p226752733210">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="AddDomains__p726713279328">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="AddDomains__p1626812274321">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="AddDomains__p92691227153217">Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to <a href="cfw_02_0027.html">Obtaining an Enterprise Project ID</a>. If the enterprise project function is not enabled, the value is <strong id="AddDomains__b1726914279322">0</strong>.</p>
</td>
</tr>
<tr id="AddDomains__row8264192713215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="AddDomains__p2269927173218">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="AddDomains__p7269627113218">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="AddDomains__p13270152714328">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="AddDomains__p9271172713217">Firewall ID, which can be obtained by referring to <a href="cfw_02_0028.html">Obtaining a Firewall ID</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="AddDomains__section0271132763214"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request header parameters</caption><thead align="left"><tr id="AddDomains__row9272142716328"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="AddDomains__p9273227203214">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="AddDomains__p16273827153220">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="AddDomains__p13274142714329">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="AddDomains__p13274132763218">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row15272122717321"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="AddDomains__p827415277321">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="AddDomains__p12275182711323">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="AddDomains__p6275102710329">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="AddDomains__p1276142711323">User token. You can obtain the token by referring to <a href="cfw_02_0029.html">Obtaining a User Token</a>.</p>
</td>
</tr>
<tr id="AddDomains__row156984472322"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="AddDomains__p16987185572214">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="AddDomains__p1453216872313">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="AddDomains__p598785514223">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="AddDomains__p1821149193417">Content type. It can only be set to application/json.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__request_AddDomainListDto" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Request body parameters</caption><thead align="left"><tr id="AddDomains__row122761027103213"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="AddDomains__p20277112723212">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="AddDomains__p227862753218">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="AddDomains__p82781827103212">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="AddDomains__p627914272325">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row5276172711325"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="AddDomains__p15279227103213">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="AddDomains__p102798274324">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="AddDomains__p4280227183219">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="AddDomains__p4280182773213">Firewall instance ID, which is automatically generated after a CFW instance is created. You can obtain the ID by calling the <a href="ListFirewallDetail.html">API for querying a firewall instance</a>.</p>
</td>
</tr>
<tr id="AddDomains__row0276327103212"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="AddDomains__p1128122717323">object_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="AddDomains__p128111275326">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="AddDomains__p328220273328">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="AddDomains__p2283112743215">Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the <a href="ListFirewallDetail.html">API for querying firewall instances</a>. In the return value, find the ID in <strong id="AddDomains__b128392783216">data.records.protect_objects.object_id</strong> (The period [.] is used to separate different levels of objects). If the value of <strong id="AddDomains__b4283182793220">type</strong> is <strong id="AddDomains__b7283827183216">0</strong>, the protected object ID belongs to the Internet border. If the value of <strong id="AddDomains__b1028318271324">type</strong> is <strong id="AddDomains__b1628372723214">1</strong>, the protected object ID belongs to the VPC border. You can obtain the value of <strong id="AddDomains__b328492753215">type</strong> from <strong id="AddDomains__b928492714328">data.records.protect_objects.type</strong> (The period [.] is used to separate different levels of objects).</p>
</td>
</tr>
<tr id="AddDomains__row1027612715325"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="AddDomains__p19284152753214">domain_names</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="AddDomains__p1228452793210">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="AddDomains__p1285192716323">Array of <a href="#AddDomains__request_DomainSetInfoDto">DomainSetInfoDto</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="AddDomains__p228513277328">Domain name list.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="AddDomains__request_DomainSetInfoDto"></a><a name="request_DomainSetInfoDto"></a><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__request_DomainSetInfoDto" frame="border" border="1" rules="all"><caption><b>Table 5 </b>DomainSetInfoDto</caption><thead align="left"><tr id="AddDomains__row5286182714326"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p id="AddDomains__p7287182711324">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p id="AddDomains__p13287142717326">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p id="AddDomains__p6288172714321">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p id="AddDomains__p132881027123213">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row6286102713323"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="AddDomains__p14289727113214">domain_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="AddDomains__p19289127153216">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="AddDomains__p1728911271326">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="AddDomains__p1290132716325">Domain name, for example, <strong id="AddDomains__b12901927183210">www.test.com</strong>.</p>
</td>
</tr>
<tr id="AddDomains__row7286527193215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="AddDomains__p2290182723220">description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="AddDomains__p1629162753211">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="AddDomains__p1529111276320">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="AddDomains__p52921927143213">Domain name description.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="AddDomains__section3292182723211"><h4 class="sectiontitle">Response Parameters</h4><p id="AddDomains__p11293142712329"><strong id="AddDomains__b9293827133216">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__response_AddDomainsResponseBody" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="AddDomains__row1529312719329"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="AddDomains__p129422713212">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="AddDomains__p32941275328">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="AddDomains__p1529542714325">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row42931627103211"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="AddDomains__p142951027183214">data</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="AddDomains__p1629622773218"><a href="#AddDomains__response_DomainSetResponseData">DomainSetResponseData</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="AddDomains__p1529662710327">Return data of a domain name group.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="AddDomains__response_DomainSetResponseData"></a><a name="response_DomainSetResponseData"></a><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__response_DomainSetResponseData" frame="border" border="1" rules="all"><caption><b>Table 7 </b>DomainSetResponseData</caption><thead align="left"><tr id="AddDomains__row629622714320"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p id="AddDomains__p112979271328">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p id="AddDomains__p12298152719326">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p id="AddDomains__p429882713212">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row629718274321"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="AddDomains__p529919274324">id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="AddDomains__p7299172716327">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="AddDomains__p18299327183215">Domain name group ID.</p>
</td>
</tr>
<tr id="AddDomains__row9297172714327"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="AddDomains__p8300162714320">name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="AddDomains__p143001027143215">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="AddDomains__p1630142783211">Domain name group name.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="AddDomains__section6301427113210"><h4 class="sectiontitle">Example Requests</h4><p id="AddDomains__p73021127163215">Add domain names <strong id="AddDomains__b4302192723210">www.bnm.com</strong> and <strong id="AddDomains__b3302132713211">www.vbc.com</strong> to the domain name group of project 14181c1245cf4fd786824efe1e2b9388. The firewall ID is 546af3f8-88e9-47f2-a205-2346d7090925, protected object ID is ae42418e-f077-41a0-9d3b-5b2f5ad9102b, and domain name group ID is 78719348-6d79-477e-acec-676a29842ab2.</p>
<pre class="screen" id="AddDomains__screen23041127133210">https://{Endpoint}v1/14181c1245cf4fd786824efe1e2b9388/domain-set/domains/78719348-6d79-477e-acec-676a29842ab2?fw_instance_id=546af3f8-88e9-47f2-a205-2346d7090925&amp;enterprise_project_id=default
{
"domain_names" : [ {
"description" : "",
"domain_name" : "www.bnm.com"
}, {
"description" : "",
"domain_name" : "www.vbc.com"
} ],
"fw_instance_id" : "546af3f8-88e9-47f2-a205-2346d7090925",
"object_id" : "ae42418e-f077-41a0-9d3b-5b2f5ad9102b"
}</pre>
</div>
<div class="section" id="AddDomains__section153081127133220"><h4 class="sectiontitle">Example Responses</h4><p id="AddDomains__p153095275322"><strong id="AddDomains__b1230942712327">Status code: 200</strong></p>
<p id="AddDomains__p5309627183214">Return value for adding a domain names.</p>
<pre class="screen" id="AddDomains__screen631014272321">{
"data" : {
"id" : "78719348-6d79-477e-acec-676a29842ab2",
"name" : "test26"
}
}</pre>
</div>
<div class="section" id="AddDomains__section1547982713215"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="AddDomains__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="AddDomains__row036982763214"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="AddDomains__p19479227113215">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="AddDomains__p4479127143212">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="AddDomains__row53696272326"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="AddDomains__p147932713218">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="AddDomains__p447910279323">Return value for adding a domain names.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="AddDomains__section1547912272325"><h4 class="sectiontitle">Error Codes</h4><p id="AddDomains__p114806278321">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000006.html">Domain Name Resolution and Domain Name Group Management</a></div>
</div>
</div>