From b3ab2b4faabe6071e2180e7e003de7a7c790dc18 Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Wed, 1 Nov 2023 15:17:10 -0700 Subject: [PATCH 1/9] Adds base for updating Microsoft.InstanceMetadataService from version stable/2021-12-13 to version 2023-07-01 --- .../2023-07-01/examples/GetAttestedData.json | 15 + .../2023-07-01/examples/GetIdentityInfo.json | 13 + .../2023-07-01/examples/GetIdentityToken.json | 20 + .../examples/GetInstanceMetadata.json | 162 +++ .../stable/2023-07-01/imds.json | 1069 +++++++++++++++++ 5 files changed, 1279 insertions(+) create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json new file mode 100644 index 000000000000..eb1054461afc --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2021-12-13", + "nonce": "abcde12345", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "encoding": "pkcs7", + "signature": "MIID2gYJKoZIhvcNAQcCoIIDyzCCA8cCAQExDzANBgkqhkiG9w0BAQsFADCBggYJKoZIhvcNAQcBoHUEc3sibm9uY2UiOiIxMTExMTExMTExIiwicGxhbiI6eyJuYW1lIjoiIiwicHJvZHVjdCI6IiIsInB1Ymxpc2hlciI6IiJ9LCJ2bUlkIjoiMDJhYWI4YTQtNzRlZi00NzZlLTgxODItZjZkMmJhNDE2NmE2In2gggI/MIICOzCCAaSgAwIBAgIQQWsFjXN35oBJKFXI3QrM3TANBgkqhkiG9w0BAQQFADArMSkwJwYDVQQDEyB0ZXN0c3ViZG9tYWluLm1ldGFkYXRhLmF6dXJlLmNvbTAeFw0xODExMDgxODUzMDRaFw0xODEyMDgxODUzMDNaMCsxKTAnBgNVBAMTIHRlc3RzdWJkb21haW4ubWV0YWRhdGEuYXp1cmUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEi0FVslYnUX+MneC7ERMU4ZM88z4J80r7RPgvzxCPNhXUQlWm3cmVRZMD8kKMv7brkvEsATP7Ak60/I/XEtOga4LGCvMaQa8I/MW8IhSyp2Vj015glAiV8TeUI5DuOIOS96lQvM+G7bt23swkIwVjm1u1ViTZiKKytwpY/EGqzQIDAQABo2AwXjBcBgNVHQEEVTBTgBAt3MRgJmEoUMiPy7k06cLfoS0wKzEpMCcGA1UEAxMgdGVzdHN1YmRvbWFpbi5tZXRhZGF0YS5henVyZS5jb22CEEFrBY1zd+aASShVyN0KzN0wDQYJKoZIhvcNAQEEBQADgYEAd87qiZnRlGIFQ5IEcL/A7ru23WSQAOBsNPt70Fg1GtaEHcYshKUJFhGwXOgZ11cY5wRfrSvEKuzvhAeIZwkvzkBjC04g8sRrjN5leLY5CsKzQhjN52TUMsHhqTM58tfAnICeTddQwn6LOgfqtYH5WO+F/VbFCwPstYUqjmQEYAoxgegwgeUCAQEwPzArMSkwJwYDVQQDEyB0ZXN0c3ViZG9tYWluLm1ldGFkYXRhLmF6dXJlLmNvbQIQQWsFjXN35oBJKFXI3QrM3TANBgkqhkiG9w0BAQsFADANBgkqhkiG9w0BAQEFAASBgCbkRKmQ1MdWZPVOrX7ZBKHQUWPFrQQNdjk3KB67GkY0W0Taxut4K7D2PmiflVEwxB92pTbaZZr/dldu1k1ab1YamHcVYdgZgxIkoOWohGR0ym8oL9JHjFMEqHUbEPtDwE8X+djtDd8TVdb6LYe77IXmz/VaX4whuejlSvQXjaL" + } + } + } +} diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json new file mode 100644 index 000000000000..dfcb511ad730 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2021-12-13", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "tenantId": "abd8daee-d393-4239-9377-883adda3d40f" + } + } + } +} diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json new file mode 100644 index 000000000000..c19f41e4c9ed --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2021-12-13", + "Metadata": "true", + "resource": "https://vault.azure.net" + }, + "responses": { + "200": { + "body": { + "access_token": "dummytoken", + "client_id": "be5947ed-3560-4afe-9504-59967a63f810", + "expires_in": "3599", + "expires_on": "1541705014", + "ext_expires_in": "262800", + "not_before": "1508961830", + "resource": "https://va" + } + } + } +} diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json new file mode 100644 index 000000000000..356b17dbfa78 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json @@ -0,0 +1,162 @@ +{ + "parameters": { + "api-version": "2021-12-13", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "compute": { + "azEnvironment": "AZUREPUBLICCLOUD", + "evictionPolicy": "deallocate", + "extendedLocation": { + "type": "edgeZone", + "name": "microsoftlosangeles" + }, + "isHostCompatibilityLayerVm": "true", + "licenseType": "Windows_Server", + "location": "westus", + "name": "examplevmname", + "offer": "Windows", + "osProfile": { + "adminUsername": "admin", + "computerName": "examplevmname", + "disablePasswordAuthentication": "true" + }, + "osType": "linux", + "placementGroupId": "f67c14ab-e92c-408c-ae2d-da15866ec79a", + "plan": { + "name": "planName", + "product": "planProduct", + "publisher": "planPublisher" + }, + "platformFaultDomain": "36", + "platformSubFaultDomain": "15", + "platformUpdateDomain": "42", + "priority": "Spot", + "provider": "Microsoft.Compute", + "publicKeys": [ + { + "keyData": "ssh-rsa 0", + "path": "/home/user/.ssh/authorized_keys0" + }, + { + "keyData": "ssh-rsa 1", + "path": "/home/user/.ssh/authorized_keys1" + } + ], + "publisher": "RDFE-Test-Microsoft-Windows-Server-Group", + "resourceGroupName": "macikgo-test-may-23", + "resourceId": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", + "securityProfile": { + "secureBootEnabled": "true", + "virtualTpmEnabled": "false", + "encryptionAtHost": "true", + "securityType": "TrustedLaunch" + }, + "hostGroup": { + "id": "testHostGroupId" + }, + "sku": "Windows-Server-2012-R2-Datacenter", + "storageProfile": { + "dataDisks": [ + { + "bytesPerSecondThrottle": "979202048", + "caching": "None", + "createOption": "Empty", + "diskCapacityBytes": "274877906944", + "diskSizeGB": "1024", + "image": { + "uri": "" + }, + "isSharedDisk": "false", + "isUltraDisk": "true", + "lun": "0", + "managedDisk": { + "id": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/disks/exampledatadiskname", + "storageAccountType": "Standard_LRS" + }, + "name": "exampledatadiskname", + "opsPerSecondThrottle": "65280", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + } + ], + "imageReference": { + "id": "", + "offer": "UbuntuServer", + "publisher": "Canonical", + "sku": "16.04.0-LTS", + "version": "latest" + }, + "osDisk": { + "caching": "ReadWrite", + "createOption": "FromImage", + "diskSizeGB": "30", + "diffDiskSettings": { + "option": "Local" + }, + "encryptionSettings": { + "enabled": "true", + "diskEncryptionKey": { + "sourceVault": { + "id": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.KeyVault/vaults/test-kv" + }, + "secretUrl": "https://test-disk.vault.azure.net/secrets/F825A67F-42B8-4F01-8BB5-A99223A9FD05/8e820e1f85be483ab51c028aa710acfc" + }, + "keyEncryptionKey": { + "sourceVault": { + "id": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.KeyVault/vaults/test-kv" + }, + "keyUrl": "https://test-key.vault.azure.net/secrets/F825A67F-42B8-4F01-8BB5-A99223A9FD05/8e820e1f85be483ab51c028aa710acfc" + } + }, + "image": { + "uri": "" + }, + "managedDisk": { + "id": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/disks/exampleosdiskname", + "storageAccountType": "Standard_LRS" + }, + "name": "exampleosdiskname", + "osType": "Linux", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + }, + "resourceDisk": { + "size": "4096" + } + }, + "subscriptionId": "8d10da13-8125-4ba9-a717-bf7490507b3d", + "tags": "baz:bash;foo:bar", + "tagsList": [ + { + "name": "baz", + "value": "bash" + }, + { + "name": "foo", + "value": "bar" + } + ], + "userData": "Zm9vYmFy", + "version": "15.05.22", + "virtualMachineScaleSet": { + "id": "/subscriptions/xxxxxxxx-xxxxx-xxx-xxx-xxxx/resourceGroups/resource-group-name/providers/Microsoft.Compute/virtualMachineScaleSets/virtual-machine-scale-set-name" + }, + "vmId": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "vmScaleSetName": "crpteste9vflji9", + "vmSize": "Standard_A3", + "zone": "", + "additionalCapabilities": { + "hibernationEnabled": "true" + } + } + } + } + } +} diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json new file mode 100644 index 000000000000..a6f8b094654a --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json @@ -0,0 +1,1069 @@ +{ + "swagger": "2.0", + "info": { + "title": "InstanceMetadataClient", + "description": "The Azure Instance Metadata Client", + "version": "2021-12-13" + }, + "host": "169.254.169.254", + "basePath": "/metadata", + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "basic_auth": { + "type": "basic", + "description": "A Basic authentication flow" + } + }, + "paths": { + "/instance": { + "get": { + "operationId": "Instances_GetMetadata", + "description": "Get Instance Metadata for the Virtual Machine.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/MetadataParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Instance" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Instance Metadata for the VM": { + "$ref": "./examples/GetInstanceMetadata.json" + } + } + } + }, + "/attested/document": { + "get": { + "operationId": "Attested_GetDocument", + "description": "Get Attested Data for the Virtual Machine.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "nonce", + "in": "query", + "required": false, + "type": "string", + "description": "This is a string of up to 32 random alphanumeric characters." + }, + { + "$ref": "#/parameters/MetadataParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AttestedData" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Attested Data for the VM": { + "$ref": "./examples/GetAttestedData.json" + } + } + } + }, + "/identity/oauth2/token": { + "get": { + "tags": [ + "Get token" + ], + "description": "Get a Token from Azure AD", + "operationId": "Identity_GetToken", + "produces": [ + "application/json" + ], + "security": [ + {}, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "$ref": "#/parameters/MetadataParameter" + }, + { + "name": "resource", + "in": "query", + "type": "string", + "description": "This is the urlencoded identifier URI of the sink resource for the requested Azure AD token. The resulting token contains the corresponding aud for this resource.", + "required": true + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "client_id", + "in": "query", + "type": "string", + "description": "This identifies, by Azure AD client id, a specific explicit identity to use when authenticating to Azure AD. Mutually exclusive with object_id and msi_res_id.", + "required": false + }, + { + "name": "object_id", + "in": "query", + "type": "string", + "description": "This identifies, by Azure AD object id, a specific explicit identity to use when authenticating to Azure AD. Mutually exclusive with client_id and msi_res_id.", + "required": false + }, + { + "name": "msi_res_id", + "in": "query", + "type": "string", + "description": "This identifies, by urlencoded ARM resource id, a specific explicit identity to use when authenticating to Azure AD. Mutually exclusive with client_id and object_id.", + "required": false + }, + { + "name": "authority", + "in": "query", + "type": "string", + "description": "This indicates the authority to request AAD tokens from. Defaults to the known authority of the identity to be used.", + "required": false + }, + { + "name": "bypass_cache", + "in": "query", + "type": "string", + "enum": [ + "true" + ], + "description": "If provided, the value must be 'true'. This indicates to the server that the token must be retrieved from Azure AD and cannot be retrieved from an internal cache.", + "required": false, + "x-ms-enum": { + "name": "BypassCache", + "modelAsString": true + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/IdentityTokenResponse" + } + }, + "default": { + "headers": { + "Www-Authenticate": { + "type": "string", + "description": "This is the response header containing a challenge for the Basic scheme with a realm value" + } + }, + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Identity Token for the VM": { + "$ref": "./examples/GetIdentityToken.json" + } + } + } + }, + "/identity/info": { + "get": { + "tags": [ + "Get metadata information" + ], + "description": "Get information about AAD Metadata", + "operationId": "Identity_GetInfo", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/MetadataParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/IdentityInfoResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Identity Info for the VM": { + "$ref": "./examples/GetIdentityInfo.json" + } + } + } + } + }, + "definitions": { + "Compute": { + "type": "object", + "properties": { + "azEnvironment": { + "type": "string", + "description": "This is the name of the environment in which the VM is running." + }, + "evictionPolicy": { + "type": "string", + "description": "Describes how the VM will be evicted if space needs to be freed up. Only applicable to Spot VMs. For a non-spot VM, this will be an empty string." + }, + "extendedLocation": { + "type": "object", + "description": "Describes the extended location of the VM", + "$ref": "#/definitions/ExtendedLocationProperties" + }, + "isHostCompatibilityLayerVm": { + "type": "string", + "description": "Identifies if the VM runs on the Host Compatibility Layer." + }, + "licenseType": { + "type": "string", + "description": "Type of license for Azure Hybrid Benefit. Note that this is only present for AHB-enabled VMs." + }, + "location": { + "type": "string", + "description": "This is the Azure Region in which the VM is running." + }, + "name": { + "type": "string", + "description": "This is the name of the VM." + }, + "offer": { + "type": "string", + "description": "This is the offer information for the VM image. This value is only present for images deployed from the Azure Image Gallery." + }, + "osProfile": { + "type": "object", + "description": "This contains the data about the OS.", + "$ref": "#/definitions/OsProfile" + }, + "osType": { + "type": "string", + "description": "This value indicates the type of OS the VM is running, either Linux or Windows." + }, + "placementGroupId": { + "type": "string", + "description": "This is the placement group of your Virtual Machine Scale Set." + }, + "plan": { + "type": "object", + "description": "This contains the data about the plan.", + "$ref": "#/definitions/PlanProperties" + }, + "publicKeys": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicKeysProperties" + }, + "description": "This is information about the SSH certificate" + }, + "platformFaultDomain": { + "type": "string", + "description": "This is the fault domain the VM resides in." + }, + "platformSubFaultDomain": { + "type": "string", + "description": "This is the sub fault domain the VM resides in, if applicable." + }, + "platformUpdateDomain": { + "type": "string", + "description": "This is the update domain the VM resides in." + }, + "priority": { + "type": "string", + "description": "This is the priority of the VM." + }, + "provider": { + "type": "string", + "description": "This is the provider of the VM." + }, + "publisher": { + "type": "string", + "description": "This is the publisher of the VM image." + }, + "resourceGroupName": { + "type": "string", + "description": "This is the resource group for the VM." + }, + "resourceId": { + "type": "string", + "description": "This is the fully qualified ID for the VM." + }, + "securityProfile": { + "description": "This contains the data about the security profile associated with the VM.", + "$ref": "#/definitions/SecurityProfile" + }, + "host": { + "description": "This contains the data about the host of VM.", + "$ref": "#/definitions/Host" + }, + "hostGroup": { + "description": "This contains the data about the host group of VM.", + "$ref": "#/definitions/HostGroup" + }, + "sku": { + "type": "string", + "description": "This is the specific SKU for the VM image." + }, + "storageProfile": { + "type": "object", + "description": "This contains the data about the storage disks associated with the VM.", + "$ref": "#/definitions/StorageProfile" + }, + "subscriptionId": { + "type": "string", + "description": "This is the Azure subscription for the VM." + }, + "tags": { + "type": "string", + "description": "This is the list of tags for your VM." + }, + "tagsList": { + "type": "array", + "items": { + "$ref": "#/definitions/TagsProperties" + }, + "description": "This is the list of tags for your VM formatted as a JSON array for easier programmatic parsing." + }, + "userData": { + "type": "string", + "description": "The set of data specified when the VM was created for use during or after provisioning (Base64 encoded)" + }, + "version": { + "type": "string", + "description": "This is the version of the VM image." + }, + "virtualMachineScaleSet": { + "type": "object", + "description": "Information about the VMSS the VM belongs to (if applicable)", + "$ref": "#/definitions/VirtualMachineScaleSet" + }, + "vmId": { + "type": "string", + "description": "This is the unique identifier for the VM." + }, + "vmScaleSetName": { + "type": "string", + "description": "This is the resource name of the VMSS." + }, + "vmSize": { + "type": "string", + "description": "This is the size of the VM." + }, + "zone": { + "type": "string", + "description": "This is the availability zone of the VM." + }, + "additionalCapabilities": { + "type": "object", + "description": "These are additional capabilities defined for VM.", + "properties": { + "hibernationEnabled": { + "type": "string", + "description": "This specifies if hibernation is enabled for VM." + } + } + } + }, + "description": "Compute Metadata" + }, + "Network": { + "type": "object", + "properties": { + "interface": { + "type": "array", + "description": "This contains data about the network interface.", + "items": { + "type": "object", + "$ref": "#/definitions/NetworkInterface" + } + } + }, + "description": "Network Metadata" + }, + "ExtendedLocationProperties": { + "type": "object", + "description": "Describes the extended location of the VM", + "properties": { + "type": { + "type": "string", + "description": "The type of the extended location of the VM" + }, + "name": { + "type": "string", + "description": "The name of the extended location of the VM" + } + } + }, + "NetworkInterface": { + "type": "object", + "description": "This contains data about the network interface.", + "properties": { + "ipv4": { + "type": "object", + "description": "This contains the IPv4 address.", + "properties": { + "ipAddress": { + "type": "array", + "description": "This is the IP address", + "items": { + "type": "object", + "description": "This contains the IPv4 properties.", + "$ref": "#/definitions/Ipv4Properties" + } + }, + "subnet": { + "type": "array", + "description": "This is the subnet", + "items": { + "type": "object", + "description": "This contains the subnet properties.", + "$ref": "#/definitions/SubnetProperties" + } + } + } + }, + "ipv6": { + "type": "object", + "description": "This contains the IPv6 address.", + "properties": { + "ipAddress": { + "type": "array", + "description": "This is the IP address", + "items": { + "type": "object", + "description": "This contains the IPv6 properties.", + "$ref": "#/definitions/Ipv6Properties" + } + } + } + }, + "macAddress": { + "type": "string", + "description": "This is the MAC address of the interface." + } + } + }, + "OsProfile": { + "type": "object", + "description": "This contains the data about the OS.", + "properties": { + "adminUsername": { + "type": "string", + "description": "This is admin account." + }, + "computerName": { + "type": "string", + "description": "This is the name of the VM." + }, + "disablePasswordAuthentication": { + "type": "string", + "description": "This specifies whether or not password authentication is disabled. Note that this is present only for Linux VMs. For a Windows VM, this value will be the empty string." + } + } + }, + "PlanProperties": { + "type": "object", + "description": "This contains the data about the plan.", + "properties": { + "name": { + "type": "string", + "description": "This is the Plan ID." + }, + "publisher": { + "type": "string", + "description": "This is the publisher ID." + }, + "product": { + "type": "string", + "description": "This is the product of the image from the Marketplace." + } + } + }, + "PublicKeysProperties": { + "type": "object", + "description": "This contains the data about the public key.", + "properties": { + "path": { + "type": "string", + "description": "This specifies the full path on the VM where the SSH public key is stored." + }, + "keyData": { + "type": "string", + "description": "This is the SSH public key certificate used to authenticate with the VM." + } + } + }, + "TagsProperties": { + "type": "object", + "description": "This contains the properties of the tags in a tagsList.", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the tag. It is equivalent to the key in the key-value pair format." + }, + "value": { + "type": "string", + "description": "This is the value of the tag. It is, as expected, equivalent to the value in the key-value pair format." + } + } + }, + "Ipv4Properties": { + "type": "object", + "description": "This contains the IPv4 properties.", + "properties": { + "privateIpAddress": { + "type": "string", + "description": "This is the private IP address assigned to the interface." + }, + "publicIpAddress": { + "type": "string", + "description": "This is the public IP address assigned to the interface." + } + } + }, + "Ipv6Properties": { + "type": "object", + "description": "This contains the IPv6 properties.", + "properties": { + "privateIpAddress": { + "type": "string", + "description": "This is the private IPv6 address assigned to the interface." + } + } + }, + "SubnetProperties": { + "type": "object", + "description": "This contains the properties of the subnet.", + "properties": { + "address": { + "type": "string", + "description": "This is the address range of the subnet." + }, + "prefix": { + "type": "string", + "description": "This is the prefix of the subnet." + } + } + }, + "SecurityProfile": { + "type": "object", + "description": "This contains the data about the security profile associated with the VM.", + "properties": { + "secureBootEnabled": { + "type": "string", + "description": "Identifies if UEFI secure boot is enabled on the VM" + }, + "virtualTpmEnabled": { + "type": "string", + "description": "Identifies if the virtual Trusted Platform Module (TPM) is enabled on the VM" + }, + "encryptionAtHost": { + "type": "string", + "description": "Identifies if encryption at host is enabled on the VM" + }, + "securityType": { + "type": "string", + "description": "Identifies if the VM is a Trusted VM or a Confidential VM" + } + } + }, + "Host": { + "type": "object", + "description": "This contains data about host of VM", + "properties": { + "id": { + "type": "string", + "description": "This is the name of the host of VM. Note that a VM will either have a host or a hostGroup but not both" + } + } + }, + "HostGroup": { + "type": "object", + "description": "This contains data about host group of VM", + "properties": { + "id": { + "type": "string", + "description": "This is the name of the host group of VM. Note that a VM will either have a host or a hostGroup but not both" + } + } + }, + "StorageProfile": { + "type": "object", + "description": "This contains the data about the storage disks associated with the VM.", + "properties": { + "imageReference": { + "type": "object", + "$ref": "#/definitions/ImageReference", + "description": "Image information" + }, + "osDisk": { + "type": "object", + "$ref": "#/definitions/OsDisk", + "description": "OS disk information" + }, + "dataDisks": { + "type": "array", + "description": "Data disk information", + "items": { + "type": "object", + "description": "This contains information about the data disk.", + "$ref": "#/definitions/DataDisk" + } + }, + "resourceDisk": { + "type": "object", + "description": "This contains data for the size of local temp disk of the VM, if it exists.", + "properties": { + "size": { + "type": "string", + "description": "The size of the local temp disk of the VM if it exists, in kilobytes. If the VM has no local temp disk, this value is 0." + } + } + } + } + }, + "ImageReference": { + "type": "object", + "description": "This contains information about the OS image.", + "properties": { + "id": { + "type": "string", + "description": "This is the resource ID." + }, + "offer": { + "type": "string", + "description": "This is the offer of the platform or marketplace image." + }, + "publisher": { + "type": "string", + "description": "This is the image publisher." + }, + "sku": { + "type": "string", + "description": "This is the image SKU." + }, + "version": { + "type": "string", + "description": "This is the version of the platform or marketplace image." + } + } + }, + "OsDisk": { + "type": "object", + "description": "This contains information about the OS disk used by the VM.", + "properties": { + "caching": { + "type": "string", + "description": "This is the caching requirements." + }, + "createOption": { + "type": "string", + "description": "This is information about how the VM was created." + }, + "diffDiskSettings": { + "type": "object", + "description": "This is the ephemeral disk settings.", + "$ref": "#/definitions/DiffDiskSettings" + }, + "diskSizeGB": { + "type": "string", + "description": "This is the size of the disk in GB." + }, + "encryptionSettings": { + "type": "object", + "description": "This is the encryption settings for the disk.", + "$ref": "#/definitions/EncryptionSettings" + }, + "image": { + "type": "object", + "description": "This is the source user image virtual hard disk.", + "$ref": "#/definitions/DiskImage" + }, + "managedDisk": { + "type": "object", + "description": "This is managed disk parameters.", + "$ref": "#/definitions/ManagedDisk" + }, + "name": { + "type": "string", + "description": "This is the disk name." + }, + "osType": { + "type": "string", + "description": "This is the type of OS included in the disk." + }, + "vhd": { + "type": "object", + "description": "This is the virtual hard disk.", + "$ref": "#/definitions/VirtualHardDisk" + }, + "writeAcceleratorEnabled": { + "type": "string", + "description": "This specifies whether or not writeAccelerator is enabled on the disk." + } + } + }, + "DataDisk": { + "type": "object", + "description": "This contains information about the data disk.", + "properties": { + "bytesPerSecondThrottle": { + "type": "string", + "description": "Disk read/write quota in bytes; only populated for Ultra Disks" + }, + "caching": { + "type": "string", + "description": "This is the caching requirements." + }, + "createOption": { + "type": "string", + "description": "This is information about how the VM was created." + }, + "diskCapacityBytes": { + "type": "string", + "description": "Size of disk in bytes; only populated for Ultra Disks" + }, + "diskSizeGB": { + "type": "string", + "description": "This is the size of the disk in GB." + }, + "image": { + "type": "object", + "description": "This is the source user image virtual hard disk.", + "$ref": "#/definitions/DiskImage" + }, + "isSharedDisk": { + "type": "string", + "description": "Identifies if the disk is shared between resources; only populated for Ultra Disks" + }, + "isUltraDisk": { + "type": "string", + "description": "Identifies if the data disk is an Ultra Disk" + }, + "lun": { + "type": "string", + "description": "This is the logical unit number of the disk." + }, + "managedDisk": { + "type": "object", + "description": "This is managed disk parameters.", + "$ref": "#/definitions/ManagedDisk" + }, + "name": { + "type": "string", + "description": "This is the disk name." + }, + "opsPerSecondThrottle": { + "type": "string", + "description": "Disk read/write quota in IOPS; only populated for Ultra Disks" + }, + "vhd": { + "type": "object", + "description": "This is the virtual hard disk.", + "$ref": "#/definitions/VirtualHardDisk" + }, + "writeAcceleratorEnabled": { + "type": "string", + "description": "This specifies whether or not writeAccelerator is enabled on the disk." + } + } + }, + "EncryptionSettings": { + "type": "object", + "description": "This is the encryption settings for the disk.", + "properties": { + "enabled": { + "type": "string", + "description": "This specifies whether or not disk encryption is enabled on the VM." + }, + "diskEncryptionKey": { + "type": "object", + "description": "This is the key used for encrypting the disk.", + "properties": { + "sourceVault": { + "type": "object", + "description": "This specifies keyvault used to store the encryption key.", + "properties": { + "id": { + "type": "string", + "description": "This specifies the resource ID of the keyvault." + } + } + }, + "secretUrl": { + "type": "string", + "description": "This specifies the secret Url of the key stored in keyvault." + } + } + }, + "keyEncryptionKey": { + "type": "object", + "description": "This is the key used for encrypting the disk encryption key.", + "properties": { + "sourceVault": { + "type": "object", + "description": "This specifies keyvault used to store the encryption key.", + "properties": { + "id": { + "type": "string", + "description": "This specifies the resource ID of the keyvault." + } + } + }, + "keyUrl": { + "type": "string", + "description": "This specifies the secret Url of the key stored in keyvault." + } + } + } + } + }, + "DiffDiskSettings": { + "type": "object", + "description": "This is the ephemeral disk settings.", + "properties": { + "option": { + "type": "string", + "description": "This specifies the ephemeral disk settings." + } + } + }, + "DiskImage": { + "type": "object", + "description": "This is the source user image virtual hard disk.", + "properties": { + "uri": { + "type": "string", + "description": "This is the uri of the virtual hard disk." + } + } + }, + "ManagedDisk": { + "type": "object", + "description": "This is managed disk parameters.", + "properties": { + "id": { + "type": "string", + "description": "This is the resource ID." + }, + "storageAccountType": { + "type": "string", + "description": "This is the storage account type for the managed disk." + } + } + }, + "VirtualHardDisk": { + "type": "object", + "description": "This is the virtual hard disk.", + "properties": { + "uri": { + "type": "string", + "description": "This is the uri of the virtual hard disk." + } + } + }, + "VirtualMachineScaleSet": { + "type": "object", + "description": "Information about the VMSS the VM belongs to (if applicable)", + "properties": { + "id": { + "type": "string", + "description": "This is the ID of the VMSS the VM belongs to (if applicable)" + } + } + }, + "ApplicationResponse": { + "type": "string", + "description": "This is a binary string containing the application." + }, + "Instance": { + "type": "object", + "description": "This is the response from the Instance_GetMetadata operation.", + "properties": { + "compute": { + "$ref": "#/definitions/Compute", + "description": "Compute Metadata" + }, + "network": { + "$ref": "#/definitions/Network", + "description": "Network Metadata" + } + } + }, + "AttestedData": { + "type": "object", + "description": "This is the response from the Attested_GetDocument operation.", + "properties": { + "signature": { + "type": "string", + "description": "This is the encoded string containing the VM ID, SKU, plan information, public key, timestamp, and nonce value." + }, + "encoding": { + "type": "string", + "description": "This is the encoding scheme of the signature." + } + } + }, + "ErrorResponse": { + "description": "This is the response from an operation in the case an error occurs.", + "type": "object", + "properties": { + "error": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "IdentityErrorResponse": { + "type": "object", + "description": "This is the response from an Identity operation in the case an error occurs.", + "properties": { + "error": { + "type": "string", + "description": "Error code", + "enum": [ + "invalid_request", + "unauthorized_client", + "access_denied", + "unsupported_response_type", + "invalid_scope", + "server_error", + "service_unavailable", + "bad_request", + "forbidden", + "not_found", + "method_not_allowed", + "too_many_requests" + ], + "x-ms-enum": { + "name": "Error", + "modelAsString": true + } + }, + "error_description": { + "type": "string", + "description": "Error message indicating why the operation failed." + } + } + }, + "IdentityTokenResponse": { + "type": "object", + "description": "This is the response from the Identity_GetToken operation.", + "properties": { + "access_token": { + "type": "string", + "description": "This is the requested access token. The app can use this token to authenticate to the sink resource." + }, + "expires_in": { + "type": "string", + "description": "This is how long the access token is valid (in seconds)." + }, + "expires_on": { + "type": "string", + "description": "This is the time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. This value is used to determine the lifetime of cached tokens." + }, + "ext_expires_in": { + "type": "string", + "description": "This indicates the extended lifetime of the token (in seconds)." + }, + "not_before": { + "type": "string", + "description": "This is the time when the access token becomes effective. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time." + }, + "resource": { + "type": "string", + "description": "This is the app ID URI of the sink resource." + }, + "token_type": { + "type": "string", + "description": "This indicates the token type value." + }, + "client_id": { + "type": "string", + "description": "This is the client_id specified in the request, if any." + }, + "object_id": { + "type": "string", + "description": "This is the object_id specified in the request, if any." + }, + "msi_res_id": { + "type": "string", + "description": "This is the msi_res_id specified in the request, if any." + } + } + }, + "IdentityInfoResponse": { + "type": "object", + "description": "This is the response from the Identity_GetInfo operation.", + "properties": { + "tenantId": { + "type": "string", + "description": "This is the AAD tenantId of the identity of the system assigned managed identity." + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "type": "string", + "description": "Version of the API to be used with the client request.", + "required": true + }, + "MetadataParameter": { + "name": "Metadata", + "in": "header", + "type": "string", + "enum": [ + "true" + ], + "description": "This must be set to 'true'.", + "required": true, + "x-ms-parameter-location": "method" + } + } +} From 9eda263931d985502baf2e03387253737c93d9fd Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Wed, 1 Nov 2023 15:17:14 -0700 Subject: [PATCH 2/9] Updates readme --- specification/imds/data-plane/readme.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/specification/imds/data-plane/readme.md b/specification/imds/data-plane/readme.md index 839fbc43ca2a..4fd8cfb97937 100644 --- a/specification/imds/data-plane/readme.md +++ b/specification/imds/data-plane/readme.md @@ -27,18 +27,27 @@ These are the global settings for the Instance Metadata Service API. ``` yaml openapi-type: data-plane azure-arm: false -tag: package-2021-12-13 +tag: package-2023-07 ``` +### Tag: package-2023-07 + +These settings apply only when `--tag=package-2023-07` is specified on the command line. + +```yaml $(tag) == 'package-2023-07' +input-file: + - Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json +``` ### Tag: package-2021-12-13 These settings apply only when `--tag=package-2021-12-13` is specified on the command line. -```yaml $(tag) == 'package-2021-12-13' +``` yaml $(tag) == 'package-2021-12-13' input-file: - Microsoft.InstanceMetadataService/stable/2021-12-13/imds.json ``` + ### Tag: package-2021-11-15 These settings apply only when `--tag=package-2021-11-15` is specified on the command line. From 380dec57a00df2c527c1f81ab06227543cf45b34 Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Wed, 1 Nov 2023 15:17:17 -0700 Subject: [PATCH 3/9] Updates API version in new specs and examples --- .../stable/2023-07-01/examples/GetAttestedData.json | 2 +- .../stable/2023-07-01/examples/GetIdentityInfo.json | 2 +- .../stable/2023-07-01/examples/GetIdentityToken.json | 2 +- .../stable/2023-07-01/examples/GetInstanceMetadata.json | 2 +- .../stable/2023-07-01/imds.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json index eb1054461afc..3419fd2a3ab9 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetAttestedData.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-12-13", + "api-version": "2023-07-01", "nonce": "abcde12345", "Metadata": "true" }, diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json index dfcb511ad730..b8f7b4e7999b 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityInfo.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-12-13", + "api-version": "2023-07-01", "Metadata": "true" }, "responses": { diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json index c19f41e4c9ed..a31845ca0e7e 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetIdentityToken.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-12-13", + "api-version": "2023-07-01", "Metadata": "true", "resource": "https://vault.azure.net" }, diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json index 356b17dbfa78..55b33f8393ca 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-12-13", + "api-version": "2023-07-01", "Metadata": "true" }, "responses": { diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json index a6f8b094654a..88cfa15864f3 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json @@ -3,7 +3,7 @@ "info": { "title": "InstanceMetadataClient", "description": "The Azure Instance Metadata Client", - "version": "2021-12-13" + "version": "2023-07-01" }, "host": "169.254.169.254", "basePath": "/metadata", From a7c4ff44f44e497e12bf5120704a6e0530065bd5 Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Thu, 2 Nov 2023 21:07:54 +0000 Subject: [PATCH 4/9] Update new fields and add `GetVersions.json`. --- .../examples/GetInstanceMetadata.json | 5 ++- .../2023-07-01/examples/GetVersions.json | 35 +++++++++++++++++++ .../stable/2023-07-01/imds.json | 12 +++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json index 55b33f8393ca..9ec6f0940bd3 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetInstanceMetadata.json @@ -89,7 +89,10 @@ "offer": "UbuntuServer", "publisher": "Canonical", "sku": "16.04.0-LTS", - "version": "latest" + "version": "latest", + "communityGalleryImageId": "/CommunityGalleries/akstestgallery-ab568100-7a05-4b31-9f7d-3aede6df4420/Images/1804Gen2/Versions/latest", + "sharedGalleryImageId": "/SharedGalleries/CblMariner.1P.Canary/Images/cbl-mariner-2-gen2/Versions/latest", + "exactVersion": "1.1686127202.30113" }, "osDisk": { "caching": "ReadWrite", diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json new file mode 100644 index 000000000000..822a1bef04f7 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json @@ -0,0 +1,35 @@ +{ + "apiVersions": [ + "2017-03-01", + "2017-04-02", + "2017-08-01", + "2017-10-01", + "2017-12-01", + "2018-02-01", + "2018-04-02", + "2018-10-01", + "2019-02-01", + "2019-03-11", + "2019-04-30", + "2019-06-01", + "2019-06-04", + "2019-08-01", + "2019-08-15", + "2019-11-01", + "2020-06-01", + "2020-07-15", + "2020-09-01", + "2020-10-01", + "2020-12-01", + "2021-01-01", + "2021-02-01", + "2021-03-01", + "2021-05-01", + "2021-08-01", + "2021-10-01", + "2021-11-01", + "2021-11-15", + "2021-12-13", + "2023-07-01" + ] +} \ No newline at end of file diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json index 88cfa15864f3..66ceacfe3df7 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json @@ -688,6 +688,18 @@ "version": { "type": "string", "description": "This is the version of the platform or marketplace image." + }, + "communityGalleryImageId": { + "type": "string", + "description": "This is the resource ID when using a community image." + }, + "sharedGalleryImageId": { + "type": "string", + "description": "This is the resource ID when using a direct shared image." + }, + "exactVersion": { + "type": "string", + "description": "This is the version of the community or direct shared image." } } }, From eb0a2833d7de4e2b43a7e3140cbcff76e89e83cc Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Thu, 2 Nov 2023 21:48:17 +0000 Subject: [PATCH 5/9] Fix version, add new path, fix `GetVersions.json`. --- .../2023-07-01/examples/GetVersions.json | 76 +++++++++++-------- .../stable/2023-07-01/imds.json | 32 ++++++++ specification/imds/data-plane/readme.md | 23 +++++- 3 files changed, 95 insertions(+), 36 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json index 822a1bef04f7..e2631b5492d1 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json @@ -1,35 +1,45 @@ { - "apiVersions": [ - "2017-03-01", - "2017-04-02", - "2017-08-01", - "2017-10-01", - "2017-12-01", - "2018-02-01", - "2018-04-02", - "2018-10-01", - "2019-02-01", - "2019-03-11", - "2019-04-30", - "2019-06-01", - "2019-06-04", - "2019-08-01", - "2019-08-15", - "2019-11-01", - "2020-06-01", - "2020-07-15", - "2020-09-01", - "2020-10-01", - "2020-12-01", - "2021-01-01", - "2021-02-01", - "2021-03-01", - "2021-05-01", - "2021-08-01", - "2021-10-01", - "2021-11-01", - "2021-11-15", - "2021-12-13", - "2023-07-01" - ] + "parameters": { + "api-version": "2023-07-01", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "apiVersions": [ + "2017-03-01", + "2017-04-02", + "2017-08-01", + "2017-10-01", + "2017-12-01", + "2018-02-01", + "2018-04-02", + "2018-10-01", + "2019-02-01", + "2019-03-11", + "2019-04-30", + "2019-06-01", + "2019-06-04", + "2019-08-01", + "2019-08-15", + "2019-11-01", + "2020-06-01", + "2020-07-15", + "2020-09-01", + "2020-10-01", + "2020-12-01", + "2021-01-01", + "2021-02-01", + "2021-03-01", + "2021-05-01", + "2021-08-01", + "2021-10-01", + "2021-11-01", + "2021-11-15", + "2021-12-13", + "2023-07-01" + ] + } + } + } } \ No newline at end of file diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json index 66ceacfe3df7..09ae65efac1d 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json @@ -24,6 +24,31 @@ } }, "paths": { + "/versions": { + "get": { + "operationId": "GetVersions", + "description": "Get supported API versions.", + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Versions" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Supported API Versions": { + "$ref": "./examples/GetVersions.json" + } + } + } + }, "/instance": { "get": { "operationId": "Instances_GetMetadata", @@ -1056,6 +1081,13 @@ "description": "This is the AAD tenantId of the identity of the system assigned managed identity." } } + }, + "Versions": { + "type": "array", + "description": "This is the set of supported API versions.", + "items": { + "type": "string" + } } }, "parameters": { diff --git a/specification/imds/data-plane/readme.md b/specification/imds/data-plane/readme.md index 4fd8cfb97937..810af2f744c5 100644 --- a/specification/imds/data-plane/readme.md +++ b/specification/imds/data-plane/readme.md @@ -27,13 +27,13 @@ These are the global settings for the Instance Metadata Service API. ``` yaml openapi-type: data-plane azure-arm: false -tag: package-2023-07 +tag: package-2023-07-01 ``` -### Tag: package-2023-07 +### Tag: package-2023-07-01 -These settings apply only when `--tag=package-2023-07` is specified on the command line. +These settings apply only when `--tag=package-2023-07-01` is specified on the command line. ```yaml $(tag) == 'package-2023-07' input-file: @@ -648,6 +648,22 @@ directive: - $.definitions.IdentityTokenResponse.properties.object_id - $.definitions.IdentityTokenResponse.properties.msi_res_id - $.definitions.IdentityErrorResponse.properties.error_description + + - suppress: DefinitionsPropertiesNamesCamelCase + reason: The following properties follow the Oath2 spec, which does not use camelCase. + from: Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json + where: + - $.definitions.IdentityTokenResponse.properties.access_token + - $.definitions.IdentityTokenResponse.properties.expires_in + - $.definitions.IdentityTokenResponse.properties.expires_on + - $.definitions.IdentityTokenResponse.properties.ext_expires_in + - $.definitions.IdentityTokenResponse.properties.not_before + - $.definitions.IdentityTokenResponse.properties.resource + - $.definitions.IdentityTokenResponse.properties.token_type + - $.definitions.IdentityTokenResponse.properties.client_id + - $.definitions.IdentityTokenResponse.properties.object_id + - $.definitions.IdentityTokenResponse.properties.msi_res_id + - $.definitions.IdentityErrorResponse.properties.error_description ``` --- @@ -703,6 +719,7 @@ input-file: - $(this-folder)/Microsoft.InstanceMetadataService/stable/2021-11-01/imds.json - $(this-folder)/Microsoft.InstanceMetadataService/stable/2021-11-15/imds.json - $(this-folder)/Microsoft.InstanceMetadataService/stable/2021-12-13/imds.json + - $(this-folder)/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json ``` If there are files that should not be in the `all-api-versions` set, From b9257795780c71aebffd027d628192e102106432 Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Thu, 2 Nov 2023 22:17:21 +0000 Subject: [PATCH 6/9] Temp fix. --- .../stable/2023-07-01/imds.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json index 09ae65efac1d..5c2c583f4f97 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json @@ -32,7 +32,10 @@ "200": { "description": "Successful operation", "schema": { - "$ref": "#/definitions/Versions" + "type": "array", + "items": { + "type": "string" + } } }, "default": { @@ -1081,13 +1084,6 @@ "description": "This is the AAD tenantId of the identity of the system assigned managed identity." } } - }, - "Versions": { - "type": "array", - "description": "This is the set of supported API versions.", - "items": { - "type": "string" - } } }, "parameters": { From 2400c2cc33b6190beb9eeeb67a9e2a957a274f6d Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Thu, 2 Nov 2023 16:02:30 -0700 Subject: [PATCH 7/9] Prettier format fix. --- .../stable/2023-07-01/examples/GetVersions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json index e2631b5492d1..746821ab964e 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/examples/GetVersions.json @@ -42,4 +42,4 @@ } } } -} \ No newline at end of file +} From feccbbd6b2ca38a452409ec10f73bd8226b7827e Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Fri, 3 Nov 2023 21:32:05 +0000 Subject: [PATCH 8/9] Minor fix. --- specification/imds/data-plane/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/imds/data-plane/readme.md b/specification/imds/data-plane/readme.md index 810af2f744c5..f84cbd46f820 100644 --- a/specification/imds/data-plane/readme.md +++ b/specification/imds/data-plane/readme.md @@ -35,7 +35,7 @@ tag: package-2023-07-01 These settings apply only when `--tag=package-2023-07-01` is specified on the command line. -```yaml $(tag) == 'package-2023-07' +```yaml $(tag) == 'package-2023-07-01' input-file: - Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json ``` From d94998b90b2cd9e070ee0d34d5013f97f945c4d1 Mon Sep 17 00:00:00 2001 From: Haofeng Xie Date: Tue, 7 Nov 2023 19:56:45 +0000 Subject: [PATCH 9/9] Fix wrong schema for `/versions` endpoint. --- .../stable/2023-07-01/imds.json | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json index 5c2c583f4f97..f550a71d905e 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2023-07-01/imds.json @@ -32,10 +32,7 @@ "200": { "description": "Successful operation", "schema": { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/definitions/Versions" } }, "default": { @@ -1084,6 +1081,19 @@ "description": "This is the AAD tenantId of the identity of the system assigned managed identity." } } + }, + "Versions": { + "type": "object", + "description": "This is the response from the GetVersions operation.", + "properties": { + "apiVersions": { + "type": "array", + "description": "List of API versions supported.", + "items": { + "type": "string" + } + } + } } }, "parameters": {