From 0c33653cd4bfc6a992c891cabd99611648397552 Mon Sep 17 00:00:00 2001 From: FBettati Date: Mon, 29 Apr 2019 11:35:44 -0700 Subject: [PATCH] Adding Create, Delete and List Namespaces Endpoints for Event Hubs Cluster Resource (#5565) * Adding ClusterPut.json example * Create ListNamespaceInClusterPost.json * Create ClusterDelete.json * Update EventHub-preview.json * Adding valid responses to Cluster PUT example. * Update specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/EventHub-preview.json Co-Authored-By: FBettati * Adding Available Regions API * Adding ListAvailableClusters POST example. * Modifying response in AvailableClusterList * Updating LIstAvailableClustersPost.json example * Delete ListAvailableClustersPost.json * Create ListAvailableClustersGet.json * Delete ListNamespaceInClusterPost.json * Create ListNamespacesInClusterGet.json * Update EventHub-preview.json * Modify availableClusters API to have a valid ARM collection response * Updating AvailableClusters collection response example * Updating /cluster/namespaces and /availableClusters calls * Adding parameters to ListAvailableClusters example. * Adding extra layer to namespace IDs in ListNamespacesInCluster example. * Removing comma from ListAvailableClusters example --- .../2018-01-01-preview/EventHub-preview.json | 248 ++++++++++++++++-- .../examples/Clusters/ClusterDelete.json | 13 + .../examples/Clusters/ClusterPut.json | 64 +++++ .../Clusters/ListAvailableClustersGet.json | 20 ++ .../Clusters/ListNamespacesInClusterGet.json | 25 ++ 5 files changed, 352 insertions(+), 18 deletions(-) create mode 100644 specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterDelete.json create mode 100644 specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterPut.json create mode 100644 specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListAvailableClustersGet.json create mode 100644 specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListNamespacesInClusterGet.json diff --git a/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/EventHub-preview.json b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/EventHub-preview.json index b14aa2e86ebe..c29b8fb3c842 100644 --- a/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/EventHub-preview.json +++ b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/EventHub-preview.json @@ -70,6 +70,42 @@ } } }, + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusters": { + "get": { + "tags": [ + "Event Hubs Clusters" + ], + "operationId": "Clusters_ListAvailableClusters", + "x-ms-examples": { + "ListAvailableClusters": { + "$ref": "./examples/Clusters/ListAvailableClustersGet.json" + } + }, + "description": "List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Available clusters listed successfully.", + "schema": { + "$ref": "#/definitions/AvailableClustersList" + } + }, + "default": { + "description": "Error response describing why available clusters could not be successfully listed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters": { "get": { "tags": [ @@ -153,6 +189,56 @@ } } }, + "put": { + "tags": [ + "Event Hubs Cluster" + ], + "operationId": "Clusters_Put", + "x-ms-examples": { + "ClusterPut": { + "$ref": "./examples/Clusters/ClusterPut.json" + } + }, + "description": "Creates or updates an instance of an Event Hubs Cluster.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/clusterNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Event Hubs Cluster successfully created or updated.", + "schema": { + "$ref": "#/definitions/Cluster" + } + }, + "201": { + "description": "Event Hubs Cluster create or update request accepted.", + "schema": { + "$ref": "#/definitions/Cluster" + } + }, + "202": { + "description": "Event Hubs Cluster create or update request accepted." + }, + "default": { + "description": "Event Hubs error response detailing why the Event Hubs Cluster create or update operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation": true + }, "patch": { "tags": [ "Event Hubs Cluster" @@ -211,6 +297,92 @@ } }, "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "Event Hubs Cluster" + ], + "operationId": "Clusters_Delete", + "x-ms-examples": { + "ClusterDelete": { + "$ref": "./examples/Clusters/ClusterDelete.json" + } + }, + "description": "Deletes an existing Event Hubs Cluster. This operation is idempotent.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/clusterNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Event Hubs Cluster successfully deleted." + }, + "202": { + "description": "Event Hubs Cluster delete request accepted." + }, + "204": { + "description": "No content." + }, + "default": { + "description": "Event Hubs error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces": { + "get": { + "tags": [ + "Event Hubs Namespace Enumeration in Cluster" + ], + "operationId": "Clusters_ListNamespaces", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/clusterNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "description": "List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster.", + "x-ms-examples": { + "ListNamespacesInCluster": { + "$ref": "./examples/Clusters/ListNamespacesInClusterGet.json" + } + }, + "responses": { + "200": { + "description": "List of Namespace IDs in Cluster successfully delivered.", + "schema": { + "$ref": "#/definitions/EHNamespaceIdListResult" + } + }, + "default": { + "description": "Event Hubs Cluster error response detailing why this operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default": { @@ -436,14 +608,14 @@ } ], "responses": { - "201": { - "description": "Namespace create request accepted.", + "200": { + "description": "Namespace successfully created.", "schema": { "$ref": "#/definitions/EHNamespace" } }, - "200": { - "description": "Namespace successfully created.", + "201": { + "description": "Namespace create request accepted.", "schema": { "$ref": "#/definitions/EHNamespace" } @@ -486,15 +658,15 @@ } ], "responses": { - "204": { - "description": "No content." - }, "200": { "description": "Namespace successfully deleted." }, "202": { "description": "Namespace delete request accepted." }, + "204": { + "description": "No content." + }, "default": { "description": "Eventhub error response describing why the operation failed.", "schema": { @@ -585,14 +757,14 @@ } ], "responses": { - "201": { - "description": "Namespace update request accepted.", + "200": { + "description": "Namespace successfully updated.", "schema": { "$ref": "#/definitions/EHNamespace" } }, - "200": { - "description": "Namespace successfully updated.", + "201": { + "description": "Namespace update request accepted.", "schema": { "$ref": "#/definitions/EHNamespace" } @@ -736,12 +908,12 @@ } ], "responses": { - "204": { - "description": "No content." - }, "200": { "description": "Namespace IpFilterRule successfully deleted." }, + "204": { + "description": "No content." + }, "default": { "description": "Eventhub error response describing why the operation failed.", "schema": { @@ -921,12 +1093,12 @@ } ], "responses": { - "204": { - "description": "No content." - }, "200": { "description": "Namespace VirtualNetworkRule successfully deleted." }, + "204": { + "description": "No content." + }, "default": { "description": "Eventhub error response describing why the operation failed.", "schema": { @@ -1156,6 +1328,25 @@ ], "description": "Single Event Hubs Cluster resource in List or Get operations." }, + "AvailableClustersList": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/AvailableCluster" + }, + "description": "The count of readily available and pre-provisioned Event Hubs Clusters per region." + } + }, + "description": "The response of the List Available Clusters operation." + }, + "AvailableCluster": { + "type": "object", + "additionalProperties": { + "type": "integer" + }, + "description": "Pre-provisioned and readily available Event Hubs Cluster count per region." + }, "ClusterListResult": { "properties": { "value": { @@ -1276,6 +1467,27 @@ ], "description": "SKU parameters particular to a cluster instance." }, + "EHNamespaceIdListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/EHNamespaceIdContainer" + }, + "description": "Result of the List Namespace IDs operation" + } + }, + "description": "The response of the List Namespace IDs operation" + }, + "EHNamespaceIdContainer": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "description": "The full ARM ID of an Event Hubs Namespace" + }, "EHNamespaceListResult": { "properties": { "value": { @@ -1676,4 +1888,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterDelete.json b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterDelete.json new file mode 100644 index 000000000000..7ba2aa0baf20 --- /dev/null +++ b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterDelete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "clusterName": "testCluster", + "resourceGroupName": "myResourceGroup", + "api-version": "2018-01-01-preview", + "subscriptionId": "5f750a97-50d9-4e36-8081-c9ee4c0210d4" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterPut.json b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterPut.json new file mode 100644 index 000000000000..d71150f6dfbc --- /dev/null +++ b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ClusterPut.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "clusterName": "testCluster", + "resourceGroupName": "myResourceGroup", + "api-version": "2018-01-01-preview", + "subscriptionId": "5f750a97-50d9-4e36-8081-c9ee4c0210d4", + "parameters": { + "sku": { + "tier": "Dedicated", + "capacity": 1 + }, + "location": "South Central US", + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/clusters/testCluster", + "name": "testCluster", + "type": "Microsoft.EventHub/Clusters", + "location": "South Central US", + "tags": { + "tag1": "value1", + "tag2": "value2" + }, + "sku": { + "name": "Dedicated", + "capacity": 1 + }, + "properties": { + "created": "2017-05-24T23:23:27.877Z", + "updated": "2017-05-24T23:23:27.877Z", + "metricId": "SN6-008" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/clusters/testCluster", + "name": "testCluster", + "type": "Microsoft.EventHub/Clusters", + "location": "South Central US", + "tags": { + "tag1": "value1", + "tag2": "value2" + }, + "sku": { + "name": "Dedicated", + "capacity": 1 + }, + "properties": { + "created": "2017-05-24T23:23:27.877Z", + "updated": "2017-05-24T23:23:27.877Z", + "metricId": "SN6-008" + } + } + }, + "202" : {} + } +} diff --git a/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListAvailableClustersGet.json b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListAvailableClustersGet.json new file mode 100644 index 000000000000..cae1cee27c48 --- /dev/null +++ b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListAvailableClustersGet.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2018-01-01-preview", + "subscriptionId": "5f750a97-50d9-4e36-8081-c9ee4c0210d4" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "westus": 5 + }, + { + "eastus": 4 + } + ] + } + } + } +} diff --git a/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListNamespacesInClusterGet.json b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListNamespacesInClusterGet.json new file mode 100644 index 000000000000..8d78ebd0cf63 --- /dev/null +++ b/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2018-01-01-preview/examples/Clusters/ListNamespacesInClusterGet.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "clusterName": "testCluster", + "resourceGroupName": "myResourceGroup", + "api-version": "2018-01-01-preview", + "subscriptionId": "5f750a97-50d9-4e36-8081-c9ee4c0210d4" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-EventHub-SouthCentralUS/providers/Microsoft.EventHub/namespaces/rrama-int7-ns1" + }, + { + "id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-EventHub-SouthCentralUS/providers/Microsoft.EventHub/namespaces/rrama-ehns2-int7" + }, + { + "id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.EventHub/namespaces/db3-rrama-foo1" + } + ] + } + } + } +}