Previous Topic: Tag a Managed Device

Next Topic: Examples: HTTP Schema

Remove a Tag from a Managed Device

You can remove the tag on a managed device to remove it from a security group.

Follow these steps:

  1. Get the ID that CA Access Control for Virtual Environments uses for the managed device.

    To get the ID that CA Access Control for Virtual Environments uses for the managed device, use a filter. For example:

    https://hostname:18443/iam/api/1.0/restapi/environments/ac/devices?managed-object-vcenter-uuid=54E79C3A-49D5-4958-A983-8B919F470CEC&managed-object-id=vm-394
    

    Note: In the previous example, you pass the vCenter UUID and the VM UUID, as defined in the VMware Managed Object Browser (MOB).

    You get a response XML document back, similar to the following:

    <Devices>
      <Device>
        <ID>vm-19</ID>
        <ParentID>esx-3</ParentID>
        <Name>ESXi in a box</Name>
        <Type>VirtualMachine</Type>
        <VirtualMachineProperties>
          <ManagedObjectID>vm-394</ManagedObjectID>
          <ManagedObjectVCenterUUID>54E79C3A-49D5-4958-A983-8B919F470CEC</ManagedObjectVCenterUUID>
          <GuestOSVersion>LINUX_REDHAT_5</GuestOSVersion>
          <GuestOSArchitecture>X86</GuestOSArchitecture>
          <GuestOSDescription>Red Hat Enterprise Linux 5 (64-bit)</GuestOSDescription>
        </VirtualMachineProperties>
        <SecurityGroups>
          <SecurityGroup>
            <ID>sg-13</ID>
            <Name>weiig01esxi01.ca.com</Name>
            <Description/>
            <Owner>superadmin</Owner>
          </SecurityGroup>
          <SecurityGroup>
            <ID>sg-15</ID>
            <Name>Discovered virtual machine</Name>
            <Description/>
            <Owner>superadmin</Owner>
          </SecurityGroup>
          <SecurityGroup>
            <ID>sg-22</ID>
            <Name>vSphere in a box</Name>
            <Description/>
            <Owner>superadmin</Owner>
          </SecurityGroup>
        </SecurityGroups>
      </Device>
    </Devices>
    

    The ID of the device is vm-19 as specified in the response XML file.

  2. Update the device and remove the tag, as follows:
    1. Edit the response XML file from Step 1 and remove all content between the <Tags>...</Tags> tags.
    2. Send the updated XML file, using the HTTP PUT command, to the following URL:
      https://<host>:18443/iam/api/1.0/restapi/environments/ac/devices/vm-19