Class ManagementGroupPolicyDefinitionCollection
- Namespace
- Azure.ResourceManager.Resources
- Assembly
- Azure.ResourceManager.dll
A class representing a collection of ManagementGroupPolicyDefinitionResource and their operations. Each ManagementGroupPolicyDefinitionResource in the collection will belong to the same instance of ManagementGroupResource. To get a ManagementGroupPolicyDefinitionCollection instance call the GetManagementGroupPolicyDefinitions method from an instance of ManagementGroupResource.
public class ManagementGroupPolicyDefinitionCollection : ArmCollection, IEnumerable<ManagementGroupPolicyDefinitionResource>, IEnumerable, IAsyncEnumerable<ManagementGroupPolicyDefinitionResource>
- Inheritance
-
ManagementGroupPolicyDefinitionCollection
- Implements
-
IAsyncEnumerable<ManagementGroupPolicyDefinitionResource>
- Inherited Members
Constructors
ManagementGroupPolicyDefinitionCollection()
Initializes a new instance of the ManagementGroupPolicyDefinitionCollection class for mocking.
protected ManagementGroupPolicyDefinitionCollection()
Methods
CreateOrUpdate(WaitUntil, string, PolicyDefinitionData, CancellationToken)
This operation creates or updates a policy definition in the given management group with the given name.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_CreateOrUpdateAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual ArmOperation<ManagementGroupPolicyDefinitionResource> CreateOrUpdate(WaitUntil waitUntil, string policyDefinitionName, PolicyDefinitionData data, CancellationToken cancellationToken = default)
Parameters
waitUntilWaitUntilAzure.WaitUntil.Completed if the method should wait to return until the long-running operation has completed on the service; Azure.WaitUntil.Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
policyDefinitionNamestringThe name of the policy definition to create.
dataPolicyDefinitionDataThe policy definition properties.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameordatais null.
CreateOrUpdateAsync(WaitUntil, string, PolicyDefinitionData, CancellationToken)
This operation creates or updates a policy definition in the given management group with the given name.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_CreateOrUpdateAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Task<ArmOperation<ManagementGroupPolicyDefinitionResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string policyDefinitionName, PolicyDefinitionData data, CancellationToken cancellationToken = default)
Parameters
waitUntilWaitUntilAzure.WaitUntil.Completed if the method should wait to return until the long-running operation has completed on the service; Azure.WaitUntil.Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
policyDefinitionNamestringThe name of the policy definition to create.
dataPolicyDefinitionDataThe policy definition properties.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameordatais null.
Exists(string, CancellationToken)
Checks to see if the resource exists in azure.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_GetAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Response<bool> Exists(string policyDefinitionName, CancellationToken cancellationToken = default)
Parameters
policyDefinitionNamestringThe name of the policy definition to get.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- Response<bool>
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameis null.
ExistsAsync(string, CancellationToken)
Checks to see if the resource exists in azure.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_GetAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Task<Response<bool>> ExistsAsync(string policyDefinitionName, CancellationToken cancellationToken = default)
Parameters
policyDefinitionNamestringThe name of the policy definition to get.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameis null.
Get(string, CancellationToken)
This operation retrieves the policy definition in the given management group with the given name.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_GetAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Response<ManagementGroupPolicyDefinitionResource> Get(string policyDefinitionName, CancellationToken cancellationToken = default)
Parameters
policyDefinitionNamestringThe name of the policy definition to get.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- Response<ManagementGroupPolicyDefinitionResource>
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameis null.
GetAll(string, int?, CancellationToken)
This operation retrieves a list of all the policy definitions in a given management group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given management group. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions
- Operation IdPolicyDefinitions_ListByManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Pageable<ManagementGroupPolicyDefinitionResource> GetAll(string filter = null, int? top = null, CancellationToken cancellationToken = default)
Parameters
filterstringThe filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}.
topint?Maximum number of records to return. When the $top filter is not provided, it will return 500 records.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- Pageable<ManagementGroupPolicyDefinitionResource>
A collection of ManagementGroupPolicyDefinitionResource that may take multiple service requests to iterate over.
GetAllAsync(string, int?, CancellationToken)
This operation retrieves a list of all the policy definitions in a given management group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given management group. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions
- Operation IdPolicyDefinitions_ListByManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual AsyncPageable<ManagementGroupPolicyDefinitionResource> GetAllAsync(string filter = null, int? top = null, CancellationToken cancellationToken = default)
Parameters
filterstringThe filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}.
topint?Maximum number of records to return. When the $top filter is not provided, it will return 500 records.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- AsyncPageable<ManagementGroupPolicyDefinitionResource>
An async collection of ManagementGroupPolicyDefinitionResource that may take multiple service requests to iterate over.
GetAsync(string, CancellationToken)
This operation retrieves the policy definition in the given management group with the given name.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_GetAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Task<Response<ManagementGroupPolicyDefinitionResource>> GetAsync(string policyDefinitionName, CancellationToken cancellationToken = default)
Parameters
policyDefinitionNamestringThe name of the policy definition to get.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- Task<Response<ManagementGroupPolicyDefinitionResource>>
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameis null.
GetIfExists(string, CancellationToken)
Tries to get details for this resource from the service.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_GetAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual NullableResponse<ManagementGroupPolicyDefinitionResource> GetIfExists(string policyDefinitionName, CancellationToken cancellationToken = default)
Parameters
policyDefinitionNamestringThe name of the policy definition to get.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- NullableResponse<ManagementGroupPolicyDefinitionResource>
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameis null.
GetIfExistsAsync(string, CancellationToken)
Tries to get details for this resource from the service.
- Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
- Operation IdPolicyDefinitions_GetAtManagementGroup
- Default Api Version2021-06-01
- ResourceManagementGroupPolicyDefinitionResource
public virtual Task<NullableResponse<ManagementGroupPolicyDefinitionResource>> GetIfExistsAsync(string policyDefinitionName, CancellationToken cancellationToken = default)
Parameters
policyDefinitionNamestringThe name of the policy definition to get.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- Task<NullableResponse<ManagementGroupPolicyDefinitionResource>>
Exceptions
- ArgumentException
policyDefinitionNameis an empty string, and was expected to be non-empty.- ArgumentNullException
policyDefinitionNameis null.