I am using the following API's to get information about a particular virtual Guest. Can some one help me get the information with one single api by combining the following?
To get VM's operating system:
https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$virtualGuestID/getOperatingSystem
Similarly To get the PoD
getFrontendRouters
Get provisioned date for a VM
getProvisionDate
Get attached Network Storage
getAttachedNetworkStorages
Replacing $virtualGuestID with the actual VM ID
You can use object masks:
GET https://$USERNAME:$APIKEY#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/$VSIID/getObject?objectMask=mask[provisionDate,operatingSystem,frontendRouters,allowedNetworkStorage]
Regards
Related
I have a table in BigQuery containing my customers' IP addresses, and I want to understand their geographical distribution.
Is there any way I can retrieve geolocation information for these IP addresses, like city, state, and country using SQL?
There was a post about doing it efficiently using Geolite2 in GCP blog:
https://cloud.google.com/blog/products/data-analytics/geolocation-with-bigquery-de-identify-76-million-ip-addresses-in-20-seconds/
The query used Felipe fh-bigquery dataset, that you'll need to recreate using Geolite2 source.
To retrieve geolocation information for an IP Address or identify its physical location you need to use a Geolocation database.
There is a service called MaxMind that provides a free/lite version of the Geolocation database, that you can use.
You can then write a function in Python to use this database and retrieve the geolocation information like city state and country for the specified IP.
In a recent release, BigQuery announced the support of Remote Functions that can be used to wrap Python functions into a SQL function that can be used in your queries.
You can find the full code on how to achieve that in this GitHub repo.
I am trying to write a query to get every active host on my network using the GET /devices/entities/online-state/v1 endpoint, however this endpoint requires a specific host's ID as a filter - meaning I would first have to query out to another API functionality to get the host ID, then hard code them into my initial query. Furthermore this API endpoint limits the amount of host Id's to 100 per query. I work on a network with 10's of thousands of endpoints, so this is not practical. I know there has to be a way to blanketly grab every host & its associated status, but I am still very new to the CS API and do not know what function to use. If anyone knows a solution - be it through a CS API endpoint I am unware of, or through syntactical corrections, (for example a wildcard I could use,) to my original query, I would really appreciate some help.
SoftLayer's API has different "services" for the different objects represented in the API. Virtual Guests, Bare Metal Servers, VLANs, IP addresses, etc are all different types of services. There are also links between these services, so I want to use a single API query to get information about multiple services. The Object Mask is one way of joining the different services.
Can anyone please tell me how to achieve it using object mask.
Here you can see information about object mask:
http://sldn.softlayer.com/article/object-Masks
Now all the services are attached to your account, so you need to take a look to the service:
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Account
http://sldn.softlayer.com/reference/services/SoftLayer_Account
The service provides several methods to get differents services such as virtual guest:
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getVirtualGuests
or get all the bare metal servers in your account:
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getHardware
Using Object mask you just need to call the getObject method and add the properties that you want for example see this RESTFul to get the virtual guest, bare metal servers and VLans:
GET https://$USERNAME:$APIKEY#api.softlayer.com/rest/v3.1/SoftLayer_Account/getObject?objectMask=mask[virtualGuests,hardware,networkVlans]
So you can get all the information that you need in a single request however, when your response contains a big amount of data your request will throw an exception, in order to handle that you need to use result limits in your request you can see more information about how to add it to your request here:
https://sldn.softlayer.com/article/REST
Regards
Yesterday I created a new Google map geocoding API key on the developper console. I need to get gps coordinates from a server script. When I use the "which key do I need" in the console, it tells me I choosed the right key. I also allowed the fixed IP of my server in the key settings.
Now, when I use "https://maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&sensor=false&key=MY_KEY", it returns an empty string.
When I use "http//maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&sensor=false&key=MY_KEY" it returns a warning about this kind of queries must use https (which is consistent with the doc).
And finally, when I use "http//maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&sensor=false" (no https and no key) I get the relevant data, either in json or xml. As explained in the doc, this can be used with a limit of 2500 geocoding per day, but the problem is that I have different domains on the same server (with the same IP) that geocode, and since google tracks by IP to evaluate daily quotas...
So my question is : what am I missing when trying to geocode an address using https and the key ?
The only thing that crossed my mind is : do I need to activate billing in google maps, even though I know for sure that I will never exceed the free quota of 2500 queries per day, at least with the project to which the key is associated ?
Thanks in advance for any tip or advice.
I am building an app which requires a user to be uniquely identified on the server without him logging in.
I have already evaluated the App Specific Hardware ID but that seems to be dependent on the hardware config of the machine and if the user even changes a network device, it will change.
Can the EasClientDeviceInformation class along with the Id property be used for this purpose?
Thanks,
Rajeev
From the MSDN article on the EasClientDeviceInformation.Id, the Id is a:
GUID truncated from the first 16 bytes of the SHA256 hash of the MachineID, User SID, and Package Family Name where the MachineID uses the SID of the local users group.
This means that the Id should be unique for each user account and machine combination. However, I imagine a cloned OS will have the same EasClientDeviceInformation.Id. If this is not a concern for your app, then it should be enough to use by itself.
The ASHWID, if you only use the components that shouldn't change, could be another option for you. MSDN has a detailed article on how to use it.
You should definitely ignore the audio, network and Bluetooth components, as I've found they get removed if you do something as trivial as turning on airplane mode, or unplug a headset.