ResourceGroupsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ResourceManagementClient's

<xref:resource_groups> attribute.

Inheritance
builtins.object
ResourceGroupsOperations

Constructor

ResourceGroupsOperations(*args, **kwargs)

Methods

begin_delete

Delete resource group.

check_existence

Checks whether resource group exists.

create_or_update

Create a resource group.

export_template

Captures the specified resource group as a template.

get

Get a resource group.

list

Gets a collection of resource groups.

list_resources

Get all of the resources under a subscription.

patch

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource groups, though if a field is unspecified current value will be carried over.

begin_delete

Delete resource group.

begin_delete(resource_group_name: str, **kwargs: Any) -> LROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group to be deleted. The name is case insensitive. 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 resource group exists.

check_existence(resource_group_name: str, **kwargs: Any) -> bool

Parameters

Name Description
resource_group_name
Required
str

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

Returns

Type Description

bool or the result of cls(response)

Exceptions

Type Description

create_or_update

Create a resource group.

create_or_update(resource_group_name: str, parameters: _models.ResourceGroup, *, content_type: str = 'application/json', **kwargs: Any) -> _models.ResourceGroup

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group to be created or updated. Required.

parameters
Required

Parameters supplied to the create or update resource group service operation. Is either a ResourceGroup type or a IO[bytes] type. Required.

Returns

Type Description

ResourceGroup or the result of cls(response)

Exceptions

Type Description

export_template

Captures the specified resource group as a template.

export_template(resource_group_name: str, parameters: _models.ExportTemplateRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.ResourceGroupExportResult

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group to be created or updated. Required.

parameters
Required

Parameters supplied to the export template resource group operation. Is either a ExportTemplateRequest type or a IO[bytes] type. Required.

Returns

Type Description

ResourceGroupExportResult or the result of cls(response)

Exceptions

Type Description

get

Get a resource group.

get(resource_group_name: str, **kwargs: Any) -> ResourceGroup

Parameters

Name Description
resource_group_name
Required
str

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

Returns

Type Description

ResourceGroup or the result of cls(response)

Exceptions

Type Description

list

Gets a collection of resource groups.

list(filter: str | None = None, top: int | None = None, **kwargs: Any) -> Iterable[ResourceGroup]

Parameters

Name Description
filter
Required
str

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

top
Required
int

Query parameters. If null is passed returns all resource groups. Default value is None.

Returns

Type Description

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

Exceptions

Type Description

list_resources

Get all of the resources under a subscription.

list_resources(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
str

Query parameters. If null is passed returns all resource groups. Required.

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

Query parameters. If null is passed returns all resource groups. Default value is None.

Returns

Type Description

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

Exceptions

Type Description

patch

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource groups, though if a field is unspecified current value will be carried over.

patch(resource_group_name: str, parameters: _models.ResourceGroup, *, content_type: str = 'application/json', **kwargs: Any) -> _models.ResourceGroup

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group to be created or updated. The name is case insensitive. Required.

parameters
Required

Parameters supplied to the update state resource group service operation. Is either a ResourceGroup type or a IO[bytes] type. Required.

Returns

Type Description

ResourceGroup or the result of cls(response)

Exceptions

Type Description

Attributes

models

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