Syntax for Retrieving Security Groups

GET /api/security-groups/{id} retrieves a security group identified by its ID.

Input

Use the supported input parameters to control the command output.

Parameter Description
URL https://$vRA/network-service/api/security-groups/{id}, where id is the ID of the security group.
$vRA

Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server.

$token

Specifies a valid HTTP bearer token with necessary credentials.

Output

The command output contains property names and values based on the command input parameters.

Parameter Description
Content Specifies an array of data rows, each of which represents one of the security objects returned in a pageable list. Each security object can contain the following information:
  • id: Specifies the unique security object identifier.
  • name: Specifies the name of the security object.
  • description: Specifies a description of the security object.
  • externalId: Specifies the external ID of the security object.
  • tenantId: Specifies the tenant ID value. Default value is null.
  • extensionData: Contains an array of Literals name "entries". Each Literanl contains a key and a value. The value, in turn, contains a type (such as a string or integer) and the Literal's value.
  • securityGroupTypeId: For internal use only. Applies to security groups only.
  • internal: For internal use only. Applies to security groups only.
  • machineIdCollection: For internal use only. Applies to security groups only.
  • ipAddressCollection: For internal use only. Applies to security groups only.

curl Command to Retrieve Security Groups

The following example command retrieves information about security group with ID=24.
curl -X --insecure -H "accept: application/json" 
-H "Authorization: Bearer $token”  https://$vRA/network-service/api/security-groups/24

The response in JSON lists the information for the security group specified.

{
    "links": [],
    "content": [
        {
            "@type": "SecurityGroup",
            "id": "24",
            "name": "security-group-name",
            "description": "Managed by VMware vRealize Automation",
            "externalId": "securitygroup-19567",
            "tenantId": null,
            "extensionData": {
                  "entries": [...]
            },
            "securityGroupTypeId": "Infrastructure.Network.SecurityGroup.NSX",
            "internal": false,
            "machineIdCollection": null,
            "ipAddressCollection": null
        }
    ],
}