NSX-T Declarative API

This post was originally published on this site

I need to use declarative API to perform some automation tasks, for this instance i need to create few segments.

 

Below code is to create just a single segment and i am putting a Patch request to https://nsx-fqdn/policy/api/v1/infra

 

{

 

    “resource_type”: “infra”,

    “children”: [

        {

        “resource_type”: “ChildSegment”,

        “Segment”: {

            “resource_type”: “Segment”,

            “display_name”: “Post01”,

            “id”: “Post01”

                   }

        }     

                ]

}

 

But i get the below error, can anyone please help to get this right
{

 

    “httpStatus”: “BAD_REQUEST”,

    “error_code”: 220,

    “module_name”: “common-services”,

    “error_message”: “Unexpected character (‘“’ (code 8220 / 0x201c)): was expecting double-quote to start field name”

}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.