@azure/arm-eventhub 3.3.1 → 5.0.0-alpha.20211103.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +65 -80
  4. package/dist/index.js +5188 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/eventHubManagementClient.d.ts +24 -0
  9. package/dist-esm/src/eventHubManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/eventHubManagementClient.js +31 -0
  11. package/dist-esm/src/eventHubManagementClient.js.map +1 -0
  12. package/dist-esm/src/eventHubManagementClientContext.d.ts +17 -0
  13. package/dist-esm/src/eventHubManagementClientContext.d.ts.map +1 -0
  14. package/dist-esm/src/eventHubManagementClientContext.js +50 -0
  15. package/dist-esm/src/eventHubManagementClientContext.js.map +1 -0
  16. package/dist-esm/src/index.d.ts +6 -0
  17. package/dist-esm/src/index.d.ts.map +1 -0
  18. package/dist-esm/src/index.js +13 -0
  19. package/dist-esm/src/index.js.map +1 -0
  20. package/dist-esm/src/lroImpl.d.ts +16 -0
  21. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  22. package/dist-esm/src/lroImpl.js +29 -0
  23. package/dist-esm/src/lroImpl.js.map +1 -0
  24. package/dist-esm/src/models/index.d.ts +1127 -0
  25. package/dist-esm/src/models/index.d.ts.map +1 -0
  26. package/dist-esm/src/models/index.js +77 -0
  27. package/dist-esm/src/models/index.js.map +1 -0
  28. package/dist-esm/src/models/mappers.d.ts +49 -0
  29. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  30. package/{esm → dist-esm/src}/models/mappers.js +979 -514
  31. package/dist-esm/src/models/mappers.js.map +1 -0
  32. package/dist-esm/src/models/parameters.d.ts +29 -0
  33. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  34. package/dist-esm/src/models/parameters.js +251 -0
  35. package/dist-esm/src/models/parameters.js.map +1 -0
  36. package/dist-esm/src/operations/clusters.d.ts +119 -0
  37. package/dist-esm/src/operations/clusters.d.ts.map +1 -0
  38. package/dist-esm/src/operations/clusters.js +553 -0
  39. package/dist-esm/src/operations/clusters.js.map +1 -0
  40. package/dist-esm/src/operations/configuration.d.ts +30 -0
  41. package/dist-esm/src/operations/configuration.d.ts.map +1 -0
  42. package/dist-esm/src/operations/configuration.js +92 -0
  43. package/dist-esm/src/operations/configuration.js.map +1 -0
  44. package/dist-esm/src/operations/consumerGroups.d.ts +71 -0
  45. package/dist-esm/src/operations/consumerGroups.d.ts.map +1 -0
  46. package/dist-esm/src/operations/consumerGroups.js +267 -0
  47. package/dist-esm/src/operations/consumerGroups.js.map +1 -0
  48. package/dist-esm/src/operations/disasterRecoveryConfigs.d.ts +133 -0
  49. package/dist-esm/src/operations/disasterRecoveryConfigs.d.ts.map +1 -0
  50. package/dist-esm/src/operations/disasterRecoveryConfigs.js +526 -0
  51. package/dist-esm/src/operations/disasterRecoveryConfigs.js.map +1 -0
  52. package/dist-esm/src/operations/eventHubs.d.ts +139 -0
  53. package/dist-esm/src/operations/eventHubs.d.ts.map +1 -0
  54. package/dist-esm/src/operations/eventHubs.js +561 -0
  55. package/dist-esm/src/operations/eventHubs.js.map +1 -0
  56. package/dist-esm/src/operations/index.d.ts +10 -0
  57. package/dist-esm/src/operations/index.d.ts.map +1 -0
  58. package/dist-esm/src/operations/index.js +17 -0
  59. package/dist-esm/src/operations/index.js.map +1 -0
  60. package/dist-esm/src/operations/namespaces.d.ts +191 -0
  61. package/dist-esm/src/operations/namespaces.d.ts.map +1 -0
  62. package/dist-esm/src/operations/namespaces.js +837 -0
  63. package/dist-esm/src/operations/namespaces.js.map +1 -0
  64. package/dist-esm/src/operations/operations.d.ts +32 -0
  65. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  66. package/dist-esm/src/operations/operations.js +120 -0
  67. package/dist-esm/src/operations/operations.js.map +1 -0
  68. package/dist-esm/src/operations/privateEndpointConnections.d.ts +75 -0
  69. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  70. package/dist-esm/src/operations/privateEndpointConnections.js +302 -0
  71. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  72. package/dist-esm/src/operations/privateLinkResources.d.ts +20 -0
  73. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  74. package/dist-esm/src/operations/privateLinkResources.js +53 -0
  75. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/clusters.d.ts +83 -0
  77. package/dist-esm/src/operationsInterfaces/clusters.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/clusters.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/clusters.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/configuration.d.ts +22 -0
  81. package/dist-esm/src/operationsInterfaces/configuration.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/configuration.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/configuration.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/consumerGroups.d.ts +43 -0
  85. package/dist-esm/src/operationsInterfaces/consumerGroups.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/consumerGroups.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/consumerGroups.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/disasterRecoveryConfigs.d.ts +89 -0
  89. package/dist-esm/src/operationsInterfaces/disasterRecoveryConfigs.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/disasterRecoveryConfigs.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/disasterRecoveryConfigs.js.map +1 -0
  92. package/dist-esm/src/operationsInterfaces/eventHubs.d.ts +95 -0
  93. package/dist-esm/src/operationsInterfaces/eventHubs.d.ts.map +1 -0
  94. package/dist-esm/src/operationsInterfaces/eventHubs.js +9 -0
  95. package/dist-esm/src/operationsInterfaces/eventHubs.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/index.d.ts +10 -0
  97. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  98. package/dist-esm/src/operationsInterfaces/index.js +17 -0
  99. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  100. package/dist-esm/src/operationsInterfaces/namespaces.d.ts +138 -0
  101. package/dist-esm/src/operationsInterfaces/namespaces.d.ts.map +1 -0
  102. package/dist-esm/src/operationsInterfaces/namespaces.js +9 -0
  103. package/dist-esm/src/operationsInterfaces/namespaces.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  105. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +50 -0
  109. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  111. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  112. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +12 -0
  113. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  114. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  115. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  116. package/dist-esm/test/eventhub_examples.d.ts +2 -0
  117. package/dist-esm/test/eventhub_examples.d.ts.map +1 -0
  118. package/dist-esm/test/eventhub_examples.js +205 -0
  119. package/dist-esm/test/eventhub_examples.js.map +1 -0
  120. package/package.json +69 -24
  121. package/review/arm-eventhub.api.md +1107 -0
  122. package/rollup.config.js +181 -30
  123. package/src/eventHubManagementClient.ts +55 -45
  124. package/src/eventHubManagementClientContext.ts +48 -46
  125. package/src/index.ts +13 -0
  126. package/src/lroImpl.ts +34 -0
  127. package/src/models/index.ts +1099 -1384
  128. package/src/models/mappers.ts +1016 -515
  129. package/src/models/parameters.ts +187 -73
  130. package/src/operations/clusters.ts +745 -0
  131. package/src/operations/configuration.ts +124 -0
  132. package/src/operations/consumerGroups.ts +221 -209
  133. package/src/operations/disasterRecoveryConfigs.ts +453 -502
  134. package/src/operations/eventHubs.ts +470 -504
  135. package/src/operations/index.ts +9 -8
  136. package/src/operations/namespaces.ts +760 -808
  137. package/src/operations/operations.ts +84 -70
  138. package/src/operations/privateEndpointConnections.ts +404 -0
  139. package/src/operations/privateLinkResources.ts +72 -0
  140. package/src/operationsInterfaces/clusters.ts +160 -0
  141. package/src/operationsInterfaces/configuration.ts +45 -0
  142. package/src/operationsInterfaces/consumerGroups.ts +84 -0
  143. package/src/operationsInterfaces/disasterRecoveryConfigs.ts +169 -0
  144. package/src/operationsInterfaces/eventHubs.ts +181 -0
  145. package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +10 -9
  146. package/src/operationsInterfaces/namespaces.ts +258 -0
  147. package/src/operationsInterfaces/operations.ts +22 -0
  148. package/src/operationsInterfaces/privateEndpointConnections.ts +92 -0
  149. package/src/operationsInterfaces/privateLinkResources.ts +27 -0
  150. package/tsconfig.json +4 -4
  151. package/types/arm-eventhub.d.ts +1889 -0
  152. package/types/tsdoc-metadata.json +11 -0
  153. package/dist/arm-eventhub.js +0 -3418
  154. package/dist/arm-eventhub.js.map +0 -1
  155. package/dist/arm-eventhub.min.js +0 -1
  156. package/dist/arm-eventhub.min.js.map +0 -1
  157. package/esm/eventHubManagementClient.d.ts +0 -30
  158. package/esm/eventHubManagementClient.d.ts.map +0 -1
  159. package/esm/eventHubManagementClient.js +0 -44
  160. package/esm/eventHubManagementClient.js.map +0 -1
  161. package/esm/eventHubManagementClientContext.d.ts +0 -23
  162. package/esm/eventHubManagementClientContext.d.ts.map +0 -1
  163. package/esm/eventHubManagementClientContext.js +0 -62
  164. package/esm/eventHubManagementClientContext.js.map +0 -1
  165. package/esm/models/consumerGroupsMappers.d.ts +0 -2
  166. package/esm/models/consumerGroupsMappers.d.ts.map +0 -1
  167. package/esm/models/consumerGroupsMappers.js +0 -9
  168. package/esm/models/consumerGroupsMappers.js.map +0 -1
  169. package/esm/models/disasterRecoveryConfigsMappers.d.ts +0 -2
  170. package/esm/models/disasterRecoveryConfigsMappers.d.ts.map +0 -1
  171. package/esm/models/disasterRecoveryConfigsMappers.js +0 -9
  172. package/esm/models/disasterRecoveryConfigsMappers.js.map +0 -1
  173. package/esm/models/eventHubsMappers.d.ts +0 -2
  174. package/esm/models/eventHubsMappers.d.ts.map +0 -1
  175. package/esm/models/eventHubsMappers.js +0 -9
  176. package/esm/models/eventHubsMappers.js.map +0 -1
  177. package/esm/models/index.d.ts +0 -1497
  178. package/esm/models/index.d.ts.map +0 -1
  179. package/esm/models/index.js +0 -8
  180. package/esm/models/index.js.map +0 -1
  181. package/esm/models/mappers.d.ts +0 -35
  182. package/esm/models/mappers.d.ts.map +0 -1
  183. package/esm/models/mappers.js.map +0 -1
  184. package/esm/models/namespacesMappers.d.ts +0 -2
  185. package/esm/models/namespacesMappers.d.ts.map +0 -1
  186. package/esm/models/namespacesMappers.js +0 -9
  187. package/esm/models/namespacesMappers.js.map +0 -1
  188. package/esm/models/operationsMappers.d.ts +0 -2
  189. package/esm/models/operationsMappers.d.ts.map +0 -1
  190. package/esm/models/operationsMappers.js +0 -9
  191. package/esm/models/operationsMappers.js.map +0 -1
  192. package/esm/models/parameters.d.ts +0 -15
  193. package/esm/models/parameters.d.ts.map +0 -1
  194. package/esm/models/parameters.js +0 -179
  195. package/esm/models/parameters.js.map +0 -1
  196. package/esm/models/regionsMappers.d.ts +0 -2
  197. package/esm/models/regionsMappers.d.ts.map +0 -1
  198. package/esm/models/regionsMappers.js +0 -9
  199. package/esm/models/regionsMappers.js.map +0 -1
  200. package/esm/operations/consumerGroups.d.ts +0 -141
  201. package/esm/operations/consumerGroups.d.ts.map +0 -1
  202. package/esm/operations/consumerGroups.js +0 -198
  203. package/esm/operations/consumerGroups.js.map +0 -1
  204. package/esm/operations/disasterRecoveryConfigs.d.ts +0 -296
  205. package/esm/operations/disasterRecoveryConfigs.d.ts.map +0 -1
  206. package/esm/operations/disasterRecoveryConfigs.js +0 -415
  207. package/esm/operations/disasterRecoveryConfigs.js.map +0 -1
  208. package/esm/operations/eventHubs.d.ts +0 -313
  209. package/esm/operations/eventHubs.d.ts.map +0 -1
  210. package/esm/operations/eventHubs.js +0 -433
  211. package/esm/operations/eventHubs.js.map +0 -1
  212. package/esm/operations/index.d.ts +0 -7
  213. package/esm/operations/index.d.ts.map +0 -1
  214. package/esm/operations/index.js.map +0 -1
  215. package/esm/operations/namespaces.d.ts +0 -416
  216. package/esm/operations/namespaces.d.ts.map +0 -1
  217. package/esm/operations/namespaces.js +0 -684
  218. package/esm/operations/namespaces.js.map +0 -1
  219. package/esm/operations/operations.d.ts +0 -46
  220. package/esm/operations/operations.d.ts.map +0 -1
  221. package/esm/operations/operations.js +0 -77
  222. package/esm/operations/operations.js.map +0 -1
  223. package/esm/operations/regions.d.ts +0 -49
  224. package/esm/operations/regions.d.ts.map +0 -1
  225. package/esm/operations/regions.js +0 -82
  226. package/esm/operations/regions.js.map +0 -1
  227. package/src/models/consumerGroupsMappers.ts +0 -30
  228. package/src/models/disasterRecoveryConfigsMappers.ts +0 -34
  229. package/src/models/eventHubsMappers.ts +0 -33
  230. package/src/models/namespacesMappers.ts +0 -35
  231. package/src/models/operationsMappers.ts +0 -14
  232. package/src/models/regionsMappers.ts +0 -30
  233. package/src/operations/regions.ts +0 -131
package/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # Release History
2
+
3
+ ## 5.0.0-beta.2 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ ### Other Changes
12
+
13
+ ## 5.0.0-beta.1 (2021-10-09)
14
+
15
+ This is the first preview for the new version of the `@azure/arm-eventhub` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.
16
+
17
+ While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/).
18
+
19
+ Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies.
20
+
21
+ **Noteworthy changes and features**
22
+ - Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice.
23
+ - Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
24
+ - List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page.
25
+ - Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`.
26
+ - The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Microsoft
3
+ Copyright (c) 2021 Microsoft
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,109 +1,94 @@
1
- ## Azure EventHubManagementClient SDK for JavaScript
1
+ # Azure EventHubManagement client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in Node.js and in browsers) for EventHubManagementClient.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure EventHubManagement client.
4
+
5
+ Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources.
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventhub/arm-eventhub) |
8
+ [Package (NPM)](https://www.npmjs.com/package/@azure/arm-eventhub) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-eventhub) |
10
+ [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
+
12
+ ## Getting started
4
13
 
5
14
  ### Currently supported environments
6
15
 
7
16
  - [LTS versions of Node.js](https://nodejs.org/about/releases/)
8
- - Latest versions of Safari, Chrome, Edge, and Firefox.
17
+ - Latest versions of Safari, Chrome, Edge and Firefox.
9
18
 
10
19
  ### Prerequisites
11
20
 
12
- You must have an [Azure subscription](https://azure.microsoft.com/free/).
21
+ - An [Azure subscription][azure_sub].
13
22
 
14
- ### How to install
23
+ ### Install the `@azure/arm-eventhub` package
15
24
 
16
- To use this SDK in your project, you will need to install two packages.
17
- - `@azure/arm-eventhub` that contains the client.
18
- - `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
25
+ Install the Azure EventHubManagement client library for JavaScript with `npm`:
19
26
 
20
- Install both packages using the below command:
21
27
  ```bash
22
- npm install --save @azure/arm-eventhub @azure/identity
28
+ npm install @azure/arm-eventhub
23
29
  ```
24
30
 
25
- > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
26
- If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
31
+ ### Create and authenticate a `EventHubManagementClient`
27
32
 
28
- ### How to use
33
+ To create a client object to access the Azure EventHubManagement API, you will need the `endpoint` of your Azure EventHubManagement resource and a `credential`. The Azure EventHubManagement client can use Azure Active Directory credentials to authenticate.
34
+ You can find the endpoint for your Azure EventHubManagement resource in the [Azure Portal][azure_portal].
29
35
 
30
- - If you are writing a client side browser application,
31
- - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions.
32
- - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below.
33
- - If you are writing a server side application,
34
- - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
35
- - Complete the set up steps required by the credential if any.
36
- - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below.
36
+ You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
37
37
 
38
- In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
39
- Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
38
+ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
39
+
40
+ ```bash
41
+ npm install @azure/identity
42
+ ```
40
43
 
41
- #### nodejs - Authentication, client creation, and list operations as an example written in JavaScript.
44
+ You will also need to **register a new AAD application and grant access to Azure EventHubManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45
+ Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
42
46
 
43
- ##### Sample code
47
+ For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
44
48
 
45
49
  ```javascript
46
- const { DefaultAzureCredential } = require("@azure/identity");
47
50
  const { EventHubManagementClient } = require("@azure/arm-eventhub");
48
- const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
49
-
50
- // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
51
- // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
52
- const creds = new DefaultAzureCredential();
53
- const client = new EventHubManagementClient(creds, subscriptionId);
54
-
55
- client.operations.list().then((result) => {
56
- console.log("The result is:");
57
- console.log(result);
58
- }).catch((err) => {
59
- console.log("An error occurred:");
60
- console.error(err);
61
- });
51
+ const { DefaultAzureCredential } = require("@azure/identity");
52
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
+ const client = new EventHubManagementClient(new DefaultAzureCredential(), subscriptionId);
62
54
  ```
63
55
 
64
- #### browser - Authentication, client creation, and list operations as an example written in JavaScript.
65
-
66
- In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
67
- - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
68
- - Note down the client Id from the previous step and use it in the browser sample below.
69
-
70
- ##### Sample code
71
-
72
- - index.html
73
-
74
- ```html
75
- <!DOCTYPE html>
76
- <html lang="en">
77
- <head>
78
- <title>@azure/arm-eventhub sample</title>
79
- <script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
80
- <script src="node_modules/@azure/identity/dist/index.js"></script>
81
- <script src="node_modules/@azure/arm-eventhub/dist/arm-eventhub.js"></script>
82
- <script type="text/javascript">
83
- const subscriptionId = "<Subscription_Id>";
84
- // Create credentials using the `@azure/identity` package.
85
- // Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
86
- const credential = new InteractiveBrowserCredential(
87
- {
88
- clientId: "<client id for your Azure AD app>",
89
- tenantId: "<optional tenant for your organization>"
90
- });
91
- const client = new Azure.ArmEventhub.EventHubManagementClient(creds, subscriptionId);
92
- client.operations.list().then((result) => {
93
- console.log("The result is:");
94
- console.log(result);
95
- }).catch((err) => {
96
- console.log("An error occurred:");
97
- console.error(err);
98
- });
99
- </script>
100
- </head>
101
- <body></body>
102
- </html>
56
+ ## Key concepts
57
+
58
+ ### EventHubManagementClient
59
+
60
+ `EventHubManagementClient` is the primary interface for developers using the Azure EventHubManagement client library. Explore the methods on this client object to understand the different features of the Azure EventHubManagement service that you can access.
61
+
62
+ ## Troubleshooting
63
+
64
+ ### Logging
65
+
66
+ Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
67
+
68
+ ```javascript
69
+ const { setLogLevel } = require("@azure/logger");
70
+ setLogLevel("info");
103
71
  ```
104
72
 
73
+ For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
74
+
75
+ ## Next steps
76
+
77
+ Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
78
+
79
+ ## Contributing
80
+
81
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
82
+
105
83
  ## Related projects
106
84
 
107
- - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
85
+ - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
86
+
87
+ ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Feventhub%2Farm-eventhub%2FREADME.png)
108
88
 
109
- ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/.\sdk\eventhub\arm-eventhub\/README.png)
89
+ [azure_cli]: https://docs.microsoft.com/cli/azure
90
+ [azure_sub]: https://azure.microsoft.com/free/
91
+ [azure_sub]: https://azure.microsoft.com/free/
92
+ [azure_portal]: https://portal.azure.com
93
+ [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
94
+ [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential