ResourcesOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:resources> attribute.
- Inheritance
-
builtins.objectResourcesOperations
Constructor
ResourcesOperations(*args, **kwargs)
Methods
begin_create_or_update |
Creates a resource. |
begin_create_or_update_by_id |
Create a resource by ID. |
begin_delete |
Deletes a resource. |
begin_delete_by_id |
Deletes a resource by ID. |
begin_move_resources |
Moves resources from one resource group to another resource group. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes. |
begin_update |
Updates a resource. |
begin_update_by_id |
Updates a resource by ID. |
begin_validate_move_resources |
Validates whether resources can be moved from one resource group to another resource group. This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation. |
check_existence |
Checks whether a resource exists. |
check_existence_by_id |
Checks by ID whether a resource exists. |
get |
Gets a resource. |
get_by_id |
Gets a resource by ID. |
list |
Get all the resources in a subscription. |
list_by_resource_group |
Get all the resources for a resource group. |
begin_create_or_update
Creates a resource.
begin_create_or_update(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, parameters: _models.GenericResource, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.GenericResource]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group for the resource. The name is case insensitive. Required. |
resource_provider_namespace
Required
|
The namespace of the resource provider. Required. |
parent_resource_path
Required
|
The parent resource identity. Required. |
resource_type
Required
|
The resource type of the resource to create. Required. |
resource_name
Required
|
The name of the resource to create. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
parameters
Required
|
Parameters for creating or updating the resource. Is either a GenericResource type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either GenericResource or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_create_or_update_by_id
Create a resource by ID.
begin_create_or_update_by_id(resource_id: str, api_version: str, parameters: _models.GenericResource, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.GenericResource]
Parameters
Name | Description |
---|---|
resource_id
Required
|
The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
parameters
Required
|
Create or update resource parameters. Is either a GenericResource type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either GenericResource or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_delete
Deletes a resource.
begin_delete(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group that contains the resource to delete. The name is case insensitive. Required. |
resource_provider_namespace
Required
|
The namespace of the resource provider. Required. |
parent_resource_path
Required
|
The parent resource identity. Required. |
resource_type
Required
|
The resource type. Required. |
resource_name
Required
|
The name of the resource to delete. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_delete_by_id
Deletes a resource by ID.
begin_delete_by_id(resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_id
Required
|
The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_move_resources
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
begin_move_resources(source_resource_group_name: str, parameters: _models.ResourcesMoveInfo, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
source_resource_group_name
Required
|
The name of the resource group containing the resources to move. Required. |
parameters
Required
|
Parameters for moving resources. Is either a ResourcesMoveInfo type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_update
Updates a resource.
begin_update(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, parameters: _models.GenericResource, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.GenericResource]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group for the resource. The name is case insensitive. Required. |
resource_provider_namespace
Required
|
The namespace of the resource provider. Required. |
parent_resource_path
Required
|
The parent resource identity. Required. |
resource_type
Required
|
The resource type of the resource to update. Required. |
resource_name
Required
|
The name of the resource to update. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
parameters
Required
|
Parameters for updating the resource. Is either a GenericResource type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either GenericResource or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_update_by_id
Updates a resource by ID.
begin_update_by_id(resource_id: str, api_version: str, parameters: _models.GenericResource, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.GenericResource]
Parameters
Name | Description |
---|---|
resource_id
Required
|
The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
parameters
Required
|
Update resource parameters. Is either a GenericResource type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either GenericResource or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_validate_move_resources
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
begin_validate_move_resources(source_resource_group_name: str, parameters: _models.ResourcesMoveInfo, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
source_resource_group_name
Required
|
The name of the resource group containing the resources to validate for move. Required. |
parameters
Required
|
Parameters for moving resources. Is either a ResourcesMoveInfo type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
check_existence
Checks whether a resource exists.
check_existence(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> bool
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group containing the resource to check. The name is case insensitive. Required. |
resource_provider_namespace
Required
|
The resource provider of the resource to check. Required. |
parent_resource_path
Required
|
The parent resource identity. Required. |
resource_type
Required
|
The resource type. Required. |
resource_name
Required
|
The name of the resource to check whether it exists. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
Returns
Type | Description |
---|---|
bool or the result of cls(response) |
Exceptions
Type | Description |
---|---|
check_existence_by_id
Checks by ID whether a resource exists.
check_existence_by_id(resource_id: str, api_version: str, **kwargs: Any) -> bool
Parameters
Name | Description |
---|---|
resource_id
Required
|
The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
Returns
Type | Description |
---|---|
bool or the result of cls(response) |
Exceptions
Type | Description |
---|---|
get
Gets a resource.
get(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> GenericResource
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group containing the resource to get. The name is case insensitive. Required. |
resource_provider_namespace
Required
|
The namespace of the resource provider. Required. |
parent_resource_path
Required
|
The parent resource identity. Required. |
resource_type
Required
|
The resource type of the resource. Required. |
resource_name
Required
|
The name of the resource to get. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
Returns
Type | Description |
---|---|
GenericResource or the result of cls(response) |
Exceptions
Type | Description |
---|---|
get_by_id
Gets a resource by ID.
get_by_id(resource_id: str, api_version: str, **kwargs: Any) -> GenericResource
Parameters
Name | Description |
---|---|
resource_id
Required
|
The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. Required. |
api_version
Required
|
The API version to use for the operation. Required. |
Returns
Type | Description |
---|---|
GenericResource or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list
Get all the resources in a subscription.
list(filter: str | None = None, expand: str | None = None, top: int | None = None, **kwargs: Any) -> Iterable[GenericResourceExpanded]
Parameters
Name | Description |
---|---|
filter
Required
|
The filter to apply on the operation.:code: |
expand
Required
|
Comma-separated list of additional properties to be included in the response.
Valid values include |
top
Required
|
The number of results to return. If null is passed, returns all resources. Default value is None. |
Returns
Type | Description |
---|---|
An iterator like instance of either GenericResourceExpanded or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list_by_resource_group
Get all the resources for a resource group.
list_by_resource_group(resource_group_name: str, filter: str | None = None, expand: str | None = None, top: int | None = None, **kwargs: Any) -> Iterable[GenericResourceExpanded]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The resource group with the resources to get. Required. |
filter
Required
|
The filter to apply on the operation.:code: |
expand
Required
|
Comma-separated list of additional properties to be included in the response.
Valid values include |
top
Required
|
The number of results to return. If null is passed, returns all resources. Default value is None. |
Returns
Type | Description |
---|---|
An iterator like instance of either GenericResourceExpanded or the result of cls(response) |
Exceptions
Type | Description |
---|---|
Attributes
models
models = <module 'azure.mgmt.resource.resources.v2019_03_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\resource\\resources\\v2019_03_01\\models\\__init__.py'>
Azure SDK for Python