{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-virtual-machines/json-schema/microsoft-azure-virtual-machines-capacity-reservation-group-update-schema.json",
  "title": "CapacityReservationGroupUpdate",
  "description": "Specifies information about the capacity reservation group. Only tags can be updated.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-virtual-machines-capacityreservationgroups-api-openapi.yml#/components/schemas/CapacityReservationGroupUpdate",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/CapacityReservationGroupProperties",
      "description": "capacity reservation group Properties.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/UpdateResource"
    }
  ],
  "$defs": {
    "CapacityReservationGroupInstanceView": {
      "type": "object",
      "properties": {
        "capacityReservations": {
          "type": "array",
          "description": "List of instance view of the capacity reservations under the capacity reservation group.",
          "items": {
            "$ref": "#/$defs/CapacityReservationInstanceViewWithName"
          },
          "readOnly": true,
          "x-ms-identifiers": [
            "name"
          ]
        },
        "sharedSubscriptionIds": {
          "type": "array",
          "description": "List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details.",
          "items": {
            "$ref": "#/$defs/SubResourceReadOnly"
          },
          "readOnly": true,
          "x-ms-identifiers": [
            "id"
          ]
        }
      }
    },
    "CapacityReservationGroupProperties": {
      "type": "object",
      "description": "capacity reservation group Properties.",
      "properties": {
        "capacityReservations": {
          "type": "array",
          "description": "A list of all capacity reservation resource ids that belong to capacity reservation group.",
          "items": {
            "$ref": "#/$defs/SubResourceReadOnly"
          },
          "readOnly": true
        },
        "virtualMachinesAssociated": {
          "type": "array",
          "description": "A list of references to all virtual machines associated to the capacity reservation group.",
          "items": {
            "$ref": "#/$defs/SubResourceReadOnly"
          },
          "readOnly": true
        },
        "instanceView": {
          "$ref": "#/$defs/CapacityReservationGroupInstanceView",
          "description": "The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group.",
          "readOnly": true
        },
        "sharingProfile": {
          "$ref": "#/$defs/ResourceSharingProfile",
          "description": "Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can be shared only across subscriptions belonging to the same Microsoft Entra ID tenant. Sharing across tenants is not supported. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details."
        },
        "reservationType": {
          "$ref": "#/$defs/ReservationType",
          "description": "Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations that enable a VM to consume capacity only from this capacity block when it is associated using a capacity reservation group, 'Targeted' for reservations that enable a VM to consume capacity from an explicitly associated capacity reservation group and fall back to the publicly available capacity if the reservation is full, and 'Open' for reservations that a VM consumes when it is eligible from an implicitly associated capacity reservation group with the matching VM size and zone without associating that capacity reservation group and fall back to the publicly available capacity if the reservation is full. The reservation type is immutable and cannot be changed after the capacity reservation group is created."
        }
      }
    },
    "CapacityReservationInstanceView": {
      "type": "object",
      "description": "The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.",
      "properties": {
        "utilizationInfo": {
          "$ref": "#/$defs/CapacityReservationUtilization",
          "description": "Unutilized capacity of the capacity reservation."
        },
        "statuses": {
          "type": "array",
          "description": "The resource status information.",
          "items": {
            "$ref": "#/$defs/InstanceViewStatus"
          },
          "x-ms-identifiers": []
        },
        "reservationStateInfo": {
          "$ref": "#/$defs/CapacityReservationStateInfo",
          "description": "The reservation state information for a capacity reservation, this detail is primarily provided for Future capacity reservations. Minimum API version: 2026-04-01."
        }
      }
    },
    "CapacityReservationInstanceViewWithName": {
      "type": "object",
      "description": "The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the response to the instance view of a capacity reservation group.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the capacity reservation.",
          "readOnly": true
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/CapacityReservationInstanceView"
        }
      ]
    },
    "CapacityReservationStateInfo": {
      "type": "object",
      "description": "Details related to the current state for a Future capacity reservation.",
      "properties": {
        "reservationState": {
          "$ref": "#/$defs/ReservationState",
          "description": "The current state of the capacity reservation."
        }
      }
    },
    "CapacityReservationUtilization": {
      "type": "object",
      "description": "Represents the capacity reservation utilization in terms of resources allocated.",
      "properties": {
        "currentCapacity": {
          "type": "integer",
          "format": "int32",
          "description": "The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.",
          "readOnly": true
        },
        "virtualMachinesAllocated": {
          "type": "array",
          "description": "A list of all virtual machines resource ids allocated against the capacity reservation.",
          "items": {
            "$ref": "#/$defs/SubResourceReadOnly"
          },
          "readOnly": true
        },
        "usedReservedCountBySubscription": {
          "type": "object",
          "description": "For open capacity reservations, this provides a map of the used reserved capacity count keyed by the subscription id (a GUID) that is consuming the capacity, i.e. each entry maps a consuming subscription id to the count of reserved capacity it is currently using. This is populated only for open capacity reservations and is not reported for targeted and block capacity reservations, which instead report allocation through virtualMachinesAllocated. Minimum api-version: 2026-04-01.",
          "additionalProperties": {
            "format": "int32",
            "type": "integer"
          },
          "readOnly": true
        }
      }
    },
    "InstanceViewStatus": {
      "type": "object",
      "description": "Instance view status.",
      "properties": {
        "code": {
          "type": "string",
          "description": "The status code."
        },
        "level": {
          "$ref": "#/$defs/StatusLevelTypes",
          "description": "The level code."
        },
        "displayStatus": {
          "type": "string",
          "description": "The short localizable label for the status."
        },
        "message": {
          "type": "string",
          "description": "The detailed status message, including for alerts and error messages."
        },
        "time": {
          "type": "string",
          "format": "date-time",
          "description": "The time of the status."
        }
      }
    },
    "ReservationState": {
      "type": "string",
      "description": "The current state of a Future capacity reservation.",
      "enum": [
        "Pending",
        "Declined",
        "Approved",
        "FulfillmentFailed",
        "Committed",
        "Live",
        "PartiallyFulfilled"
      ],
      "x-ms-enum": {
        "name": "ReservationState",
        "modelAsString": true,
        "values": [
          {
            "name": "Pending",
            "value": "Pending",
            "description": "The capacity reservation request has been submitted and is awaiting evaluation."
          },
          {
            "name": "Declined",
            "value": "Declined",
            "description": "The capacity reservation request was rejected, and will not change again without user action."
          },
          {
            "name": "Approved",
            "value": "Approved",
            "description": "The capacity reservation request has been approved by Azure and is awaiting fulfillment."
          },
          {
            "name": "FulfillmentFailed",
            "value": "FulfillmentFailed",
            "description": "A failure occurred while attempting to fulfill the capacity reservation request."
          },
          {
            "name": "Committed",
            "value": "Committed",
            "description": "The capacity reservation is locked and cannot be updated or deleted prior to going live."
          },
          {
            "name": "Live",
            "value": "Live",
            "description": "The capacity reservation is active and available for use, and cannot be modified or deleted until the minimum commitment period has elapsed."
          },
          {
            "name": "PartiallyFulfilled",
            "value": "PartiallyFulfilled",
            "description": "Azure was only able to deliver a portion of the requested capacity. The capacity reservation cannot be modified or deleted until the minimum commitment period has elapsed. The portion of fulfilled capacity can be viewed by inspecting the capacity reservation's instance view, displayed as currentCapacity within the utilizationInfo."
          }
        ]
      }
    },
    "ReservationType": {
      "type": "string",
      "description": "Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations that enable a VM to consume capacity only from this capacity block when it is associated using a capacity reservation group, 'Targeted' for reservations that enable a VM to consume capacity from an explicitly associated capacity reservation group and fall back to the publicly available capacity if the reservation is full, and 'Open' for reservations that a VM consumes when it is eligible from an implicitly associated capacity reservation group with the matching VM size and zone without associating that capacity reservation group and fall back to the publicly available capacity if the reservation is full. Future capacity reservations can be created in 'Targeted' or 'Open' capacity reservation groups. The reservation type is immutable and cannot be changed after the capacity reservation group is created.",
      "enum": [
        "Targeted",
        "Block",
        "Open"
      ],
      "x-ms-enum": {
        "name": "ReservationType",
        "modelAsString": true,
        "values": [
          {
            "name": "Targeted",
            "value": "Targeted",
            "description": "Reservations that enable a VM to consume capacity from an explicitly associated capacity reservation group and fall back to the publicly available capacity if the reservation is full."
          },
          {
            "name": "Block",
            "value": "Block",
            "description": "Block capacity reservations that enable a VM to consume capacity only from this capacity block when it is associated using a capacity reservation group."
          },
          {
            "name": "Open",
            "value": "Open",
            "description": "Reservations that a VM consumes when it is eligible from an implicitly associated capacity reservation group with the matching VM size and zone without associating that capacity reservation group, and fall back to the publicly available capacity if the reservation is full. Minimum api-version: 2026-04-01."
          }
        ]
      }
    },
    "ResourceSharingProfile": {
      "type": "object",
      "properties": {
        "subscriptionIds": {
          "type": "array",
          "description": "Specifies an array of subscription resource IDs that capacity reservation group is shared with. Block Capacity Reservations does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details.",
          "items": {
            "$ref": "#/$defs/SubResource"
          }
        }
      }
    },
    "StatusLevelTypes": {
      "type": "string",
      "description": "The level code.",
      "enum": [
        "Info",
        "Warning",
        "Error"
      ],
      "x-ms-enum": {
        "name": "StatusLevelTypes",
        "modelAsString": false
      }
    },
    "SubResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource Id"
        }
      }
    },
    "SubResourceReadOnly": {
      "type": "object",
      "properties": {
        "id": {
          "readOnly": true,
          "type": "string",
          "description": "Resource Id"
        }
      }
    },
    "UpdateResource": {
      "type": "object",
      "description": "The Update Resource model definition.",
      "properties": {
        "tags": {
          "type": "object",
          "description": "Resource tags",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  }
}