{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/turbonomic/json-schema/turbonomic-policy-api-dto-schema.json",
  "title": "PolicyApiDTO",
  "description": "Model to describe a Workload policy, used to manage the entities in the Environment. e.g. Restrict the number of VMs that can use a given datastore, Limit VM mobility by restricting a collection of VMs to a specified cluster or group of hosts, Expand VM mobility by merging a number of clusters, Keep workload running on hosts that have the required licenses",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/turbonomic-openapi.yml#/components/schemas/PolicyApiDTO",
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Link"
      }
    },
    "uuid": {
      "type": "string"
    },
    "displayName": {
      "type": "string",
      "description": "A user readable name of the api object.\nCannot be blank.\nThe UTF-8 encoding must be at most 255 bytes."
    },
    "className": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "description": "Placement Policy Type",
      "enum": [
        "AT_MOST_N",
        "BIND_TO_GROUP",
        "BIND_TO_COMPLEMENTARY_GROUP",
        "MUST_RUN_TOGETHER",
        "AT_MOST_N_BOUND",
        "MERGE",
        "BIND_TO_GROUP_AND_LICENSE",
        "MUST_NOT_RUN_TOGETHER",
        "EXCLUSIVE_BIND_TO_GROUP"
      ]
    },
    "name": {
      "type": "string",
      "description": "Name of the policy"
    },
    "enabled": {
      "type": "boolean",
      "description": "Shows if the policy is enabled"
    },
    "capacity": {
      "type": "integer",
      "format": "int32",
      "description": "Indicate the max workload entities at the same time per placement entites, used when type is AT_MOST_N_BOUND"
    },
    "commodityType": {
      "type": "string",
      "description": "Commodity type used for the policy"
    },
    "mergeType": {
      "type": "string",
      "description": "Type of Group that is merged, used only when type is MERGE",
      "enum": [
        "Cluster",
        "StorageCluster",
        "DataCenter",
        "DesktopPool"
      ]
    },
    "consumerGroup": {
      "$ref": "#/$defs/BaseApiDTO"
    },
    "providerGroup": {
      "$ref": "#/$defs/BaseApiDTO"
    },
    "mergeGroups": {
      "type": "array",
      "description": "List of Groups to merge, used when type is MERGE",
      "items": {
        "$ref": "#/$defs/BaseApiDTO"
      }
    },
    "providerEntityType": {
      "type": "string",
      "description": "The entity type for the provider. This property is only applicable when policy type is set to MUST_RUN_TOGETHER or MUST_NOT_RUN_TOGETHER. When policy type is set to MUST_RUN_TOGETHER or MUST_NOT_RUN_TOGETHER, this field  should be set with type of provider where members of consumer group must run or must not run together on it depending on the policy type.",
      "enum": [
        "Application",
        "ApplicationComponent",
        "ApplicationServer",
        "AvailabilityZone",
        "BusinessAccount",
        "BusinessApplication",
        "BusinessTransaction",
        "BusinessUser",
        "Chassis",
        "CloudService",
        "ComputeTier",
        "Container",
        "ContainerPod",
        "ContainerSpec",
        "Database",
        "DatabaseServer",
        "DatabaseServerTier",
        "DatabaseTier",
        "DataCenter",
        "DesktopPool",
        "DiskArray",
        "DPod",
        "HCIPhysicalMachine",
        "HypervisorServer",
        "Internet",
        "IOModule",
        "LoadBalancer",
        "LogicalPool",
        "Namespace",
        "Network",
        "Numa",
        "PhysicalMachine",
        "ProcessorPool",
        "Project",
        "Region",
        "Repository",
        "ReservedInstance",
        "Service",
        "ServiceProvider",
        "Storage",
        "StorageController",
        "StorageProvisioner",
        "StoragePool",
        "StorageVolumeController",
        "StorageTier",
        "Switch",
        "Unknown",
        "ViewPod",
        "VirtualApplication",
        "VirtualDataCenter",
        "VirtualMachine",
        "VirtualVolume",
        "VPod",
        "WebServer",
        "WorkloadController",
        "ContainerPlatformCluster",
        "CloudCommitment",
        "ApplicationComponentSpec",
        "VirtualMachineSpec",
        "DocumentCollection",
        "NodeGroup",
        "PowerVMPhysicalMachine",
        "DataWarehouse",
        "DataWarehouseTier",
        "ClusterEntity",
        "DatabaseServerCluster",
        "DatabaseServerSpec",
        "DataLakehouse",
        "ContainerizedVirtualMachine",
        "GuestVirtualMachine",
        "Image"
      ]
    },
    "enableCreateResourcePool": {
      "type": "boolean",
      "description": "Enable create resource pool during cross VM moves, used when type is any but MERGE.When enabled resource pool, of which VM is part of at source , is created in destination if it does not exists in destination during a cross cluster or vcenter VM move.By default this is disabled(false)"
    },
    "createdAt": {
      "type": "integer",
      "format": "int64",
      "description": "The time at which the policy was created, in epoch seconds"
    },
    "updatedAt": {
      "type": "integer",
      "format": "int64",
      "description": "The time at which the policy was last updated, in epoch seconds"
    },
    "createdBy": {
      "type": "integer",
      "format": "int64",
      "description": "The OID of the user who created this policy"
    },
    "updatedBy": {
      "type": "integer",
      "format": "int64",
      "description": "The OID of the user who last updated this policy"
    },
    "description": {
      "type": "string",
      "description": "Description of the placement policy"
    }
  },
  "$defs": {
    "BaseApiDTO": {
      "type": "object",
      "properties": {
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Link"
          }
        },
        "uuid": {
          "type": "string"
        },
        "displayName": {
          "type": "string",
          "description": "A user readable name of the api object.\nCannot be blank.\nThe UTF-8 encoding must be at most 255 bytes."
        },
        "className": {
          "type": "string"
        }
      },
      "description": "Basic information of an entity"
    },
    "Link": {
      "type": "object",
      "properties": {
        "rel": {
          "$ref": "#/$defs/LinkRelation"
        },
        "href": {
          "type": "string",
          "readOnly": true
        },
        "hreflang": {
          "type": "string",
          "readOnly": true
        },
        "media": {
          "type": "string",
          "readOnly": true
        },
        "title": {
          "type": "string",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "readOnly": true
        },
        "deprecation": {
          "type": "string",
          "readOnly": true
        },
        "profile": {
          "type": "string",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "readOnly": true
        }
      }
    },
    "LinkRelation": {
      "type": "object"
    }
  }
}