ResourcesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ResourceManagementClient's

<xref:resources> attribute.

Inheritance
builtins.object
ResourcesOperations

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.

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.

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
str

The name of the resource group for the resource. The name is case insensitive. Required.

resource_provider_namespace
Required
str

The namespace of the resource provider. Required.

parent_resource_path
Required
str

The parent resource identity. Required.

resource_type
Required
str

The resource type of the resource to create. Required.

resource_name
Required
str

The name of the resource to create. Required.

api_version
Required
str

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
str

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
str

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
str

The name of the resource group that contains the resource to delete. The name is case insensitive. Required.

resource_provider_namespace
Required
str

The namespace of the resource provider. Required.

parent_resource_path
Required
str

The parent resource identity. Required.

resource_type
Required
str

The resource type. Required.

resource_name
Required
str

The name of the resource to delete. Required.

api_version
Required
str

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
str

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
str

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
str

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
str

The name of the resource group for the resource. The name is case insensitive. Required.

resource_provider_namespace
Required
str

The namespace of the resource provider. Required.

parent_resource_path
Required
str

The parent resource identity. Required.

resource_type
Required
str

The resource type of the resource to update. Required.

resource_name
Required
str

The name of the resource to update. Required.

api_version
Required
str

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
str

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
str

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

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
str

The name of the resource group containing the resource to check. The name is case insensitive. Required.

resource_provider_namespace
Required
str

The resource provider of the resource to check. Required.

parent_resource_path
Required
str

The parent resource identity. Required.

resource_type
Required
str

The resource type. Required.

resource_name
Required
str

The name of the resource to check whether it exists. Required.

api_version
Required
str

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
str

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
str

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
str

The name of the resource group containing the resource to get. The name is case insensitive. Required.

resource_provider_namespace
Required
str

The namespace of the resource provider. Required.

parent_resource_path
Required
str

The parent resource identity. Required.

resource_type
Required
str

The resource type of the resource. Required.

resource_name
Required
str

The name of the resource to get. Required.

api_version
Required
str

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
str

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
str

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
str

The filter to apply on the operation. Default value is None.

expand
Required
str

Comma-separated list of additional properties to be included in the response. Valid values include createdTime, changedTime and provisioningState. For example, $expand=createdTime,changedTime. Default value is None.

top
Required
int

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.v2016_09_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\resource\\resources\\v2016_09_01\\models\\__init__.py'>