Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Hiermee maakt u een nieuwe Event Hub. Wanneer u een Event Hub maakt, kunt u de volgende eigenschappen opgeven. Als er geen eigenschap is opgegeven, gebruikt Event Hubs de standaardwaarde voor deze eigenschap. Zie Eigenschappen van EventHubDescription.
Eigenschappen
Naast de eigenschappen die als volgt worden vermeld, kunt u aanvullende eigenschappen opgeven die worden weergegeven in de beschrijving van Event Hub, maar worden genegeerd door de service.
U moet de eigenschappen opgeven in de onderstaande volgorde. Elke eigenschap die niet op volgorde is opgegeven, wordt geïnterpreteerd als een gebruikerseigenschap. Deze eigenschap wordt twee keer weergegeven in de beschrijving van De Event Hub: één keer met de waarde die is ingesteld door de gebruiker en eenmaal met de standaardwaarde die wordt gebruikt door Event Hubs.
| Eigenschapsnaam | Beschikbaar sinds API-versie | Standaard | Beschrijving van de eigenschap |
|---|---|---|---|
MessageRetentionInDays |
2014-01 | 0 | Beschrijving |
Authorization |
2014-01 | (leeg) | Beschrijving |
Status |
2014-01 | Actief | Beschrijving |
UserMetadata |
2014-01 | (leeg) | Beschrijving |
PartitionCount |
2014-01 | 16 | Beschrijving |
Aanvraag
| Methode | Aanvraag-URI | HTTP-versie |
|---|---|---|
| PUT | https://{serviceNamespace}.servicebus.windows.net/{eventHubPath} |
HTTP/1.1 |
Aanvraagheaders
Zie Algemene parameters en headers voor headers en parameters die worden gebruikt door alle aanvragen met betrekking tot Event Hubs.
Aanvraagbody
Atom-vermelding met de beschrijving die is ingesloten in de inhoud. Bijvoorbeeld:
<entry xmlns='http://www.w3.org/2005/Atom'>
<content type='application/xml'>
{EventHubDescription}
</content>
</entry>
Antwoord
Het antwoord bevat een HTTP-statuscode, een set antwoordheaders en een antwoordtekst.
Antwoordcodes
| Code | Beschrijving |
|---|---|
| 201 | Event Hub gemaakt. |
| 400 | Ongeldig verzoek. |
| 401 | Autorisatiefout. |
| 403 | Quotum overschreden; Event Hub niet gemaakt. |
| 409 | De opgegeven Event Hub bestaat al (of het opgegeven pad is al bezet). |
| 500 | Interne fout. |
Hoofdtekst van antwoord
Als de aanvraag is geslaagd, bevat de antwoordtekst de beschrijving van de gemaakte Event Hub. Als de aanvraag niet lukt, bevat de hoofdtekst een foutcode en een foutbericht.
Voorbeelden
Aanvraag
Notitie
U kunt ook een Azure Active Directory-token gebruiken voor de autorisatie-header , zoals vermeld in de Algemene parameters en headers. Bijvoorbeeld: Authorization: Bearer <Azure AD token>.
PUT https://your-namespace.servicebus.windows.net/your-event-hub?timeout=60&api-version=2014-01 HTTP/1.1
Authorization: SharedAccessSignature sr=your-namespace.servicebus.windows.net&sig=tYu8qdH563Pc96Lky0SFs5PhbGnljF7mLYQwCZmk9M0%3d&se=1403736877&skn=RootManageSharedAccessKey
Content-Type: application/atom+xml;type=entry;charset=utf-8
Host: your-namespace.servicebus.windows.net
Content-Length: 264
Expect: 100-continue
Connection: Keep-Alive
<entry xmlns='http://www.w3.org/2005/Atom'>
<content type='application/xml'>
<EventHubDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
</EventHubDescription>
</content>
</entry>
Response
HTTP/1.1 201 Created
Transfer-Encoding: chunked
Content-Type: application/atom+xml;type=entry;charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 25 Jun 2014 22:43:27 GMT
<entry xmlns="http://www.w3.org/2005/Atom">
<id>https://your-namespace.servicebus.windows.net/your-event-hub?timeout=60&api-version=2014-01</id>
<title type="text">your-event-hub</title>
<published>2014-06-25T22:43:16Z</published>
<updated>2014-06-25T22:43:27Z</updated>
<author>
<name>your-namespace</name>
</author>
<link rel="self" href="https://your-namespace.servicebus.windows.net/your-event-hub?timeout=60&api-version=2014-01"/>
<content type="application/xml">
<EventHubDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<MessageRetentionInDays>3</MessageRetentionInDays>
<SizeInBytes>0</SizeInBytes>
<AuthorizationRules></AuthorizationRules>
<Status>Active</Status>
<PartitionCount>16</PartitionCount>
<EntityAvailabilityStatus>Available</EntityAvailabilityStatus>
</EventHubDescription>
</content>
</entry>
Met de volgende HTTP-aanvraag maakt u een Event Hub met aangepaste instellingen:
PUT https://your-namespace.servicebus.windows.net/your-event-hub?timeout=60&api-version=2014-01 HTTP/1.1
Authorization: SharedAccessSignature sr=your-namespace.servicebus.windows.net&sig=your-sas-key&se=1403736877&skn=RootManageSharedAccessKey
Content-Type: application/atom+xml;type=entry;charset=utf-8
Host: your-namespace.servicebus.windows.net
<entry xmlns='http://www.w3.org/2005/Atom'>
<content type='application/xml'>
<EventHubDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
<MessageRetentionInDays>3</MessageRetentionInDays>
<PartitionCount>8</PartitionCount>
</EventHubDescription>
</content>
</entry>
Event Hubs retourneert het volgende antwoord:
HTTP/1.1 201 Created
Transfer-Encoding: chunked
Content-Type: application/atom+xml;type=entry;charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 25 Jun 2014 22:43:27 GMT
<entry xmlns="http://www.w3.org/2005/Atom">
<id>https://your-namespace.servicebus.windows.net/your-event-hub?timeout=60&api-version=2014-01</id>
<title type="text">your-event-hub</title>
<published>2014-06-25T22:43:16Z</published>
<updated>2014-06-25T22:43:27Z</updated>
<author>
<name>your-namespace</name>
</author>
<link rel="self" href="https://your-namespace.servicebus.windows.net/your-event-hub?timeout=60&api-version=2014-01"/>
<content type="application/xml">
<EventHubDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<MessageRetentionInDays>3</MessageRetentionInDays>
<SizeInBytes>0</SizeInBytes>
<AuthorizationRules></AuthorizationRules>
<Status>Active</Status>
<PartitionCount>16</PartitionCount>
<EntityAvailabilityStatus>Available</EntityAvailabilityStatus>
</EventHubDescription>
</content>
</entry>