swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Azure resources can be linked together to form logical relationships. You can establish links between resources belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or moved, the link owner must clean up the remaining link.
  title: ManagementLinkClient
  version: 2016-09-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.Resources/stable/2016-09-01/links.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: resources-links
  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:
  /providers/Microsoft.Resources/operations:
    get:
      description: Lists all of the available Microsoft.Resources REST API operations.
      operationId: Operations_List
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK. The request has succeeded.
          schema:
            $ref: "#/definitions/OperationListResult"
      tags:
        - Operations
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/links":
    get:
      description: Gets all the linked resources for the subscription.
      operationId: ResourceLinks_ListAtSubscription
      parameters:
        - description: The filter to apply on the list resource links operation. The supported filter for list resource links is targetId. For example, $filter=targetId eq {value}
          in: query
          name: $filter
          required: false
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Returns an array of resource links for the subscription.
          schema:
            $ref: "#/definitions/ResourceLinkResult"
      tags:
        - ResourceLinks
      x-ms-odata: "#/definitions/ResourceLinkFilter"
      x-ms-pageable:
        nextLinkName: nextLink
  "/{linkId}":
    delete:
      description: Deletes a resource link with the specified ID.
      operationId: ResourceLinks_Delete
      parameters:
        - description: The fully qualified ID of the resource link. Use the format, /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
          in: path
          name: linkId
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK
        "204":
          description: No Content
      tags:
        - ResourceLinks
    get:
      description: Gets a resource link with the specified ID.
      operationId: ResourceLinks_Get
      parameters:
        - description: The fully qualified Id of the resource link. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
          in: path
          name: linkId
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK - Returns information about the resource link.
          schema:
            $ref: "#/definitions/ResourceLink"
      tags:
        - ResourceLinks
    put:
      description: Creates or updates a resource link between the specified resources.
      operationId: ResourceLinks_CreateOrUpdate
      parameters:
        - description: The fully qualified ID of the resource link. Use the format, /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
          in: path
          name: linkId
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: Parameters for creating or updating a resource link.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ResourceLink"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK - Returns information about the link.
          schema:
            $ref: "#/definitions/ResourceLink"
        "201":
          description: Created - Returns information about the link.
          schema:
            $ref: "#/definitions/ResourceLink"
      tags:
        - ResourceLinks
  "/{scope}/providers/Microsoft.Resources/links":
    get:
      description: Gets a list of resource links at and below the specified source scope.
      operationId: ResourceLinks_ListAtSourceScope
      parameters:
        - description: The fully qualified ID of the scope for getting the resource links. For example, to list resource links at and under a resource group, set the scope to /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup.
          in: path
          name: scope
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - description: The filter to apply when getting resource links. To get links only at the specified scope (not below the scope), use Filter.atScope().
          enum:
            - atScope()
          in: query
          name: $filter
          required: false
          type: string
          x-ms-enum:
            modelAsString: false
            name: Filter
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK - Returns an array of links at the specified scope.
          schema:
            $ref: "#/definitions/ResourceLinkResult"
      tags:
        - ResourceLinks
      x-ms-odata: "#/definitions/ResourceLinkFilter"
      x-ms-pageable:
        nextLinkName: nextLink
definitions:
  Operation:
    description: Microsoft.Resources operation
    properties:
      display:
        description: The object that represents the operation.
        properties:
          description:
            description: Description of the operation.
            type: string
          operation:
            description: "Operation type: Read, write, delete, etc."
            type: string
          provider:
            description: "Service provider: Microsoft.Resources"
            type: string
          resource:
            description: "Resource on which the operation is performed: Profile, endpoint, etc."
            type: string
      name:
        description: "Operation name: {provider}/{resource}/{operation}"
        type: string
    type: object
  OperationListResult:
    description: Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the next set of results.
    properties:
      nextLink:
        description: URL to get the next set of operation list results if there are any.
        type: string
      value:
        description: List of Microsoft.Resources operations.
        items:
          $ref: "#/definitions/Operation"
        type: array
  ResourceLink:
    description: The resource link.
    properties:
      id:
        description: The fully qualified ID of the resource link.
        readOnly: true
        type: string
      name:
        description: The name of the resource link.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/ResourceLinkProperties"
        description: Properties for resource link.
      type:
        description: The resource link object.
        readOnly: true
        type: object
    x-ms-azure-resource: true
  ResourceLinkFilter:
    description: Resource link filter.
    properties:
      targetId:
        description: The ID of the target resource.
        type: string
    required:
      - targetId
  ResourceLinkProperties:
    description: The resource link properties.
    properties:
      notes:
        description: Notes about the resource link.
        type: string
      sourceId:
        description: "The fully qualified ID of the source resource in the link. "
        readOnly: true
        type: string
      targetId:
        description: The fully qualified ID of the target resource in the link.
        type: string
    required:
      - targetId
  ResourceLinkResult:
    description: List of resource links.
    properties:
      nextLink:
        description: The URL to use for getting the next set of results.
        readOnly: true
        type: string
      value:
        description: An array of resource links.
        items:
          $ref: "#/definitions/ResourceLink"
        type: array
    required:
      - value
