你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Disks - List
Returns a list of disks.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/disks?api-version=2018-07-30-preview
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/disks?userSubscriptionId={userSubscriptionId}&status={status}&sharePath={sharePath}&scaleUnit={scaleUnit}&volumeLabel={volumeLabel}&count={count}&start={start}&api-version=2018-07-30-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
location
|
path | True |
string |
Location of the resource. |
subscription
|
path | True |
string |
Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
api-version
|
query | True |
string |
The API version to use for this operation. |
count
|
query |
integer int32 |
The maximum number of disks to return. |
|
scale
|
query |
string |
The scale unit which the resource belongs to. |
|
share
|
query |
string |
The share which the resource belongs to. |
|
start
|
query |
integer int32 |
The start index of disks in query. |
|
status
|
query |
string |
The parameters of disk state. |
|
user
|
query |
string |
User Subscription Id which the resource belongs to. |
|
volume
|
query |
string |
The volume label of the volume which the resource belongs to. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK -- The list of disks has been returned. |
|
Other Status Codes |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
Security
azure_auth
Authorization uses an Azure Active Directory OAuth2 flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Returns a list of disks.
Sample Request
GET https://management.azure.com/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks?status=Unattached&count=100&start=1&api-version=2018-07-30-preview
Sample Response
{
"value": [
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/423e4eb4-f791-4d13-ad5b-4d415733b0d6",
"name": "redmond/423e4eb4-f791-4d13-ad5b-4d415733b0d6",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "423e4eb4-f791-4d13-ad5b-4d415733b0d6",
"status": "Unattached",
"sharePath": "\\\\SU1FileServer.mydomain.com\\SU1_ObjStore_4",
"actualSizeGB": 183,
"provisionSizeGB": 200,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Disks/diskrptest9vb55sb15w",
"diskType": "Disk",
"diskSku": "Standard_LRS"
}
},
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/48dc9b56-5883-4011-9dc3-0e527f33e6ab",
"name": "redmond/48dc9b56-5883-4011-9dc3-0e527f33e6ab",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "48dc9b56-5883-4011-9dc3-0e527f33e6ab",
"status": "Unattached",
"sharePath": "\\\\SU1FileServer.mydomain.com\\SU1_ObjStore_2",
"actualSizeGB": 1,
"provisionSizeGB": 200,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Snapshots/diskrptestjrlt133h5g8t",
"diskType": "Snapshot",
"diskSku": "Standard_LRS"
}
},
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/5018f340-c41b-4e82-a553-248431c4df64",
"name": "redmond/5018f340-c41b-4e82-a553-248431c4df64",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "5018f340-c41b-4e82-a553-248431c4df64",
"status": "Unattached",
"sharePath": "",
"actualSizeGB": 0,
"provisionSizeGB": 200,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Snapshots/diskrptestlhy3gmrez379",
"diskType": "Snapshot",
"diskSku": "Standard_LRS"
}
},
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/8b5a40f9-c5d0-4273-a5b2-7ec4be371e30",
"name": "redmond/8b5a40f9-c5d0-4273-a5b2-7ec4be371e30",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "8b5a40f9-c5d0-4273-a5b2-7ec4be371e30",
"status": "Unattached",
"sharePath": "",
"actualSizeGB": 0,
"provisionSizeGB": 200,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Disks/diskrptest5wnmxirn",
"diskType": "Disk",
"diskSku": "Standard_LRS"
}
},
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/9664bba5-dcc1-4481-a85d-8a2dfca26c55",
"name": "redmond/9664bba5-dcc1-4481-a85d-8a2dfca26c55",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "9664bba5-dcc1-4481-a85d-8a2dfca26c55",
"status": "Unattached",
"sharePath": "",
"actualSizeGB": 0,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Snapshots/diskrptestj32ckp6df9v",
"diskType": "Snapshot",
"diskSku": "Standard_LRS"
}
},
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/cc79941f-5f42-4ac7-8428-7553f5e47e4b",
"name": "redmond/cc79941f-5f42-4ac7-8428-7553f5e47e4b",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "cc79941f-5f42-4ac7-8428-7553f5e47e4b",
"status": "Unattached",
"sharePath": "",
"actualSizeGB": 0,
"provisionSizeGB": 200,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Snapshots/diskrptestthml7uzd3hs2",
"diskType": "Snapshot",
"diskSku": "Standard_LRS"
}
},
{
"id": "/subscriptions/04666444-56f0-4d4f-afc5-dbd6b134b084/providers/Microsoft.Compute.Admin/locations/redmond/disks/dfee6038-fc35-4e0f-acd9-597b097a0b52",
"name": "redmond/dfee6038-fc35-4e0f-acd9-597b097a0b52",
"type": "Microsoft.Compute.Admin/locations/disks",
"location": "redmond",
"properties": {
"diskId": "dfee6038-fc35-4e0f-acd9-597b097a0b52",
"status": "Unattached",
"sharePath": "",
"actualSizeGB": 0,
"provisionSizeGB": 200,
"userResourceId": "/subscriptions/4496690e-348e-4dc0-addc-17395c3966ba/resourceGroups/DISKRG6ECD14E6/providers/Microsoft.Compute/Snapshots/diskrptestn9wefmbaqiu",
"diskType": "Snapshot",
"diskSku": "Standard_LRS"
}
}
]
}
Definitions
Name | Description |
---|---|
Account |
Disk Sku. |
Crp |
Error response |
Disk |
Managed Disk. |
Disk |
List of disks. |
Disk |
Disk resource type. |
Disk |
Disk State. |
Error |
The error detail. |
AccountType
Disk Sku.
Name | Type | Description |
---|---|---|
Premium_LRS |
string |
|
StandardSSD_LRS |
string |
|
Standard_GRS |
string |
|
Standard_LRS |
string |
|
Standard_RAGRS |
string |
|
Standard_ZRS |
string |
|
UltraSSD_LRS |
string |
CrpErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
Disk
Managed Disk.
Name | Type | Description |
---|---|---|
id |
string |
ID of the resource. |
location |
string |
Location of the resource. |
name |
string |
Name of the resource. |
properties.actualSizeGB |
integer |
The actual size of disk in GB. |
properties.diskId |
string |
The disk id. |
properties.diskSku |
the disk sku. |
|
properties.diskType |
The type of the disk resource. |
|
properties.managedBy |
string |
Compute resource Uri which owns this disk. |
properties.provisionSizeGB |
integer |
The provision size of disk in GB. |
properties.sharePath |
string |
The disk share path. |
properties.status |
The disk status. |
|
properties.userResourceId |
string |
The disk resource Uri from user view. |
type |
string |
Type of Resource. |
DiskList
List of disks.
Name | Type | Description |
---|---|---|
nextLink |
string |
URI to the next page. |
value |
Disk[] |
List of disks. |
DiskResourceType
Disk resource type.
Name | Type | Description |
---|---|---|
Disk |
string |
|
ManagedBlob |
string |
|
RestorePoint |
string |
|
Snapshot |
string |
|
Undefined |
string |
DiskState
Disk State.
Name | Type | Description |
---|---|---|
ActiveSAS |
string |
|
All |
string |
|
Attached |
string |
|
OfflineMigration |
string |
|
OnlineMigration |
string |
|
Recommended |
string |
|
Reserved |
string |
|
Unattached |
string |
|
Undefined |
string |
|
Unknown |
string |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
message |
string |
The error message. |
target |
string |
The error target. |