tgt interface — VMware Salt for VCF Components API

tgt interface — VMware Salt for VCF Components API

tgt interface

The tgt (Target) interface manages dynamic grouping constraints based on component grain tags. It allows you to create, search, and update saved target groups (e.g., "All vCenter Instances") that can be referenced dynamically during job executions to ensure the correct endpoints are addressed.

get_tgts(tgt_uuid: uuid.UUID | None, name: str | None, desc: str | None, sort_by: str | None, reverse: bool | None, limit: int | None = 50, page: int | None)
Returns: <class 'dict'>

Get target groups by UUID or search target groups.

For more information on target groups, see the VMware Salt for VCF Components API documentation on Broadcom's TechDocs.

Example:
curl -k -X POST "https://<vcfms-hostname>/raas/rpc" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <jwt_token>" \
  -d '{
    "resource": "tgt",
    "method": "get_tgts",
    "kwarg": {
      "limit": 50
    }
  }'
save_tgt(name: str | None, desc: str | None, tgt: dict | None, tgt_uuid: uuid.UUID | None)
Returns: <class 'str'>

Create or update a target group.

For more information on target groups, see the VMware Salt for VCF Components API documentation on Broadcom's TechDocs.

Example:
curl -k -X POST "https://<vcfms-hostname>/raas/rpc" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <jwt_token>" \
  -d '{
    "resource": "tgt",
    "method": "save_tgt",
    "kwarg": {
      "name": "Global vCenters",
      "desc": "Dynamically target all vCenter instances",
      "tgt": {
        "*": {
          "tgt_type": "compound",
          "tgt": "G@vcfops_resource_kind:vcenter"
        }
      }
    }
  }'