<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: NSX ALB Avi 30.1.1 - macro API &amp;quot;Input object does not have model_name field&amp;quot; even thou in VMware NSX Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993824#M17038</link>
    <description>&lt;P&gt;Do you have a (cleaned up if needed) example of the payload you used?&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 23:28:36 GMT</pubDate>
    <dc:creator>EvertAM</dc:creator>
    <dc:date>2023-11-01T23:28:36Z</dc:date>
    <item>
      <title>NSX ALB Avi 30.1.1 - macro API "Input object does not have model_name field" even though present</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993047#M17027</link>
      <description>&lt;P&gt;I've started evaluating the Avi/NSX ALB product a short while ago and try to automate the creation of some of the objects.&lt;/P&gt;&lt;P&gt;When using the macro API to create a virtual service I cannot get past the&amp;nbsp;"Input object does not have model_name field" error.&lt;/P&gt;&lt;P&gt;How this works is pretty confusing.&lt;/P&gt;&lt;P&gt;First I have created a new virtual service using the UI and captured the query using the browsers' developer mode. Afterwards I used curl to make a request, for which I copied the payload 1:1 from what was captured earlier. The error&amp;nbsp;"Input object does not have model_name field" accompanzing a http error 400 was returned.&lt;/P&gt;&lt;P&gt;I've checked the payload, the model_name field was actually missing. Instead the&amp;nbsp;&lt;SPAN&gt;"uri_path":"/api/virtualservice" was present. Manually adding the&amp;nbsp;"model_name": "VirtualService" field to the payload did not resolve the error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using the example provided in&amp;nbsp;&lt;A href="https://avinetworks.com/docs/latest/api-guide/macro.html" target="_blank"&gt;MACRO API (avinetworks.com)&lt;/A&gt;&amp;nbsp;also results in the error mentioned above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Am I doing something wrong here? How does the query work, when executed using the UI without the model_name field? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Overall, the REST API makes a pretty janky first impression. I've noticed a similar problem when creating a new server pool. Copied the payload from browser dev mode, query returns an errro 400 with reason of being not able to interpret the healt monitor field...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 14:32:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993047#M17027</guid>
      <dc:creator>Czernobog</dc:creator>
      <dc:date>2023-10-27T14:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: NSX ALB Avi 30.1.1 - macro API "Input object does not have model_name field" even thou</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993824#M17038</link>
      <description>&lt;P&gt;Do you have a (cleaned up if needed) example of the payload you used?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 23:28:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993824#M17038</guid>
      <dc:creator>EvertAM</dc:creator>
      <dc:date>2023-11-01T23:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: NSX ALB Avi 30.1.1 - macro API "Input object does not have model_name field" even thou</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993855#M17041</link>
      <description>&lt;P&gt;This can be tested with the example provided in the documentation, it end with the response:&lt;/P&gt;&lt;P&gt;Response: {&lt;/P&gt;&lt;P&gt;"error": "Input object does not have model_name field"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;ERROR!: 400 Client Error: BAD REQUEST for url: &lt;A href="https://{base_url}/api/macro" target="_self"&gt;https://{base_url}/api/macro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the same response with my custom VS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    payload = {
        "model_name": "VirtualService",
        "data": {
            "name": "n_vs",
            "services": [
                {
                    "port": 80
                }
            ],
            "vip":[
                {
                    "ip_address": {
                        "type": "V4",
                        "addr": "2.2.2.2"
                    }
                }
            ],
            "application_profile_ref": "/api/applicationprofile?name=n_app_http",
            "pool_ref_data": {
                "name": "n_pool",
                "servers": [
                    {
                        "ip": {
                            "type": "V4",
                            "addr": "1.1.1.1"
                        }
                    }
                ],
                "health_monitor_refs_data": [
                    {
                        "type": "HEALTH_MONITOR_HTTP",
                        "name": "n_http",
                        "http_monitor": {
                            "http_response_code": [
                                {
                                    "code": "HTTP_2XX"
                                }
                            ]
                        }
                    }
                ]
            } 
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 07:13:33 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-ALB-Avi-30-1-1-macro-API-quot-Input-object-does-not-have/m-p/2993855#M17041</guid>
      <dc:creator>Czernobog</dc:creator>
      <dc:date>2023-11-02T07:13:33Z</dc:date>
    </item>
  </channel>
</rss>

