Disks - List

List disks in a given user profile.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks?api-version=2018-09-15
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks?$expand={$expand}&$filter={$filter}&$top={$top}&$orderby={$orderby}&api-version=2018-09-15

URI Parameters

Name In Required Type Description
labName
path True

string

The name of the lab.

resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

The subscription ID.

userName
path True

string

The name of the user profile.

api-version
query True

string

Client API version.

$expand
query

string

Specify the $expand query. Example: 'properties($select=diskType)'

$filter
query

string

The filter to apply to the operation. Example: '$filter=contains(name,'myName')

$orderby
query

string

The ordering expression for the results, using OData notation. Example: '$orderby=name desc'

$top
query

integer

int32

The maximum number of resources to return from the operation. Example: '$top=10'

Responses

Name Type Description
200 OK

DiskList

OK

Other Status Codes

CloudError

BadRequest

Security

azure_auth

OAuth2 Implicit Grant

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation Access Microsoft Azure

Examples

Disks_List

Sample Request

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/@me/disks?api-version=2018-09-15

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userId}/disks/{diskName}",
      "name": "{diskName}",
      "type": "Microsoft.DevTestLab/labs/users/disks",
      "properties": {
        "diskType": "Standard",
        "diskSizeGiB": 1023,
        "leasedByLabVmId": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName",
        "diskUri": "",
        "createdDate": "2021-01-04T20:27:32.1445632+00:00",
        "hostCaching": "None",
        "managedDiskId": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.compute/disks/{diskName}",
        "provisioningState": "Succeeded",
        "uniqueIdentifier": "9bf098d1-1b64-41a5-aa05-286767074a0b"
      }
    }
  ]
}

Definitions

Name Description
CloudError

Error from a REST request.

CloudErrorBody

Body of an error from a REST request.

Disk

A Disk.

DiskList

The response of a list operation.

StorageType

The storage type for the disk (i.e. Standard, Premium).

CloudError

Error from a REST request.

Name Type Description
error

CloudErrorBody

The cloud error that occurred

CloudErrorBody

Body of an error from a REST request.

Name Type Description
code

string

The error code.

details

CloudErrorBody[]

Inner errors.

message

string

The error message.

target

string

The error target.

Disk

A Disk.

Name Type Description
id

string

The identifier of the resource.

location

string

The location of the resource.

name

string

The name of the resource.

properties.createdDate

string

The creation date of the disk.

properties.diskBlobName

string

When backed by a blob, the name of the VHD blob without extension.

properties.diskSizeGiB

integer

The size of the disk in Gibibytes.

properties.diskType

StorageType

The storage type for the disk (i.e. Standard, Premium).

properties.diskUri

string

When backed by a blob, the URI of underlying blob.

properties.hostCaching

string

The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).

properties.leasedByLabVmId

string

The resource ID of the VM to which this disk is leased.

properties.managedDiskId

string

When backed by managed disk, this is the ID of the compute disk resource.

properties.provisioningState

string

The provisioning status of the resource.

properties.storageAccountId

string

When backed by a blob, the storage account where the blob is.

properties.uniqueIdentifier

string

The unique immutable identifier of a resource (Guid).

tags

object

The tags of the resource.

type

string

The type of the resource.

DiskList

The response of a list operation.

Name Type Description
nextLink

string

Link for next set of results.

value

Disk[]

Results of the list operation.

StorageType

The storage type for the disk (i.e. Standard, Premium).

Name Type Description
Premium

string

Standard

string

StandardSSD

string