How to Connect Virtual Machines in a Cloud Service using REST - rest

I'm working with Virtual Machines on Windows Azure and according to the following link:
http://www.windowsazure.com/en-us/manage/windows/how-to-guides/connect-to-a-cloud-service/
it is possible to link various Virtual Machines to the same cloud service. The provided link clearly explains how to do it by means of the Windows Azure Management Portal. Nevertheless, in my case, I want to do the same using the REST API. Anyone knows how can it be done?
Thank you so much in advance,
Abel.

I believe you need to "add role" to add a new VM to an existing IaaS Cloud service: http://msdn.microsoft.com/en-us/library/windowsazure/jj157186.aspx

Related

Get relation between Hosts and Datastores using vSphere Automation REST API

I'm trying to create VM using vSphere Automation SDK REST API and vRealize Orchestrator but the workflow in Orchestrator I'm using needs the host and datastore on which to create the VM (I'm cloning a VM using a template).
My problem is that my datastores are not shared by all clusters (and hosts) so I need to be careful to create a VM with a matching host and datastore.
With the vSphere Automation SDK REST API I can easily get the list of hosts and datastores (here's the doc I found : https://code.vmware.com/doc/preview?id=4645), but none of the "list" or "get" requests give me links between hosts and datastores.
How can I get the relations between my datastores and my hosts so that I can call Orchestrator with the correct parameters ?
Thank you.
Check out https://github.com/doublecloudinc/vim-rest-api
The REST APIs supports FULL features of vSphere APIs, and scales across many vCenter/ESXi servers. You can list all the host and pick one to get its datastore property easily with a couple of REST calls.
Also, vBrownBag tech talk: https://youtu.be/EpMlP27gEEM
Disclaimer: I am the creator of the REST APIs.

Creating multiple users in Bluemix Biginsight to test Knox service

I have created a space and a BigInsight cluster on Bluemix. In order to test Knox, I need multiple users for authentication. Is it possible to create users in Bluemix Biginsight service? The ID that is provided to access the cluster does not have root access. Also, it would be helpful if someone can explain in detail how the admin-related task(adding more components like Hue,Drill using yum commands) could be performed in Bluemix Biginsights service. Thanks in advance.
I am guessing here that you have created a Bluemix Biginsights Basic (Beta) plan.
This service is a single user service and cannot have multiple users.
In addition this service is a managed service and installation of software by the user is not allowed.
This service comes with preconfigured settings and pre-installed softwares that is fixed. If you do need something apart from this, I would suggest to open a Biginsights service ticket through Bluemix Support page with a request for it and why you need the software.
The product management team will look at it and see if they can be preinstalled in the future release.
These installations will not be done on a any Basic (Beta) plan for individual clusters.

Azure REST API - getting identity data

In Amazon cloud API there is the possibility to get identity data, meaning data from the running instance - on which region it is, dns ....
is there the same option in Azure? as I am creating management system in which the server is installed on a virtual machine and I need to know to which region it is related, all this using REST API
In Azure you can use Azure API Management REST API to get all sort of information for Azure:
ex:
Lists all of the resources in a subscription:
https://management.azure.com/subscriptions/{subscription-id}/resources?$top={top}$skiptoken={skiptoken}&$filter={filter}&api-version={api-version}
For the complete documentation look at this page here:
https://msdn.microsoft.com/en-us/library/azure/dn776326.aspx
You can do similar things using Powershell scripts as well.

List Azure Virtual Machines via REST API

I am currently attempting to get a list of all of the Virtual Machines that I have running under a Windows Azure subscription programmatically. For this, I am attempting to use the Azure REST API (https://management.core.windows.net), and not use the power-shell cmdlets.
Using the cmdlets I can run 'Get-AzureVM' and get a listing of all of the VM's with ServiceName, Name, and Status without any modifications. The problem is that I cannot find anywhere in the documentation of how to list out the VMs via the API.
I have looked through the various Azure REST API's but have not been able to find anything. The documentation for VM REST API does not show or provide a list function.
Am I missing the fundamentals somewhere?
// Create the request.
// https://management.core.windows.net/<subscription-id>/services/hostedservices
requestUri = new Uri("https://management.core.windows.net/"
+ subscriptionId
+ "/services/"
+ operation);
This is what I am using for the base of the request. I can get a list of hosted services but not the Virtual Machines.
You would need to get a list all the Cloud Services (Hosted Services), and then the deployment properties for each. Look for the deployment in the Production environment/slot. Then check for a role type of "PersistentVMRole".
VMs are really just a type of Cloud Service, along with Web and Worker roles. The Windows Azure management portal and PowerShell cmdlets abstracts this away to make things a little easier to understand and view.
Follow these steps for listing VMs:
List HostedServices using the following ListHostedServices
For each service in from the above,
a)GetDeployment by Environment(production or staging).
OR
b) Get Deployment By Name.
In either case, get the value for Deployment.getRoleInstanceList().getRoleInstance().getInstanceName().
You can use Azure node SDK to list out all VMs in your subscription
computeClient.virtualMachines.listAll(function (err, result))
More details on Azure Node SDK here: https://github.com/Azure-Samples/compute-node-manage-vm

Get metrics via API

I'm using Azure SQL, and there is a page in there with metrics
From what I understood the new Azure Managment Portal consumes only public apis. What I'm trying to find out is how to access these metrics via a REST or SOAP api. I've searched through the MSDN documentation but couldn't come up with anything.
Anyone have any ideas?
I presume Microsoft did not provide Azure Database monitoring REST or SOAP API as it would not be used much.
DBAs can connect to Azure Database and gather all the necessary statistics via dynamic management views which are quite powerful.
However, I do not have any article / documentation confirming my presumptions.
try the new sys.event_log and sys.database_connection_stats DMVs instead.
see: Announcing: New System Views for Windows Azure SQL Database