diff --git a/packages/@azure/arm-iothub/LICENSE.txt b/packages/@azure/arm-iothub/LICENSE.txt
index a70e8cf66038..8f3d856145c5 100644
--- a/packages/@azure/arm-iothub/LICENSE.txt
+++ b/packages/@azure/arm-iothub/LICENSE.txt
@@ -1,21 +1,21 @@
-The MIT License (MIT)
-
-Copyright (c) 2018 Microsoft
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+The MIT License (MIT)
+
+Copyright (c) 2019 Microsoft
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/packages/@azure/arm-iothub/README.md b/packages/@azure/arm-iothub/README.md
index 3e4fea2328fa..fd95240c703b 100644
--- a/packages/@azure/arm-iothub/README.md
+++ b/packages/@azure/arm-iothub/README.md
@@ -1,99 +1,96 @@
-## Azure IotHubClient SDK for JavaScript
-
-This package contains an isomorphic SDK for IotHubClient.
-
-### Currently supported environments
-
-- Node.js version 6.x.x or higher
-- Browser JavaScript
-
-### How to Install
-
-```
-npm install @azure/arm-iothub
-```
-
-### How to use
-
-#### nodejs - Authentication, client creation and list operations as an example written in TypeScript.
-
-##### Install @azure/ms-rest-nodeauth
-
-```
-npm install @azure/ms-rest-nodeauth
-```
-
-##### Sample code
-
-```ts
-import * as msRest from "@azure/ms-rest-js";
-import * as msRestAzure from "@azure/ms-rest-azure-js";
-import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
-import { IotHubClient, IotHubModels, IotHubMappers } from "@azure/arm-iothub";
-const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
-
-msRestNodeAuth.interactiveLogin().then((creds) => {
- const client = new IotHubClient(creds, subscriptionId);
- client.operations.list().then((result) => {
- console.log("The result is:");
- console.log(result);
- });
-}).catch((err) => {
- console.error(err);
-});
-```
-
-#### browser - Authentication, client creation and list operations as an example written in JavaScript.
-
-##### Install @azure/ms-rest-browserauth
-
-```
-npm install @azure/ms-rest-browserauth
-```
-
-##### Sample code
-
-See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
-
-- index.html
-```html
-
-
-
- @azure/arm-iothub sample
-
-
-
-
-
-
-
-
-```
-
-## Related projects
-
-- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
-
-
-
+## Azure IotHubClient SDK for JavaScript
+
+This package contains an isomorphic SDK for IotHubClient.
+
+### Currently supported environments
+
+- Node.js version 6.x.x or higher
+- Browser JavaScript
+
+### How to Install
+
+```bash
+npm install @azure/arm-iothub
+```
+
+### How to use
+
+#### nodejs - Authentication, client creation and list operations as an example written in TypeScript.
+
+##### Install @azure/ms-rest-nodeauth
+
+```bash
+npm install @azure/ms-rest-nodeauth
+```
+
+##### Sample code
+
+```typescript
+import * as msRest from "@azure/ms-rest-js";
+import * as msRestAzure from "@azure/ms-rest-azure-js";
+import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
+import { IotHubClient, IotHubModels, IotHubMappers } from "@azure/arm-iothub";
+const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
+
+msRestNodeAuth.interactiveLogin().then((creds) => {
+ const client = new IotHubClient(creds, subscriptionId);
+ client.operations.list().then((result) => {
+ console.log("The result is:");
+ console.log(result);
+ });
+}).catch((err) => {
+ console.error(err);
+});
+```
+
+#### browser - Authentication, client creation and list operations as an example written in JavaScript.
+
+##### Install @azure/ms-rest-browserauth
+
+```bash
+npm install @azure/ms-rest-browserauth
+```
+
+##### Sample code
+
+See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
+
+- index.html
+```html
+
+
+
+ @azure/arm-iothub sample
+
+
+
+
+
+
+
+
+```
+
+## Related projects
+
+- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
diff --git a/packages/@azure/arm-iothub/lib/iotHubClient.ts b/packages/@azure/arm-iothub/lib/iotHubClient.ts
index 36360600b831..acbec4a87d10 100644
--- a/packages/@azure/arm-iothub/lib/iotHubClient.ts
+++ b/packages/@azure/arm-iothub/lib/iotHubClient.ts
@@ -21,6 +21,7 @@ class IotHubClient extends IotHubClientContext {
iotHubResource: operations.IotHubResource;
resourceProviderCommon: operations.ResourceProviderCommon;
certificates: operations.Certificates;
+ iotHub: operations.IotHub;
/**
* Initializes a new instance of the IotHubClient class.
@@ -34,6 +35,7 @@ class IotHubClient extends IotHubClientContext {
this.iotHubResource = new operations.IotHubResource(this);
this.resourceProviderCommon = new operations.ResourceProviderCommon(this);
this.certificates = new operations.Certificates(this);
+ this.iotHub = new operations.IotHub(this);
}
}
diff --git a/packages/@azure/arm-iothub/lib/iotHubClientContext.ts b/packages/@azure/arm-iothub/lib/iotHubClientContext.ts
index 4e27860b04d5..86967fe65040 100644
--- a/packages/@azure/arm-iothub/lib/iotHubClientContext.ts
+++ b/packages/@azure/arm-iothub/lib/iotHubClientContext.ts
@@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
const packageName = "@azure/arm-iothub";
-const packageVersion = "0.1.0";
+const packageVersion = "2.1.0";
export class IotHubClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
@@ -44,7 +44,7 @@ export class IotHubClientContext extends msRestAzure.AzureServiceClient {
super(credentials, options);
- this.apiVersion = '2018-04-01';
+ this.apiVersion = '2019-03-22-preview';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
diff --git a/packages/@azure/arm-iothub/lib/models/certificatesMappers.ts b/packages/@azure/arm-iothub/lib/models/certificatesMappers.ts
index 063684f78e5f..854b59f2a251 100644
--- a/packages/@azure/arm-iothub/lib/models/certificatesMappers.ts
+++ b/packages/@azure/arm-iothub/lib/models/certificatesMappers.ts
@@ -37,7 +37,7 @@ export {
MessagingEndpointProperties,
CloudToDeviceProperties,
FeedbackProperties,
- OperationsMonitoringProperties,
+ IotHubPropertiesDeviceStreams,
IotHubSkuInfo
} from "../models/mappers";
diff --git a/packages/@azure/arm-iothub/lib/models/index.ts b/packages/@azure/arm-iothub/lib/models/index.ts
index e621acb66598..19013dcd94a7 100644
--- a/packages/@azure/arm-iothub/lib/models/index.ts
+++ b/packages/@azure/arm-iothub/lib/models/index.ts
@@ -356,9 +356,8 @@ export interface RoutingServiceBusQueueEndpointProperties {
* @member {string} name The name that identifies this endpoint. The name can
* only include alphanumeric characters, periods, underscores, hyphens and
* has a maximum length of 64 characters. The following names are reserved:
- * events, operationsMonitoringEvents, fileNotifications, $default. Endpoint
- * names must be unique across endpoint types. The name need not be the same
- * as the actual queue name.
+ * events, fileNotifications, $default. Endpoint names must be unique across
+ * endpoint types. The name need not be the same as the actual queue name.
*/
name: string;
/**
@@ -389,9 +388,8 @@ export interface RoutingServiceBusTopicEndpointProperties {
* @member {string} name The name that identifies this endpoint. The name can
* only include alphanumeric characters, periods, underscores, hyphens and
* has a maximum length of 64 characters. The following names are reserved:
- * events, operationsMonitoringEvents, fileNotifications, $default. Endpoint
- * names must be unique across endpoint types. The name need not be the same
- * as the actual topic name.
+ * events, fileNotifications, $default. Endpoint names must be unique across
+ * endpoint types. The name need not be the same as the actual topic name.
*/
name: string;
/**
@@ -422,8 +420,8 @@ export interface RoutingEventHubProperties {
* @member {string} name The name that identifies this endpoint. The name can
* only include alphanumeric characters, periods, underscores, hyphens and
* has a maximum length of 64 characters. The following names are reserved:
- * events, operationsMonitoringEvents, fileNotifications, $default. Endpoint
- * names must be unique across endpoint types.
+ * events, fileNotifications, $default. Endpoint names must be unique across
+ * endpoint types.
*/
name: string;
/**
@@ -454,8 +452,8 @@ export interface RoutingStorageContainerProperties {
* @member {string} name The name that identifies this endpoint. The name can
* only include alphanumeric characters, periods, underscores, hyphens and
* has a maximum length of 64 characters. The following names are reserved:
- * events, operationsMonitoringEvents, fileNotifications, $default. Endpoint
- * names must be unique across endpoint types.
+ * events, fileNotifications, $default. Endpoint names must be unique across
+ * endpoint types.
*/
name: string;
/**
@@ -492,11 +490,11 @@ export interface RoutingStorageContainerProperties {
*/
maxChunkSizeInBytes?: number;
/**
- * @member {string} [encoding] Encoding that is used to serialize messages to
- * blobs. Supported values are 'avro' and 'avrodeflate'. Default value is
- * 'avro'.
+ * @member {Encoding} [encoding] Encoding that is used to serialize messages
+ * to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default
+ * value is 'avro'. Possible values include: 'Avro', 'AvroDeflate', 'JSON'
*/
- encoding?: string;
+ encoding?: Encoding;
}
/**
@@ -647,8 +645,8 @@ export interface RoutingProperties {
*/
export interface StorageEndpointProperties {
/**
- * @member {string} [sasTtlAsIso8601] The period of time for which the the
- * SAS URI generated by IoT Hub for file upload is valid. See:
+ * @member {string} [sasTtlAsIso8601] The period of time for which the SAS
+ * URI generated by IoT Hub for file upload is valid. See:
* https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options.
*/
sasTtlAsIso8601?: string;
@@ -745,18 +743,15 @@ export interface CloudToDeviceProperties {
/**
* @interface
- * An interface representing OperationsMonitoringProperties.
- * The operations monitoring properties for the IoT hub. The possible keys to
- * the dictionary are Connections, DeviceTelemetry, C2DCommands,
- * DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations,
- * C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods.
+ * An interface representing IotHubPropertiesDeviceStreams.
+ * The device streams properties of iothub.
*
*/
-export interface OperationsMonitoringProperties {
+export interface IotHubPropertiesDeviceStreams {
/**
- * @member {{ [propertyName: string]: OperationMonitoringLevel }} [events]
+ * @member {string[]} [streamingEndpoints] List of Device Streams Endpoints.
*/
- events?: { [propertyName: string]: OperationMonitoringLevel };
+ streamingEndpoints?: string[];
}
/**
@@ -783,7 +778,7 @@ export interface IotHubProperties {
*/
readonly provisioningState?: string;
/**
- * @member {string} [state] Thehub state state.
+ * @member {string} [state] The hub state.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
@@ -796,10 +791,9 @@ export interface IotHubProperties {
readonly hostName?: string;
/**
* @member {{ [propertyName: string]: EventHubProperties }}
- * [eventHubEndpoints] The Event Hub-compatible endpoint properties. The
- * possible keys to this dictionary are events and
- * operationsMonitoringEvents. Both of these keys have to be present in the
- * dictionary while making create or update calls for the IoT hub.
+ * [eventHubEndpoints] The Event Hub-compatible endpoint properties. The only
+ * possible keys to this dictionary is events. This key has to be present in
+ * the dictionary while making create or update calls for the IoT hub.
*/
eventHubEndpoints?: { [propertyName: string]: EventHubProperties };
/**
@@ -836,9 +830,10 @@ export interface IotHubProperties {
*/
comments?: string;
/**
- * @member {OperationsMonitoringProperties} [operationsMonitoringProperties]
+ * @member {IotHubPropertiesDeviceStreams} [deviceStreams] The device streams
+ * properties of iothub.
*/
- operationsMonitoringProperties?: OperationsMonitoringProperties;
+ deviceStreams?: IotHubPropertiesDeviceStreams;
/**
* @member {Capabilities} [features] The capabilities and features enabled
* for the IoT hub. Possible values include: 'None', 'DeviceManagement'
@@ -957,6 +952,12 @@ export interface OperationDisplay {
* the server.**
*/
readonly operation?: string;
+ /**
+ * @member {string} [description] Description of the operation
+ * **NOTE: This property will not be serialized. It can only be populated by
+ * the server.**
+ */
+ readonly description?: string;
}
/**
@@ -1052,8 +1053,19 @@ export interface EndpointHealthData {
*/
endpointId?: string;
/**
- * @member {EndpointHealthStatus} [healthStatus] Health status. Possible
- * values include: 'unknown', 'healthy', 'unhealthy', 'dead'
+ * @member {EndpointHealthStatus} [healthStatus] Health statuses have
+ * following meanings. The 'healthy' status shows that the endpoint is
+ * accepting messages as expected. The 'unhealthy' status shows that the
+ * endpoint is not accepting messages as expected and IoT Hub is retrying to
+ * send data to this endpoint. The status of an unhealthy endpoint will be
+ * updated to healthy when IoT Hub has established an eventually consistent
+ * state of health. The 'dead' status shows that the endpoint is not
+ * accepting messages, after IoT Hub retried sending messages for the retrial
+ * period. See IoT Hub metrics to identify errors and monitor issues with
+ * endpoints. The 'unknown' status shows that the IoT Hub has not established
+ * a connection with the endpoint. No messages have been delivered to or
+ * rejected from this endpoint. Possible values include: 'unknown',
+ * 'healthy', 'unhealthy', 'dead'
*/
healthStatus?: EndpointHealthStatus;
}
@@ -1398,13 +1410,13 @@ export interface RoutingMessage {
*/
export interface RoutingTwinProperties {
/**
- * @member {any} [desiredProperties] Twin desired properties
+ * @member {any} [desired] Twin desired properties
*/
- desiredProperties?: any;
+ desired?: any;
/**
- * @member {any} [reportedProperties] Twin desired properties
+ * @member {any} [reported] Twin desired properties
*/
- reportedProperties?: any;
+ reported?: any;
}
/**
@@ -1621,6 +1633,20 @@ export interface ImportDevicesRequest {
outputBlobContainerUri: string;
}
+/**
+ * @interface
+ * An interface representing FailoverInput.
+ * Use to provide failover region when requesting Customer Initiated Fail over
+ * for a hub.
+ *
+ */
+export interface FailoverInput {
+ /**
+ * @member {string} failoverRegion Region the hub will be failed over to
+ */
+ failoverRegion: string;
+}
+
/**
* @interface
* An interface representing IotHubResourceCreateOrUpdateOptionalParams.
@@ -1889,14 +1915,6 @@ export type IpFilterActionType = 'Accept' | 'Reject';
*/
export type RoutingSource = 'Invalid' | 'DeviceMessages' | 'TwinChangeEvents' | 'DeviceLifecycleEvents' | 'DeviceJobLifecycleEvents';
-/**
- * Defines values for OperationMonitoringLevel.
- * Possible values include: 'None', 'Error', 'Information', 'Error, Information'
- * @readonly
- * @enum {string}
- */
-export type OperationMonitoringLevel = 'None' | 'Error' | 'Information' | 'Error, Information';
-
/**
* Defines values for Capabilities.
* Possible values include: 'None', 'DeviceManagement'
@@ -1979,6 +1997,14 @@ export type TestResultStatus = 'undefined' | 'false' | 'true';
*/
export type RouteErrorSeverity = 'error' | 'warning';
+/**
+ * Defines values for Encoding.
+ * Possible values include: 'Avro', 'AvroDeflate', 'JSON'
+ * @readonly
+ * @enum {string}
+ */
+export type Encoding = 'Avro' | 'AvroDeflate' | 'JSON';
+
/**
* Contains response data for the list operation.
*/
@@ -2765,3 +2791,22 @@ export type CertificatesVerifyResponse = CertificateDescription & {
parsedBody: CertificateDescription;
};
};
+
+/**
+ * Contains response data for the customerInitiatedFailover operation.
+ */
+export type IotHubCustomerInitiatedFailoverResponse = IotHubDescription & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: IotHubDescription;
+ };
+};
diff --git a/packages/@azure/arm-iothub/lib/models/iotHubMappers.ts b/packages/@azure/arm-iothub/lib/models/iotHubMappers.ts
new file mode 100644
index 000000000000..953b216bf023
--- /dev/null
+++ b/packages/@azure/arm-iothub/lib/models/iotHubMappers.ts
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+export {
+ FailoverInput,
+ IotHubDescription,
+ Resource,
+ BaseResource,
+ IotHubProperties,
+ SharedAccessSignatureAuthorizationRule,
+ IpFilterRule,
+ EventHubProperties,
+ RoutingProperties,
+ RoutingEndpoints,
+ RoutingServiceBusQueueEndpointProperties,
+ RoutingServiceBusTopicEndpointProperties,
+ RoutingEventHubProperties,
+ RoutingStorageContainerProperties,
+ RouteProperties,
+ FallbackRouteProperties,
+ StorageEndpointProperties,
+ MessagingEndpointProperties,
+ CloudToDeviceProperties,
+ FeedbackProperties,
+ IotHubPropertiesDeviceStreams,
+ IotHubSkuInfo,
+ ErrorDetails,
+ CertificateDescription,
+ CertificateProperties,
+ CertificateWithNonceDescription,
+ CertificatePropertiesWithNonce,
+ EventHubConsumerGroupInfo
+} from "../models/mappers";
+
diff --git a/packages/@azure/arm-iothub/lib/models/iotHubResourceMappers.ts b/packages/@azure/arm-iothub/lib/models/iotHubResourceMappers.ts
index edcf42a6f5d8..10643ad3cc46 100644
--- a/packages/@azure/arm-iothub/lib/models/iotHubResourceMappers.ts
+++ b/packages/@azure/arm-iothub/lib/models/iotHubResourceMappers.ts
@@ -28,7 +28,7 @@ export {
MessagingEndpointProperties,
CloudToDeviceProperties,
FeedbackProperties,
- OperationsMonitoringProperties,
+ IotHubPropertiesDeviceStreams,
IotHubSkuInfo,
ErrorDetails,
TagsResource,
diff --git a/packages/@azure/arm-iothub/lib/models/mappers.ts b/packages/@azure/arm-iothub/lib/models/mappers.ts
index ffafd0911b12..457314d427f0 100644
--- a/packages/@azure/arm-iothub/lib/models/mappers.ts
+++ b/packages/@azure/arm-iothub/lib/models/mappers.ts
@@ -944,17 +944,17 @@ export const CloudToDeviceProperties: msRest.CompositeMapper = {
}
};
-export const OperationsMonitoringProperties: msRest.CompositeMapper = {
- serializedName: "OperationsMonitoringProperties",
+export const IotHubPropertiesDeviceStreams: msRest.CompositeMapper = {
+ serializedName: "IotHubProperties_deviceStreams",
type: {
name: "Composite",
- className: "OperationsMonitoringProperties",
+ className: "IotHubPropertiesDeviceStreams",
modelProperties: {
- events: {
- serializedName: "events",
+ streamingEndpoints: {
+ serializedName: "streamingEndpoints",
type: {
- name: "Dictionary",
- value: {
+ name: "Sequence",
+ element: {
type: {
name: "String"
}
@@ -1078,11 +1078,11 @@ export const IotHubProperties: msRest.CompositeMapper = {
name: "String"
}
},
- operationsMonitoringProperties: {
- serializedName: "operationsMonitoringProperties",
+ deviceStreams: {
+ serializedName: "deviceStreams",
type: {
name: "Composite",
- className: "OperationsMonitoringProperties"
+ className: "IotHubPropertiesDeviceStreams"
}
},
features: {
@@ -1240,6 +1240,13 @@ export const OperationDisplay: msRest.CompositeMapper = {
type: {
name: "String"
}
+ },
+ description: {
+ readOnly: true,
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
}
}
}
@@ -1808,14 +1815,14 @@ export const RoutingTwinProperties: msRest.CompositeMapper = {
name: "Composite",
className: "RoutingTwinProperties",
modelProperties: {
- desiredProperties: {
- serializedName: "desiredProperties",
+ desired: {
+ serializedName: "desired",
type: {
name: "Object"
}
},
- reportedProperties: {
- serializedName: "reportedProperties",
+ reported: {
+ serializedName: "reported",
type: {
name: "Object"
}
@@ -2116,6 +2123,23 @@ export const ImportDevicesRequest: msRest.CompositeMapper = {
}
};
+export const FailoverInput: msRest.CompositeMapper = {
+ serializedName: "failoverInput",
+ type: {
+ name: "Composite",
+ className: "FailoverInput",
+ modelProperties: {
+ failoverRegion: {
+ required: true,
+ serializedName: "failoverRegion",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
export const OperationListResult: msRest.CompositeMapper = {
serializedName: "OperationListResult",
type: {
diff --git a/packages/@azure/arm-iothub/lib/operations/index.ts b/packages/@azure/arm-iothub/lib/operations/index.ts
index 6746b192f768..9c561acd7985 100644
--- a/packages/@azure/arm-iothub/lib/operations/index.ts
+++ b/packages/@azure/arm-iothub/lib/operations/index.ts
@@ -12,3 +12,4 @@ export * from "./operations";
export * from "./iotHubResource";
export * from "./resourceProviderCommon";
export * from "./certificates";
+export * from "./iotHub";
diff --git a/packages/@azure/arm-iothub/lib/operations/iotHub.ts b/packages/@azure/arm-iothub/lib/operations/iotHub.ts
new file mode 100644
index 000000000000..2118544cb83f
--- /dev/null
+++ b/packages/@azure/arm-iothub/lib/operations/iotHub.ts
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+import * as msRest from "@azure/ms-rest-js";
+import * as Models from "../models";
+import * as Mappers from "../models/iotHubMappers";
+import * as Parameters from "../models/parameters";
+import { IotHubClientContext } from "../iotHubClientContext";
+
+/** Class representing a IotHub. */
+export class IotHub {
+ private readonly client: IotHubClientContext;
+
+ /**
+ * Create a IotHub.
+ * @param {IotHubClientContext} client Reference to the service client.
+ */
+ constructor(client: IotHubClientContext) {
+ this.client = client;
+ }
+
+ /**
+ * Perform customer initiated fail over of given hub
+ * @summary Customer Initiated Fail over
+ * @param iotHubName IotHub to fail over
+ * @param resourceGroupName resource group which Iot Hub belongs to
+ * @param failoverRegion Region the hub will be failed over to
+ * @param [options] The optional parameters
+ * @returns Promise
+ */
+ customerInitiatedFailover(iotHubName: string, resourceGroupName: string, failoverRegion: string, options?: msRest.RequestOptionsBase): Promise;
+ /**
+ * @param iotHubName IotHub to fail over
+ * @param resourceGroupName resource group which Iot Hub belongs to
+ * @param failoverRegion Region the hub will be failed over to
+ * @param callback The callback
+ */
+ customerInitiatedFailover(iotHubName: string, resourceGroupName: string, failoverRegion: string, callback: msRest.ServiceCallback): void;
+ /**
+ * @param iotHubName IotHub to fail over
+ * @param resourceGroupName resource group which Iot Hub belongs to
+ * @param failoverRegion Region the hub will be failed over to
+ * @param options The optional parameters
+ * @param callback The callback
+ */
+ customerInitiatedFailover(iotHubName: string, resourceGroupName: string, failoverRegion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void;
+ customerInitiatedFailover(iotHubName: string, resourceGroupName: string, failoverRegion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ iotHubName,
+ resourceGroupName,
+ failoverRegion,
+ options
+ },
+ customerInitiatedFailoverOperationSpec,
+ callback) as Promise;
+ }
+}
+
+// Operation Specifications
+const serializer = new msRest.Serializer(Mappers);
+const customerInitiatedFailoverOperationSpec: msRest.OperationSpec = {
+ httpMethod: "POST",
+ path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover",
+ urlParameters: [
+ Parameters.iotHubName,
+ Parameters.subscriptionId,
+ Parameters.resourceGroupName
+ ],
+ queryParameters: [
+ Parameters.apiVersion
+ ],
+ headerParameters: [
+ Parameters.acceptLanguage
+ ],
+ requestBody: {
+ parameterPath: {
+ failoverRegion: "failoverRegion"
+ },
+ mapper: {
+ ...Mappers.FailoverInput,
+ required: true
+ }
+ },
+ responses: {
+ 200: {
+ bodyMapper: Mappers.IotHubDescription
+ },
+ default: {
+ bodyMapper: Mappers.ErrorDetails
+ }
+ },
+ serializer
+};
diff --git a/packages/@azure/arm-iothub/package.json b/packages/@azure/arm-iothub/package.json
index 65b852e5fe63..2ffb54125116 100644
--- a/packages/@azure/arm-iothub/package.json
+++ b/packages/@azure/arm-iothub/package.json
@@ -4,8 +4,8 @@
"description": "IotHubClient Library with typescript type definitions for node.js and browser.",
"version": "2.1.0",
"dependencies": {
- "@azure/ms-rest-azure-js": "^1.1.0",
- "@azure/ms-rest-js": "^1.1.0",
+ "@azure/ms-rest-azure-js": "^1.2.0",
+ "@azure/ms-rest-js": "^1.2.0",
"tslib": "^1.9.3"
},
"keywords": [
@@ -23,6 +23,7 @@
"typescript": "^3.1.1",
"rollup": "^0.66.2",
"rollup-plugin-node-resolve": "^3.4.0",
+ "rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.4.9"
},
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-iothub",
@@ -51,6 +52,5 @@
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-iothub.js.map'\" -o ./dist/arm-iothub.min.js ./dist/arm-iothub.js",
"prepack": "npm install && npm run build"
},
- "sideEffects": false,
- "authPublish": true
+ "sideEffects": false
}
diff --git a/packages/@azure/arm-iothub/rollup.config.js b/packages/@azure/arm-iothub/rollup.config.js
index 0209b0ba1400..8464171f6338 100644
--- a/packages/@azure/arm-iothub/rollup.config.js
+++ b/packages/@azure/arm-iothub/rollup.config.js
@@ -1,10 +1,16 @@
+import rollup from "rollup";
import nodeResolve from "rollup-plugin-node-resolve";
+import sourcemaps from "rollup-plugin-sourcemaps";
+
/**
- * @type {import('rollup').RollupFileOptions}
+ * @type {rollup.RollupFileOptions}
*/
const config = {
- input: './esm/iotHubClient.js',
- external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
+ input: "./esm/iotHubClient.js",
+ external: [
+ "@azure/ms-rest-js",
+ "@azure/ms-rest-azure-js"
+ ],
output: {
file: "./dist/arm-iothub.js",
format: "umd",
@@ -16,16 +22,16 @@ const config = {
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
- * Changes may cause incorrect behavior and will be lost if the code is
- * regenerated.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/`
},
plugins: [
- nodeResolve({ module: true })
+ nodeResolve({ module: true }),
+ sourcemaps()
]
};
+
export default config;