From 992c5121618e37917c0a41314ad5e05dd3534e7f Mon Sep 17 00:00:00 2001 From: Joshua McCarthy Date: Wed, 5 May 2021 16:15:30 -0400 Subject: [PATCH 1/8] Adds base for updating Microsoft.InstanceMetadataService from version stable/2021-01-01 to version 2021-02-01 --- .../2021-02-01/examples/GetAttestedData.json | 15 + .../2021-02-01/examples/GetIdentityInfo.json | 13 + .../2021-02-01/examples/GetIdentityToken.json | 20 + .../examples/GetInstanceMetadata.json | 126 +++ .../stable/2021-02-01/imds.json | 922 ++++++++++++++++++ 5 files changed, 1096 insertions(+) create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json create mode 100644 specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json new file mode 100644 index 000000000000..b71d458e4416 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2021-01-01", + "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/2021-02-01/examples/GetIdentityInfo.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json new file mode 100644 index 000000000000..3692929485e6 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2021-01-01", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "tenantId": "abd8daee-d393-4239-9377-883adda3d40f" + } + } + } +} diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json new file mode 100644 index 000000000000..dc1b4a2f37b1 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2021-01-01", + "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/2021-02-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json new file mode 100644 index 000000000000..24c40f248d83 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json @@ -0,0 +1,126 @@ +{ + "parameters": { + "api-version": "2021-01-01", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "compute": { + "azEnvironment": "AZUREPUBLICCLOUD", + "evictionPolicy": "deallocate", + "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", + "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" + }, + "sku": "Windows-Server-2012-R2-Datacenter", + "storageProfile": { + "dataDisks": [ + { + "caching": "None", + "createOption": "Empty", + "diskSizeGB": "1024", + "image": { + "uri": "" + }, + "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", + "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": "false" + }, + "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" + } + }, + "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", + "vmId": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "vmScaleSetName": "crpteste9vflji9", + "vmSize": "Standard_A3", + "zone": "" + } + } + } + } +} diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json new file mode 100644 index 000000000000..f2bcbd5a39f1 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json @@ -0,0 +1,922 @@ +{ + "swagger": "2.0", + "info": { + "title": "InstanceMetadataClient", + "description": "The Azure Instance Metadata Client", + "version": "2021-01-01" + }, + "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." + }, + "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 in which the VM." + }, + "platformUpdateDomain": { + "type": "string", + "description": "This is the update domain in which the VM." + }, + "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" + }, + "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." + }, + "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." + } + }, + "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" + }, + "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" + } + } + }, + "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" + } + } + } + }, + "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": { + "caching": { + "type": "string", + "description": "This is the caching requirements." + }, + "createOption": { + "type": "string", + "description": "This is information about how the VM was created." + }, + "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" + }, + "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." + }, + "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." + } + } + }, + "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." + } + } + }, + "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", + "enum": [ + "2018-10-01" + ], + "description": "This is the API version to use.", + "required": true, + "x-ms-enum": { + "name": "ApiVersion", + "modelAsString": 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 2e1c9bb275067f2fe020e73c119bf7ff2882de9f Mon Sep 17 00:00:00 2001 From: Joshua McCarthy Date: Wed, 5 May 2021 16:15:51 -0400 Subject: [PATCH 2/8] Updates readme --- specification/imds/data-plane/readme.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/specification/imds/data-plane/readme.md b/specification/imds/data-plane/readme.md index 909b82a53edc..aa69437395ed 100644 --- a/specification/imds/data-plane/readme.md +++ b/specification/imds/data-plane/readme.md @@ -27,9 +27,18 @@ These are the global settings for the Instance Metadata Service API. ``` yaml openapi-type: data-plane azure-arm: false -tag: package-2021-01-01 +tag: package-2021-02 ``` + +### Tag: package-2021-02 + +These settings apply only when `--tag=package-2021-02` is specified on the command line. + +```yaml $(tag) == 'package-2021-02' +input-file: + - Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json +``` ### Tag: package-2018-10-01 These settings apply only when `--tag=package-2018-10-01` is specified on the command line. @@ -416,7 +425,6 @@ directive: - $.definitions.IdentityErrorResponse.properties.error_description ``` - --- # Code Generation From 82cc10aa97514f78d26dce061c07f771baa03203 Mon Sep 17 00:00:00 2001 From: Joshua McCarthy Date: Wed, 5 May 2021 16:15:52 -0400 Subject: [PATCH 3/8] Updates API version in new specs and examples --- .../stable/2021-02-01/examples/GetAttestedData.json | 2 +- .../stable/2021-02-01/examples/GetIdentityInfo.json | 2 +- .../stable/2021-02-01/examples/GetIdentityToken.json | 2 +- .../stable/2021-02-01/examples/GetInstanceMetadata.json | 2 +- .../stable/2021-02-01/imds.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json index b71d458e4416..8d4f2a66be2e 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetAttestedData.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-01-01", + "api-version": "2021-02-01", "nonce": "abcde12345", "Metadata": "true" }, diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json index 3692929485e6..c2cec409204d 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityInfo.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-01-01", + "api-version": "2021-02-01", "Metadata": "true" }, "responses": { diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json index dc1b4a2f37b1..6129f4e4e462 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetIdentityToken.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-01-01", + "api-version": "2021-02-01", "Metadata": "true", "resource": "https://vault.azure.net" }, diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json index 24c40f248d83..e4b233550ccf 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-01-01", + "api-version": "2021-02-01", "Metadata": "true" }, "responses": { diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json index f2bcbd5a39f1..c2d5f578d5e8 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json @@ -3,7 +3,7 @@ "info": { "title": "InstanceMetadataClient", "description": "The Azure Instance Metadata Client", - "version": "2021-01-01" + "version": "2021-02-01" }, "host": "169.254.169.254", "basePath": "/metadata", From e73e256226f5cd9e818fe9510a7a2c94f816bc42 Mon Sep 17 00:00:00 2001 From: jmccarthy Date: Wed, 5 May 2021 16:44:08 -0400 Subject: [PATCH 4/8] Adding swagger for imds version 2021-02-01 --- .../examples/GetInstanceMetadata.json | 3 ++ specification/imds/data-plane/readme.md | 39 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json index e4b233550ccf..de862d190468 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json @@ -41,6 +41,9 @@ } ], "publisher": "RDFE-Test-Microsoft-Windows-Server-Group", + "resourceDisk": { + "size": "4096" + }, "resourceGroupName": "macikgo-test-may-23", "resourceId": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", "securityProfile": { diff --git a/specification/imds/data-plane/readme.md b/specification/imds/data-plane/readme.md index aa69437395ed..5a0bbcc3f4ab 100644 --- a/specification/imds/data-plane/readme.md +++ b/specification/imds/data-plane/readme.md @@ -27,18 +27,9 @@ These are the global settings for the Instance Metadata Service API. ``` yaml openapi-type: data-plane azure-arm: false -tag: package-2021-02 +tag: package-2021-02-01 ``` - -### Tag: package-2021-02 - -These settings apply only when `--tag=package-2021-02` is specified on the command line. - -```yaml $(tag) == 'package-2021-02' -input-file: - - Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json -``` ### Tag: package-2018-10-01 These settings apply only when `--tag=package-2018-10-01` is specified on the command line. @@ -174,6 +165,15 @@ input-file: - Microsoft.InstanceMetadataService/stable/2021-01-01/imds.json ``` +### Tag: package-2021-02-01 + +These settings apply only when `--tag=package-2021-02-01` is specified on the command line. + +``` yaml $(tag) == 'package-2021-02-01' +input-file: + - Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json +``` + ## Suppression ``` yaml @@ -423,6 +423,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/2021-02-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 ``` --- @@ -485,8 +501,7 @@ input-file: - $(this-folder)/Microsoft.InstanceMetadataService/stable/2020-10-01/imds.json - $(this-folder)/Microsoft.InstanceMetadataService/stable/2020-12-01/imds.json - $(this-folder)/Microsoft.InstanceMetadataService/stable/2021-01-01/imds.json - - + - $(this-folder)/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json ``` From eab66a89ea88191c981fc7073b578405b14a0069 Mon Sep 17 00:00:00 2001 From: jmccarthy Date: Thu, 6 May 2021 11:30:42 -0400 Subject: [PATCH 5/8] Adding new blob --- .../stable/2021-02-01/imds.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json index c2d5f578d5e8..a971db0412f2 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json @@ -314,6 +314,16 @@ "type": "string", "description": "This is the publisher of the VM image." }, + "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." + } + } + }, "resourceGroupName": { "type": "string", "description": "This is the resource group for the VM." From 7fc1c11d9ab6f8a8678883be486ca87fa98a2f33 Mon Sep 17 00:00:00 2001 From: jmccarthy Date: Thu, 6 May 2021 17:00:50 -0400 Subject: [PATCH 6/8] Fixing --- .../examples/GetInstanceMetadata.json | 6 +++--- .../stable/2021-02-01/imds.json | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json index de862d190468..62c2943557e0 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/examples/GetInstanceMetadata.json @@ -41,9 +41,6 @@ } ], "publisher": "RDFE-Test-Microsoft-Windows-Server-Group", - "resourceDisk": { - "size": "4096" - }, "resourceGroupName": "macikgo-test-may-23", "resourceId": "/subscriptions/8d10da13-8125-4ba9-a717-bf7490507b3d/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", "securityProfile": { @@ -102,6 +99,9 @@ "uri": "" }, "writeAcceleratorEnabled": "false" + }, + "resourceDisk": { + "size": "4096" } }, "subscriptionId": "8d10da13-8125-4ba9-a717-bf7490507b3d", diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json index a971db0412f2..e4109723312e 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json @@ -314,16 +314,6 @@ "type": "string", "description": "This is the publisher of the VM image." }, - "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." - } - } - }, "resourceGroupName": { "type": "string", "description": "This is the resource group for the VM." @@ -588,6 +578,16 @@ "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." + } + } } } }, From 727efc7e4edea9254446d35b05f33885619c9ec2 Mon Sep 17 00:00:00 2001 From: jmccarthy Date: Wed, 26 May 2021 16:20:50 -0400 Subject: [PATCH 7/8] Spacing --- 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 5a0bbcc3f4ab..05a3ec15a057 100644 --- a/specification/imds/data-plane/readme.md +++ b/specification/imds/data-plane/readme.md @@ -423,7 +423,7 @@ 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/2021-02-01/imds.json From a9d57c4cea2dd6c7a71f8beb1a9c6f8c5d1c4163 Mon Sep 17 00:00:00 2001 From: jmccarthy Date: Wed, 26 May 2021 16:36:08 -0400 Subject: [PATCH 8/8] Prettier --- .../stable/2021-02-01/imds.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json index e4109723312e..1d10d33765d1 100644 --- a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2021-02-01/imds.json @@ -578,10 +578,10 @@ "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.", + "description": "This contains data for the size of local temp disk of the VM, if it exists.", "properties": { "size": { "type": "string",