Ana içeriğe geç

Update Routing Addresses

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/addresses/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name

Request Body

Full JSON Body Example

{
"routingAddressList": [
{
"address": "https://backend1.example.com",
"description": "Primary backend server",
"weight": 100,
"addressType": "PRIMARY",
"healthCheckPath": "/health",
"healthMonitoringEnabled": true
},
{
"address": "https://backend2.example.com",
"description": "Secondary backend server",
"weight": 50,
"addressType": "PRIMARY",
"healthCheckPath": "/health",
"healthMonitoringEnabled": true
},
{
"address": "https://failover.example.com",
"description": "Failover backend",
"addressType": "FAILOVER_ONLY"
}
],
"deploy": false,
"deployTargetEnvironmentNameList": []
}

Request Body Fields

The request body is an object containing an array of routing address objects.

Routing Address Object

FieldTypeRequiredDefaultDescription
addressstringYes-Backend address URL
descriptionstringNo-Description for this backend address
weightintegerNo1Load balancing weight (required if loadBalanceAlgorithm=WEIGHTED)
soapTypestringNo*SOAP11SOAP version (required if API type is SOAP)
addressTypestringNoPRIMARYAddress type. See EnumRoutingAddressType
healthCheckPathstringNo-Active health check path for this backend (only for PRIMARY and FAILOVER_ONLY)
healthMonitoringEnabledbooleanNo-Enable per-address health monitoring (only for HTTP type)

EnumRoutingAddressType

  • PRIMARY - Primary backend address (default, used for normal traffic)
  • CANARY - Canary release address (receives a percentage of traffic)
  • MIRROR - Mirror address (receives a copy of traffic for testing)
  • FAILOVER_ONLY - Failover-only address (used only when primary backends are unavailable)

EnumSoapApiPortType

  • SOAP11 - SOAP 1.1
  • SOAP12 - SOAP 1.2

Request Body Object

FieldTypeRequiredDescription
routingAddressListarrayYesArray of routing address objects
deploybooleanNoIf true, deploy the API proxy after saving changes (default: false)
deployTargetEnvironmentNameListarray[string]NoList of environment names to deploy to (required when deploy=true)

Note

  • Request body must be an object with routingAddressList array
  • For REST APIs, soapType is not required
  • For SOAP APIs, soapType defaults to SOAP11 if not provided
  • Weight is used when load balancing algorithm is WEIGHTED

Response

Success Response (200 OK)

{
"success": true
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful

When deploy=true is specified:

{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}
FieldTypeDescription
deploymentResultobjectOnly present when deploy=true
deploymentResult.successbooleanOverall deployment success status
deploymentResult.deploymentResultsarrayPer-environment deployment results

Error Response (400 Bad Request)

{
"error": "bad_request",
"error_description": "Address is required"
}

Error Response (401 Unauthorized)

{
"error": "unauthorized_client",
"error_description": "Invalid token"
}

Error Response (404 Not Found)

{
"error": "not_found",
"error_description": "ApiProxy (name: MyAPI) was not found!"
}

cURL Example

Example 1: Update REST API Backend Addresses

curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/addresses/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"routingAddressList": [
{
"address": "https://backend1.example.com",
"description": "Primary datacenter",
"weight": 100
},
{
"address": "https://backend2.example.com",
"description": "Secondary datacenter",
"weight": 50
}
]
}'

Example 2: Configure Primary and Failover Addresses with Health Check

curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/addresses/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"routingAddressList": [
{
"address": "https://primary.example.com",
"description": "Primary backend",
"addressType": "PRIMARY",
"healthCheckPath": "/actuator/health",
"healthMonitoringEnabled": true
},
{
"address": "https://failover.example.com",
"description": "Failover backend",
"addressType": "FAILOVER_ONLY",
"healthCheckPath": "/actuator/health",
"healthMonitoringEnabled": true
}
]
}'

Example 3: Configure Mirror Address for Traffic Testing

curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/addresses/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"routingAddressList": [
{
"address": "https://production.example.com",
"addressType": "PRIMARY"
},
{
"address": "https://staging.example.com",
"description": "Mirror for testing",
"addressType": "MIRROR"
}
]
}'

Example 4: Update SOAP API Backend Addresses

curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/addresses/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"routingAddressList": [
{
"address": "https://soap-backend.example.com/Service",
"weight": 100,
"soapType": "SOAP11"
},
{
"address": "https://soap-backend2.example.com/Service",
"weight": 50,
"soapType": "SOAP12"
}
]
}'

Example 5: Save and Deploy

curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/addresses/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"routingAddressList": [
{
"address": "https://backend.example.com",
"description": "Primary backend",
"addressType": "PRIMARY"
}
],
"deploy": true,
"deployTargetEnvironmentNameList": ["production"]
}'

Notes and Warnings

  • Request Body Format: Request body must be an object with routingAddressList array
  • Address Format: Must be a valid URL (http:// or https://)
  • Weight: Used for weighted load balancing (higher weight = more traffic)
  • SOAP Type: Required for SOAP APIs, defaults to SOAP11 if not provided
  • Empty Array: Empty array removes all routing addresses (routing will fail)
  • Load Balancing: Configure load balancing algorithm separately (via routing settings)
  • Address Types: Use FAILOVER_ONLY for disaster recovery backends, MIRROR for shadow traffic testing, CANARY for gradual rollout
  • Health Check: healthCheckPath defines the endpoint the gateway calls to verify backend health. Only applicable for PRIMARY and FAILOVER_ONLY addresses.
  • Description: Use description to document the purpose of each backend address
  • Deploy: When deploy=true, the API proxy is automatically deployed to the specified environments after saving

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.