Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

AS3 PATCH method to add new pool?

Bidondo
Nimbostratus
Nimbostratus

AS3 noob here. Been successful using POST to create partition, app, VS, and pool. Now, I simply want to add a new standalone pool to the tenant, but not attached to a virtual server (because I'm using dynamic pool routing via DG) using the PATCH method. Should be very easy, but seeing some interesting errors, which I'm sure is related to schema formatting. Any advice? The restnoded logs were not much help. Payload follows using PATCH method, followed by the error. Also tried adding to the schema without the app, but same deal...

 

[
    {
        "path": "/Sample/A1",
        "op": "add",
        "value": {
        	"web_pool_new": {
                    "class": "Pool",
                    "monitors": [
                        "http"
                    ],
                    "members": [{
                            "servicePort": 80,
                            "serverAddresses": [
                                "192.0.1.20",
                                "192.0.1.21"
                            ]
                        }
                    ]
                }
        }
    }
]

 

{
    "code": 422,
    "errors": [
        "/Sample/A1: should have required property 'class'"
    ],
    "declarationFullId": "",
    "message": "declaration is invalid"
}
3 REPLIES 3

PeteWhite
F5 Employee
F5 Employee

Very simple - your declaration does not have a class for /Sample/A1 ie is it a Tenant or what

Bidondo
Nimbostratus
Nimbostratus

Pete, thanks for the response.

Yes, while I can specify the class for the Tenant and Application to get this working (see below), I can only create a new pool with the PATCH method and attach it to an existing virtual server.

My use case is simply this: I want to add a new pool to an existing tenant and NOT attach it to anything (a standalone pool). Again, I'm using dynamic pool selections through iRules and context-based routing. The syntax or schema does not seem to support that under the PATCH method. Since my support ticket is 2 weeks stale, thinking it's probably not supported. Again, any help is appreciated!

[
  {
    "op": "add",
    "path": "/ConsulPoolTest/A1",
    "value": {
 
    "class": "Application",
    "template": "http",
    "serviceMain": {
      "class": "Service_HTTP",
      "virtualAddresses": [
        "10.117.56.178"
    	],
      "pool": "web_poolnew"
      },
      "web_poolnew": {
        "class": "Pool",
        "monitors": [
          "http"
        ],
        "members": [{
          "servicePort": 80,
          "serverAddresses": [
            "192.0.1.20",
            "192.0.1.21"
          ]
        }]
      }
    }
  }
]

AZahajkiewicz
F5 Employee
F5 Employee

Use PATCH with:

[ { "op": "add", "path": "/ConsulPoolTest/A1", "value": { "class": "Application", "template": "http", "web_poolnew": { "class": "Pool", "monitors": [ "http" ], "members": [{ "servicePort": 80, "serverAddresses": [ "192.0.1.20", "192.0.1.21" ] }] } } } ]