共用方式為


標籤

標籤資源的定義如下:

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

支援下列作業:

  • 清單​​

所有作業 name 都是選擇性篩選參數。 如果省略,則表示 任何 標籤。

必要條件

清單標籤

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

回應

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

分頁

如果傳回的項目數目超過回應限制,則會分頁結果。 請遵循選擇性 Link 的回應標頭,並用於 rel="next" 流覽。 或者,內容會以 屬性的形式 @nextLink 提供下一個連結。 下一個連結包含 api-version 參數。

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

回應:

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}"
}

篩選

支援篩選依據 name

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

支援的篩選器

標籤篩選 效果
省略 name 或使用 name=* 符合任何標籤
name=abc 比對名為 abc 的 標籤
name=abc* 比對開頭為 abc 的 標籤名稱
name=abc,xyz 比對標籤名稱 abcxyz (限制為 5 CSV)

保留字元

*、 、 \,

如果保留字元是值的一部分,則必須使用 \{Reserved Character}逸出它。 您也可以逸出非保留字元。

篩選驗證

如果發生篩選驗證錯誤,回應會是 HTTP 400 ,其中包含錯誤詳細資料:

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
}

範例

  • 全部

    GET /labels?api-version={api-version}
    
  • 標籤名稱開頭為 abc

    GET  /labels?name=abc*&api-version={api-version}
    
  • 標籤稱為 abcxyz

    GET /labels?name=abc,xyz&api-version={api-version}
    

要求特定欄位

使用選擇性 $select 的查詢字串參數,並提供以逗號分隔的要求欄位清單。 $select如果省略 參數,回應會包含預設集合。

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

以時間為基礎的存取

取得過去一段時間的結果表示法。 請參閱 2.1.1 節

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

回應:

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": [
        ....
    ]
}