{ "swagger": "2.0", "info": { "title": "ManagementLockClient", "version": "2016-09-01", "description": "Azure resources can be locked to prevent other users in your organization from deleting or modifying resources." }, "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": { "/providers/Microsoft.Authorization/operations": { "get": { "tags": [ "Operations" ], "operationId": "AuthorizationOperations_List", "description": "Lists all of the available Microsoft.Authorization REST API operations.", "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK. The request has succeeded.", "schema": { "$ref": "#/definitions/OperationListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List provider operations": { "$ref": "./examples/ListProviderOperations.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}": { "put": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_CreateOrUpdateAtResourceGroupLevel", "summary": "Creates or updates a management lock at the resource group level.", "description": "When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group to lock.", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \\, ?, /, or any control characters." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ManagementLockObject" }, "description": "The management lock parameters." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } }, "201": { "description": "Created - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Create management lock at resource group level": { "$ref": "./examples/ManagementLocks_CreateOrUpdateAtResourceGroupLevel.json" } } }, "delete": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_DeleteAtResourceGroupLevel", "summary": "Deletes a management lock at the resource group level.", "description": "To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing the lock.", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock to delete." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "NoContent" }, "200": { "description": "OK" } }, "x-ms-examples": { "Delete management lock at resource group level": { "$ref": "./examples/ManagementLocks_DeleteAtResourceGroupLevel.json" } } }, "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_GetAtResourceGroupLevel", "description": "Gets a management lock at the resource group level.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the locked resource group.", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of the lock to get." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Get management lock at resource group level": { "$ref": "./examples/ManagementLocks_GetAtResourceGroupLevel.json" } } } }, "/{scope}/providers/Microsoft.Authorization/locks/{lockName}": { "put": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_CreateOrUpdateByScope", "description": "Create or update a management lock by scope.", "parameters": [ { "name": "scope", "in": "path", "required": true, "type": "string", "description": "The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources." }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ManagementLockObject" }, "description": "Create or update management lock parameters." }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ManagementLockObject" } }, "201": { "description": "Created", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Create management lock at scope": { "$ref": "./examples/ManagementLocks_CreateOrUpdateAtScope.json" } } }, "delete": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_DeleteByScope", "description": "Delete a management lock by scope.", "parameters": [ { "name": "scope", "in": "path", "required": true, "type": "string", "description": "The scope for the lock. " }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock." }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "204": { "description": "NoContent" }, "200": { "description": "OK" } }, "x-ms-examples": { "Delete management lock at scope": { "$ref": "./examples/ManagementLocks_DeleteAtScope.json" } } }, "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_GetByScope", "description": "Get a management lock by scope.", "parameters": [ { "name": "scope", "in": "path", "required": true, "type": "string", "description": "The scope for the lock. " }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock." }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Get management lock at scope": { "$ref": "./examples/ManagementLocks_GetAtScope.json" } } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}": { "put": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_CreateOrUpdateAtResourceLevel", "summary": "Creates or updates a management lock at the resource level or any level below the resource.", "description": "When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing the resource to lock. ", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "resourceProviderNamespace", "in": "path", "required": true, "type": "string", "description": "The resource provider namespace of the resource to lock." }, { "name": "parentResourcePath", "in": "path", "required": true, "type": "string", "description": "The parent resource identity.", "x-ms-skip-url-encoding": true }, { "name": "resourceType", "in": "path", "required": true, "type": "string", "description": "The resource type of the resource to lock.", "x-ms-skip-url-encoding": true }, { "name": "resourceName", "in": "path", "required": true, "type": "string", "description": "The name of the resource to lock." }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \\, ?, /, or any control characters." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ManagementLockObject" }, "description": "Parameters for creating or updating a management lock." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } }, "201": { "description": "Created - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Create management lock at resource level": { "$ref": "./examples/ManagementLocks_CreateOrUpdateAtResourceLevel.json" } } }, "delete": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_DeleteAtResourceLevel", "summary": "Deletes the management lock of a resource or any level below the resource.", "description": "To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing the resource with the lock to delete. ", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "resourceProviderNamespace", "in": "path", "required": true, "type": "string", "description": "The resource provider namespace of the resource with the lock to delete." }, { "name": "parentResourcePath", "in": "path", "required": true, "type": "string", "description": "The parent resource identity.", "x-ms-skip-url-encoding": true }, { "name": "resourceType", "in": "path", "required": true, "type": "string", "description": "The resource type of the resource with the lock to delete.", "x-ms-skip-url-encoding": true }, { "name": "resourceName", "in": "path", "required": true, "type": "string", "description": "The name of the resource with the lock to delete." }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of the lock to delete." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "NoContent" }, "200": { "description": "OK" } }, "x-ms-examples": { "Delete management lock at resource level": { "$ref": "./examples/ManagementLocks_DeleteAtResourceLevel.json" } } }, "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_GetAtResourceLevel", "description": "Get the management lock of a resource or any level below resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group. ", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "resourceProviderNamespace", "in": "path", "required": true, "type": "string", "description": "The namespace of the resource provider." }, { "name": "parentResourcePath", "in": "path", "required": true, "type": "string", "description": "An extra path parameter needed in some services, like SQL Databases.", "x-ms-skip-url-encoding": true }, { "name": "resourceType", "in": "path", "required": true, "type": "string", "description": "The type of the resource.", "x-ms-skip-url-encoding": true }, { "name": "resourceName", "in": "path", "required": true, "type": "string", "description": "The name of the resource." }, { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Get management lock at resource level": { "$ref": "./examples/ManagementLocks_GetAtResourceLevel.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}": { "put": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_CreateOrUpdateAtSubscriptionLevel", "summary": "Creates or updates a management lock at the subscription level.", "description": "When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.", "parameters": [ { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \\, ?, /, or any control characters." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ManagementLockObject" }, "description": "The management lock parameters." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Created - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } }, "200": { "description": "OK - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Create management lock at subscription level": { "$ref": "./examples/ManagementLocks_CreateOrUpdateAtSubscriptionLevel.json" } } }, "delete": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_DeleteAtSubscriptionLevel", "summary": "Deletes the management lock at the subscription level.", "description": "To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.", "parameters": [ { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of lock to delete." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "NoContent" }, "200": { "description": "OK" } }, "x-ms-examples": { "Delete management lock at subscription level": { "$ref": "./examples/ManagementLocks_DeleteAtSubscriptionLevel.json" } } }, "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_GetAtSubscriptionLevel", "description": "Gets a management lock at the subscription level.", "parameters": [ { "name": "lockName", "in": "path", "required": true, "type": "string", "description": "The name of the lock to get." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns information about the lock.", "schema": { "$ref": "#/definitions/ManagementLockObject" } } }, "x-ms-examples": { "Get management lock at subscription level": { "$ref": "./examples/ManagementLocks_GetAtSubscriptionLevel.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks": { "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_ListAtResourceGroupLevel", "description": "Gets all the management locks for a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing the locks to get.", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "The filter to apply on the operation." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns an array of resource locks.", "schema": { "$ref": "#/definitions/ManagementLockListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/ManagementLockObject", "x-ms-examples": { "List management groups at resource group level": { "$ref": "./examples/ManagementLocks_ListAtResourceGroupLevel.json" } } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks": { "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_ListAtResourceLevel", "description": "Gets all the management locks for a resource or any level below resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing the locked resource. The name is case insensitive.", "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 }, { "name": "resourceProviderNamespace", "in": "path", "required": true, "type": "string", "description": "The namespace of the resource provider." }, { "name": "parentResourcePath", "in": "path", "required": true, "type": "string", "description": "The parent resource identity.", "x-ms-skip-url-encoding": true }, { "name": "resourceType", "in": "path", "required": true, "type": "string", "description": "The resource type of the locked resource.", "x-ms-skip-url-encoding": true }, { "name": "resourceName", "in": "path", "required": true, "type": "string", "description": "The name of the locked resource." }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "The filter to apply on the operation." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns an array of resource locks.", "schema": { "$ref": "#/definitions/ManagementLockListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/ManagementLockObject", "x-ms-examples": { "List management locks at resource level": { "$ref": "./examples/ManagementLocks_ListAtResourceLevel.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks": { "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_ListAtSubscriptionLevel", "description": "Gets all the management locks for a subscription.", "parameters": [ { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "The filter to apply on the operation." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "OK - Returns an array of resource locks.", "schema": { "$ref": "#/definitions/ManagementLockListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/ManagementLockObject", "x-ms-examples": { "List management locks at subscription level": { "$ref": "./examples/ManagementLocks_ListAtSubscriptionLevel.json" } } } }, "/{scope}/providers/Microsoft.Authorization/locks": { "get": { "tags": [ "ManagementLocks" ], "operationId": "ManagementLocks_ListByScope", "description": "Gets all the management locks for a scope.", "parameters": [ { "name": "scope", "in": "path", "required": true, "type": "string", "description": "The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources." }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "The filter to apply on the operation." }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns an array of resource locks.", "schema": { "$ref": "#/definitions/ManagementLockListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/ManagementLockObject", "x-ms-examples": { "List management locks at scope": { "$ref": "./examples/ManagementLocks_ListAtScope.json" } } } } }, "definitions": { "ManagementLockOwner": { "properties": { "applicationId": { "type": "string", "description": "The application ID of the lock owner." } }, "description": "Lock owner properties." }, "ManagementLockProperties": { "properties": { "level": { "type": "string", "description": "The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.", "enum": [ "NotSpecified", "CanNotDelete", "ReadOnly" ], "x-ms-enum": { "name": "LockLevel", "modelAsString": true } }, "notes": { "type": "string", "description": "Notes about the lock. Maximum of 512 characters." }, "owners": { "type": "array", "items": { "$ref": "#/definitions/ManagementLockOwner" }, "description": "The owners of the lock." } }, "required": [ "level" ], "description": "The lock properties." }, "ManagementLockObject": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ManagementLockProperties", "description": "The properties of the lock." }, "id": { "readOnly": true, "type": "string", "description": "The resource ID of the lock." }, "type": { "readOnly": true, "type": "string", "description": "The resource type of the lock - Microsoft.Authorization/locks." }, "name": { "readOnly": true, "type": "string", "description": "The name of the lock." } }, "required": [ "properties" ], "description": "The lock information.", "x-ms-azure-resource": true }, "ManagementLockListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ManagementLockObject" }, "description": "The list of locks." }, "nextLink": { "type": "string", "description": "The URL to use for getting the next set of results." } }, "description": "The list of locks." }, "Operation": { "description": "Microsoft.Authorization operation", "type": "object", "properties": { "name": { "description": "Operation name: {provider}/{resource}/{operation}", "type": "string" }, "display": { "description": "The object that represents the operation.", "properties": { "provider": { "description": "Service provider: Microsoft.Authorization", "type": "string" }, "resource": { "description": "Resource on which the operation is performed: Profile, endpoint, etc.", "type": "string" }, "operation": { "description": "Operation type: Read, write, delete, etc.", "type": "string" } } } } }, "OperationListResult": { "description": "Result of the request to list Microsoft.Authorization operations. It contains a list of operations and a URL link to get the next set of results.", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Operation" }, "description": "List of Microsoft.Authorization operations." }, "nextLink": { "type": "string", "description": "URL to get the next set of operation list results if there are any." } } } }, "parameters": { "SubscriptionIdParameter": { "name": "subscriptionId", "in": "path", "required": true, "type": "string", "description": "The ID of the target subscription." }, "ApiVersionParameter": { "name": "api-version", "in": "query", "required": true, "type": "string", "description": "The API version to use for the operation." } } }