ResourcesOperations Class

ResourcesOperations operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
ResourcesOperations

Constructor

ResourcesOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

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: azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource, **kwargs: Any) -> azure.core.polling._poller.LROPoller[azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource]

Parameters

resource_group_name
str
Required

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

resource_provider_namespace
str
Required

The namespace of the resource provider.

parent_resource_path
str
Required

The parent resource identity.

resource_type
str
Required

The resource type of the resource to create.

resource_name
str
Required

The name of the resource to create.

api_version
str
Required

The API version to use for the operation.

parameters
GenericResource
Required

Parameters for creating or updating the resource.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either GenericResource or the result of cls(response)

Return type

Exceptions

begin_create_or_update_by_id

Create a resource by ID.

begin_create_or_update_by_id(resource_id: str, api_version: str, parameters: azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource, **kwargs: Any) -> azure.core.polling._poller.LROPoller[azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource]

Parameters

resource_id
str
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}.

api_version
str
Required

The API version to use for the operation.

parameters
GenericResource
Required

Create or update resource parameters.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either GenericResource or the result of cls(response)

Return type

Exceptions

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) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_group_name
str
Required

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

resource_provider_namespace
str
Required

The namespace of the resource provider.

parent_resource_path
str
Required

The parent resource identity.

resource_type
str
Required

The resource type.

resource_name
str
Required

The name of the resource to delete.

api_version
str
Required

The API version to use for the operation.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either None or the result of cls(response)

Return type

Exceptions

begin_delete_by_id

Deletes a resource by ID.

begin_delete_by_id(resource_id: str, api_version: str, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

resource_id
str
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}.

api_version
str
Required

The API version to use for the operation.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either None or the result of cls(response)

Return type

Exceptions

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: azure.mgmt.resource.resources.v2020_06_01.models._models_py3.ResourcesMoveInfo, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

source_resource_group_name
str
Required

The name of the resource group containing the resources to move.

parameters
ResourcesMoveInfo
Required

Parameters for moving resources.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either None or the result of cls(response)

Return type

Exceptions

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: azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource, **kwargs: Any) -> azure.core.polling._poller.LROPoller[azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource]

Parameters

resource_group_name
str
Required

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

resource_provider_namespace
str
Required

The namespace of the resource provider.

parent_resource_path
str
Required

The parent resource identity.

resource_type
str
Required

The resource type of the resource to update.

resource_name
str
Required

The name of the resource to update.

api_version
str
Required

The API version to use for the operation.

parameters
GenericResource
Required

Parameters for updating the resource.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either GenericResource or the result of cls(response)

Return type

Exceptions

begin_update_by_id

Updates a resource by ID.

begin_update_by_id(resource_id: str, api_version: str, parameters: azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource, **kwargs: Any) -> azure.core.polling._poller.LROPoller[azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource]

Parameters

resource_id
str
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}.

api_version
str
Required

The API version to use for the operation.

parameters
GenericResource
Required

Update resource parameters.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either GenericResource or the result of cls(response)

Return type

Exceptions

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: azure.mgmt.resource.resources.v2020_06_01.models._models_py3.ResourcesMoveInfo, **kwargs: Any) -> azure.core.polling._poller.LROPoller[None]

Parameters

source_resource_group_name
str
Required

The name of the resource group containing the resources to validate for move.

parameters
ResourcesMoveInfo
Required

Parameters for moving resources.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either None or the result of cls(response)

Return type

Exceptions

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

resource_group_name
str
Required

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

resource_provider_namespace
str
Required

The resource provider of the resource to check.

parent_resource_path
str
Required

The parent resource identity.

resource_type
str
Required

The resource type.

resource_name
str
Required

The name of the resource to check whether it exists.

api_version
str
Required

The API version to use for the operation.

cls
callable

A custom type or function that will be passed the direct response

Returns

bool, or the result of cls(response)

Return type

Exceptions

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

resource_id
str
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}.

api_version
str
Required

The API version to use for the operation.

cls
callable

A custom type or function that will be passed the direct response

Returns

bool, or the result of cls(response)

Return type

Exceptions

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) -> azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource

Parameters

resource_group_name
str
Required

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

resource_provider_namespace
str
Required

The namespace of the resource provider.

parent_resource_path
str
Required

The parent resource identity.

resource_type
str
Required

The resource type of the resource.

resource_name
str
Required

The name of the resource to get.

api_version
str
Required

The API version to use for the operation.

cls
callable

A custom type or function that will be passed the direct response

Returns

GenericResource, or the result of cls(response)

Return type

Exceptions

get_by_id

Gets a resource by ID.

get_by_id(resource_id: str, api_version: str, **kwargs: Any) -> azure.mgmt.resource.resources.v2020_06_01.models._models_py3.GenericResource

Parameters

resource_id
str
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}.

api_version
str
Required

The API version to use for the operation.

cls
callable

A custom type or function that will be passed the direct response

Returns

GenericResource, or the result of cls(response)

Return type

Exceptions

list

Get all the resources in a subscription.

list(filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any) -> Iterable[azure.mgmt.resource.resources.v2020_06_01.models._models_py3.ResourceListResult]

Parameters

filter
str
Required

The filter to apply on the operation.:code:
<br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.:code:<br>``<br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:<br>``<br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.:code:<br>``<br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name):code:<br>``<br>You can link more than one substringof together by adding and/or operators.:code:<br>``<br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.:code:<br>:code:>><<<br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default value is None.

expand
str
Required

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
int
Required

The number of results to return. If null is passed, returns all resources. Default value is None.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either ResourceListResult or the result of cls(response)

Return type

Exceptions

list_by_resource_group

Get all the resources for a resource group.

list_by_resource_group(resource_group_name: str, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any) -> Iterable[azure.mgmt.resource.resources.v2020_06_01.models._models_py3.ResourceListResult]

Parameters

resource_group_name
str
Required

The resource group with the resources to get.

filter
str
Required

The filter to apply on the operation.:code:
<br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.:code:<br>``<br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:<br>``<br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.:code:<br>``<br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name):code:<br>``<br>You can link more than one substringof together by adding and/or operators.:code:<br>``<br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.:code:<br>:code:>><<<br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default value is None.

expand
str
Required

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
int
Required

The number of results to return. If null is passed, returns all resources. Default value is None.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either ResourceListResult or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.resource.resources.v2020_06_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\resource\\resources\\v2020_06_01\\models\\__init__.py'>