{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-compute-engine/json-schema/google-cloud-compute-engine-capacity-advice-request-schema.json",
  "title": "CapacityAdviceRequest",
  "description": "A request to provide Assistant Scores. These scores determine VM\nobtainability and preemption likelihood.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-compute-engine-advice-api-openapi.yml#/components/schemas/CapacityAdviceRequest",
  "properties": {
    "size": {
      "type": "integer",
      "description": "The number of VM instances to request.",
      "format": "int32"
    },
    "distributionPolicy": {
      "$ref": "#/$defs/CapacityAdviceRequestDistributionPolicy",
      "description": "Policy specifying the distribution of instances across\nzones within the requested region."
    },
    "instanceProperties": {
      "$ref": "#/$defs/CapacityAdviceRequestInstanceProperties",
      "description": "Instance properties for this request."
    },
    "instanceFlexibilityPolicy": {
      "$ref": "#/$defs/CapacityAdviceRequestInstanceFlexibilityPolicy",
      "description": "Policy for instance selectors."
    }
  },
  "type": "object",
  "$defs": {
    "AcceleratorConfig": {
      "type": "object",
      "properties": {
        "acceleratorCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of the guest accelerator cards exposed to this instance."
        },
        "acceleratorType": {
          "description": "Full or partial URL of the accelerator type resource to attach to this\ninstance. For example:projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100\nIf you are creating an instance template, specify only the\naccelerator name.\nSee GPUs on Compute Engine\nfor a full list of accelerator types.",
          "type": "string"
        }
      },
      "description": "A specification of the type and number of accelerator cards attached to the\ninstance."
    },
    "CapacityAdviceRequestDistributionPolicy": {
      "properties": {
        "targetShape": {
          "description": "Target distribution shape. You can specify the following values:ANY, ANY_SINGLE_ZONE, or BALANCED.",
          "enum": [
            "ANY",
            "ANY_SINGLE_ZONE",
            "BALANCED",
            "TARGET_SHAPE_UNSPECIFIED"
          ],
          "type": "string"
        },
        "zones": {
          "description": "Zones where Capacity Advisor looks for capacity.",
          "items": {
            "$ref": "#/$defs/CapacityAdviceRequestDistributionPolicyZoneConfiguration"
          },
          "type": "array"
        }
      },
      "description": "Distribution policy.",
      "type": "object"
    },
    "CapacityAdviceRequestDistributionPolicyZoneConfiguration": {
      "type": "object",
      "description": "Zone configuration for the distribution policy.",
      "properties": {
        "zone": {
          "type": "string",
          "description": "The URL of the zone. It can be a\npartial or full URL. For example, the following are valid values: \n   \n   \n     - https://www.googleapis.com/compute/v1/projects/project/zones/zone \n   - projects/project/zones/zone \n   - zones/zone"
        }
      }
    },
    "CapacityAdviceRequestInstanceFlexibilityPolicy": {
      "properties": {
        "instanceSelections": {
          "additionalProperties": {
            "$ref": "#/$defs/CapacityAdviceRequestInstanceFlexibilityPolicyInstanceSelection"
          },
          "type": "object",
          "description": "Named instance selections to configure properties.\nThe key is an arbitrary, unique RFC1035 string that identifies the\ninstance selection."
        }
      },
      "description": "Specification of alternative, flexible instance configurations.",
      "type": "object"
    },
    "CapacityAdviceRequestInstanceFlexibilityPolicyInstanceSelection": {
      "type": "object",
      "properties": {
        "guestAccelerators": {
          "items": {
            "$ref": "#/$defs/AcceleratorConfig"
          },
          "type": "array",
          "description": "Accelerators configuration."
        },
        "disks": {
          "items": {
            "$ref": "#/$defs/CapacityAdviceRequestInstanceFlexibilityPolicyInstanceSelectionAttachedDisk"
          },
          "type": "array",
          "description": "Local SSDs."
        },
        "machineTypes": {
          "description": "Full machine-type names, e.g. \"n1-standard-16\".",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "description": "Machine specification."
    },
    "CapacityAdviceRequestInstanceFlexibilityPolicyInstanceSelectionAttachedDisk": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Specifies the type of the disk.",
          "enum": [
            "DISK_TYPE_UNSPECIFIED",
            "SCRATCH"
          ]
        }
      },
      "description": "Attached disk configuration."
    },
    "CapacityAdviceRequestInstanceProperties": {
      "description": "Instance provisioning properties.",
      "type": "object",
      "properties": {
        "scheduling": {
          "$ref": "#/$defs/CapacityAdviceRequestInstancePropertiesScheduling",
          "description": "Specifies the scheduling options."
        }
      }
    },
    "CapacityAdviceRequestInstancePropertiesScheduling": {
      "description": "Defines the instance scheduling options.",
      "properties": {
        "provisioningModel": {
          "type": "string",
          "description": "Specifies the provisioning model.",
          "enum": [
            "FLEX_START",
            "RESERVATION_BOUND",
            "SPOT",
            "STANDARD"
          ]
        }
      },
      "type": "object"
    }
  }
}