次の方法で共有


パーティション ランタイム メタデータを取得する

イベント ハブ上の指定されたパーティションのメタデータを返します。 「 パーティションの説明のプロパティ」を参照してください。

Request

Method 要求 URI
GET https://{servicebusNamespace}.servicebus.windows.net/{eventHubPath}/consumergroups/{consumergroupName}/partitions/{partitionId}

要求ヘッダー

Event Hubs に関連するすべての要求で使用されるヘッダーとパラメーターについては、「 共通 パラメーターとヘッダー」を参照してください。

[応答]

応答には、HTTP 状態コード、一連の応答ヘッダー、および応答本文が含まれています。

要素名 必須 Type Version Description
SizeInBytes はい、読み取り専用 INT 2014-01 Event Hubs パーティションのおおよそのサイズ (バイト単位)。
BeginSequenceNumber はい、読み取り専用 string 2014-01 開始シーケンス番号。
EndSequenceNumber はい、読み取り専用 string 2014-01 終了シーケンス番号。
IncomingBytesPerSecond はい、読み取り専用 string 2014-01 このコンシューマー グループ内のパーティションのイベントのおおよその受信レート (1 秒あたりのバイト数)。
OutgoingBytesPerSecond はい、読み取り専用 string 2014-01 このコンシューマー グループ内のパーティションのおおよその送信レート (1 秒あたりのバイト数)。
LastEnqueuedOffset はい、読み取り専用 string 2015-01 最後にエンキューされたイベントのオフセット。
LastEnqueuedTimeUtc はい、読み取り専用 string 2015-01 最後のイベントがエンキューされた UTC の時刻。

応答コード

コード 説明
200 正常終了しました。
401 認証エラー。
500 内部エラーです。

応答本文

要求が成功した場合、応答本文には、指定されたパーティションの説明が含まれます。 要求が失敗すると、本文にエラー コードとエラー メッセージが追加されます。

使用例

Request

注意

また、「共通パラメーターとヘッダー」で説明されているように、Authorization ヘッダーに Azure Active Directory トークンを使用することもできます。 たとえば、Authorization: Bearer <Azure AD token> のように指定します。

GET https://your-namespace.servicebus.windows.net/your-event-hub//consumergroups/$Default/partitions/0?timeout=60&api-version=2015-01 HTTP/1.1  
Authorization: SharedAccessSignature sr=your-namespace.servicebus.windows.net&sig=your-sas-key&se=1456273000&skn=RootManageSharedAccessKey  
Content-Type: application/atom+xml;type=entry;charset=utf-8  
Host: your-namespace.servicebus.windows.net  
  

Response

HTTP/1.1 200 OK  
Content-Type: application/atom+xml;type=entry;charset=utf-8  
Server: Microsoft-HTTPAPI/2.0  
Date: Tue, 23 Feb 2016 23:34:13 GMT  
Content-Length: 910  
  
<?xml version="1.0" encoding="UTF-8"?>  
<entry xmlns="http://www.w3.org/2005/Atom">  
   <id>sb://your-namespace.servicebus.windows.net/your-event-hub/consumergroups/$Default/partitions/0?timeout=60&api-version=2014-01</id>  
   <title type="text">0</title>  
   <published>2015-09-09T20:31:00Z</published>  
   <updated>2015-09-09T20:31:00Z</updated>  
   <link rel="self" href="sb://your-namespace.servicebus.windows.net/your-event-hub/consumergroups/$Default/partitions/0?timeout=60&api-version=2014-01" />  
   <content type="application/xml">  
      <PartitionDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
         <SizeInBytes>33554432</SizeInBytes>  
         <BeginSequenceNumber>0</BeginSequenceNumber>  
         <EndSequenceNumber>20044</EndSequenceNumber>  
         <IncomingBytesPerSecond>0</IncomingBytesPerSecond>  
         <OutgoingBytesPerSecond>0</OutgoingBytesPerSecond>  
         <LastEnqueuedOffset>2062040</LastEnqueuedOffset>  
         <LastEnqueuedTimeUtc>2016-02-23T03:22:27.024Z</LastEnqueuedTimeUtc>  
      </PartitionDescription>  
   </content>  
</entry>