你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

获取分区运行时元数据

返回事件中心上指定分区的元数据。 请参阅 分区说明属性

请求

方法 请求 URI
GET https://{servicebusNamespace}.servicebus.windows.net/{eventHubPath}/consumergroups/{consumergroupName}/partitions/{partitionId}

请求标头

有关与事件中心相关的所有请求使用的标头和参数,请参阅 通用参数 和标头。

响应

响应包括 HTTP 状态代码、一组响应标头和响应正文。

元素名称 必须 类型 版本 说明
SizeInBytes 是,只读 int 2014-01 事件中心分区的近似大小(以字节为单位)。
BeginSequenceNumber 是,只读 string 2014-01 起始序列号。
EndSequenceNumber 是,只读 string 2014-01 结束序列号。
IncomingBytesPerSecond 是,只读 string 2014-01 此使用者组中的分区) ,事件的大致传入速率 (字节/秒。
OutgoingBytesPerSecond 是,只读 string 2014-01 此使用者组中分区的近似传出速率 (字节/秒) 。
LastEnqueuedOffset 是,只读 string 2015-01 最后一个排队事件的偏移量。
LastEnqueuedTimeUtc 是,只读 string 2015-01 最后一个事件的排队时间(UTC)。

响应代码

代码 说明
200 成功。
401 授权失败。
500 内部错误。

响应正文

如果请求成功,响应正文将包含指定分区的说明。 如果请求不成功,则正文包含错误代码和错误消息。

示例

请求

注意

还可以将 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  
  

响应

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>