云服务器内容精选

  • 请求示例 批量创建规则(第一条为指定端口的规则,第二条为all port类型的规则)。 POST https://{Endpoint}/v2/d199ba7e0ba64899b2e81518104b1526/dnat_rules/batch { "dnat_rules" : [ { "floating_ip_id" : "bf99c679-9f41-4dac-8513-9c9228e713e1", "nat_gateway_id" : "cda3a125-2406-456c-a11f-598e10578541", "port_id" : "9a469561-daac-4c94-88f5-39366e5ea193", "internal_service_port" : 993, "protocol" : "tcp", "external_service_port" : 242, "description" : "my dnat rule 01" }, { "floating_ip_id" : "cf99c679-9f41-4dac-8513-9c9228e713e1", "nat_gateway_id" : "dda3a125-2406-456c-a11f-598e10578541", "private_ip" : "192.168.1.100", "internal_service_port" : 0, "protocol" : "any", "external_service_port" : 0, "description" : "my dnat rule 01" } ] }
  • 响应示例 状态码: 201 POST操作正常返回。 { "dnat_rules" : [ { "floating_ip_id" : "bf99c679-9f41-4dac-8513-9c9228e713e1", "status" : "PENDING_CREATE", "nat_gateway_id" : "cda3a125-2406-456c-a11f-598e10578541", "admin_state_up" : true, "port_id" : "9a469561-daac-4c94-88f5-39366e5ea193", "private_ip" : "", "internal_service_port" : 993, "protocol" : "tcp", "tenant_id" : "d199ba7e0ba64899b2e81518104b1526", "created_at" : "2019-11-15 15:44:42.595173", "id" : "79195d50-0271-41f1-bded-4c089b2502ff", "floating_ip_address" : "5.21.11.226", "external_service_port" : 242, "description" : "my dnat rule 01" }, { "floating_ip_id" : "cf99c679-9f41-4dac-8513-9c9228e713e1", "status" : "PENDING_CREATE", "nat_gateway_id" : "dda3a125-2406-456c-a11f-598e10578541", "admin_state_up" : true, "port_id" : "", "private_ip" : "192.168.1.100", "internal_service_port" : 0, "protocol" : "any", "tenant_id" : "d199ba7e0ba64899b2e81518104b1526", "created_at" : "2019-11-15 15:44:42.595173", "id" : "79195d50-0271-41f1-bded-4c089c2502ff", "floating_ip_address" : "5.21.11.227", "external_service_port" : 0, "description" : "my dnat rule 01" } ] }
  • 响应示例 状态码: 200 查询DNAT规则成功。 { "dnat_rule" : { "id" : "24dd6bf5-48f2-4915-ad0b-5bb111d39c83", "project_id" : "da261828016849188f4dcc2ef94d9da9", "description" : "aa", "gateway_id" : "0adefb29-a6c2-48a5-8637-2be67fa03fec", "transit_ip_id" : "3faa719d-6d18-4ccb-a5c7-33e65a09663e", "enterprise_project_id" : "2759da7b-8015-404c-ae0a-a389007b0e2a", "network_interface_id" : "dae9393a-b536-491c-a5a2-72edc1104707", "type" : "COMPUTE", "protocol" : "any", "internal_service_port" : "0", "transit_service_port" : "0", "private_ip_address" : "192.168.1.72", "created_at" : "2019-04-29T07:10:01", "updated_at" : "2019-04-29T07:10:01" }, "request_id" : "747a911c17067a39692f75ac146fb47e"}