你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

PolicyClient 类

若要管理和控制对资源的访问,可以定义并在某个范围内分配自定义的策略。

此就绪包含多个 API 版本,可帮助你处理所有 Azure 云 (Azure Stack、Azure 政府、Azure 中国等) 。 默认情况下,它使用公共 Azure 上提供的最新 API 版本。 对于生产环境,应坚持使用特定的 API 版本和/或配置文件。 配置文件设置操作组与其 API 版本之间的映射。 如果配置文件中未描述操作组,则 api-version 参数设置默认 API 版本。

继承
PolicyClient
azure.mgmt.resource.policy._policy_client._SDKClient
PolicyClient

构造函数

PolicyClient(credential: TokenCredential, subscription_id: str, api_version: str | None = None, base_url: str = 'https://management.azure.com', profile: KnownProfiles = KnownProfiles.default, **kwargs: Any)

参数

名称 说明
credential
必需

客户端连接到 Azure 所需的凭据。 必需。

subscription_id
必需
str

目标订阅的 ID。 必需。

api_version
str

如果未提供配置文件,或者配置文件中缺少,则要使用的 API 版本。

默认值: None
base_url
str

服务 URL

默认值: https://management.azure.com
profile

从 KnownProfiles 到 dict 的配置文件定义。

默认值: KnownProfiles.default

方法

close
models

模块取决于 API 版本:

close

close()

models

模块取决于 API 版本:

models(api_version='2022-06-01')

参数

名称 说明
api_version
默认值: 2022-06-01

属性

data_policy_manifests

实例取决于 API 版本:

policy_assignments

policy_definitions

policy_exemptions

实例取决于 API 版本:

policy_set_definitions

variable_values

实例取决于 API 版本:

variables

实例取决于 API 版本:

DEFAULT_API_VERSION

DEFAULT_API_VERSION = '2022-06-01'

LATEST_PROFILE

LATEST_PROFILE = azure.mgmt.resource.policy.PolicyClient latest