Modify an ALB Forwarding Rule by ID
1 min
PUT
https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/applicationloadbalancers/{applicationLoadBalancerId}/forwardingrules/{forwardingRuleId}
Path Parameters
- datacenterIdstringrequiredDescription
- applicationLoadBalancerIdstringrequiredDescription
- forwardingRuleIdstringrequiredDescription
Query Parameters
- prettybooleanDescriptionDefaulttrue
- depthinteger<int32>DescriptionDefault0Formatint32Minimum0Maximum10
Header Parameters
- X-Contract-Numberinteger<int32>DescriptionFormatint32
Body Parameters
- bodyApplicationLoadBalancerForwardingRulePutrequiredDescription
- typeobject
- Type
- propertiesApplicationLoadBalancerForwardingRulePropertiesrequired
- namestringrequiredExampleDescription
- protocolstring<HTTP>requiredExampleDescriptionAllowedHTTP
- listenerIpstringrequiredExampleDescription
- listenerPortinteger<int32>requiredExampleDescriptionFormatint32
- clientTimeoutinteger<int32>ExampleDescriptionFormatint32
- serverCertificatesstring[]Example
[ "3839d24f-57bd-408e-96ee-8da3d2db5a03", "a6b4f7d5-b23a-4f53-b83e-8a6528ab4612" ]
Description - httpRulesApplicationLoadBalancerHttpRule[]Description
- namestringrequiredExampleDescription
- typestring<FORWARD | STATIC | REDIRECT>requiredExampleDescriptionAllowedFORWARDSTATICREDIRECT
- targetGroupstringExampleDescription
- dropQuerybooleanExampleDescription
- locationstringExampleDescription
- statusCodeinteger<int32>ExampleDescriptionFormatint32
- responseMessagestringExampleDescription
- contentTypestringExampleDescription
- conditionsApplicationLoadBalancerHttpRuleCondition[]Description
- typestring<HEADER | PATH | QUERY | METHOD | HOST | COOKIE | SOURCE_IP>requiredExampleDescriptionAllowedHEADERPATHQUERYMETHODHOSTCOOKIESOURCE_IP
- conditionstring<EXISTS | CONTAINS | EQUALS | MATCHES | STARTS_WITH | ENDS_WITH>requiredExampleDescriptionAllowedEXISTSCONTAINSEQUALSMATCHESSTARTS_WITHENDS_WITH
- negatebooleanDescription
- keystringExampleDescription
- valuestringExampleDescription
Responses
202
- ApplicationLoadBalancerForwardingRule
- idstringExampleDescription
- typeobject
- Type
- hrefstring<uri>ExampleDescriptionFormaturi
- metadataDatacenterElementMetadata
- etagstringExampleDescription
- createdDatestring<date-time>ExampleDescriptionFormatdate-time
- createdBystringExampleDescription
- createdByUserIdstringExampleDescription
- lastModifiedDatestring<date-time>ExampleDescriptionFormatdate-time
- lastModifiedBystringExampleDescription
- lastModifiedByUserIdstringExampleDescription
- statestring<AVAILABLE | INACTIVE | BUSY | DEPLOYING | ACTIVE | FAILED | SUSPENDED | FAILED_SUSPENDED | UPDATING | FAILED_UPDATING | DESTROYING | FAILED_DESTROYING | TERMINATED | HIBERNATING | FAILED_HIBERNATING | MAINTENANCE | FAILED_MAINTENANCE | UNKNOWN>ExampleDescriptionAllowedAVAILABLEINACTIVEBUSYDEPLOYINGACTIVEFAILEDSUSPENDEDFAILED_SUSPENDEDUPDATINGFAILED_UPDATINGDESTROYINGFAILED_DESTROYINGTERMINATEDHIBERNATINGFAILED_HIBERNATINGMAINTENANCEFAILED_MAINTENANCEUNKNOWN
- propertiesApplicationLoadBalancerForwardingRulePropertiesrequired
- namestringrequiredExampleDescription
- protocolstring<HTTP>requiredExampleDescriptionAllowedHTTP
- listenerIpstringrequiredExampleDescription
- listenerPortinteger<int32>requiredExampleDescriptionFormatint32
- clientTimeoutinteger<int32>ExampleDescriptionFormatint32
- serverCertificatesstring[]Example
[ "3839d24f-57bd-408e-96ee-8da3d2db5a03", "a6b4f7d5-b23a-4f53-b83e-8a6528ab4612" ]
Description - httpRulesApplicationLoadBalancerHttpRule[]Description
- namestringrequiredExampleDescription
- typestring<FORWARD | STATIC | REDIRECT>requiredExampleDescriptionAllowedFORWARDSTATICREDIRECT
- targetGroupstringExampleDescription
- dropQuerybooleanExampleDescription
- locationstringExampleDescription
- statusCodeinteger<int32>ExampleDescriptionFormatint32
- responseMessagestringExampleDescription
- contentTypestringExampleDescription
- conditionsApplicationLoadBalancerHttpRuleCondition[]Description
- typestring<HEADER | PATH | QUERY | METHOD | HOST | COOKIE | SOURCE_IP>requiredExampleDescriptionAllowedHEADERPATHQUERYMETHODHOSTCOOKIESOURCE_IP
- conditionstring<EXISTS | CONTAINS | EQUALS | MATCHES | STARTS_WITH | ENDS_WITH>requiredExampleDescriptionAllowedEXISTSCONTAINSEQUALSMATCHESSTARTS_WITHENDS_WITH
- negatebooleanDescription
- keystringExampleDescription
- valuestringExampleDescription
Response Headers
- X-RateLimit-Remaininginteger<int32>DescriptionFormatint32
- X-RateLimit-Limitinteger<int32>DescriptionFormatint32
- X-RateLimit-Burstinteger<int32>DescriptionFormatint32
default
- Error
- httpStatusinteger<int32>ExampleDescriptionFormatint32
- messagesErrorMessage[]
- errorCodestringExampleDescription
- messagestringExampleDescription
curl
curl --request PUT \
--url 'https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/applicationloadbalancers/{applicationLoadBalancerId}/forwardingrules/{forwardingRuleId}?pretty=true&depth=integer%3Cint32%3E' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"type": {},
"properties": {
"name": "My Application Load Balancer forwarding rule",
"protocol": "HTTP",
"listenerIp": "81.173.1.2",
"listenerPort": 8080,
"httpRules": [
{
"name": "My Application Load Balancer HTTP rule",
"type": "FORWARD",
"conditions": [
{
"type": "HEADER",
"condition": "STARTS_WITH"
}
]
}
]
}
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"type": {},
"properties": {
"name": "My Application Load Balancer forwarding rule",
"protocol": "HTTP",
"listenerIp": "81.173.1.2",
"listenerPort": 8080,
"httpRules": [
{
"name": "My Application Load Balancer HTTP rule",
"type": "FORWARD",
"conditions": [
{
"type": "HEADER",
"condition": "STARTS_WITH"
}
]
}
]
}
});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/applicationloadbalancers/{applicationLoadBalancerId}/forwardingrules/{forwardingRuleId}?pretty=true&depth=integer<int32>", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/applicationloadbalancers/{applicationLoadBalancerId}/forwardingrules/{forwardingRuleId}?pretty=true&depth=integer<int32>")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"type": {},
"properties": {
"name": "My Application Load Balancer forwarding rule",
"protocol": "HTTP",
"listenerIp": "81.173.1.2",
"listenerPort": 8080,
"httpRules": [
{
"name": "My Application Load Balancer HTTP rule",
"type": "FORWARD",
"conditions": [
{
"type": "HEADER",
"condition": "STARTS_WITH"
}
]
}
]
}
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/applicationloadbalancers/{applicationLoadBalancerId}/forwardingrules/{forwardingRuleId}?pretty=true&depth=integer<int32>"
payload = json.dumps({
"type": {},
"properties": {
"name": "My Application Load Balancer forwarding rule",
"protocol": "HTTP",
"listenerIp": "81.173.1.2",
"listenerPort": 8080,
"httpRules": [
{
"name": "My Application Load Balancer HTTP rule",
"type": "FORWARD",
"conditions": [
{
"type": "HEADER",
"condition": "STARTS_WITH"
}
]
}
]
}
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
202
// Successful operation
{
"id": "15f67991-0f51-4efc-a8ad-ef1fb31a480c",
"type": {},
"href": "<RESOURCE-URI>",
"metadata": {
"etag": "45480eb3fbfc31f1d916c1eaa4abdcc3",
"createdDate": "2015-12-04T14:34:09.809Z",
"createdBy": "[email protected]",
"createdByUserId": "[email protected]",
"lastModifiedDate": "2015-12-04T14:34:09.809Z",
"lastModifiedBy": "[email protected]",
"lastModifiedByUserId": "63cef532-26fe-4a64-a4e0-de7c8a506c90",
"state": "AVAILABLE"
},
"properties": {
"name": "My Application Load Balancer forwarding rule",
"protocol": "HTTP",
"listenerIp": "81.173.1.2",
"listenerPort": 8080,
"clientTimeout": 50,
"serverCertificates": [
""
],
"httpRules": [
{
"name": "My Application Load Balancer HTTP rule",
"type": "FORWARD",
"targetGroup": "96e514d0-73e4-4abd-8fbc-c0f53b79bfae",
"dropQuery": true,
"location": "www.ionos.com",
"statusCode": 301,
"responseMessage": "Application Down",
"contentType": "text/html",
"conditions": [
{
"type": "HEADER",
"condition": "STARTS_WITH",
"negate": false,
"key": "forward-at",
"value": "Friday"
}
]
}
]
}
}default
// Any erroneous status code: 400 (parse error), 401 (auth error), 402 (trial access), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).
{
"httpStatus": 400,
"messages": [
{
"errorCode": "123",
"message": "Error message example."
}
]
}Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.