Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@azure/arm-iothub/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
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
Expand Down
11 changes: 4 additions & 7 deletions packages/@azure/arm-iothub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for IotHubClient.

### How to Install

```
```bash
npm install @azure/arm-iothub
```

Expand All @@ -19,13 +19,13 @@ npm install @azure/arm-iothub

##### Install @azure/ms-rest-nodeauth

```
```bash
npm install @azure/ms-rest-nodeauth
```

##### Sample code

```ts
```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";
Expand All @@ -47,7 +47,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {

##### Install @azure/ms-rest-browserauth

```
```bash
npm install @azure/ms-rest-browserauth
```

Expand Down Expand Up @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fpackages%2F%40azure%2Farm-iothub%2FREADME.png)
2 changes: 2 additions & 0 deletions packages/@azure/arm-iothub/lib/iotHubClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/@azure/arm-iothub/lib/iotHubClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down
3 changes: 2 additions & 1 deletion packages/@azure/arm-iothub/lib/models/certificatesMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ export {
RoutingStorageContainerProperties,
RouteProperties,
FallbackRouteProperties,
EnrichmentProperties,
StorageEndpointProperties,
MessagingEndpointProperties,
CloudToDeviceProperties,
FeedbackProperties,
OperationsMonitoringProperties,
IotHubPropertiesDeviceStreams,
IotHubSkuInfo
} from "../models/mappers";

163 changes: 118 additions & 45 deletions packages/@azure/arm-iothub/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -609,6 +607,29 @@ export interface FallbackRouteProperties {
isEnabled: boolean;
}

/**
* @interface
* An interface representing EnrichmentProperties.
* The properties of an enrichment that your IoT hub applies to messages
* delivered to endpoints.
*
*/
export interface EnrichmentProperties {
/**
* @member {string} key The key or name for the enrichment property.
*/
key: string;
/**
* @member {string} value The value for the enrichment property.
*/
value: string;
/**
* @member {string[]} endpointNames The list of endpoints for which the
* enrichment is applied to the message.
*/
endpointNames: string[];
}

/**
* @interface
* An interface representing RoutingProperties.
Expand Down Expand Up @@ -637,6 +658,12 @@ export interface RoutingProperties {
* eventhub endpoint.
*/
fallbackRoute?: FallbackRouteProperties;
/**
* @member {EnrichmentProperties[]} [enrichments] The list of user-provided
* enrichments that the IoT hub applies to messages to be delivered to
* built-in and custom endpoints. See: https://aka.ms/iotmsgenrich
*/
enrichments?: EnrichmentProperties[];
}

/**
Expand All @@ -647,8 +674,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;
Expand Down Expand Up @@ -745,18 +772,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[];
}

/**
Expand All @@ -783,7 +807,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.**
*/
Expand All @@ -796,10 +820,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 };
/**
Expand Down Expand Up @@ -836,9 +859,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'
Expand Down Expand Up @@ -957,6 +981,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;
}

/**
Expand Down Expand Up @@ -1052,8 +1082,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;
}
Expand Down Expand Up @@ -1398,13 +1439,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;
}

/**
Expand Down Expand Up @@ -1621,6 +1662,19 @@ export interface ImportDevicesRequest {
outputBlobContainerUri: string;
}

/**
* @interface
* An interface representing FailoverInput.
* Use to provide failover region when requesting manual Failover for a hub.
*
*/
export interface FailoverInput {
/**
* @member {string} failoverRegion Region the hub will be failed over to
*/
failoverRegion: string;
}

/**
* @interface
* An interface representing IotHubResourceCreateOrUpdateOptionalParams.
Expand Down Expand Up @@ -1889,14 +1943,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'
Expand Down Expand Up @@ -1979,6 +2025,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.
*/
Expand Down Expand Up @@ -2765,3 +2819,22 @@ export type CertificatesVerifyResponse = CertificateDescription & {
parsedBody: CertificateDescription;
};
};

/**
* Contains response data for the manualFailover operation.
*/
export type IotHubManualFailoverResponse = 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;
};
};
Loading