Socket
Socket
Sign inDemoInstall

azure-arm-resource

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-arm-resource - npm Package Compare versions

Comparing version 0.10.6 to 0.10.7

128

lib/subscriptionClient.js

@@ -325,2 +325,130 @@ /* jshint latedef:false */

/**
* Gets a list of the subscription locations.
*
* @param {string} subscriptionId Id of the subscription
*
* @param {function} callback
*
* @returns {Stream} The response stream.
*/
SubscriptionOperations.prototype.listLocations = function(subscriptionId, callback) {
if (callback === null || callback === undefined) {
throw new Error('callback cannot be null.');
}
// Validate
if (subscriptionId === null || subscriptionId === undefined) {
return callback(new Error('subscriptionId cannot be null.'));
}
// Tracing
// Construct URL
var url2 = '';
url2 = url2 + '/subscriptions/';
url2 = url2 + encodeURIComponent(subscriptionId);
url2 = url2 + '/locations';
var queryParameters = [];
queryParameters.push('api-version=2014-04-01-preview');
if (queryParameters.length > 0) {
url2 = url2 + '?' + queryParameters.join('&');
}
var baseUrl = this.client.baseUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.length - 1] === '/') {
baseUrl = baseUrl.substring(0, (baseUrl.length - 1) + 0);
}
if (url2[0] === '/') {
url2 = url2.substring(1);
}
url2 = baseUrl + '/' + url2;
url2 = url2.replace(' ', '%20');
// Create HTTP transport objects
var httpRequest = new WebResource();
httpRequest.method = 'GET';
httpRequest.headers = {};
httpRequest.url = url2;
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
// Send Request
return this.client.pipeline(httpRequest, function (err, response, body) {
if (err !== null && err !== undefined) {
return callback(err);
}
var statusCode = response.statusCode;
if (statusCode !== 200) {
var error = new Error(body);
error.statusCode = response.statusCode;
return callback(error);
}
// Create Result
var result = null;
// Deserialize Response
if (statusCode === 200) {
var responseContent = body;
result = { locations: [] };
var responseDoc = null;
if (responseContent) {
responseDoc = JSON.parse(responseContent);
}
if (responseDoc !== null && responseDoc !== undefined) {
var valueArray = responseDoc['value'];
if (valueArray !== null && valueArray !== undefined) {
for (var loweredIndex1 = 0; loweredIndex1 < valueArray.length; loweredIndex1 = loweredIndex1 + 1) {
var valueValue = valueArray[loweredIndex1];
var locationInstance = {};
result.locations.push(locationInstance);
var idValue = valueValue['id'];
if (idValue !== null && idValue !== undefined) {
var idInstance = idValue;
locationInstance.id = idInstance;
}
var subscriptionIdValue = valueValue['subscriptionId'];
if (subscriptionIdValue !== null && subscriptionIdValue !== undefined) {
var subscriptionIdInstance = subscriptionIdValue;
locationInstance.subscriptionId = subscriptionIdInstance;
}
var nameValue = valueValue['name'];
if (nameValue !== null && nameValue !== undefined) {
var nameInstance = nameValue;
locationInstance.name = nameInstance;
}
var displayNameValue = valueValue['displayName'];
if (displayNameValue !== null && displayNameValue !== undefined) {
var displayNameInstance = displayNameValue;
locationInstance.displayName = displayNameInstance;
}
var latitudeValue = valueValue['latitude'];
if (latitudeValue !== null && latitudeValue !== undefined) {
var latitudeInstance = latitudeValue;
locationInstance.latitude = latitudeInstance;
}
var longitudeValue = valueValue['longitude'];
if (longitudeValue !== null && longitudeValue !== undefined) {
var longitudeInstance = longitudeValue;
locationInstance.longitude = longitudeInstance;
}
}
}
}
}
result.statusCode = statusCode;
result.requestId = response.headers['x-ms-request-id'];
return callback(null, result);
});
};
return SubscriptionOperations;

@@ -327,0 +455,0 @@ })();

2

package.json

@@ -13,3 +13,3 @@ {

],
"version": "0.10.6",
"version": "0.10.7",
"description": "Microsoft Azure Resource Management Client Library for node",

@@ -16,0 +16,0 @@ "tags": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc