Skip to content

Commit

Permalink
mgmt upgrade policy to 2021-06 (#24117)
Browse files Browse the repository at this point in the history
* update version

* regen

* changelog

* remove UserAssignedIdentitiesValue from policy, as Identity is overriden by one in resources
  • Loading branch information
weidongxu-microsoft authored Sep 15, 2021
1 parent fe98736 commit 494ec4a
Show file tree
Hide file tree
Showing 42 changed files with 2,666 additions and 612 deletions.
2 changes: 1 addition & 1 deletion sdk/resourcemanager/api-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"dir": "azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
"args": "--payload-flattening-threshold=1 --tag=package-policy-2020-09"
"args": "--payload-flattening-threshold=1 --tag=package-policy-2021-06 --remove-model=UserAssignedIdentitiesValue"
},
"powerbi": {
"dir": "azure-resourcemanager-powerbi",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2.8.0-beta.1 (Unreleased)

### Dependency Updates

- Updated `api-version` of policy to `2021-06-01`.

### Other Changes

- Updated to use `PATCH` HTTP method for the update flow of `GenericResource`. For tagging resource, it is advised to use `TagOperations` instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface AuthorizationOperationsClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Authorization operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedFlux<OperationInner> listAsync();
Expand All @@ -28,7 +28,7 @@ public interface AuthorizationOperationsClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Authorization operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list();
Expand All @@ -40,7 +40,7 @@ public interface AuthorizationOperationsClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Authorization operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list(Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public interface FeatureClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Features operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedFlux<OperationInner> listOperationsAsync();
Expand All @@ -79,7 +79,7 @@ public interface FeatureClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Features operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> listOperations();
Expand All @@ -91,7 +91,7 @@ public interface FeatureClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Features operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> listOperations(Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface OperationsClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Resources operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedFlux<OperationInner> listAsync();
Expand All @@ -28,7 +28,7 @@ public interface OperationsClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Resources operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list();
Expand All @@ -40,7 +40,7 @@ public interface OperationsClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to list Microsoft.
* @return result of the request to list Microsoft.Resources operations.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list(Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
import com.azure.resourcemanager.resources.models.PolicyAssignmentUpdate;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in PolicyAssignmentsClient. */
Expand Down Expand Up @@ -248,6 +249,90 @@ Response<PolicyAssignmentInner> createWithResponse(
@ServiceMethod(returns = ReturnType.SINGLE)
Response<PolicyAssignmentInner> getWithResponse(String scope, String policyAssignmentName, Context context);

/**
* This operation updates a policy assignment with the given scope and name. Policy assignments apply to all
* resources contained within their scope. For example, when you assign a policy at resource group scope, that
* policy applies to all resources in the group.
*
* @param scope The scope of the policy assignment. Valid scopes are: management group (format:
* '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format:
* '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
* @param policyAssignmentName The name of the policy assignment.
* @param parameters Parameters for policy assignment patch request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<PolicyAssignmentInner>> updateWithResponseAsync(
String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters);

/**
* This operation updates a policy assignment with the given scope and name. Policy assignments apply to all
* resources contained within their scope. For example, when you assign a policy at resource group scope, that
* policy applies to all resources in the group.
*
* @param scope The scope of the policy assignment. Valid scopes are: management group (format:
* '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format:
* '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
* @param policyAssignmentName The name of the policy assignment.
* @param parameters Parameters for policy assignment patch request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<PolicyAssignmentInner> updateAsync(
String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters);

/**
* This operation updates a policy assignment with the given scope and name. Policy assignments apply to all
* resources contained within their scope. For example, when you assign a policy at resource group scope, that
* policy applies to all resources in the group.
*
* @param scope The scope of the policy assignment. Valid scopes are: management group (format:
* '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format:
* '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
* @param policyAssignmentName The name of the policy assignment.
* @param parameters Parameters for policy assignment patch request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
PolicyAssignmentInner update(String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters);

/**
* This operation updates a policy assignment with the given scope and name. Policy assignments apply to all
* resources contained within their scope. For example, when you assign a policy at resource group scope, that
* policy applies to all resources in the group.
*
* @param scope The scope of the policy assignment. Valid scopes are: management group (format:
* '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format:
* '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
* @param policyAssignmentName The name of the policy assignment.
* @param parameters Parameters for policy assignment patch request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<PolicyAssignmentInner> updateWithResponse(
String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters, Context context);

/**
* This operation retrieves the list of all policy assignments associated with the given resource group in the given
* subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()'
Expand Down Expand Up @@ -957,4 +1042,91 @@ Response<PolicyAssignmentInner> createByIdWithResponse(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<PolicyAssignmentInner> getByIdWithResponse(String policyAssignmentId, Context context);

/**
* This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all
* resources contained in that scope. For example, when you assign a policy to a resource group that policy applies
* to all resources in the group. Policy assignment IDs have this format:
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are:
* management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription
* (format: '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
*
* @param policyAssignmentId The ID of the policy assignment to update. Use the format
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.
* @param parameters Parameters for policy assignment patch request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<PolicyAssignmentInner>> updateByIdWithResponseAsync(
String policyAssignmentId, PolicyAssignmentUpdate parameters);

/**
* This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all
* resources contained in that scope. For example, when you assign a policy to a resource group that policy applies
* to all resources in the group. Policy assignment IDs have this format:
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are:
* management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription
* (format: '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
*
* @param policyAssignmentId The ID of the policy assignment to update. Use the format
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.
* @param parameters Parameters for policy assignment patch request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<PolicyAssignmentInner> updateByIdAsync(String policyAssignmentId, PolicyAssignmentUpdate parameters);

/**
* This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all
* resources contained in that scope. For example, when you assign a policy to a resource group that policy applies
* to all resources in the group. Policy assignment IDs have this format:
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are:
* management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription
* (format: '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
*
* @param policyAssignmentId The ID of the policy assignment to update. Use the format
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.
* @param parameters Parameters for policy assignment patch request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
PolicyAssignmentInner updateById(String policyAssignmentId, PolicyAssignmentUpdate parameters);

/**
* This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all
* resources contained in that scope. For example, when you assign a policy to a resource group that policy applies
* to all resources in the group. Policy assignment IDs have this format:
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are:
* management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription
* (format: '/subscriptions/{subscriptionId}'), resource group (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
* '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
*
* @param policyAssignmentId The ID of the policy assignment to update. Use the format
* '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.
* @param parameters Parameters for policy assignment patch request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the policy assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<PolicyAssignmentInner> updateByIdWithResponse(
String policyAssignmentId, PolicyAssignmentUpdate parameters, Context context);
}
Loading

0 comments on commit 494ec4a

Please sign in to comment.