PolicyClient 類別

若要管理和控制資源的存取權,您可以定義自訂的原則,並在範圍內將它們加以指派。

此就緒包含多個 API 版本,可協助您處理 Azure Stack、Azure Government、Azure China 等所有 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)

參數

名稱 Description
credential
必要

用戶端連線到 Azure 所需的認證。 必要。

subscription_id
必要
str

目標訂用帳戶的識別碼。 必要。

api_version
str

如果未提供任何設定檔,或設定檔中遺漏,則要使用的 API 版本。

預設值: None
base_url
str

服務 URL

預設值: https://management.azure.com
profile

設定檔定義,從 KnownProfiles 到聽寫。

預設值: KnownProfiles.default

方法

close
models

模組取決於 API 版本:

close

close()

models

模組取決於 API 版本:

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

參數

名稱 Description
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