Accounts-accountId-dedicatedServers-serverId-ipAddresses-ipaddress-natRules-ruleId:PUT

From Hostway API Documentation
Revision as of 11:15, 18 September 2015 by Mike.robski (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PUT /accounts/{accountId}/dedicatedServers/{serverId}/ipAddresses/{ipAddress}/natRules/{ruleId}

Update specific NAT rule, which is assigned to a specific IP address of a dedicated server

Contents


Request

PUT /accounts/{accountId}/dedicatedServers/{serverId}/ipAddresses/{ipAddress}/natRules/{ruleId}

Request Parameters

accountId - string
The user account owning the dedicated server
serverId - string
The specified dedicated server Id
ipAddress - string
The specified IP address of the dedicated server
ruleId - string
The specific NAT rule Id

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.
Content-Type
application/json

Request Body

{
    "priority": {priority},
    "protocol": "{protocol}",
    "externalPort": {externalPort},
    "port": {port}
}
 

Parameters

priority - integer
rule priority, starting from 0 lowest priority
protocol - string
TCP, UDP, AH, ESP, GRE, AH+ESP or ALL
AH, ESP, GRE, AH+ESP, ALL protocols don't support port/externalPort - both should be 0
port - integer
internal port
externalPort - integer
external port

Note: When both port and externalPort are set to zero, this means - map all external ports to the same internal ports

Response

Status Code

204 No Content
Success
400 Bad Request
Invalid request body.
401 Unauthorized
The supplied credentials are invalid or do not provide permissions for this operation.
403 Forbidden
The authorized user does not have permissions to access the resource.
404 Not Found
Resource does not exist.
409 Conflict
Update matches already existing resource.
415 Unsupported Media Type
The Content-Type header was not specified or the specified type is not supported. Use application/json.

Examples

Update a specific NAT rule for a specific dedicated server IP

Request

PUT /accounts/test-acount/dedicatedServers/test-server-213/ipAddresses/1.1.1.1/natRules/test-rule-1

{
    "priority": 0,
    "protocol": "TCP",
    "externalPort": 1234,
    "port": 4321,
}
 

Response

204 No Content
 

Update that matches existing NAT rule for a specific dedicated server IP

Request

PUT /accounts/test-acount/dedicatedServers/test-server-213/ipAddresses/1.1.1.1/natRules/test-rule-2

{
    "priority": 0,
    "protocol": "TCP",
    "externalPort": 1234,
    "port": 4321,
}
 

Response

409 Conflict

{"conflict": {"message": "Cannot update rule: The same rule test-rule-1 already exists", "code": 409}}
 


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox