Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Deprecation/migration notice
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Cauchois committed Sep 18, 2018
1 parent 9de882c commit 732fa04
Show file tree
Hide file tree
Showing 28 changed files with 130 additions and 98 deletions.
30 changes: 3 additions & 27 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
**The Azure IoT SDKs team wants to hear from you!**
Hi there!

- [Ask a question](#ask-a-question)
- [File a bug](#file-a-bug)
- [Contribute documentation](#contribute-documentation)
- [Contribute code](#contribute-code)
**iothub-explorer** will be retired on November 31st, 2018 and has been replaced by the [Azure CLI IoT Extension](https://aka.ms/iotcli).

# Ask a question
Our team monitors Stack Overflow, especially the [azure-iot-hub](http://stackoverflow.com/questions/tagged/azure-iot-hub) tag. It really is the best place to ask.

We monitor the Github issues section specifically for bugs found with our SDK and tools, however we will reply to questions asked using Github issues too.

# File a bug (code or documentation)
That is definitely something we want to hear about. Please open an issue on github, we'll address it as fast as possible. Typically here's the information we're going to ask for to get started:
- What version of `iothub-explorer` are you using?
- Do you have logs showing what's happening?
- Do you have code samples of what is/should be happening on the other side?

`iothub-explorer` is entirely open-source and we do accept pull-requests if you feel like taking a stab at fixing the bug and maybe adding your name to our commit history :) Please mention any relevant issue number in the pull request description.

# Contribute code and/or documentation
We look at all pull requests submitted against the `master` branch carefully. We also actively use the [Wiki](https://github.com/Azure/azure-iot-sdk-node/wiki) for longer-form documents. The wiki can be cloned and used as a regular Git repository so feel free to contribute there too!

As far as code is concerned the code associated with the PR will be pulled and run through the gated build before it makes it to the master branch. As much as possible, we insist on having tests associated with the code, and if necessary, additions/modifications to the requirement documents. As a matter of fact, the build will fail if code coverage goes down.

Also, have you signed the [Contribution License Agreement](https://cla.microsoft.com/) ([CLA](https://cla.microsoft.com/))? A friendly bot will remind you about it when you submit your pull-request.

If you feel like your contribution is going to be a major effort, you should probably give us a heads-up. We have a lot of items captured in our backlog and we release every two weeks, so before you spend the time, just check with us to make
sure your plans and ours are in sync :) Just open an issue on github and tag it "enhancement" or "feature request"
We will not address any issues regarding iothub-explorer except for those related to migrating towards the Azure CLI.
23 changes: 3 additions & 20 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
<!--
Hi there! thank you for discovering and submitting an issue!
Hi there!
iothub-explorer will be retired on November 31st, 2018 and has been replaced by the [Azure CLI IoT Extension](https://aka.ms/iotcli).
Please first tell us a little bit about the environment you're running:
The commands in the comments can be run directly in a command prompt.
We will not address any issues regarding iothub-explorer except for those related to migrating towards the Azure CLI.
-->

# Context
- **OS and version used:** <VERSION> <!-- Windows 10, Ubuntu 15.04... -->
- **Node.js version:** <VERSION> <!-- in a command prompt: node --version -->
- **npm version:** <VERSION> <!-- in a command prompt: npm --version -->
- **list of installed packages:** <VERSION> <!-- in a command prompt, from the directory containing your code: npm list -->
- **cloned repo:** <VERSION> <!-- **If** you are using a cloned repository, in a command prompt: git describe -->

# Description of the issue:
<!-- please be as detailed as possible: which feature has a problem, how often does it fail, -->

# Console log of the issue:
<!-- Consider setting the DEBUG environment variable to '*'. This will produce a much more verbose output that will help debugging -->
<!-- Don't forget to remove any connection string information! -->

# Code sample exhibiting the issue:
<!-- Please remove any connection string information! -->
19 changes: 4 additions & 15 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
<!--
Thank you for helping us improve the Azure IoT Node.js SDK!
Hi there!
iothub-explorer will be retired on November 31st, 2018 and has been replaced by the [Azure CLI IoT Extension](https://aka.ms/iotcli).
Here's a little checklist of things that will help it make its way to the repository: Note that you don't have to check all the boxes, we can help you with that.
This being said, the more you do, the quicker it'll go through our gated build!
-->

# Checklist
- [ ] I have read the [contribution guidelines] (https://github.com/Azure/iothub-explorer/blob/master/.github/CONTRIBUTING.md).

# Reference/Link to the issue solved with this PR (if any)

# Description of the problem
<!-- Please be as precise as possible: what issue you experienced, how often... -->

# Description of the solution
<!-- How you solved the issue and the other things you considered and maybe rejected -->
We will not address any pull-requests against iothub-explorer except for those related to migrating towards the Azure CLI.
-->
20 changes: 13 additions & 7 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var fs = require('fs');

// external dependencies
var colorsTmpl = require('colors-tmpl');
var chalk = require('chalk');
var prettyjson = require('prettyjson');
var uuid = require('uuid');
var _ = require('lodash');
Expand Down Expand Up @@ -74,15 +74,15 @@ function inputError(message) {
}

function printErrorWithHintAndExit(message, hint, prefix) {
printErrorAndExit(message + '\n\n{bold}{yellow}Hint:{/yellow}{/bold} ' + hint, prefix);
printErrorAndExit(message + chalk.yellow.bold('Hint: ') + hint, prefix);
}

function printErrorAndExit(message, prefix) {
if (!prefix) {
prefix = 'Error:';
}

console.error(colorsTmpl('\n{bold}{red}' + prefix + '{/red}{/bold} ' + message));
console.error(chalk.red.bold(prefix) + ' ' + message);
process.exit(1);
}

Expand All @@ -95,7 +95,7 @@ function serviceError(err) {
}

function printSuccess(message) {
console.log(colorsTmpl('{green}' + message + '{/green}'));
console.log(chalk.green(message));
}

/**
Expand All @@ -110,13 +110,13 @@ function printDevice(device, hubHostName, propertyFilter, rawOutput) {
var output = createDeviceJSONObject(device, hubHostName, propertyFilter);

output = rawOutput ? JSON.stringify(output) : prettyjson.render(output);

console.log(output);
}

function createDeviceJSONObject(device, hubHostName, propertyFilter) {
var filtered = {};

if (propertyFilter) {
var props = propertyFilter.split(',');
props.forEach(function (prop) {
Expand Down Expand Up @@ -217,6 +217,11 @@ function getHostFromSas(sas) {
return SharedAccessSignature.parse(sas).sr;
}

function showDeprecationText(newCommand) {
console.log(chalk.bold(chalk.red("The equivalent command in the Azure CLI is: ") + chalk.green(newCommand)));
console.log('--------');
}

module.exports = {
inputError: inputError,
serviceError: serviceError,
Expand All @@ -229,5 +234,6 @@ module.exports = {
getSas: getSas,
configLoc: configLoc,
createMessageFromArgument: createMessageFromArgument,
createDeviceConnectionString: createDeviceConnectionString
createDeviceConnectionString: createDeviceConnectionString,
showDeprecationText: showDeprecationText
};
3 changes: 3 additions & 0 deletions iothub-explorer-cancel-job.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ var program = require('commander');
var serviceError = require('./common.js').serviceError;
var getSas = require('./common.js').getSas;
var JobClient = require('azure-iothub').JobClient;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub job cancel');

program
.description('Cancel existing job')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ var printDevice = require('./common.js').printDevice;
var getHostFromSas = require('./common.js').getHostFromSas;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-identity create');

var info;

Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var serviceError = require('./common.js').serviceError;
var printSuccess = require('./common.js').printSuccess;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-identity delete');

program
.description('Delete a device identity from your IoT hub device registry')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-device-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var inputError = require('./common.js').inputError;
var serviceError = require('./common.js').serviceError;
var getSas = require('./common.js').getSas;
var Client = require('azure-iothub').Client;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub invoke-device-method');

program
.description('Call a device method on a specific device')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-export-devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var serviceError = require('./common.js').serviceError;
var printSuccess = require('./common.js').printSuccess;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-identity export');

program
.description('Export devices in bulk from the device identity registry. The list of devices gets exported to a blob and then downloaded to a local file.')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-get-twin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var inputError = require('./common.js').inputError;
var serviceError = require('./common.js').serviceError;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-twin show');

program
.description('Get the twin of the specified device')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-get.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var printDevice = require('./common.js').printDevice;
var getHostFromSas = require('./common.js').getHostFromSas;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-identity show');

program
.description('Get a device identity from your IoT hub device registry')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-import-devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var serviceError = require('./common.js').serviceError;
var printSuccess = require('./common.js').printSuccess;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-identity import');

program
.description('Import devices in bulk into the device identity registry. The input file gets uploaded to a blob and then an import job is started from that blob.')
Expand Down
5 changes: 4 additions & 1 deletion iothub-explorer-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var getHostFromSas = require('./common.js').getHostFromSas;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var prettyjson = require('prettyjson');
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub device-identity list');

program
.description('List the device identities currently in your IoT hub device registry')
Expand All @@ -34,7 +37,7 @@ registry.list(function (err, devices) {
});

results = program.raw ? JSON.stringify(results) : prettyjson.render(results);

console.log(results);
}
});
3 changes: 3 additions & 0 deletions iothub-explorer-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var configLoc = require('./common.js').configLoc;
// Azure IoT SDK dependencies
var ConnectionString = require('azure-iothub').ConnectionString;
var SharedAccessSignature = require('azure-iothub').SharedAccessSignature;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az login');

program
.description('Create a temporary session on your IoT hub')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ var program = require('commander');
var printErrorAndExit = require('./common.js').printErrorAndExit;
var printSuccess = require('./common.js').printSuccess;
var configLoc = require('./common.js').configLoc;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az logout');

program
.description('Terminate a temporary session on your IoT hub')
Expand Down
11 changes: 7 additions & 4 deletions iothub-explorer-monitor-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

'use strict';

var Promise = require('bluebird');
var Registry = require('azure-iothub').Registry;

// external dependencies
var program = require('commander');
var colorsTmpl = require('colors-tmpl');
var Promise = require('bluebird');
var chalk = require('chalk');

// local dependencies
var inputError = require('./common.js').inputError;
Expand All @@ -19,6 +19,9 @@ var errorHints = require('./error-hints.js');

// Azure Event Hubs dependencies
var EventHubsClient = require('azure-event-hubs').Client;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub monitor-events');

function coerceAndValidateDuration(value) {
var d = parseInt(value);
Expand Down Expand Up @@ -53,9 +56,9 @@ var connectionString = program.login;
var monitorEvents = function () {
if (!program.raw) {
if (deviceId) {
console.log(colorsTmpl('\n{grey}Monitoring events from device {green}' + deviceId + '{/green}...{/grey}'));
console.log(chalk.grey('Monitoring events from device ' + chalk.green(deviceId) + chalk.gray('...')));
} else {
console.log(colorsTmpl('\n{grey}Monitoring events from all devices...{/grey}'));
console.log(chalk.grey('Monitoring events from all devices...'));
}
}

Expand Down
7 changes: 5 additions & 2 deletions iothub-explorer-monitor-feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// external dependencies
var program = require('commander');
var colorsTmpl = require('colors-tmpl');
var chalk = require('chalk');
var prettyjson = require('prettyjson');

// local dependencies
Expand All @@ -16,6 +16,9 @@ var getSas = require('./common.js').getSas;

// Azure Event Hubs dependencies
var ServiceClient = require('azure-iothub').Client;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub monitor-feedback');

program
.description('Monitor feedback messages sent by devices when they receive a cloud-to-device (c2d) message.')
Expand All @@ -32,7 +35,7 @@ client.open(function (err) {
client.getFeedbackReceiver(function (err, receiver) {
if (err) serviceError(err);
if (!program.raw) {
console.log(colorsTmpl('\n{yellow}Waiting for feedback...{/yellow} (Ctrl-C to quit)'));
console.log(chalk.yellow('Waiting for feedback...') + ' (Ctrl-C to quit)');
}

receiver.on('errorReceived', function (err) { serviceError(err); });
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-monitor-ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ var serviceError = require('./common.js').serviceError;

// Azure Event Hubs dependencies
var EventHubsClient = require('azure-event-hubs').Client;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('There is no equivalent command in the Azure CLI - this feature is deprecated and replaced with Azure Monitor');

program
.description('Listen to the operations monitoring endpoint of your IoT Hub instance (must be enabled in the portal)')
Expand Down
7 changes: 5 additions & 2 deletions iothub-explorer-monitor-uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// external dependencies
var program = require('commander');
var colorsTmpl = require('colors-tmpl');
var chalk = require('chalk');
var prettyjson = require('prettyjson');

// local dependencies
Expand All @@ -16,6 +16,9 @@ var getSas = require('./common.js').getSas;

// Azure Event Hubs dependencies
var ServiceClient = require('azure-iothub').Client;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('There is no equivalent command in the Azure CLI - if this feature is important to you please open an issue on the Azure CLI IoT Extension repository (https://aka.ms/iotcli)');

program
.description('Monitor file upload notifications emitted by devices')
Expand All @@ -32,7 +35,7 @@ client.open(function (err) {
client.getFileNotificationReceiver(function (err, receiver) {
if (err) serviceError(err);
if (!program.raw) {
console.log(colorsTmpl('\n{yellow}Waiting for file notifications...{/yellow} (Ctrl-C to quit)'));
console.log(chalk.yellow('Waiting for file notifications...') + ' (Ctrl-C to quit)');
}

receiver.on('errorReceived', function (err) { serviceError(err); });
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-query-job.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ var prettyjson = require('prettyjson');
var serviceError = require('./common.js').serviceError;
var getSas = require('./common.js').getSas;
var JobClient = require('azure-iothub').JobClient;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub job list');

program
.description('Query existing jobs')
Expand Down
3 changes: 3 additions & 0 deletions iothub-explorer-query-twin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var inputError = require('./common.js').inputError;
var serviceError = require('./common.js').serviceError;
var getSas = require('./common.js').getSas;
var Registry = require('azure-iothub').Registry;
var showDeprecationText = require('./common.js').showDeprecationText;

showDeprecationText('az iot hub query');

program
.description('Query the registry for twins matching the SQL query passed as argument')
Expand Down
Loading

0 comments on commit 732fa04

Please sign in to comment.