Disable Origin Pool with API

Hi Everyone.
Im trying to disable a origin (server1), from a pool (pool1), but it doesnt work, at this time the error i get is “code”: 1001,
“message”: “Object not found.”

There is the API call im using:

PATCH "https://api.cloudflare.com/client/v4/user/load_balancers/pools/{POOLID}"
-H “X-Auth-Email: [email protected]
-H “X-Auth-Key: MYAPIKEY”
-H “Content-Type: application/json”
–data ‘{
“name”: “pool1”,
“origins”: [
{
“name”: “server1”,
“address”: “1.2.3.4”,
“enabled”: “false”
}
],
}’

I’m just getting my first steps with the API, so if anyone knows a better way to make this work, I’d appreciate that as well.

Best regards

Hi there, are you able to try this again except with the enable field set to false instead of "false" (i.e. remove the quote)

For example

{
  "name": "pool1",
  "origins": [
    {
      "name": "server1",
      "address": "1.2.3.4",
      "enabled": false
    }
  ]
}

Let us know if you still have issues though.

Hi Erisa.

Thanks by your reply.
Im still getting the same issue. Even when i change the parameter as you say.

I think my problem is the URL im using, when i try to aim that URL with a GET to only list the pool info i get the same error that says object not found.
(I pick that URL format from the CF documentation)

Do you know if the URL im using is in the correct format? or how can i aim to a specific pools parameters? .

Best regards.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.