Syntax for Updating a Tenant ID
PUT /api/security-groups/{id} updates the tenant for the security group with a specified 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 to update. |
$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. |
$securityId | Specifies the unique security object identifier. |
$securityName | 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. Valid values
are:
<unscoped>,
null, and
tenant_name, where:
|
$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. |
JSON Input File Template
To simplify command line input, you can call a JSON file with input parameters from the command line. You create the JSON file using a text editor, replacing italicized variables in the following template with your specific values.
{ "@type": "SecurityGroup", "id": "$securityId", "name": "$securityName", "description": "$description", "externalId": "$externalId", "tenantId": "$tenantId", "extensionData": { "entries": [...] }, "securityGroupTypeId": "$securityGroupTypeId", "internal": false, "machineIdCollection": null, "ipAddressCollection": null }
Output
The command output contains property names and values based on the command input parameters.
Parameter | Description |
---|---|
Links |
Specifies an array of link objects, each of which contains the following parts:
|
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:
|
Metadata | Specifies the following paging-related
data:
|
curl Command to Update the Tenant ID for a Security Group With JSON File
{ "@type": "SecurityGroup", "id": "24", "name": "security-group-name", "description": "Managed by VMware vRealize Automation", "externalId": "securitygroup-19567", "tenantId": "my_tenant_example", "extensionData": { "entries": [...] }, "securityGroupTypeId": "Infrastructure.Network.SecurityGroup.NSX", "internal": false, "machineIdCollection": null, "ipAddressCollection": null }
curl -X PUT --insecure -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer $token” -H "Cache-control: no cache" https://$vRA/network-service/api/security-groups/24 --data @C:/Temp/updateTenantId.json
curl Command to Update the Tenant ID for a Security Group With Parameters Inline
curl -X PUT --insecure -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer $token” -H "Cache-control: no cache" https://$vRA/network-service/api/security-groups/24 --data { "@type": "SecurityGroup", "id": "24", "name": "security-group-name", "description": "Managed by VMware vRealize Automation", "externalId": "securitygroup-19567", "tenantId": "my_tenant_example", "extensionData": { "entries": [...] }, "securityGroupTypeId": "Infrastructure.Network.SecurityGroup.NSX", "internal": false, "machineIdCollection": null, "ipAddressCollection": null }