diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getattesteddata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getattesteddata.json new file mode 100644 index 000000000000..f263d37ed78f --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getattesteddata.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "api-version": "2018-10-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" + } + }, + "400": { + "body": { + "error": "Bad request" + } + }, + "403": { + "body": { + "error": "Forbidden" + } + }, + "404": { + "body": { + "error": "Not found" + } + }, + "405": { + "body": { + "error": "Not allowed" + } + }, + "429": { + "body": { + "error": "Too many requests" + } + }, + "503": { + "body": { + "error": "Service unavailable" + } + }, + "500": { + "body": { + "error": "Server error" + } + } + } +} \ No newline at end of file diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getidentityinfo.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getidentityinfo.json new file mode 100644 index 000000000000..e0857d0bceb9 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getidentityinfo.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "api-version": "2018-10-01", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "tenantId": "abd8daee-d393-4239-9377-883adda3d40f" + } + }, + "400": { + "body": { + "error": "invalid_request", + "error_description": "Bad request" + } + }, + "404": { + "body": { + "error": "not_found", + "error_description": "Not found" + } + }, + "405": { + "body": { + "error": "method_not_allowed", + "error_description": "Not allowed" + } + }, + "429": { + "body": { + "error": "too_many_requests", + "error_description": "Too many requests" + } + }, + "500": { + "body": { + "error": "server_error", + "error_description": "Server error" + } + } + } +} \ No newline at end of file diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getidentitytoken.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getidentitytoken.json new file mode 100644 index 000000000000..0cf1fd061608 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getidentitytoken.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "api-version": "2018-10-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" + } + }, + "400": { + "body": { + "error": "invalid_request", + "error_description": "Bad request" + } + }, + "404": { + "body": { + "error": "not_found", + "error_description": "Not found" + } + }, + "405": { + "body": { + "error": "method_not_allowed", + "error_description": "Not allowed" + } + }, + "429": { + "body": { + "error": "too_many_requests", + "error_description": "Too many requests" + } + }, + "500": { + "body": { + "error": "server_error", + "error_description": "Server error" + } + } + } +} \ No newline at end of file diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getinstancemetadata.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getinstancemetadata.json new file mode 100644 index 000000000000..c5f5cb36b8f3 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/examples/getinstancemetadata.json @@ -0,0 +1,82 @@ +{ + "parameters": { + "api-version": "2018-10-01", + "Metadata": "true" + }, + "responses": { + "200": { + "body": { + "compute": { + "azEnvironment": "AZUREPUBLICCLOUD", + "location": "westus", + "name": "examplevmname", + "offer": "Windows", + "osType": "linux", + "placementGroupId": "f67c14ab-e92c-408c-ae2d-da15866ec79a", + "plan": { + "name": "planName", + "product": "planProduct", + "publisher": "planPublisher" + }, + "platformFaultDomain": "36", + "platformUpdateDomain": "42", + "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", + "sku": "Windows-Server-2012-R2-Datacenter", + "subscriptionId": "8d10da13-8125-4ba9-a717-bf7490507b3d", + "tags": "baz:bash;foo:bar", + "version": "15.05.22", + "vmId": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "vmScaleSetName": "crpteste9vflji9", + "vmSize": "Standard_A3", + "zone": "" + } + } + }, + "400": { + "body": { + "error": "Bad request" + } + }, + "403": { + "body": { + "error": "Forbidden" + } + }, + "404": { + "body": { + "error": "Not found" + } + }, + "405": { + "body": { + "error": "Not allowed" + } + }, + "429": { + "body": { + "error": "Too many requests" + } + }, + "503": { + "body": { + "error": "Service unavailable" + } + }, + "500": { + "body": { + "error": "Server error" + } + } + } +} \ No newline at end of file diff --git a/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/imds.json b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/imds.json new file mode 100644 index 000000000000..ecd501259644 --- /dev/null +++ b/specification/imds/data-plane/Microsoft.InstanceMetadataService/stable/2018-10-01/imds.json @@ -0,0 +1,765 @@ +{ + "swagger": "2.0", + "info": { + "title": "InstanceMetadataClient", + "description": "The Azure Instance Metadata Client", + "version": "2018-10-01" + }, + "host": "169.254.169.254", + "basePath": "/metadata", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "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" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "405": { + "description": "Method not allowed", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Server error", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "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" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "405": { + "description": "Method not allowed", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Server error", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "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" + ], + "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" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "405": { + "description": "Method not allowed", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "500": { + "description": "Server error", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "default": { + "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" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "405": { + "description": "Method not allowed", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "500": { + "description": "Server error", + "schema": { + "$ref": "#/definitions/IdentityErrorResponse" + } + }, + "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." + }, + "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." + }, + "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." + }, + "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." + }, + "sku": { + "type": "string", + "description": "This is the specific SKU for the VM image." + }, + "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." + }, + "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." + } + } + }, + "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." + } + } + }, + "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." + } + } + }, + "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, 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." + }, + "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 caller." + } + } + } + }, + "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" + } + } +} \ No newline at end of file diff --git a/specification/imds/data-plane/readme.csharp.md b/specification/imds/data-plane/readme.csharp.md new file mode 100644 index 000000000000..20481e7f6788 --- /dev/null +++ b/specification/imds/data-plane/readme.csharp.md @@ -0,0 +1,20 @@ +# C# Storage + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for IMDS. + +## Common C# Settings + +``` yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + clear-output-folder: true +``` + +``` yaml $(csharp) && !$(multiapi) && !$(profile) +payload-flattening-threshold: 2 +namespace: Microsoft.Azure.InstanceMetadataService +output-folder: $(csharp-sdks-folder)/Azure/InstanceMetadataService/Generated +``` diff --git a/specification/imds/data-plane/readme.go.md b/specification/imds/data-plane/readme.go.md new file mode 100644 index 000000000000..a805b79cf2ba --- /dev/null +++ b/specification/imds/data-plane/readme.go.md @@ -0,0 +1,10 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +``` yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: storage + clear-output-folder: true +``` diff --git a/specification/imds/data-plane/readme.md b/specification/imds/data-plane/readme.md new file mode 100644 index 000000000000..246faba00e21 --- /dev/null +++ b/specification/imds/data-plane/readme.md @@ -0,0 +1,73 @@ +# Instance Metadata Service +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Instance Metadata Service. + +## Getting Started +To build the SDKs for Instance Metadata Service, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: +> `autorest readme.md` + +To see additional help and options, run: +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information +These are the global settings for the Instance Metadata Service API. + +``` yaml +openapi-type: data-plane +azure-arm: true +tag: package-2018-05 +input-file: +- Microsoft.InstanceMetadataService/stable/2018-10-01/imds.json +output-folder: ./Generated +``` + +## Suppression + ``` yaml + directive: + - suppress: DefinitionsPropertiesNamesCamelCase + reason: The following properties follow the Oath2 spec, which does not use camelCase. + from: Microsoft.InstanceMetadataService/stable/2018-10-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 + ``` + +--- +# Code Generation + +## C# + +These settings apply only when `--csharp` is specified on the command line. + +``` yaml $(csharp) +csharp: + azure-arm: true + output-folder: ./Generated + clear-output-folder: true +``` + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python +``` diff --git a/specification/imds/data-plane/readme.nodejs.md b/specification/imds/data-plane/readme.nodejs.md new file mode 100644 index 000000000000..744df7b8af95 --- /dev/null +++ b/specification/imds/data-plane/readme.nodejs.md @@ -0,0 +1,16 @@ +## Node.js + +These settings apply only when `--nodejs` is specified on the command line. +Please also specify `--node-sdks-folder=`. + +``` yaml $(nodejs) +nodejs: + azure-arm: true + package-name: azure-imds + output-folder: $(node-sdks-folder)/lib/services/imds + payload-flattening-threshold: 2 + override-client-name: IMDSClient + generate-license-txt: true + generate-package-json: true + generate-readme-md: false +``` diff --git a/specification/imds/data-plane/readme.python.md b/specification/imds/data-plane/readme.python.md new file mode 100644 index 000000000000..daf2ae712b71 --- /dev/null +++ b/specification/imds/data-plane/readme.python.md @@ -0,0 +1,27 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: azure.imds + package-name: azure-imds + package-version: 0.1.0 + clear-output-folder: true +``` +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-imds/azure/imds +``` +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/azure-imds +``` \ No newline at end of file diff --git a/specification/imds/data-plane/readme.ruby.md b/specification/imds/data-plane/readme.ruby.md new file mode 100644 index 000000000000..ef7d2c898277 --- /dev/null +++ b/specification/imds/data-plane/readme.ruby.md @@ -0,0 +1,10 @@ +## Ruby + +These settings apply only when `--ruby` is specified on the command line. + +``` yaml +package-name: azure_imds +package-version: "0.16.3" +azure-arm: true +``` + diff --git a/specification/imds/data-plane/readme.typescript.md b/specification/imds/data-plane/readme.typescript.md new file mode 100644 index 000000000000..cd79798fce9c --- /dev/null +++ b/specification/imds/data-plane/readme.typescript.md @@ -0,0 +1,14 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +``` yaml $(typescript) +typescript: + azure-arm: true + package-name: "@azure/imds" + output-folder: "$(typescript-sdks-folder)/packages/@azure/imds" + payload-flattening-threshold: 2 + override-client-name: IMDSClient + generate-metadata: true +```