Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding changes resource type to Microsoft.Resources #17500

Merged
merged 13 commits into from
Jan 27, 2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,424 @@
{
"swagger": "2.0",
"info": {
"version": "2022-03-01-preview",
"title": "ChangesClient",
"description": "The Resource Changes Client"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes": {
"get": {
"tags": [
"ListChanges"
],
"operationId": "ChangeResources_List",
"x-ms-examples": {
"ListChanges": {
"$ref": "./examples/ListChanges.json"
}
},
"description": "Obtains a list of change resources from the past 14 days for the target resource",
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ResourceProviderNamespaceParameter"
},
{
"$ref": "#/parameters/ResourceTypeParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/top"
},
{
"$ref": "#/parameters/skipToken"
}
],
"responses": {
"200": {
"description": "OK.",
"schema": {
"$ref": "#/definitions/ChangeResourceListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}": {
"get": {
"tags": [
"GetChange"
],
"operationId": "ChangeResource_Get",
"x-ms-examples": {
"GetChange": {
"$ref": "./examples/GetChange.json"
}
},
"description": "Obtains the specified change resource for the target resource",
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ResourceProviderNamespaceParameter"
},
{
"$ref": "#/parameters/ResourceTypeParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/ChangeResourceIdParameter"
}
],
"responses": {
"200": {
"description": "OK.",
"schema": {
"$ref": "#/definitions/ChangeResourceResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {
"ChangeResourceListResult": {
"description": "The list of resources",
"type": "object",
"properties": {
"nextLink": {
"type": "string",
"description": "The link used to get the next page of Change Resources"
},
"value": {
"description": "The list of resources",
"type": "array",
"items": {
"$ref": "#/definitions/ChangeResourceResult"
}
}
}
},
"ChangeResourceResult": {
"description": "Change Resource",
"type": "object",
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/Resource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/ChangeProperties"
}
}
},
"ChangeProperties": {
"description": "The properties of a change",
"type": "object",
"properties": {
"targetResourceId": {
"description": "The fully qualified ID of the target resource that was changed",
"type": "string",
"readOnly": true
},
"targetResourceType": {
"description": "The namespace and type of the resource",
"type": "string",
"readOnly": true
},
"changeType": {
"description": "The type of change that was captured in the resource",
"type": "string",
"readOnly": true,
"enum": [
"Update",
"Delete",
"Create"
],
"x-ms-enum": {
"name": "ChangeType",
"modelAsString": false,
"values": [
{
"value": "Update",
"description": "An existing resource underwent a change",
"name": "Update"
},
{
"value": "Delete",
"description": "An existing resource was deleted",
"name": "Update"
},
{
"value": "Create",
"description": "A newly created resource",
"name": "Create"
}
]
}
},
"changeAttributes": {
"$ref": "#/definitions/ChangeAttributes"
},
"changes": {
"$ref": "#/definitions/ChangesDictionary"
}
}
},
"ChangeAttributes": {
"description": "Details about the change resource",
"type": "object",
"properties": {
"correlationId": {
"description": "The ARM correlation ID of the change resource",
"type": "string",
"readOnly": true
},
"timestamp": {
"description": "The time the change(s) on the target resource ocurred",
"type": "string",
"readOnly": true
},
"changesCount": {
"type": "integer",
"format": "int64",
"readOnly": true,
"description": "The number of changes this resource captures"
},
"previousResourceSnapshotId": {
"description": "The GUID of the previous snapshot",
"type": "string",
"readOnly": true
},
"newResourceSnapshotId": {
"description": "The GUID of the new snapshot",
"type": "string",
"readOnly": true
}
}
},
"ChangesDictionary": {
"description": "A dictionary with changed property name as a key and the change details as the value",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ChangeBase"
}
},
"ChangeBase": {
"description": "An individual change on the target resource",
"type": "object",
"properties": {
"propertyChangeType": {
"description": "The type of change that occurred",
"type": "string",
"readOnly": true,
"enum": [
"Insert",
"Update",
"Remove"
],
"x-ms-enum": {
"name": "PropertyChangeType",
"modelAsString": false,
"values": [
{
"value": "Update",
"description": "An existing property underwent a change",
"name": "Update"
},
{
"value": "Insert",
"description": "A property was newly created",
"name": "Insert"
},
{
"value": "Remove",
"description": "An existing property was deleted",
"name": "Remove"
}
]
}
},
"changeCategory": {
"description": "The entity that made the change",
"type": "string",
"readOnly": true,
"enum": [
"User",
"System"
],
"x-ms-enum": {
"name": "ChangeCategory",
"modelAsString": false,
"values": [
{
"value": "User",
"description": "User initiated change",
"name": "User"
},
{
"value": "System",
"description": "System initiated change",
"name": "System"
},
{
"value": "Create",
"description": "A newly created resource",
"name": "Create"
}
]
}
},
"previousValue": {
"description": "The target resource property value before the change",
"type": "string",
"readOnly": true
},
"newValue": {
"description": "The target resource property value after the change",
"type": "string",
"readOnly": true
}
}
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"
},
"ResourceGroupNameParameter": {
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group.",
"x-ms-parameter-location": "method"
},
"ResourceProviderNamespaceParameter": {
"name": "resourceProviderNamespace",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource provider namespace.",
"x-ms-parameter-location": "method"
},
"ResourceTypeParameter": {
"name": "resourceType",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource type.",
"x-ms-parameter-location": "method"
},
"ResourceNameParameter": {
"name": "resourceName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource.",
"x-ms-parameter-location": "method"
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "The API version to be used with the HTTP request."
},
"ChangeResourceIdParameter": {
"name": "changeResourceId",
"in": "path",
"required": true,
"type": "string",
"description": "The ID of the change resource",
"x-ms-parameter-location": "method"
},
"top": {
"required": false,
"default": 100,
"description": "(Optional) Set the maximum number of results per response.",
"in": "query",
"maximum": 999,
"minimum": 1,
"name": "top",
"type": "integer",
"format": "int64",
"x-ms-parameter-location": "method"
},
"skipToken": {
"required": false,
"description": "(Optional) The page-continuation token",
"in": "query",
"name": "skipToken",
"type": "string",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"parameters": {
"subscriptionId": "subscriptionId1",
"resourceGroupName": "resourceGroup1",
"resourceProviderNamespace": "resourceProvider1",
"resourceType": "resourceType1",
"resourceName": "resourceName1",
"api-version": "2022-03-01-preview",
"changeResourceId": "1d58d72f-0719-4a48-9228-b7ea682885bf"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subscriptionId1/resourceGroups/resourceGroup1/providers/resourceProvider1/resourceType1/resourceName1/Microsoft.Resources/changes/1d58d72f-0719-4a48-9228-b7ea682885bf",
"name": "1d58d72f-0719-4a48-9228-b7ea682885bf",
"type": "Microsoft.Resources/changes",
"properties": {
"targetResourceId": "/subscriptions/subscriptionId1/resourceGroups/resourceGroup1/providers/resourceProvider1/resourceType1/resourceName1",
"targetResourceType": "resourceProvider1/resourceType1",
"changeType": "Update",
"changeAttributes": {
"correlationId": "88420d5d-8d0e-471f-9115-10d34750c617",
"timestamp": "2021-11-19T14:29:09.9210000Z",
"changesCount": 2,
"previousResourceSnapshotId": "ed90e35a-1661-42cc-a44c-e27f508005be",
"newResourceSnapshotId": "6eac9d0f-63b4-4e7f-97a5-740c73757efb"
},
"changes": {
"properties.provisioningState": {
"propertyChangeType": "Update",
"changeCategory": "System",
"previousValue": "Updating",
"newValue": "Succeeded"
},
"tags.key1": {
"propertyChangeType": "Insert",
"changeCategory": "User",
"previousValue": "null",
"newValue": "someValue"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"parameters": {
"subscriptionId": "subscriptionId1",
"resourceGroupName": "resourceGroup1",
"resourceProviderNamespace": "resourceProvider1",
"resourceType": "resourceType1",
"resourceName": "resourceName1",
"api-version": "2022-03-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/subscriptionId1/resourceGroups/resourceGroup1/providers/resourceProvider1/resourceType1/resourceName1/Microsoft.Resources/changes/a9f34285-13a2-e79c-f468-cfb71c7bd227",
"name": "a9f34285-13a2-e79c-f468-cfb71c7bd227",
"type": "Microsoft.Resources/changes",
"properties": {
"targetResourceId": "/subscriptions/subscriptionId1/resourceGroups/resourceGroup1/providers/resourceProvider1/resourceType1/resourceName1",
"targetResourceType": "resourceProvider1/resourceType1",
"changeType": "Update",
"changeAttributes": {
"correlationId": "88420d5d-8d0e-471f-9115-10d34750c617",
"timestamp": "2021-11-19T14:29:09.9210000Z",
"changesCount": 2,
"previousResourceSnapshotId": "ed90e35a-1661-42cc-a44c-e27f508005be",
"newResourceSnapshotId": "6eac9d0f-63b4-4e7f-97a5-740c73757efb"
},
"changes": {
"properties.provisioningState": {
"propertyChangeType": "Update",
"changeCategory": "System",
"previousValue": "Updating",
"newValue": "Succeeded"
},
"tags.key1": {
"propertyChangeType": "Insert",
"changeCategory": "User",
"previousValue": "null",
"newValue": "someValue"
}
}
}
},
{
"id": "/subscriptions/subscriptionId1/resourceGroups/resourceGroup1/providers/resourceProvider1/resourceType1/resourceName1/Microsoft.Resources/changes/a9f34285-13a2-e79c-f468-cfb71c7bd227",
"name": "a9f34285-13a2-e79c-f468-cfb71c7bd227",
"type": "Microsoft.Resources/changes",
"properties": {
"targetResourceId": "/subscriptions/subscriptionId1/resourceGroups/resourceGroup1/providers/resourceProvider1/resourceType1/resourceName1",
"targetResourceType": "resourceProvider1/resourceType1",
"changeType": "Create",
"changeAttributes": {
"changesCount": 0,
"correlationId": "88420d5d-8d0e-471f-9115-10d34750c617",
"timestamp": "2021-11-19T14:29:09.9210000Z",
"previousResourceSnapshotId": "b09f5e52-0b46-4d13-84a9-08653d39fed6",
"newResourceSnapshotId": "4db20fc0-de17-4cdd-92d8-fd6bf94b9fd9"
},
"changes": {}
}
}
]
}
}
}
}
24 changes: 24 additions & 0 deletions specification/resources/resource-manager/readme.md
Original file line number Diff line number Diff line change
@@ -68,6 +68,19 @@ tag: package-deploymentscripts-2020-10
tag: package-templatespecs-2021-05
```
``` yaml $(package-changes)
tag: package-changes-2022-03
```
### Tag: package-changes-2022-03
These settings apply only when `--tag=package-changes-2022-03-01-preview` is specified on the command line.

``` yaml $(tag) == 'package-changes-2022-03'
input-file:
- Microsoft.Resources/preview/2022-03-01-preview/changes.json
```

### Tag: package-policy-2021-06

These settings apply only when `--tag=package-policy-2021-06` is specified on the command line.
@@ -835,6 +848,16 @@ directive:
- suppress: TopLevelResourcesListByResourceGroup
from: privateLinks.json
reason: The resource is managed in a management group level (instead of inside a resource group)
- suppress: TopLevelResourcesListBySubscription
from: changes.json
reason: We will be pushing customers to use Azure Resource Graph for those at scale scenarios.
- from: changes.json
suppress: OperationsAPIImplementation
where: $.paths
reason: 'Duplicate Operations API causes generation issues'
- suppress: RequiredReadOnlySystemData
from: changes.json
reason: System Metadata from a change resource perspective is irrelevant
```

---
@@ -884,6 +907,7 @@ batch:
- package-managedapplications: true
- package-deploymentscripts: true
- package-templatespecs: true
- package-changes: true
```

### Tag: profile-hybrid-2019-03-01