Condividi tramite


LongTermRetentionPoliciesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

SqlManagementClient's

<xref:long_term_retention_policies> attribute.

Constructor

LongTermRetentionPoliciesOperations(*args, **kwargs)

Methods

begin_create_or_update

Set or update a database's long term retention policy.

get

Gets a database's long term retention policy.

list_by_database

Gets a database's long term retention policy.

begin_create_or_update

Set or update a database's long term retention policy.

async begin_create_or_update(resource_group_name: str, server_name: str, database_name: str, policy_name: str | _models.LongTermRetentionPolicyName, parameters: _models.LongTermRetentionPolicy, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.LongTermRetentionPolicy]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. Required.

server_name
Required
str

The name of the server. Required.

database_name
Required
str

The name of the database. Required.

policy_name
Required

The policy name. Should always be Default. "default" Required.

parameters
Required

The long term retention policy info. Is either a LongTermRetentionPolicy type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either LongTermRetentionPolicy or the result of cls(response)

Exceptions

Type Description

get

Gets a database's long term retention policy.

async get(resource_group_name: str, server_name: str, database_name: str, policy_name: str | LongTermRetentionPolicyName, **kwargs: Any) -> LongTermRetentionPolicy

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. Required.

server_name
Required
str

The name of the server. Required.

database_name
Required
str

The name of the database. Required.

policy_name
Required

The policy name. Should always be Default. "default" Required.

Returns

Type Description

LongTermRetentionPolicy or the result of cls(response)

Exceptions

Type Description

list_by_database

Gets a database's long term retention policy.

list_by_database(resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> AsyncItemPaged[LongTermRetentionPolicy]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. Required.

server_name
Required
str

The name of the server. Required.

database_name
Required
str

The name of the database. Required.

Returns

Type Description

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

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.sql.models' from 'C:\\ToolCache\\Python\\3.12.10\\x64\\Lib\\site-packages\\py2docfx\\venv\\venv268\\Lib\\site-packages\\azure\\mgmt\\sql\\models\\__init__.py'>