共用方式為


列出供應項目

若要列出資料庫帳戶下的供應專案,請在供應專案資源上執行 GET,也就是供應專案 URI 路徑。

要求

方法 要求 URI 描述
GET https://{databaseaccount}.documents.azure.com/offers 請注意,{databaseaccount} 是您在您訂用帳戶下建立的 Azure Cosmos DB 帳戶名稱。

標題

如需所有 Cosmos DB 要求所使用的標頭,請參閱 常見的 Azure Cosmos DB REST 要求標頭

建構主要金鑰權杖的雜湊簽章時,ResourceType應該是「offers」。 ResourceLink應為空白。

主體

無。

回應

標題

如需所有 Cosmos DB 回應所傳回的標頭,請參閱 常見的 Azure Cosmos DB REST 回應標頭

狀態碼

下表列出此作業所傳回的常見狀態碼。 如需狀態碼的完整清單,請參閱 HTTP 狀態碼

HTTP 狀態碼 Description
200 確定 作業成功。
401 未經授權 未設定 Authorizationx-ms-date 標頭。 當 Authorization 標頭設為無效的授權權杖時,也會傳回 401。

主體

屬性 Description
_擺脫 這是系統產生的屬性。 此作業 的_rid 值是空的。
_計數 此屬性會顯示在清單作業中傳回的供應項目數目。
提供 此陣列包含做為清單作業一部分傳回的供應專案。
請參閱 供應專案 以尋找供應專案資源的屬性。
{  
  "_rid": "",  
  "Offers": [  
    {  
      "offerVersion": "V2",  
      "offerType": "Invalid",  
      "content": {  
        "offerThroughput": 400  
      },  
      "resource": "dbs/PaYSAA==/colls/PaYSAPH7qAo=/",  
      "offerResourceId": "PaYSAPH7qAo=",  
      "id": "QH8O",  
      "_rid": "QH8O",  
      "_self": "offers/QH8O/",  
      "_etag": "\"00001400-0000-0000-0000-56f9897f0000\"",  
      "_ts": 1459194239  
    },  
    {  
      "offerType": "S3",  
      "resource": "dbs/hPJRAA==/colls/hPJRAJQcIQg=/",  
      "offerResourceId": "hPJRAJQcIQg=",  
      "id": "Z2sl",  
      "_rid": "Z2sl",  
      "_self": "offers/Z2sl/",  
      "_etag": "\"00000200-0000-0000-0000-56b281730000\"",  
      "_ts": 1454539123  
    }  
  ],  
  "_count": 2  
}  
  

範例

GET https://querydemo.documents.azure.com/offers HTTP/1.1  
x-ms-date: Tue, 29 Mar 2016 17:50:18 GMT  
authorization: type%3dmaster%26ver%3d1.0%26sig%3d13hxyOkKYq9ahWqSret83vS72Z0v3%2fo2HKodfDQQpoQ%3d  
Cache-Control: no-cache  
User-Agent: Microsoft.Azure.Documents.Client/1.6.0.0 samples-net/3  
x-ms-version: 2015-12-16  
Accept: application/json  
Host: querydemo.documents.azure.com  
  
HTTP/1.1 200 Ok  
Cache-Control: no-store, no-cache  
Pragma: no-cache  
Transfer-Encoding: chunked  
Content-Type: application/json  
Content-Location: https://querydemo.documents.azure.com/offers  
Server: Microsoft-HTTPAPI/2.0  
Strict-Transport-Security: max-age=31536000  
x-ms-last-state-change-utc: Fri, 25 Mar 2016 21:27:20.035 GMT  
x-ms-item-count: 2  
x-ms-schemaversion: 1.1  
x-ms-request-charge: 11.04  
x-ms-serviceversion: version=1.6.52.5  
x-ms-activity-id: ed5cb8aa-0324-4ad8-9bdb-da513c76d9eb  
x-ms-session-token: M:8110  
x-ms-gatewayversion: version=1.6.52.5  
Date: Tue, 29 Mar 2016 17:50:18 GMT  
  
{  
  "_rid": "",  
  "Offers": [  
    {  
      "offerVersion": "V2",  
      "offerType": "Invalid",  
      "content": {  
        "offerThroughput": 400  
      },  
      "resource": "dbs/PaYSAA==/colls/PaYSAPH7qAo=/",  
      "offerResourceId": "PaYSAPH7qAo=",  
      "id": "QH8O",  
      "_rid": "QH8O",  
      "_self": "offers/QH8O/",  
      "_etag": "\"00001400-0000-0000-0000-56f9897f0000\"",  
      "_ts": 1459194239  
    },  
    {  
      "offerType": "S3",  
      "resource": "dbs/hPJRAA==/colls/hPJRAJQcIQg=/",  
      "offerResourceId": "hPJRAJQcIQg=",  
      "id": "Z2sl",  
      "_rid": "Z2sl",  
      "_self": "offers/Z2sl/",  
      "_etag": "\"00000200-0000-0000-0000-56b281730000\"",  
      "_ts": 1454539123  
    }  
  ],  
  "_count": 2  
}  
  

另請參閱