DisksOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:disks> attribute.
- Inheritance
-
builtins.objectDisksOperations
Constructor
DisksOperations(*args, **kwargs)
Methods
begin_create_or_update |
Creates or updates a disk. |
begin_delete |
Deletes a disk. |
begin_grant_access |
Grants access to a disk. |
begin_revoke_access |
Revokes access to a disk. |
begin_update |
Updates (patches) a disk. |
get |
Gets information about a disk. |
list |
Lists all the disks under a subscription. |
list_by_resource_group |
Lists all the disks under a resource group. |
begin_create_or_update
Creates or updates a disk.
async begin_create_or_update(resource_group_name: str, disk_name: str, disk: _models.Disk, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.Disk]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
disk_name
Required
|
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. Required. |
disk
Required
|
Disk object supplied in the body of the Put disk operation. Is either a Disk type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of AsyncLROPoller that returns either Disk or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_delete
Deletes a disk.
async begin_delete(resource_group_name: str, disk_name: str, **kwargs: Any) -> AsyncLROPoller[OperationStatusResponse]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
disk_name
Required
|
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. Required. |
Returns
Type | Description |
---|---|
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_grant_access
Grants access to a disk.
async begin_grant_access(resource_group_name: str, disk_name: str, grant_access_data: _models.GrantAccessData, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.AccessUri]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
disk_name
Required
|
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. Required. |
grant_access_data
Required
|
Access data object supplied in the body of the get disk access operation. Is either a GrantAccessData type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_revoke_access
Revokes access to a disk.
async begin_revoke_access(resource_group_name: str, disk_name: str, **kwargs: Any) -> AsyncLROPoller[OperationStatusResponse]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
disk_name
Required
|
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. Required. |
Returns
Type | Description |
---|---|
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_update
Updates (patches) a disk.
async begin_update(resource_group_name: str, disk_name: str, disk: _models.DiskUpdate, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.Disk]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
disk_name
Required
|
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. Required. |
disk
Required
|
Disk object supplied in the body of the Patch disk operation. Is either a DiskUpdate type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of AsyncLROPoller that returns either Disk or the result of cls(response) |
Exceptions
Type | Description |
---|---|
get
Gets information about a disk.
async get(resource_group_name: str, disk_name: str, **kwargs: Any) -> Disk
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
disk_name
Required
|
The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. Required. |
Returns
Type | Description |
---|---|
Disk or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list
Lists all the disks under a subscription.
list(**kwargs: Any) -> AsyncIterable[Disk]
Returns
Type | Description |
---|---|
An iterator like instance of either Disk or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list_by_resource_group
Lists all the disks under a resource group.
list_by_resource_group(resource_group_name: str, **kwargs: Any) -> AsyncIterable[Disk]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
Returns
Type | Description |
---|---|
An iterator like instance of either Disk or the result of cls(response) |
Exceptions
Type | Description |
---|---|
Attributes
models
models = <module 'azure.mgmt.compute.v2017_03_30.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\compute\\v2017_03_30\\models\\__init__.py'>
Azure SDK for Python