diff --git a/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/changes.json b/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/changes.json new file mode 100644 index 000000000000..a2b0cf9b4943 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/changes.json @@ -0,0 +1,499 @@ +{ + "swagger": "2.0", + "info": { + "version": "2023-07-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": "Changes_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": "Changes_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": "Delete" + }, + { + "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 + }, + "isTruncated": { + "description": "The flag indicating whether property changes dictionary was truncated in this resource", + "type": "boolean", + "readOnly": true + }, + "changedBy": { + "description": "The entity that made the change(s)", + "type": "string", + "readOnly": true + }, + "changedByType": { + "description": "The entity type that made the change(s)", + "type": "string", + "readOnly": true, + "enum": [ + "Application", + "User", + "ManagedIdentity", + "Unknown" + ], + "x-ms-enum": { + "name": "changedByType", + "modelAsString": true, + "values": [ + { + "value": "Application", + "description": "An application made the change(s)", + "name": "Application" + }, + { + "value": "User", + "description": "A user made the change(s)", + "name": "User" + }, + { + "value": "ManagedIdentity", + "description": "A ManagedIdentity made the change(s)", + "name": "ManagedIdentity" + } + ] + } + }, + "clientType": { + "description": "Client used to make the changes", + "type": "string", + "readOnly": true, + "enum": [ + "CLI", + "Portal", + "SDK" + ], + "x-ms-enum": { + "name": "clientType", + "modelAsString": true, + "values": [ + { + "value": "CLI", + "description": "The change(s) were made through the Command Line Interface", + "name": "CLI" + }, + { + "value": "Portal", + "description": "The change(s) were made through the Portal", + "name": "Portal" + }, + { + "value": "SDK", + "description": "The change(s) were made through a Software Development Kit", + "name": "SDK" + } + ] + } + }, + "operation": { + "description": "The Azure Resource Provider operation that was invoked to make the change(s). See [here](https://learn.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations) for a full list of possible values", + "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" + } + ] + } + }, + "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)", + "x-ms-parameter-location": "method" + }, + "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.", + "x-ms-parameter-location": "method" + }, + "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": 100, + "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" + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/examples/GetChange.json b/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/examples/GetChange.json new file mode 100644 index 000000000000..5839c38fa203 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/examples/GetChange.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "subscriptionId": "subscriptionId1", + "resourceGroupName": "resourceGroup1", + "resourceProviderNamespace": "resourceProvider1", + "resourceType": "resourceType1", + "resourceName": "resourceName1", + "api-version": "2023-07-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", + "changedBy": "someAlias@microsoft.com", + "changedByType": "User", + "clientType": "Portal", + "operation": "Microsoft.Namespace/ResourceType/write" + }, + "changes": { + "properties.provisioningState": { + "propertyChangeType": "Update", + "changeCategory": "System", + "previousValue": "Updating", + "newValue": "Succeeded" + }, + "tags.key1": { + "propertyChangeType": "Insert", + "changeCategory": "User", + "previousValue": "null", + "newValue": "someValue" + } + } + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/examples/ListChanges.json b/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/examples/ListChanges.json new file mode 100644 index 000000000000..df24e11543e4 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/preview/2023-07-01-preview/examples/ListChanges.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "subscriptionId": "subscriptionId1", + "resourceGroupName": "resourceGroup1", + "resourceProviderNamespace": "resourceProvider1", + "resourceType": "resourceType1", + "resourceName": "resourceName1", + "api-version": "2023-07-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", + "changedBy": "9500bb33-43da-4588-80b8-f65430dd937a", + "changedByType": "Application", + "clientType": "SDK", + "operation": "Microsoft.Namespace/ResourceType/write" + }, + "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", + "changedBy": "9500bb33-43da-4588-80b8-f65430dd937a", + "changedByType": "Application", + "clientType": "SDK", + "operation": "Microsoft.Namespace/ResourceType/write" + }, + "changes": {} + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index ca8c4cff698a..4edb6d949335 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -159,6 +159,15 @@ input-file: - Microsoft.Resources/preview/2023-03-01-preview/changes.json ``` +### Tag: package-changes-2023-07-01-preview + +These settings apply only when `--tag=package-changes-2023-07-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-changes-2023-07-01-preview' +input-file: +- Microsoft.Resources/preview/2023-07-01-preview/changes.json +``` + ### Tag: package-snapshots-2022-11 These settings apply only when `--tag=package-snapshots-2022-11` is specified on the command line. @@ -1089,6 +1098,12 @@ directive: - suppress: RequiredReadOnlySystemData from: changes.json reason: System Metadata from a change resource perspective is irrelevant + - suppress: ResourceNameRestriction + from: changes.json + reason: change resources cannot be created or named by end users + - from: changes.json + suppress: OperationsAPIImplementation + reason: Duplicate Operations API causes generation issues - from: resources.json suppress: R4009 where: