Edit

Labels

The Label resource is defined as follows:

{
      "name": [string]             // Name of the label
}

Supports the following operations:

  • List

For all operations name is an optional filter parameter. If omitted it implies any label.

Use the optional resourceType parameter to filter labels by their associated resource type. Set resourceType to kv for key-value labels or ff for enhanced feature flag labels.

Prerequisites

  • All HTTP requests must be authenticated. See the authentication section.
  • All HTTP requests must provide explicit api-version. See the versioning section.

List Labels

GET /labels?api-version={api-version} HTTP/1.1

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.microsoft.appconfig.labelset+json; charset=utf-8"
{
    "items": [
        {
          "name": "{label-name}"
        },
        ...
    ],
    "@nextLink": "{relative uri}"
}

List labels by resource type

The following request lists labels associated with enhanced feature flags:

GET /labels?resourceType=ff&api-version={api-version} HTTP/1.1

To list labels associated with key-values, set resourceType to kv.

Pagination

The result is paginated if the number of items returned exceeds the response limit. Follow the optional Link response headers and use rel="next" for navigation. Alternatively the content provides a next link in form of the @nextLink property. The next link contains api-version parameter.

GET /labels?api-version={api-version} HTTP/1.1

Response:

HTTP/1.1 OK
Content-Type: application/vnd.microsoft.appconfig.labelset+json; charset=utf-8
Accept-Ranges: items
Link: <{relative uri}>; rel="next"
{
    "items": [
        ...
    ],
    "@nextLink": "{relative uri}"
}

Filtering

Filtering by name is supported.

GET /labels?name={label-name}&api-version={api-version}

Supported filters

Label Filter Effect
name is omitted or name=* Matches any label
name=abc Matches a label named abc
name=abc* Matches label names that start with abc
name=abc,xyz Matches label names abc or xyz (limited to 5 CSV)

Resource type filter

Resource type filter Effect
resourceType is omitted Matches labels associated with key-values
resourceType=kv Matches labels associated with key-values
resourceType=ff Matches labels associated with enhanced feature flags

Reserved characters

*, \, ,

If a reserved character is part of the value, then it must be escaped using \{Reserved Character}. Non-reserved characters can also be escaped.

Filter Validation

If a filter validation error occurs, the response is HTTP 400 with error details:

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
  "type": "https://azconfig.io/errors/invalid-argument",
  "title": "Invalid request parameter 'name'",
  "name": "name",
  "detail": "name(2): Invalid character",
  "status": 400
}

Examples

  • All

    GET /labels?api-version={api-version}
    
  • Label name starts with abc

    GET  /labels?name=abc*&api-version={api-version}
    
  • Label name is either abc or xyz

    GET /labels?name=abc,xyz&api-version={api-version}
    
  • Enhanced feature flag label name starts with abc

    GET /labels?resourceType=ff&name=abc*&api-version={api-version}
    

Request specific fields

Use the optional $select query string parameter and provide comma-separated list of requested fields. If the $select parameter is omitted, the response contains the default set.

GET /labels?$select=name&api-version={api-version} HTTP/1.1

Time-Based Access

Obtain a representation of the result as it was at a past time. See section 2.1.1

GET /labels&api-version={api-version} HTTP/1.1
Accept-Datetime: Sat, 12 May 2018 02:10:00 GMT

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.microsoft.appconfig.labelset+json"
Memento-Datetime: Sat, 12 May 2018 02:10:00 GMT
Link: <{relative uri}>; rel="original"
{
    "items": [
        ....
    ]
}