Advanced Load Balancer Macro API method

Advanced Load Balancer Macro API method

Question

Hi everybody,

I want to provide to application responsibles an easy way to manage their Virtual Servers.
I have spent few hours to try virtualservice model of ALB macro API method but this latter is not well documented.
Until now, I have only configured successfully virtual servers and all its related components in the default cloud in the admin tenant.
Unfortunately, it is not my use case and I still receive the response below as soon I try to specify another cloud.
{
"error": "Error in creating VirtualService test1_vs: Error in creating VirtualService test1_vs: tier1_lr not configured"
}

I use AVI 21.1.4 version and here is the body I use.

{
"model_name": "VirtualService",
"data": {
"name": "test1_vs",
"vrf_context_ref":"/api/vrfcontext?name=sirveglabnsxt1t11",
"tenant_ref": "/api/tenant?name=admin",
"cloud_ref": "/api/cloud?name=POD_lab_alw",
"se_group_ref": "/api/serviceenginegroup?name=lab_alw_seg1",
"tier1_lr": "/infra/tier-1s/sirveglabnsxt1t11",
"services": [
{
"port": 80
}
],
"vsvip_ref_data": {
"name": "test1_vsvip",
"vip": [
{
"ip_address": {
"type": "V4",
"addr": "10.253.222.162"
},
"cloud_ref": "/api/cloud?name=POD_lab_alw",
"vrf_context_ref":"/api/vrfcontext?name=sirveglabnsxt1t11",
"tier1_lr": "/infra/tier-1s/sirveglabnsxt1t11"
}
]
},
"application_profile_ref": "/api/applicationprofile?name=http_application_profile",
"pool_ref_data": {
"name": "test1_pool",
"cloud_ref": "/api/cloud?name=POD_lab_alw",
"tier1_lr": "/infra/tier-1s/sirveglabnsxt1t11",
"servers": [
{
"ip": {
"type": "V4",
"addr": "10.253.221.45"
}
},
{
"ip": {
"type": "V4",
"addr": "10.253.221.46"
}
}
],
"health_monitor_ref": "/api/healthmonitor?name=monitor_http_standard"
}
}
}

Thank in advance for any help.

 

 

Answer

 

Labels (1)
Comments

Hi,

 

What you can try to do:
Use web developer in your browser.(Network tab)
Create the VS by hand and when you press save, checkout the POST to /api/marco
From there you can reconstruct to use in your own API call.

@p0wertje 

Thank you for this tips.
It helped me to spot the misplace of tier1_lr key in the vsvip part.

From now, I know how to set up a vs with all its elements (vsvip and pool).

So I have made a step beyond.

Next step, modifying this vs.

The short piece of available documentation says "Additionally, the same API (macro) can be used to modify any of the objects using PUT"

So I was hoping of a kind of declarative API but it seems not that simple.

 

 

 

 

 

Version history
Revision #:
1 of 1
Last update:
‎07-11-2022 03:07 AM
Updated by:
 
Contributors