swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Use these REST APIs for performing operations on Cache entity in your Azure API Management deployment. Azure API Management also allows for caching responses in an external Azure Cache for Redis. For more information refer to [External Redis Cache in ApiManagement](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-cache-external).
  title: ApiManagementClient
  version: 2019-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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2019-01-01/apimcaches.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: apimanagement-apimcaches
  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: {}
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches":
    get:
      description: Lists a collection of all external Caches in the specified service instance.
      operationId: Cache_ListByService
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Number of records to return.
          format: int32
          in: query
          minimum: 1
          name: $top
          required: false
          type: integer
          x-ms-parameter-location: method
        - description: Number of records to skip.
          format: int32
          in: query
          minimum: 0
          name: $skip
          required: false
          type: integer
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: Returns a collection of Cache entity.
          schema:
            description: Paged Caches list representation.
            properties:
              nextLink:
                description: Next page link if any.
                type: string
              value:
                description: Page values.
                items:
                  allOf:
                    - description: The Resource definition.
                      properties:
                        id:
                          description: Resource ID.
                          readOnly: true
                          type: string
                        name:
                          description: Resource name.
                          readOnly: true
                          type: string
                        type:
                          description: Resource type for API Management resource.
                          readOnly: true
                          type: string
                      x-ms-azure-resource: true
                  description: Cache details.
                  properties:
                    properties:
                      description: Properties of the Cache contract.
                      properties:
                        connectionString:
                          description: Runtime connection string to cache
                          maxLength: 300
                          type: string
                        description:
                          description: Cache description
                          maxLength: 2000
                          type: string
                        resourceId:
                          description: Original uri of entity in external system cache points to
                          maxLength: 2000
                          type: string
                      required:
                        - connectionString
                type: array
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Cache
      x-ms-examples:
        ApiManagementListCaches:
          parameters:
            api-version: 2019-01-01
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/westindia
                    name: westindia
                    properties:
                      connectionString: "{{5c68d535a40f7e61103cd285}}}"
                      description: Redis cache instances in West India
                      resourceId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/contoso5
                    type: Microsoft.ApiManagement/service/caches
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}":
    delete:
      description: Deletes specific Cache.
      operationId: Cache_Delete
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
          in: path
          maxLength: 80
          minLength: 1
          name: cacheId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
          in: header
          name: If-Match
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The Cache was successfully deleted.
        "204":
          description: The Cache was successfully deleted.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Cache
      x-ms-examples:
        ApiManagementDeleteCache:
          parameters:
            If-Match: "*"
            api-version: 2019-01-01
            cacheId: southindia
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200": {}
            "204": {}
    get:
      description: Gets the details of the Cache specified by its identifier.
      operationId: Cache_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
          in: path
          maxLength: 80
          minLength: 1
          name: cacheId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The response body contains the specified Cache entity.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Cache details.
            properties:
              properties:
                description: Properties of the Cache contract.
                properties:
                  connectionString:
                    description: Runtime connection string to cache
                    maxLength: 300
                    type: string
                  description:
                    description: Cache description
                    maxLength: 2000
                    type: string
                  resourceId:
                    description: Original uri of entity in external system cache points to
                    maxLength: 2000
                    type: string
                required:
                  - connectionString
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Cache
      x-ms-examples:
        ApiManagementGetCache:
          parameters:
            api-version: 2019-01-01
            cacheId: westindia
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/westindia
                name: westindia
                properties:
                  connectionString: "{{5c68d535a40f7e61103cd285}}}"
                  description: Redis cache instances in West India
                  resourceId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/contoso5
                type: Microsoft.ApiManagement/service/caches
    head:
      description: Gets the entity state (Etag) version of the Cache specified by its identifier.
      operationId: Cache_GetEntityTag
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
          in: path
          maxLength: 80
          minLength: 1
          name: cacheId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: Specified Cache entity exists and current entity state version is present in the ETag header.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Cache
      x-ms-examples:
        ApiManagementHeadCache:
          parameters:
            api-version: 2019-01-01
            cacheId: default
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              headers:
                etag: AAAAAAAAAAa=
    patch:
      description: Updates the details of the cache specified by its identifier.
      operationId: Cache_Update
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
          in: path
          maxLength: 80
          minLength: 1
          name: cacheId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Update parameters.
          in: body
          name: parameters
          required: true
          schema:
            description: Cache update details.
            properties:
              properties:
                description: Parameters supplied to the Update Cache operation.
                properties:
                  connectionString:
                    description: Runtime connection string to cache
                    maxLength: 300
                    type: string
                  description:
                    description: Cache description
                    maxLength: 2000
                    type: string
                  resourceId:
                    description: Original uri of entity in external system cache points to
                    maxLength: 2000
                    type: string
        - description: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
          in: header
          name: If-Match
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "204":
          description: The cache details were successfully updated.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Cache
      x-ms-examples:
        ApiManagementUpdateCache:
          parameters:
            If-Match: "*"
            api-version: 2019-01-01
            cacheId: westindia
            parameters:
              properties:
                description: Update Cache in west India
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "204": {}
    put:
      description: Creates or updates an External Cache to be used in Api Management instance.
      externalDocs:
        description: Use an external cache in Azure API Management
        url: https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-cache-external
      operationId: Cache_CreateOrUpdate
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
          in: path
          maxLength: 80
          minLength: 1
          name: cacheId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Create or Update parameters.
          in: body
          name: parameters
          required: true
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Cache details.
            properties:
              properties:
                description: Properties of the Cache contract.
                properties:
                  connectionString:
                    description: Runtime connection string to cache
                    maxLength: 300
                    type: string
                  description:
                    description: Cache description
                    maxLength: 2000
                    type: string
                  resourceId:
                    description: Original uri of entity in external system cache points to
                    maxLength: 2000
                    type: string
                required:
                  - connectionString
        - description: ETag of the Entity. Not required when creating an entity, but required when updating an entity.
          in: header
          name: If-Match
          required: false
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The Cache details were successfully updated.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Cache details.
            properties:
              properties:
                description: Properties of the Cache contract.
                properties:
                  connectionString:
                    description: Runtime connection string to cache
                    maxLength: 300
                    type: string
                  description:
                    description: Cache description
                    maxLength: 2000
                    type: string
                  resourceId:
                    description: Original uri of entity in external system cache points to
                    maxLength: 2000
                    type: string
                required:
                  - connectionString
        "201":
          description: The new Cache was successfully added.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Cache details.
            properties:
              properties:
                description: Properties of the Cache contract.
                properties:
                  connectionString:
                    description: Runtime connection string to cache
                    maxLength: 300
                    type: string
                  description:
                    description: Cache description
                    maxLength: 2000
                    type: string
                  resourceId:
                    description: Original uri of entity in external system cache points to
                    maxLength: 2000
                    type: string
                required:
                  - connectionString
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Cache
      x-ms-examples:
        ApiManagementCreateCache:
          parameters:
            api-version: 2019-01-01
            cacheId: westindia
            parameters:
              properties:
                connectionString: contoso5.redis.cache.windows.net,ssl=true,password=...
                description: Redis cache instances in West India
                resourceId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/contoso5
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/westindia
                name: westindia
                properties:
                  connectionString: "{{5c68d535a40f7e61103cd285}}}"
                  description: Redis cache instances in West India
                  resourceId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/contoso5
                type: Microsoft.ApiManagement/service/caches
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/westindia
                name: westindia
                properties:
                  connectionString: "{{5c68d535a40f7e61103cd285}}}"
                  description: Redis cache instances in West India
                  resourceId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/contoso5
                type: Microsoft.ApiManagement/service/caches
definitions: {}
