Permalink
Browse files

Merge pull request #678 from WindowsAzure/release-0.6.12

Merge release 0.7.0 back into master
  • Loading branch information...
2 parents d961707 + f74fdf0 commit b9ca3064314ba18bfa4255db9401671f85ab2b0d @christav christav committed Mar 23, 2013
Showing 414 changed files with 20,025 additions and 12,463 deletions.
View
@@ -0,0 +1,27 @@
+{
+ "bitwise": true,
+ "camelcase": true,
+ "curly": false,
+ "eqeqeq": false,
+ "forin": true,
+ "immed": true,
+ "indent": 2,
+ "latedef": true,
+ "maxparams": false,
+ "maxdepth": false,
+ "maxstatements": false,
+ "maxcomplexity": false,
+ "newcap": true,
+ "noarg": true,
+ "node": true,
+ "noempty": true,
+ "nonew": true,
+ "plusplus": false,
+ "quotmark": "single",
+ "regexp": true,
+ "sub": true,
+ "strict": false,
+ "trailing": true,
+ "undef": true,
+ "unused": true
+}
View
@@ -7,5 +7,15 @@ node_modules/
# Test folder #
test/
+# Examples #
+examples/blobuploader/
+examples/blog/
+examples/geophoto/
+examples/helloruntime/
+examples/myevents/
+examples/serviceexplorer/
+examples/servicemanagement/
+examples/tasklist/
+
# Tools #
tools/
View
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.8
+ - 0.6
View
@@ -1,3 +1,11 @@
+2012.03.25 Version 0.7.0
+* Breaking change: Primitive types will be stored for table storage.
+* Adding support for creating and deleting affinity groups
+* Replacing http-mock by nock and making all tests use it by default
+* Adding notification hubs messages for WNS and APNS
+* Add Strict SSL validation for server certificates
+* Add support for creating subscriptions that expire
+
2012.03.12 Version 0.6.11
* Added constraint to package.json to restrict to node versions < 0.9.
View
@@ -1,4 +1,4 @@
-# Windows Azure SDK for Node.js
+# Windows Azure SDK for Node.js [![Build Status](https://travis-ci.org/WindowsAzure/azure-sdk-for-node.png)](https://travis-ci.org/WindowsAzure/azure-sdk-for-node)
This project provides a Node.js package that makes it easy to access Windows Azure Services like Table Storage and Service Bus.
@@ -128,7 +128,7 @@ blobService.getBlobToStream('taskcontainer', 'task1', fs.createWriteStream('task
});
```
-To create a SAS URL you can use the **generateSharedAccessSignatureUrl** method. Additionally you can use the **date** helper functions to easily create a SAS that expires at some point relative to the current time.
+To create a SAS URL you can use the **getBlobUrl** method. Additionally you can use the **date** helper functions to easily create a SAS that expires at some point relative to the current time.
```Javascript
var blobService = azure.createBlobService();
@@ -140,7 +140,7 @@ var sharedAccessPolicy = {
}
};
-var sasUrl = blobService.generateSharedAccessSignatureUrl(containerName, blobName, sharedAccessPolicy);
+var sasUrl = blobService.getBlobUrl(containerName, blobName, sharedAccessPolicy);
```
## Storage Queues
@@ -268,6 +268,58 @@ serviceBusService.createSubscription(topic, subscription, function(error1){
}
});
```
+
+
+## Notification Hubs
+
+Notification hubs allow you to send notifications to WNS and APNS receivers.
+
+To create a notification hub, use the method **createNotificationHub**.
+
+```JavaScript
+var serviceBusService = azure.createServiceBusService();
+
+serviceBusService.createNotificationHub('hubName', function (err) {
+ if (!err) {
+ // Notification hub created successfully
+ }
+});
+```
+
+To send messages to the notification hub use the methods of the **wns** or **apns** objects. For a full reference on WNS method templates, check http://msdn.microsoft.com/en-us/library/windows/apps/hh779725.aspx.
+
+```JavaScript
+var notificationHubService = azure.createNotificationHubService('hubName');
+
+notificationHubService.wns.sendTileSquarePeekImageAndText01(
+ null,
+ {
+ image1src: 'http://foobar.com/dog.jpg',
+ image1alt: 'A dog',
+ text1: 'This is a dog',
+ text2: 'The dog is nice',
+ text3: 'The dog bites',
+ text4: 'Beware of dog'
+ },
+ function (error) {
+ if (!error) {
+ // message sent successfully
+ }
+ });
+
+notificationHubService.apns.send(
+ null,
+ {
+ alert: 'This is my toast message for iOS!',
+ expiry: expiryDate
+ },
+ function (error) {
+ if (!error) {
+ // message sent successfully
+ }
+ });
+```
+
## Azure SQL Database
The Azure SQL Database functions allow you to manage Azure SQL servers, databases and firewall rules.
@@ -333,7 +385,6 @@ sqlServer.listServerDatabases(function(error, dbs) {
```
-
## Service Runtime
The Service Runtime allows you to interact with the machine environment where the current role is running. Please note that these commands will only work if your code is running in a worker role inside the Azure emulator or in the cloud.
@@ -116,6 +116,7 @@ app.post('/uploadhandler', function (req, res) {
if (error != null) {
helpers.renderError(res);
} else {
+ setSAS(containerName, fields.itemName);
res.redirect('/Display');
}
});
@@ -138,11 +139,23 @@ app.post('/Delete/:id', function (req, res) {
blobClient.createContainerIfNotExists(containerName, function (error) {
if (error) {
console.log(error);
- } else {
+ } else {
setPermissions();
}
});
+
+function setSAS(containerName, blobName) {
+ var sharedAccessPolicy = {
+ AccessPolicy: {
+ Expiry: azure.date.minutesFromNow(3)
+ }
+ };
+
+ var blobUrl = blobClient.getBlobUrl(containerName, blobName, sharedAccessPolicy);
+ console.log("access the blob at ", blobUrl);
+}
+
function setPermissions() {
blobClient.setContainerAcl(containerName, azure.Constants.BlobConstants.BlobContainerPublicAccessType.BLOB, function (error) {
if (error) {
@@ -52,7 +52,6 @@ var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;
var util = require('util');
-var ISO8061Date = require('../../lib/util/iso8061date');
var container = 'sassample';
var blob = 'sassample';
@@ -47,7 +47,7 @@ svcmgmt.addCertificate(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -60,7 +60,7 @@ svcmgmt.addDataDisk(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -61,7 +61,7 @@ svcmgmt.addDataDisk(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -60,7 +60,7 @@ svcmgmt.addDataDisk(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -40,7 +40,7 @@ svcmgmt.addDisk(diskName, mediaLink, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -93,7 +93,7 @@ svcmgmt.addRole(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -62,7 +62,7 @@ svcmgmt.captureRoleInstance(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -131,7 +131,7 @@ svcmgmt.createDeployment(svcname,
console.log(response);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -40,7 +40,7 @@ svcmgmt.createHostedService(svcname, svcopt, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -41,7 +41,7 @@ svcmgmt.createOSImage(typeOS, imgName, mediaLink, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -45,7 +45,7 @@ svcmgmt.deleteCertificate(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -43,7 +43,7 @@ svcmgmt.deleteDeployment(inputNames.serviceName, inputNames.deploymentName, func
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -39,7 +39,7 @@ svcmgmt.deleteDisk(diskName, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -42,7 +42,7 @@ svcmgmt.deleteHostedService(inputNames.serviceName, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -42,7 +42,7 @@ svcmgmt.deleteOSImage(inputNames.imageName, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -44,7 +44,7 @@ svcmgmt.deleteRole(inputNames.serviceName, inputNames.deploymentName, inputNames
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -41,7 +41,7 @@ svcmgmt.listCertificates(inputNames.serviceName, function(error, response) {
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -56,7 +56,7 @@ svcmgmt.modifyDataDisk(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -59,7 +59,7 @@ svcmgmt.modifyRole(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
@@ -49,7 +49,7 @@ svcmgmt.removeDataDisk(inputNames.serviceName,
testCommon.showErrorResponse(error);
} else {
if (response && response.isSuccessful) {
- if (response.statusCode == HttpResponseCodes.OK_CODE) {
+ if (response.statusCode == HttpResponseCodes.Ok) {
console.log('OK');
} else {
console.log('Pending');
Oops, something went wrong.

0 comments on commit b9ca306

Please sign in to comment.