Last active
September 25, 2021 22:03
-
-
Save subudear/0dbe495658460b90c32f7617606e1ac4 to your computer and use it in GitHub Desktop.
create event hub topic using postman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "info": { | |
| "_postman_id": "10d1b2a9-40fe-4eaf-8a7f-19a2a5658faf", | |
| "name": "Event Hub - Topic", | |
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
| }, | |
| "item": [ | |
| { | |
| "name": "Get Access Token", | |
| "event": [ | |
| { | |
| "listen": "test", | |
| "script": { | |
| "exec": [ | |
| "var data = JSON.parse(responseBody);\r", | |
| "postman.setEnvironmentVariable(\"access_token\", data.access_token);" | |
| ], | |
| "type": "text/javascript" | |
| } | |
| } | |
| ], | |
| "protocolProfileBehavior": { | |
| "disableBodyPruning": true | |
| }, | |
| "request": { | |
| "method": "GET", | |
| "header": [ | |
| { | |
| "key": "Content-Type", | |
| "value": "application/x-www-form-urlencoded", | |
| "type": "text" | |
| } | |
| ], | |
| "body": { | |
| "mode": "urlencoded", | |
| "urlencoded": [ | |
| { | |
| "key": "grant_type", | |
| "value": "{{grant_type}}", | |
| "type": "text" | |
| }, | |
| { | |
| "key": "client_id", | |
| "value": "{{client_id}}", | |
| "type": "text" | |
| }, | |
| { | |
| "key": "client_secret", | |
| "value": "{{client_secret}}", | |
| "type": "text" | |
| }, | |
| { | |
| "key": "resource", | |
| "value": "{{resource}}", | |
| "type": "text" | |
| } | |
| ] | |
| }, | |
| "url": { | |
| "raw": "https://login.microsoftonline.com/{{tenantid}}/oauth2/token", | |
| "protocol": "https", | |
| "host": [ | |
| "login", | |
| "microsoftonline", | |
| "com" | |
| ], | |
| "path": [ | |
| "{{tenantid}}", | |
| "oauth2", | |
| "token" | |
| ] | |
| } | |
| }, | |
| "response": [] | |
| }, | |
| { | |
| "name": "Create Event Hub - Topic", | |
| "request": { | |
| "auth": { | |
| "type": "bearer", | |
| "bearer": [ | |
| { | |
| "key": "token", | |
| "value": "{{access_token}}", | |
| "type": "string" | |
| } | |
| ] | |
| }, | |
| "method": "PUT", | |
| "header": [], | |
| "body": { | |
| "mode": "raw", | |
| "raw": "{\r\n \"name\": \"testtopicusingpostman\",\r\n \"type\": \"Microsoft.EventHub/namespaces/eventhubs\",\r\n \"apiVersion\": \"2021-01-01-preview\",\r\n \"properties\": {\r\n \"messageRetentionInDays\": \"1\",\r\n \"partitionCount\": \"2\",\r\n \"status\": \"Active\"\r\n \r\n }\r\n}", | |
| "options": { | |
| "raw": { | |
| "language": "json" | |
| } | |
| } | |
| }, | |
| "url": { | |
| "raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.EventHub/namespaces/{{eventhubNamespace}}/eventhubs/{{eventHubName}}?api-version=2021-01-01-preview", | |
| "protocol": "https", | |
| "host": [ | |
| "management", | |
| "azure", | |
| "com" | |
| ], | |
| "path": [ | |
| "subscriptions", | |
| "{{subscriptionId}}", | |
| "resourceGroups", | |
| "{{resourceGroupName}}", | |
| "providers", | |
| "Microsoft.EventHub", | |
| "namespaces", | |
| "{{eventhubNamespace}}", | |
| "eventhubs", | |
| "{{eventHubName}}" | |
| ], | |
| "query": [ | |
| { | |
| "key": "api-version", | |
| "value": "2021-01-01-preview" | |
| } | |
| ] | |
| } | |
| }, | |
| "response": [] | |
| }, | |
| { | |
| "name": "GET Event Hub - Topic", | |
| "protocolProfileBehavior": { | |
| "disableBodyPruning": true | |
| }, | |
| "request": { | |
| "auth": { | |
| "type": "bearer", | |
| "bearer": [ | |
| { | |
| "key": "token", | |
| "value": "{{access_token}}", | |
| "type": "string" | |
| } | |
| ] | |
| }, | |
| "method": "GET", | |
| "header": [], | |
| "body": { | |
| "mode": "raw", | |
| "raw": "", | |
| "options": { | |
| "raw": { | |
| "language": "json" | |
| } | |
| } | |
| }, | |
| "url": { | |
| "raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.EventHub/namespaces/{{eventhubNamespace}}/eventhubs/{{eventHubName}}?api-version=2021-01-01-preview", | |
| "protocol": "https", | |
| "host": [ | |
| "management", | |
| "azure", | |
| "com" | |
| ], | |
| "path": [ | |
| "subscriptions", | |
| "{{subscriptionId}}", | |
| "resourceGroups", | |
| "{{resourceGroupName}}", | |
| "providers", | |
| "Microsoft.EventHub", | |
| "namespaces", | |
| "{{eventhubNamespace}}", | |
| "eventhubs", | |
| "{{eventHubName}}" | |
| ], | |
| "query": [ | |
| { | |
| "key": "api-version", | |
| "value": "2021-01-01-preview" | |
| } | |
| ] | |
| } | |
| }, | |
| "response": [] | |
| }, | |
| { | |
| "name": "List Event Hub - Topic by Namespace", | |
| "protocolProfileBehavior": { | |
| "disableBodyPruning": true | |
| }, | |
| "request": { | |
| "auth": { | |
| "type": "bearer", | |
| "bearer": [ | |
| { | |
| "key": "token", | |
| "value": "{{access_token}}", | |
| "type": "string" | |
| } | |
| ] | |
| }, | |
| "method": "GET", | |
| "header": [], | |
| "body": { | |
| "mode": "raw", | |
| "raw": "", | |
| "options": { | |
| "raw": { | |
| "language": "json" | |
| } | |
| } | |
| }, | |
| "url": { | |
| "raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.EventHub/namespaces/{{eventhubNamespace}}/eventhubs?api-version=2021-01-01-preview", | |
| "protocol": "https", | |
| "host": [ | |
| "management", | |
| "azure", | |
| "com" | |
| ], | |
| "path": [ | |
| "subscriptions", | |
| "{{subscriptionId}}", | |
| "resourceGroups", | |
| "{{resourceGroupName}}", | |
| "providers", | |
| "Microsoft.EventHub", | |
| "namespaces", | |
| "{{eventhubNamespace}}", | |
| "eventhubs" | |
| ], | |
| "query": [ | |
| { | |
| "key": "api-version", | |
| "value": "2021-01-01-preview" | |
| } | |
| ] | |
| } | |
| }, | |
| "response": [] | |
| }, | |
| { | |
| "name": "Update Event Hub - Topic", | |
| "request": { | |
| "auth": { | |
| "type": "bearer", | |
| "bearer": [ | |
| { | |
| "key": "token", | |
| "value": "{{access_token}}", | |
| "type": "string" | |
| } | |
| ] | |
| }, | |
| "method": "PUT", | |
| "header": [], | |
| "body": { | |
| "mode": "raw", | |
| "raw": "{\r\n \"name\": \"testeventhubtopic\",\r\n \"type\": \"Microsoft.EventHub/namespaces/eventhubs\",\r\n \"apiVersion\": \"2021-01-01-preview\",\r\n \"properties\": {\r\n \"messageRetentionInDays\": \"2\",\r\n \"partitionCount\": \"2\",\r\n \"status\": \"Active\"\r\n \r\n }\r\n}", | |
| "options": { | |
| "raw": { | |
| "language": "json" | |
| } | |
| } | |
| }, | |
| "url": { | |
| "raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.EventHub/namespaces/{{eventhubNamespace}}/eventhubs/{{eventHubName}}?api-version=2021-01-01-preview", | |
| "protocol": "https", | |
| "host": [ | |
| "management", | |
| "azure", | |
| "com" | |
| ], | |
| "path": [ | |
| "subscriptions", | |
| "{{subscriptionId}}", | |
| "resourceGroups", | |
| "{{resourceGroupName}}", | |
| "providers", | |
| "Microsoft.EventHub", | |
| "namespaces", | |
| "{{eventhubNamespace}}", | |
| "eventhubs", | |
| "{{eventHubName}}" | |
| ], | |
| "query": [ | |
| { | |
| "key": "api-version", | |
| "value": "2021-01-01-preview" | |
| } | |
| ] | |
| } | |
| }, | |
| "response": [] | |
| }, | |
| { | |
| "name": "Delete Event Hub - Topic", | |
| "request": { | |
| "auth": { | |
| "type": "bearer", | |
| "bearer": [ | |
| { | |
| "key": "token", | |
| "value": "{{access_token}}", | |
| "type": "string" | |
| } | |
| ] | |
| }, | |
| "method": "DELETE", | |
| "header": [], | |
| "body": { | |
| "mode": "raw", | |
| "raw": "", | |
| "options": { | |
| "raw": { | |
| "language": "json" | |
| } | |
| } | |
| }, | |
| "url": { | |
| "raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.EventHub/namespaces/{{eventhubNamespace}}/eventhubs/{{eventHubName}}?api-version=2021-01-01-preview", | |
| "protocol": "https", | |
| "host": [ | |
| "management", | |
| "azure", | |
| "com" | |
| ], | |
| "path": [ | |
| "subscriptions", | |
| "{{subscriptionId}}", | |
| "resourceGroups", | |
| "{{resourceGroupName}}", | |
| "providers", | |
| "Microsoft.EventHub", | |
| "namespaces", | |
| "{{eventhubNamespace}}", | |
| "eventhubs", | |
| "{{eventHubName}}" | |
| ], | |
| "query": [ | |
| { | |
| "key": "api-version", | |
| "value": "2021-01-01-preview" | |
| } | |
| ] | |
| } | |
| }, | |
| "response": [] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment