swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: ManagementLockClient
  version: 2015-01-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/resources/resource-manager/Microsoft.Authorization/stable/2015-01-01/locks.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: resources-locks
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: The API version to use for the operation.
    in: query
    name: api-version
    required: true
    type: string
  SubscriptionIdParameter:
    description: The ID of the target subscription.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks":
    get:
      description: Gets all the management locks of a subscription.
      operationId: ManagementLocks_ListAtSubscriptionLevel
      parameters:
        - description: The filter to apply on the operation.
          in: query
          name: $filter
          required: false
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockListResult"
      tags:
        - ManagementLocks
      x-ms-odata: "#/definitions/ManagementLockObject"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}":
    delete:
      description: Deletes the management lock of a subscription.
      operationId: ManagementLocks_DeleteAtSubscriptionLevel
      parameters:
        - description: The name of lock.
          in: path
          name: lockName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
        "204":
          description: NoContent
      tags:
        - ManagementLocks
    get:
      description: Gets the management lock of a scope.
      operationId: ManagementLocks_Get
      parameters:
        - description: Name of the management lock.
          in: path
          name: lockName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockObject"
      tags:
        - ManagementLocks
    put:
      description: Create or update a management lock at the subscription level.
      operationId: ManagementLocks_CreateOrUpdateAtSubscriptionLevel
      parameters:
        - description: The name of lock.
          in: path
          name: lockName
          required: true
          type: string
        - description: The management lock parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ManagementLockObject"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockObject"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/ManagementLockObject"
      tags:
        - ManagementLocks
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks":
    get:
      description: Gets all the management locks of a resource group.
      operationId: ManagementLocks_ListAtResourceGroupLevel
      parameters:
        - description: Resource group name.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: The filter to apply on the operation.
          in: query
          name: $filter
          required: false
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockListResult"
      tags:
        - ManagementLocks
      x-ms-odata: "#/definitions/ManagementLockObject"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}":
    delete:
      description: Deletes the management lock of a resource group.
      operationId: ManagementLocks_DeleteAtResourceGroupLevel
      parameters:
        - description: The resource group name.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: The name of lock.
          in: path
          name: lockName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
        "204":
          description: NoContent
      tags:
        - ManagementLocks
    get:
      description: Gets a management lock at the resource group level.
      operationId: ManagementLocks_GetAtResourceGroupLevel
      parameters:
        - description: The resource group name.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: The lock name.
          in: path
          name: lockName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockObject"
      tags:
        - ManagementLocks
    put:
      description: Create or update a management lock at the resource group level.
      operationId: ManagementLocks_CreateOrUpdateAtResourceGroupLevel
      parameters:
        - description: The resource group name.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: The lock name.
          in: path
          name: lockName
          required: true
          type: string
        - description: The management lock parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ManagementLockObject"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockObject"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/ManagementLockObject"
      tags:
        - ManagementLocks
  "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks":
    get:
      description: Gets all the management locks of a resource or any level below resource.
      operationId: ManagementLocks_ListAtResourceLevel
      parameters:
        - description: The name of the resource group. The name is case insensitive.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: Resource identity.
          in: path
          name: resourceProviderNamespace
          required: true
          type: string
        - description: Resource identity.
          in: path
          name: parentResourcePath
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Resource identity.
          in: path
          name: resourceType
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Resource identity.
          in: path
          name: resourceName
          required: true
          type: string
        - description: The filter to apply on the operation.
          in: query
          name: $filter
          required: false
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockListResult"
      tags:
        - ManagementLocks
      x-ms-odata: "#/definitions/ManagementLockObject"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}":
    delete:
      description: Deletes the management lock of a resource or any level below resource.
      operationId: ManagementLocks_DeleteAtResourceLevel
      parameters:
        - description: "The name of the resource group. "
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: Resource identity.
          in: path
          name: resourceProviderNamespace
          required: true
          type: string
        - description: Resource identity.
          in: path
          name: parentResourcePath
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Resource identity.
          in: path
          name: resourceType
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Resource identity.
          in: path
          name: resourceName
          required: true
          type: string
        - description: The name of lock.
          in: path
          name: lockName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
        "204":
          description: NoContent
      tags:
        - ManagementLocks
    put:
      description: Create or update a management lock at the resource level or any level below resource.
      operationId: ManagementLocks_CreateOrUpdateAtResourceLevel
      parameters:
        - description: "The name of the resource group. "
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
        - description: Resource identity.
          in: path
          name: resourceProviderNamespace
          required: true
          type: string
        - description: Resource identity.
          in: path
          name: parentResourcePath
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Resource identity.
          in: path
          name: resourceType
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Resource identity.
          in: path
          name: resourceName
          required: true
          type: string
        - description: The name of lock.
          in: path
          name: lockName
          required: true
          type: string
        - description: Create or update management lock parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ManagementLockObject"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ManagementLockObject"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/ManagementLockObject"
      tags:
        - ManagementLocks
definitions:
  ManagementLockListResult:
    description: List of management locks.
    properties:
      nextLink:
        description: The URL to get the next set of results.
        type: string
      value:
        description: The list of locks.
        items:
          $ref: "#/definitions/ManagementLockObject"
        type: array
  ManagementLockObject:
    description: Management lock information.
    properties:
      id:
        description: The Id of the lock.
        readOnly: true
        type: string
      name:
        description: The name of the lock.
        type: string
      properties:
        $ref: "#/definitions/ManagementLockProperties"
        description: The properties of the lock.
        x-ms-client-flatten: true
      type:
        description: The type of the lock.
        readOnly: true
        type: string
    x-ms-azure-resource: true
  ManagementLockProperties:
    description: The management lock properties.
    properties:
      level:
        description: The lock level of the management lock.
        enum:
          - NotSpecified
          - CanNotDelete
          - ReadOnly
        type: string
        x-ms-enum:
          modelAsString: true
          name: LockLevel
      notes:
        description: The notes of the management lock.
        type: string
