<?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 NSX-T REST APIs with Unique Identifier for Security Groups in VMware NSX Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985645#M16894</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am new to VMWare NSX-T. I am exploring the APIs available to query Security Groups, Add/Remove VMs to/from Security Groups. As I understand, the APIs take Security Group names in the URI path, as given below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;GET Request to Query Security Group - /policy/api/v1/infra/domains/&amp;lt;domain-id&amp;gt;/groups/&lt;STRONG&gt;&amp;lt;group-id&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;PATCH request to Add VM to Security Group -&amp;nbsp;&lt;SPAN&gt;/policy/api/v1/infra/domains/&amp;lt;domain-id&amp;gt;/groups/&lt;STRONG&gt;&amp;lt;group-id&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My Question -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Are there APIs available that would take the Unique Identifier for the Security Group ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VMWare NSX-T allows creation of multiple security groups with the same name. Are there APIs to query, Add/Remove VM to security Groups using the Unique Identifier of the security group rather than group name ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 03:59:12 GMT</pubDate>
    <dc:creator>sivas1</dc:creator>
    <dc:date>2023-09-07T03:59:12Z</dc:date>
    <item>
      <title>NSX-T REST APIs with Unique Identifier for Security Groups</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985645#M16894</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am new to VMWare NSX-T. I am exploring the APIs available to query Security Groups, Add/Remove VMs to/from Security Groups. As I understand, the APIs take Security Group names in the URI path, as given below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;GET Request to Query Security Group - /policy/api/v1/infra/domains/&amp;lt;domain-id&amp;gt;/groups/&lt;STRONG&gt;&amp;lt;group-id&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;PATCH request to Add VM to Security Group -&amp;nbsp;&lt;SPAN&gt;/policy/api/v1/infra/domains/&amp;lt;domain-id&amp;gt;/groups/&lt;STRONG&gt;&amp;lt;group-id&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My Question -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Are there APIs available that would take the Unique Identifier for the Security Group ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VMWare NSX-T allows creation of multiple security groups with the same name. Are there APIs to query, Add/Remove VM to security Groups using the Unique Identifier of the security group rather than group name ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 03:59:12 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985645#M16894</guid>
      <dc:creator>sivas1</dc:creator>
      <dc:date>2023-09-07T03:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: NSX-T REST APIs with Unique Identifier for Security Groups</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985659#M16895</link>
      <description>&lt;P&gt;The group id is a unique identifier. You can call every group the exact same name but the identifier has to be different. Thats how it's been in my experience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example using the exmaple in the API document&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PUT https://&amp;lt;policy-mgr&amp;gt;/policy/api/v1/infra/domains/vmc/groups/&lt;STRONG&gt;&lt;EM&gt;webgroup&lt;/EM&gt;&lt;/STRONG&gt; { "expression": [ { "member_type": "VirtualMachine", "value": "webvm", "key": "Tag", "operator": "EQUALS", "resource_type": "Condition" } ], "description": "web group", "display_name": "web group", "_revision":0 }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PUT https://&amp;lt;policy-mgr&amp;gt;/policy/api/v1/infra/domains/vmc/groups/&lt;STRONG&gt;webgroup1&lt;/STRONG&gt; { "expression": [ { "member_type": "VirtualMachine", "value": "webvm", "key": "Tag", "operator": "EQUALS", "resource_type": "Condition" } ], "description": "web group", "display_name": "web group", "_revision":0 }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need a unique ID for each group you add otherwise it'll overwrite the previous group.&lt;/P&gt;&lt;P&gt;Pretty much every API you query is looking for that ID. Below is the API to add a rule&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PUT https://&amp;lt;policy-mgr&amp;gt;/policy/api/v1/infra/domains/vmc/security-policies/application-section-1 { "description": "comm map", "display_name": "application-section-1", "category": "Application", "rules": [ { "description": " comm entry", "display_name": "ce-1", "sequence_number": 1, "source_groups": [ "/infra/domains/vmc/groups/&lt;STRONG&gt;webgroup&lt;/STRONG&gt;" ], "destination_groups": [ "/infra/domains/vmc/groups/&lt;STRONG&gt;webgroup1&lt;/STRONG&gt;" ], "services": [ "/infra/services/HTTP", "/infra/services/CIM-HTTP" ], "action": "ALLOW" } ] }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it wasn't unique you'd never be able to reference it since you wouldn't know what you're calling.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 06:46:37 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985659#M16895</guid>
      <dc:creator>bmcb555</dc:creator>
      <dc:date>2023-09-07T06:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: NSX-T REST APIs with Unique Identifier for Security Groups</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985721#M16897</link>
      <description>&lt;P&gt;Thank you very much for the detailed response. That helps!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 14:55:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985721#M16897</guid>
      <dc:creator>sivas1</dc:creator>
      <dc:date>2023-09-07T14:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: NSX-T REST APIs with Unique Identifier for Security Groups</title>
      <link>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985744#M16900</link>
      <description>&lt;P&gt;No problem, I hope it's clear! Group ID must be unique for the security groups but they can all share the same&amp;nbsp;&lt;SPAN&gt;display_name if you wanted. If this has helped you solve your issue please mark as solved.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 15:58:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-NSX-Discussions/NSX-T-REST-APIs-with-Unique-Identifier-for-Security-Groups/m-p/2985744#M16900</guid>
      <dc:creator>bmcb555</dc:creator>
      <dc:date>2023-09-07T15:58:50Z</dc:date>
    </item>
  </channel>
</rss>

