更新时间:2022-08-08 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
更新SNAT规则
功能介绍
更新SNAT规则。
 
 
   更新弹性公网IP的地址或者更新描述时,要求SNAT规则状态status = "ACTIVE",要求网关管理员状态admin_state_up = True。
URI
PUT /v2/{project_id}/snat_rules/{snat_rule_id}
| 参数 | 是否必选 | 参数类型 | 描述 | 
|---|---|---|---|
| project_id | 是 | String | 项目ID。 | 
| snat_rule_id | 是 | String | SNAT规则的id。 | 
请求消息
请求参数如表2所示。
响应消息
响应参数如表4所示。
| 参数 | 参数类型 | 描述 | 
|---|---|---|
| id | String | SNAT规则的id。 | 
| tenant_id | String | 项目ID。 | 
| nat_gateway_id | String | NAT网关的id。 | 
| network_id | String | 规则使用的网络id。 | 
| cidr | String | cidr,vpc子网网段的子集或专线侧网段。 | 
| source_type | Integer | 0:VPC侧,可以指定network_id或者cidr。 1:专线侧,只能指定cidr。 不输入默认为0(VPC)。 | 
| floating_ip_id | String(4096) | 
 | 
| description | String(255) | SNAT规则的描述。 | 
| status | String | 
 | 
| admin_state_up | Boolean | 
 | 
| created_at | String | 
 | 
| public_ip_address | String(1024) | 
 | 
| floating_ip_address | String(1024) | 
 | 
示例
- 请求样例
    PUT https://{Endpoint}/v2/d199ba7e0ba64899b2e81518104b1526/snat_rules/5b95c675-69c2-4656-ba06-58ff72e1d338 { "snat_rule": { "nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8", "description": "my snat rule 01", "public_ip_address": "10.15.10.11,10.15.10.12" } }
- 响应样例
    { "snat_rule": { "floating_ip_id": " bdc10a4c-d81a-41ec-adf7-de857f7c812a,7a094014-9657-463f-972b-e84d56b931a0", "status": "PENDING_UPDATE", "nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8", "admin_state_up": true, "network_id": "eaad9cd6-2372-4be1-9535-9bd37210ae7b", "source_type":0, "tenant_id": "27e25061336f4af590faeabeb7fcd9a3", "created_at": "2017-11-18 07:54:21.665430", "id": "5b95c675-69c2-4656-ba06-58ff72e1d338", "public_ip_address": "10.15.10.11,10.15.10.12", , "floating_ip_address": "", "description": "my snat rule 01" } }
状态码
请参考状态码。
   父主题: SNAT规则
  
  
    