QingCloud 文档 – API接口 - kaiyun官方网站下载手机网页 /security/firewall/api/command_list/ Recent content in API接口 on QingCloud 文档 Hugo -- gohugo.io Security: AddSecurityGroupRules /security/firewall/api/command_list/add_security_group_rules/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/add_security_group_rules/ <p>给防火墙添加规则。每条规则包括的属性为:</p> <ul> <li>protocol:协议</li> <li>priority:优先级,由高到低为 0 - 100</li> <li>security_group_rule_name:规则名称</li> <li>action:操作,分为 accept 接受 和 drop 拒绝</li> <li>direction:方向,0 表示下行,1 表示上行。</li> <li>val1:如果协议为 tcp 或 udp,此值表示起始端口。 如果协议为 icmp,此值表示 ICMP 类型。 具体类型可参见 <a href="/development_docs/api/common/security_group_rule_icmp_type/"><em>ICMP 类型及代码</em></a></li> <li>val2:如果协议为 tcp 或 udp,此值表示结束端口。 如果协议为 icmp,此值表示 ICMP 代码。 具体代码可参见 <a href="/development_docs/api/common/security_group_rule_icmp_type/"><em>ICMP 类型及代码</em></a></li> <li>val3:源IP</li> </ul> <p>注解</p> <p>添加规则后,记得调用 <a href="../apply_security_group/"><em>ApplySecurityGroup</em></a> 使其生效。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙ID</td> <td>Yes</td> </tr> <tr> <td>rules.n.protocol</td> <td>String</td> <td>协议,目前支持 tcp, udp, icmp, gre, esp, ah, ipip</td> <td>Yes</td> </tr> <tr> <td>rules.n.priority</td> <td>Integer</td> <td>优先级,由高到低为 0 - 100</td> <td>Yes</td> </tr> <tr> <td>rules.n.security_group_rule_name</td> <td>String</td> <td>规则名称</td> <td>No</td> </tr> <tr> <td>rules.n.action</td> <td>String</td> <td>操作,支持 accept (接受) 或 drop (拒绝)</td> <td>No</td> </tr> <tr> <td>rules.n.direction</td> <td>Integer</td> <td>方向,0 表示下行,1 表示上行。默认为 0。</td> <td>No</td> </tr> <tr> <td>rules.n.val1</td> <td>String</td> <td>如果协议为 tcp 或 udp,此值表示起始端口。 如果协议为 icmp,此值表示 ICMP 类型。 其他协议无需此值。</td> <td>No</td> </tr> <tr> <td>rules.n.val2</td> <td>String</td> <td>如果协议为 tcp 或 udp,此值表示结束端口。 如果协议为 icmp,此值表示 ICMP 代码。 其他协议无需此值。</td> <td>No</td> </tr> <tr> <td>rules.n.val3</td> <td>String</td> <td>目标 IP,如果填写,则这条防火墙规则只对此IP(或IP段)有效。</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_rules</td> <td>Array</td> <td>添加成功的防火墙规则ID列表</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=AddSecurityGroupRules &amp;rules.1.action=accept &amp;rules.1.direction=0 &amp;rules.1.priority=7 &amp;rules.1.protocol=tcp &amp;rules.1.val1=22 &amp;rules.1.val2= &amp;rules.1.val3= &amp;security_group=sg-6ft05wt6 &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;AddSecurityGroupRulesResponse&#34;, &#34;security_group_rules&#34;:[ &#34;sgr-vgiw8cv8&#34; ], &#34;ret_code&#34;:0 } </code></pre> Security: ApplySecurityGroup /security/firewall/api/command_list/apply_security_group/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/apply_security_group/ <p>应用防火墙规则。当防火墙的规则发生改变后,新规则不会即刻生效 (可通过 is_applied 属性分辨),需要调用 ApplySecurityGroup 之后才生效。</p> <p>防火墙规则可通过 <a href="../add_security_group_rules/"><em>AddSecurityGroupRules</em></a>, <a href="../delete_security_group_rules/"><em>DeleteSecurityGroupRules</em></a>, <a href="../modify_security_group_rule_attributes/"><em>ModifySecurityGroupRuleAttributes</em></a> 修改。</p> <p>如果请求参数中传递了 instances.n ,则表示将此防火墙的规则应用到对应的云服务器。 如果不传此参数,则会将最新规则更新到所有已应用此防火墙的云服务器。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙 ID</td> <td>Yes</td> </tr> <tr> <td>instances.n</td> <td>String</td> <td>应用防火墙的云服务器ID。<br/>如果不传任何值,则会将最新规格更新到所有之前已应用此防火墙的云服务器。</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>job_id</td> <td>String</td> <td>执行任务的 Job ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=ApplySecurityGroup &amp;security_group=sg-12djpg8q &amp;instances.1=i-12345678, &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;ApplySecurityGroupResponse&#34;, &#34;job_id&#34;:&#34;j-bm6ym3r8&#34;, &#34;ret_code&#34;:0 } </code></pre> Security: CopySecurityGroupIPSets /security/firewall/api/command_list/copy_security_group_ipsets/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/copy_security_group_ipsets/ <p>复制 IP/端口集合到其他 zone(可以复制到当前zone)。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>ipsets.n</td> <td>String</td> <td>一个或多个IP/端口集合ID</td> <td>Yes</td> </tr> <tr> <td>dest_zones.n</td> <td>String</td> <td>一个或多个区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=CopySecurityGroupIPSets &amp;ipsets.1=sgi-12345678 &amp;dest_zones.1=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;CopySecurityGroupIPSetsResponse&#34;, &#34;ret_code&#34;:0 } </code></pre> Security: CreateSecurityGroup /security/firewall/api/command_list/create_security_group/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/create_security_group/ <p>创建防火墙。防火墙可用于保障云服务器和路由器的网络安全。</p> <p>刚创建的防火墙不包含任何规则,即任何端口都是封闭的, 需要建立规则以打开相应的端口。</p> <p>开·云app官方版下载为每个用户提供了一个缺省防火墙,为了方便用户使用, 缺省防火墙默认打开了下行 icmp 协议和 tcp 22 端口。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_name</td> <td>String</td> <td>防火墙名称</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_id</td> <td>String</td> <td>创建成功的防火墙 ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=CreateSecurityGroup &amp;security_group_name=specify &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;CreateSecurityGroupResponse&#34;, &#34;security_group_id&#34;:&#34;sg-j38f2h3h&#34; &#34;ret_code&#34;:0 } </code></pre> Security: CreateSecurityGroupIPSet /security/firewall/api/command_list/create_security_group_ipset/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/create_security_group_ipset/ <p>创建防火墙IP/端口集合。</p> <p>您可以借助 “IP/端口集合” 功能把具有相同特征的一组 IP 或者一组端口设置成为 “IP/端口集合”,并且在防火墙规则中进行添加,实现批量管理功能。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_ipset_name</td> <td>String</td> <td>名称</td> <td>No</td> </tr> <tr> <td>ipset_type</td> <td>Integer</td> <td>类型 (0:IP, 1:端口)</td> <td>Yes</td> </tr> <tr> <td>val</td> <td>String</td> <td>值 (例如: 192.168.1.0/24 或 10000-15000)</td> <td>Yes</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_id</td> <td>String</td> <td>创建成功的资源 ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=CreateSecurityGroupIPSet &amp;ipset_type=1 &amp;val=10000-15000 &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;CreateSecurityGroupIPSetResponse&#34;, &#34;security_group_ipset_id&#34;:&#34;sgi-sptxtjg9&#34; &#34;ret_code&#34;:0 } </code></pre> Security: CreateSecurityGroupSnapshot /security/firewall/api/command_list/create_security_group_snapshot/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/create_security_group_snapshot/ <blockquote> <p>根据当前的防火墙规则创建一个备份, 用于随时回滚之前的防火墙规则。</p> </blockquote> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙ID</td> <td>Yes</td> </tr> <tr> <td>name</td> <td>String</td> <td>名称</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_snapshot_id</td> <td>String</td> <td>创建成功的防火墙备份的 ID</td> </tr> <tr> <td>security_group_id</td> <td>String</td> <td>防火墙 ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=CreateSecurityGroupSnapshot &amp;security_group=sg-q36kwq5r &amp;name=sg_snapshot &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;CreateSecurityGroupSnapshotResponse&#34;, &#34;security_group_id&#34;:&#34;sg-j38f2h3h&#34;, &#34;security_group_snapshot_id&#34;:&#34;sgs-6la5ljm3&#34;, &#34;ret_code&#34;:0 } </code></pre> Security: DeleteSecurityGroupIPSets /security/firewall/api/command_list/delete_security_group_ipsets/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/delete_security_group_ipsets/ <p>删除一个或多个防火墙IP/端口集合。</p> <p>IP/端口集合须在没有资源(防火墙)使用的情况下才能被删除。 已加载到资源的IP/端口集合,需先将相关资源从防火墙移出后才能被删除。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_ipsets.n</td> <td>String</td> <td>ID</td> <td>Yes</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_ipsets</td> <td>Array</td> <td>成功删除的ID列表</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DeleteSecurityGroupIPSets &amp;security_group_ipsets.1=sgi-inijevna &amp;security_group_ipsets.2=sgi-o3msxqpp &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DeleteSecurityGroupIPSetsResponse&#34;, &#34;security_group_ipsets&#34;:[ &#34;sgi-inijevna&#34;, &#34;sgi-o3msxqpp&#34; ], &#34;ret_code&#34;:0 } </code></pre> Security: DeleteSecurityGroupRules /security/firewall/api/command_list/delete_security_group_rules/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/delete_security_group_rules/ <p>删除防火墙规则。</p> <p>注解</p> <p>删除规则后,记得调用 <a href="../apply_security_group/"><em>ApplySecurityGroup</em></a> 使其生效。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_rules.n</td> <td>String</td> <td>防火墙规则ID</td> <td>Yes</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_rules</td> <td>Array</td> <td>成功删除的防火墙规则ID列表</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DeleteSecurityGroupRules &amp;security_group_rules.1=sgr-13cooxdd &amp;security_group_rules.2=sgr-c25rz9c1 &amp;security_group_rules.3=sgr-191d8eb5 &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DeleteSecurityGroupRulesResponse&#34;, &#34;security_group_rules&#34;:[ &#34;sgr-13cooxdd&#34;, &#34;sgr-c25rz9c1&#34;, &#34;sgr-191d8eb5&#34; ], &#34;ret_code&#34;:0 } </code></pre> Security: DeleteSecurityGroups /security/firewall/api/command_list/delete_security_groups/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/delete_security_groups/ <p>删除一个或多个防火墙。</p> <p>防火墙须在没有资源(云服务器或路由器)使用的情况下才能被删除。 已加载规则到资源的防火墙,需先将相关资源从防火墙移出后才能被删除。</p> <ul> <li>要删除的防火墙已加载规则到云服务器,则需要先调用 <a href="../apply_security_group/"><em>ApplySecurityGroup</em></a> 将其他防火墙的规则应用到对应云服务器,之后才能被删除。</li> <li>要删除的防火墙已加载规则到路由器,则需要先调用 <a href="/network/vpc/api/vpc_api/modify_router_attributes/"><em>ModifyRouterAttributes</em></a> 并 <a href="/network/vpc/api/vpc_api/update_routers/"><em>UpdateRouters</em></a> 将其他防火墙的规则应用到对应路由器,之后才能被删除。</li> </ul> <p>开·云app官方版下载系统提供的缺省防火墙不能被删除。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_groups.n</td> <td>String</td> <td>防火墙 ID</td> <td>Yes</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_groups</td> <td>Array</td> <td>成功删除的防火墙ID列表</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DeleteSecurityGroups &amp;security_groups.1=sg-inijevna &amp;security_groups.2=sg-o3msxqpp &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DeleteSecurityGroupsResponse&#34;, &#34;security_groups&#34;:[ &#34;sg-inijevna&#34;, &#34;sg-o3msxqpp&#34; ], &#34;ret_code&#34;:0 } </code></pre> Security: DeleteSecurityGroupSnapshots /security/firewall/api/command_list/delete_security_group_snapshots/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/delete_security_group_snapshots/ <p>删除防火墙备份。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_snapshots.n</td> <td>String</td> <td>防火墙规则ID</td> <td>Yes</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_snapshots</td> <td>Array</td> <td>成功删除的防火墙备份ID列表</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DeleteSecurityGroupSnapshots &amp;security_group_snapshots.1=sgs-wx55xhix &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DeleteSecurityGroupSnapshotsResponse&#34;, &#34;security_group_snapshots&#34;:[ &#34;sgs-wx55xhix&#34; ], &#34;ret_code&#34;:0 } </code></pre> Security: DescribeSecurityGroupIPSets /security/firewall/api/command_list/describe_security_group_ipsets/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/describe_security_group_ipsets/ <p>获取一个或多个IP/端口集合信息。</p> <p>可根据ID,名称作过滤条件,来获取IP/端口集合列表。 如果不指定任何过滤条件,默认返回你所拥有的所有IP/端口集合。 如果指定不存在的ID,或非法状态值,则会返回错误信息。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_ipsets.n</td> <td>String</td> <td>IP/端口集合ID</td> <td>No</td> </tr> <tr> <td>ipset_type</td> <td>Integer</td> <td>类型 (0:IP, 1:端口)</td> <td>No</td> </tr> <tr> <td>security_group_ipset_name</td> <td>String</td> <td>IP/端口集合名称, 可以部分匹配</td> <td>No</td> </tr> <tr> <td>tags.n</td> <td>String</td> <td>按照标签ID过滤, 只返回已绑定某标签的资源</td> <td>No</td> </tr> <tr> <td>verbose</td> <td>Integer</td> <td>是否返回冗长的信息,若为1,则返回应用了此IP/端口集合的其他资源的信息,默认为0.</td> <td>No</td> </tr> <tr> <td>offset</td> <td>Integer</td> <td>数据偏移量,默认为0</td> <td>No</td> </tr> <tr> <td>limit</td> <td>Integer</td> <td>返回数据长度,默认为20,最大100</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_ipset_set</td> <td>Array</td> <td>JSON 格式的IP/端口集合数据列表,每项数据可见下面 <a href="#response-item">Response Item</a></td> </tr> <tr> <td>total_count</td> <td>Integer</td> <td>根据过滤条件得到的总数</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Response Item</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>security_group_ipset_id</td> <td>String</td> <td>ID</td> </tr> <tr> <td>security_group_ipset_name</td> <td>String</td> <td>名称</td> </tr> <tr> <td>description</td> <td>String</td> <td>描述</td> </tr> <tr> <td>val</td> <td>String</td> <td>值, 例如: 192.168.1.0/24</td> </tr> <tr> <td>ipset_type</td> <td>Integer</td> <td>值,0 或者 1</td> </tr> <tr> <td>create_time</td> <td>TimeStamp</td> <td>创建时间,为UTC时间,格式可参见 <a href="http://www.w3.org/TR/NOTE-datetime">ISO8601</a>.</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DescribeSecurityGroupIPSets &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DescribeSecurityGroupIPSetsResponse&#34;, &#34;total_count&#34;:1, &#34;security_group_ipset_set&#34;:[ { &#34;val&#34;:&#34;192.168.1.0/24&#34;, &#34;ipset_type&#34;: &#34;0&#34;, &#34;description&#34;:null, &#34;security_group_ipset_id&#34;:&#34;sgi-9eicklme&#34;, &#34;create_time&#34;:&#34;2013-03-19T08:27:05Z&#34;, &#34;security_group_ipset_name&#34;:&#34;default security group_ipset&#34; } ], &#34;ret_code&#34;:0 } </code></pre> Security: DescribeSecurityGroupRules /security/firewall/api/command_list/describe_security_group_rules/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/describe_security_group_rules/ <p>获取某个防火墙的规则信息。</p> <p>可根据防火墙ID,上行/下行,防火墙规则ID 作过滤条件,获取防火墙规则列表。 如果不指定任何过滤条件,默认返回你所拥有的所有防火墙的所有规则。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙ID</td> <td>No</td> </tr> <tr> <td>security_group_rules.n</td> <td>String</td> <td>防火墙规则ID</td> <td>No</td> </tr> <tr> <td>direction</td> <td>Integer</td> <td>方向,0 表示下行,1 表示上行。默认为 0。</td> <td>No</td> </tr> <tr> <td>offset</td> <td>Integer</td> <td>数据偏移量,默认为0</td> <td>No</td> </tr> <tr> <td>limit</td> <td>Integer</td> <td>返回数据长度,默认为20,最大100</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_rule_set</td> <td>Array</td> <td>JSON 格式的防火墙规则数据列表,每项参数可见下面 <a href="#responseitemtype">ResponseItemType</a></td> </tr> <tr> <td>total_count</td> <td>Integer</td> <td>根据过滤条件得到的防火墙总数</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>ResponseItemType</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>security_group_id</td> <td>String</td> <td>防火墙ID</td> </tr> <tr> <td>security_group_rule_id</td> <td>String</td> <td>防火墙规则ID</td> </tr> <tr> <td>priority</td> <td>Integer</td> <td>防火墙规则优先级。优先级由高到低的范围是 0 到 100,值越大优先级越低。</td> </tr> <tr> <td>protocol</td> <td>String</td> <td>协议</td> </tr> <tr> <td>action</td> <td>String</td> <td>操作,accept 表示接受,drop 表示拒绝。</td> </tr> <tr> <td>val1</td> <td>String</td> <td>如果协议为 tcp 或 udp,此值表示起始端口。<br/>如果协议为 icmp,此值表示 ICMP 类型。 具体类型可参见 <a href="/development_docs/api/common/security_group_rule_icmp_type/"><em>ICMP 类型及代码</em></a></td> </tr> <tr> <td>val2</td> <td>String</td> <td>如果协议为 tcp 或 udp,此值表示结束端口。<br/>如果协议为 icmp,此值表示 ICMP 代码。 具体代码可参见 <a href="/development_docs/api/common/security_group_rule_icmp_type/"><em>ICMP 类型及代码</em></a></td> </tr> <tr> <td>val3</td> <td>String</td> <td>源IP</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DescribeSecurityGroupRules &amp;security_group=sg-n43jh2pq &amp;direction=0 &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DescribeSecurityGroupRulesResponse&#34;, &#34;security_group_rule_set&#34;:[ { &#34;protocol&#34;:&#34;tcp&#34;, &#34;security_group_id&#34;:&#34;sg-nlqi5sa1&#34;, &#34;priority&#34;:1, &#34;action&#34;:&#34;accept&#34;, &#34;security_group_rule_id&#34;:&#34;sgr-0jzv8t0q&#34;, &#34;val2&#34;:&#34;8088&#34;, &#34;val1&#34;:&#34;8080&#34;, &#34;direction&#34;:0 }, { &#34;protocol&#34;:&#34;icmp&#34;, &#34;security_group_id&#34;:&#34;sg-nlqi5sa1&#34;, &#34;priority&#34;:2, &#34;action&#34;:&#34;accept&#34;, &#34;security_group_rule_id&#34;:&#34;sgr-vqxvzjg3&#34;, &#34;val2&#34;:&#34;0&#34;, &#34;val1&#34;:&#34;11&#34;, &#34;direction&#34;:1 } ], &#34;ret_code&#34;:0, &#34;total_count&#34;:2 } </code></pre> Security: DescribeSecurityGroups /security/firewall/api/command_list/describe_security_groups/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/describe_security_groups/ <p>获取一个或多个防火墙信息。</p> <p>可根据防火墙ID,名称作过滤条件,来获取防火墙列表。 如果不指定任何过滤条件,默认返回你所拥有的所有防火墙。 如果指定不存在的防火墙ID,或非法状态值,则会返回错误信息。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_groups.n</td> <td>String</td> <td>防火墙ID</td> <td>No</td> </tr> <tr> <td>search_word</td> <td>String</td> <td>搜索关键词,支持防火墙ID,防火墙名称</td> <td>No</td> </tr> <tr> <td>tags.n</td> <td>String</td> <td>按照标签ID过滤, 只返回已绑定某标签的资源</td> <td>No</td> </tr> <tr> <td>verbose</td> <td>Integer</td> <td>是否返回冗长的信息,若为1,则返回应用了此防火墙的其他资源的信息,默认为0.</td> <td>No</td> </tr> <tr> <td>offset</td> <td>Integer</td> <td>数据偏移量,默认为0</td> <td>No</td> </tr> <tr> <td>limit</td> <td>Integer</td> <td>返回数据长度,默认为20,最大100</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_set</td> <td>Array</td> <td>JSON 格式的防火墙数据列表,每项数据可见下面 <a href="#response-item">Response Item</a></td> </tr> <tr> <td>total_count</td> <td>Integer</td> <td>根据过滤条件得到的防火墙总数</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Response Item</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>security_group_id</td> <td>String</td> <td>防火墙ID</td> </tr> <tr> <td>security_group_name</td> <td>String</td> <td>防火墙名称</td> </tr> <tr> <td>description</td> <td>String</td> <td>防火墙描述</td> </tr> <tr> <td>is_applied</td> <td>Integer</td> <td>是否已更新规则,1为已更新,0为还未更新。<br/>当你修改防火墙的规则后,要“更新规则”才会生效。 更新规则 API 参见 <a href="../apply_security_group/"><em>ApplySecurityGroup</em></a></td> </tr> <tr> <td>is_default</td> <td>Integer</td> <td>是否是系统默认防火墙,1为是,0为不是</td> </tr> <tr> <td>resources</td> <td>Array</td> <td>应用了此防火墙的资源列表,每项资源数据格式为:<br/>{<br/> &ldquo;resource_id&rdquo;: &ldquo;i-nz7v9hgq&rdquo;,<br/> &ldquo;resource_name&rdquo;: &ldquo;api test&rdquo;<br/> &ldquo;resource_type&rdquo;: &ldquo;instance&rdquo;<br/>}<br/>只有在请求参数 verbose=1 时才会返回此信息。</td> </tr> <tr> <td>create_time</td> <td>TimeStamp</td> <td>防火墙创建时间,为UTC时间,格式可参见 <a href="http://www.w3.org/TR/NOTE-datetime">ISO8601</a>.</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DescribeSecurityGroups &amp;verbose=1 &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DescribeSecurityGroupsResponse&#34;, &#34;total_count&#34;:1, &#34;security_group_set&#34;:[ { &#34;is_applied&#34;:1, &#34;description&#34;:null, &#34;security_group_id&#34;:&#34;sg-z13kokni&#34;, &#34;is_default&#34;:1, &#34;create_time&#34;:&#34;2013-03-19T08:27:05Z&#34;, &#34;security_group_name&#34;:&#34;default security group&#34;, &#34;resources&#34;:[ { &#34;resource_name&#34;:&#34;&#34;, &#34;resource_type&#34;:&#34;instance&#34;, &#34;resource_id&#34;:&#34;i-ogbndull&#34; } ] } ], &#34;ret_code&#34;:0 } </code></pre> Security: DescribeSecurityGroupSnapshots /security/firewall/api/command_list/describe_security_group_snapshots/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/describe_security_group_snapshots/ <p>获取某个防火墙的备份信息。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙ID</td> <td>Yes</td> </tr> <tr> <td>security_group_snapshots.n</td> <td>String</td> <td>防火墙备份ID</td> <td>No</td> </tr> <tr> <td>offset</td> <td>Integer</td> <td>数据偏移量,默认为0</td> <td>No</td> </tr> <tr> <td>limit</td> <td>Integer</td> <td>返回数据长度,默认为20,最大100</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_snapshot_set</td> <td>Array</td> <td>JSON 格式的防火墙备份数据列表,每项参数可见下面 <a href="#responseitemtype">ResponseItemType</a></td> </tr> <tr> <td>total_count</td> <td>Integer</td> <td>根据过滤条件得到的防火墙备份总数</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>ResponseItemType</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>group_id</td> <td>String</td> <td>防火墙ID</td> </tr> <tr> <td>security_group_snapshot_id</td> <td>String</td> <td>防火墙备份ID</td> </tr> <tr> <td>rules</td> <td>Array</td> <td>规则列表</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=DescribeSecurityGroupSnapshots &amp;security_group=sg-n43jh2pq &amp;direction=0 &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;DescribeSecurityGroupSnapshotsResponse&#34;, &#34;total_count&#34;:4, &#34;security_group_snapshot_set&#34;:[ { &#34;description&#34;:&#34;&#34;, &#34;rules&#34;:[ { &#34;disabled&#34;:0, &#34;direction&#34;:0, &#34;protocol&#34;:&#34;tcp&#34;, &#34;priority&#34;:2, &#34;val3&#34;:&#34;&#34;, &#34;action&#34;:&#34;accept&#34;, &#34;val2&#34;:&#34;22&#34;, &#34;val1&#34;:&#34;22&#34;, &#34;security_group_rule_name&#34;:&#34;&#34; }, { &#34;disabled&#34;:0, &#34;direction&#34;:0, &#34;protocol&#34;:&#34;icmp&#34;, &#34;priority&#34;:1, &#34;val3&#34;:&#34;&#34;, &#34;action&#34;:&#34;accept&#34;, &#34;val2&#34;:&#34;0&#34;, &#34;val1&#34;:&#34;8&#34;, &#34;security_group_rule_name&#34;:&#34;&#34; } ], &#34;root_user_id&#34;:&#34;usr-T5OfrfRb&#34;, &#34;create_time&#34;:&#34;2015-12-14T06:34:21Z&#34;, &#34;security_group_snapshot_id&#34;:&#34;sgs-hycrez7a&#34;, &#34;owner&#34;:&#34;usr-T5OfrfRb&#34;, &#34;group_id&#34;:&#34;sg-q36kwq5r&#34;, &#34;name&#34;:&#34;sg_snapshot&#34; } ], &#34;ret_code&#34;:0 } </code></pre> Security: ModifySecurityGroupAttributes /security/firewall/api/command_list/modify_security_group_attributes/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/modify_security_group_attributes/ <p>修改防火墙的名称和描述。</p> <p>一次只能修改一个防火墙。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙 ID</td> <td>Yes</td> </tr> <tr> <td>security_group_name</td> <td>String</td> <td>防火墙名称</td> <td>No</td> </tr> <tr> <td>description</td> <td>String</td> <td>防火墙描述</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_id</td> <td>String</td> <td>防火墙 ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=ModifySecurityGroupAttributes &amp;security_group=sg-rtyv0968 &amp;security_group_name=sample &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;ModifySecurityGroupAttributesResponse&#34;, &#34;security_group_id&#34;:&#34;sg-rtyv0968&#34;, &#34;ret_code&#34;:0 } </code></pre> Security: ModifySecurityGroupIPSetAttributes /security/firewall/api/command_list/modify_security_group_ipset_attributes/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/modify_security_group_ipset_attributes/ <p>修改防火墙IP/端口集合的名称和描述。</p> <p>一次只能修改一个。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_ipset</td> <td>String</td> <td>ID</td> <td>Yes</td> </tr> <tr> <td>security_group_ipset_name</td> <td>String</td> <td>名称</td> <td>No</td> </tr> <tr> <td>description</td> <td>String</td> <td>描述</td> <td>No</td> </tr> <tr> <td>val</td> <td>String</td> <td>值</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_ipset_id</td> <td>String</td> <td>ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=ModifySecurityGroupIPSetAttributes &amp;security_group_ipset=sgi-rtyv0968 &amp;security_group_ipset_name=sample &amp;zone=pek3a &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;ModifySecurityGroupIPSetAttributesResponse&#34;, &#34;security_group_ipset_id&#34;:&#34;sgi-rtyv0968&#34;, &#34;ret_code&#34;:0 } </code></pre> Security: ModifySecurityGroupRuleAttributes /security/firewall/api/command_list/modify_security_group_rule_attributes/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/modify_security_group_rule_attributes/ <p>修改防火墙规则的优先级。</p> <p>注解</p> <p>修改规则后,记得调用 <a href="../apply_security_group/"><em>ApplySecurityGroup</em></a> 使其生效。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group_rule</td> <td>String</td> <td>防火墙规则ID</td> <td>Yes</td> </tr> <tr> <td>security_group_rule_name</td> <td>String</td> <td>防火墙规则名称</td> <td>No</td> </tr> <tr> <td>priority</td> <td>Integer</td> <td>优先级,由高到低为 0 - 100</td> <td>No</td> </tr> <tr> <td>rule_action</td> <td>String</td> <td>行为:accept 表示接受,drop 为拒绝</td> <td>No</td> </tr> <tr> <td>direction</td> <td>Integer</td> <td>方向,0 表示下行,1 表示上行。</td> <td>No</td> </tr> <tr> <td>protocol</td> <td>String</td> <td>协议,目前支持 tcp, udp, icmp, gre, esp, ah, ipip</td> <td>No</td> </tr> <tr> <td>val1</td> <td>String</td> <td>如果协议为 tcp 或 udp,此值表示起始端口。 如果协议为 icmp,此值表示 ICMP 类型, 具体类型可参见 <a href="/development_docs/api/common/security_group_rule_icmp_type/"><em>ICMP 类型及代码</em></a> 。 其他协议无需此值。</td> <td>No</td> </tr> <tr> <td>val2</td> <td>String</td> <td>如果协议为 tcp 或 udp,此值表示结束端口。 如果协议为 icmp,此值表示 ICMP 代码, 具体代码可参见 <a href="/development_docs/api/common/security_group_rule_icmp_type/"><em>ICMP 类型及代码</em></a> 。 其他协议无需此值。</td> <td>No</td> </tr> <tr> <td>val3</td> <td>String</td> <td>目标 IP,如果填写,则这条防火墙规则只对此IP(或IP段)有效。</td> <td>No</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_rule_id</td> <td>String</td> <td>成功修改的防火墙规则ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=ModifySecurityGroupRuleAttributes &amp;security_group_rule=sgr-13cooxdd &amp;security_group_rule_name=demo_rule &amp;priority=13 &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;ModifySecurityGroupRuleAttributesResponse&#34;, &#34;security_group_rule_id&#34;:&#34;sgr-13cooxdd&#34;, &#34;ret_code&#34;:0 } </code></pre> Security: RollbackSecurityGroup /security/firewall/api/command_list/rollback_security_group/ Mon, 01 Jan 0001 00:00:00 +0000 /security/firewall/api/command_list/rollback_security_group/ <p>使用防火墙备份回滚。</p> <p>注解</p> <p>回滚规则后,记得调用 <a href="../apply_security_group/"><em>ApplySecurityGroup</em></a> 使其生效。</p> <p><strong>Request Parameters</strong></p> <table> <thead> <tr> <th>Parameter name</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>security_group</td> <td>String</td> <td>防火墙ID</td> <td>Yes</td> </tr> <tr> <td>security_group_snapshot</td> <td>String</td> <td>防火墙备份ID</td> <td>Yes</td> </tr> <tr> <td>zone</td> <td>String</td> <td>区域 ID,注意要小写</td> <td>Yes</td> </tr> </tbody> </table> <p><a href="../../parameters/"><em>公共参数</em></a></p> <p><strong>Response Elements</strong></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>action</td> <td>String</td> <td>响应动作</td> </tr> <tr> <td>security_group_id</td> <td>String</td> <td>防火墙ID</td> </tr> <tr> <td>security_group_snapshot_id</td> <td>String</td> <td>防火墙备份ID</td> </tr> <tr> <td>ret_code</td> <td>Integer</td> <td>执行成功与否,0 表示成功,其他值则为错误代码</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p><em>Example Request</em>:</p> <pre tabindex="0"><code>https://api.qingcloud.com/iaas/?action=RollbackSecurityGroup &amp;security_group_snapshot=sgs-wx55xhix &amp;security_group=sg-q36kwq5r &amp;COMMON_PARAMS </code></pre><p><em>Example Response</em>:</p> <pre tabindex="0"><code>{ &#34;action&#34;:&#34;RollbackSecurityGroupResponse&#34;, security_group_id: &#34;sg-q36kwq5r&#34;, security_group_snapshot_id: &#34;sgs-hycrez7a&#34;, &#34;ret_code&#34;:0 } </code></pre>