Forum Discussion
AS3 add another VS to existing tenant
I have deployed the sample AS3 script to create a VS with pool and pool members from here:
{
"class": "AS3",
"action": "deploy",
"persist": true,
"declaration": {
"class": "ADC",
"schemaVersion": "3.0.0",
"id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
"label": "Sample 1",
"remark": "Simple HTTP Service with Round-Robin Load Balancing",
"AS1": {
"class": "Tenant",
"A1": {
"class": "Application",
"template": "generic",
"MyVS1": {
"class": "Service_HTTP",
"virtualAddresses": [
"10.0.1.11"
],
"pool": "web_pool_1"
},
"web_pool_1": {
"class": "Pool",
"monitors": [
"http"
],
"members": [
{
"servicePort": 80,
"serverAddresses": [
"192.0.1.10",
"192.0.1.11"
]
}
]
}
}
}
}
}
Now I want to add another VS to the same tenant (same partition)
but when I edit the above script and deploy this:
{
"class": "AS3",
"action": "deploy",
"persist": true,
"declaration": {
"class": "ADC",
"schemaVersion": "3.0.0",
"id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
"label": "Sample 1",
"remark": "Simple HTTP Service with Round-Robin Load Balancing",
"AS1": {
"class": "Tenant",
"A1": {
"class": "Application",
"template": "generic",
"MyVS2": {
"class": "Service_HTTP",
"virtualAddresses": [
"10.0.1.12"
],
"pool": "web_pool_2"
},
"web_pool_2": {
"class": "Pool",
"monitors": [
"http"
],
"members": [
{
"servicePort": 80,
"serverAddresses": [
"192.0.1.12",
"192.0.1.13"
]
}
]
}
}
}
}
}
It replaces the old configuration and I only have MyVS2.
How can I add MyVS2 to the current configuration without losing MyVS1?
- FFEmployee
You may want to try using the patch action to modify the existing declaration: https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/refguide/as3-api.html#method-patch
For example details, you may want to check out https://support.f5.com/csp/article/K91316819
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com