August 25, 2014 | Written by: Reynaldo Mincov Junior
Share this post:
Before we cover the IBM SoftLayer API, it is important to understand the basic concept of an application programming interface (API). You can use an API to interact with a system without needing to understand how the system works or what technology was developed. In general, with an API you can create a collection of routines or methods that receives a call and returns some information.
In a web environment, you can expose a service for creating new user IDs for your application without worrying about which database vendor is being used or how database modeling was done. All you need to do is develop, create and expose a web service (for example, createNewUser), and this service will interact with your enterprise server to create a user ID. The source application will make a web service call, add some required parameters and submit it using the SOAP, XML-RPC or REST protocols for data transmission.
On the SoftLayer customer portal, there are several features that enable developers and system administrators to interact with the infrastructure. They can use the SoftLayer API by sending data toward an API endpoint and receiving structured data in response. The API is available for SoftLayer clients at no cost. The API call requires a valid user ID, which you can get from the SoftLayer customer portal.
Once you have the required permissions in place, you can start coding your API calls using C#, Perl, PHP, Python, Ruby or Visual Basic .NET, which will supply more than 3,000 methods and over 180 services, including access from mobile devices.
There are three categories within the SoftLayer API:
• The core SoftLayer API component, which manages infrastructure and things like user accounts, tickets, notifications, access controls and monitoring
• The Object Storage component, which is based on OpenStack Swift and interacts with the multitenant object store hosted by SoftLayer
• The Message Queue component, which helps with intra-application and inter-system communications on a global scale
The SoftLayer API can be used for a wide variety of tasks and scenarios, including:
• Invoking selected services for white label service providers in order to implement their own rebranded portals
• Programmatic upscaling and downscaling in a public or private cloud
• Handling cloud monitoring events, such as re-instantiating servers, rebooting and OS loading
• Programmatic cloud management, including upgrading and downgrading, adding storage, performing backup and restore functions, and using the Object Store
• Writing cloud-native software applications
• Implementing business workflows (message queues)
The following is an example of an API call: SoftLayer_Virtual_Host.
The virtual host service provides a common interface to any virtualization platform supported by SoftLayer. Interaction with various third-party APIs is not needed when implementing this service to administer your hosts.
• getAccount: Retrieve the account to which a virtual host belongs.
• getBilledPerGuestFlag: Retrieve boolean flag indicating whether this virtualization platform gets billed per guest rather than at a fixed rate.
• getBilledPerMemoryUsageFlag: Retrieve boolean flag indicating whether this virtualization platform gets billed per memory usage rather than at a fixed rate.
• getGuests: Retrieve the guests associated with a virtual host.
• getHardware: Retrieve the hardware record on which a virtual host resides.
• getLiveGuestByUuid: Query a virtualization platform directly to retrieve details regarding a guest.
• getLiveGuestList: Query a virtualization platform directly to retrieve a list of known guests.
• getLiveGuestRecentMetricData: Query a virtualization platform directly to retrieve recent metric data for a guest.
• getMetricTrackingObject: Retrieve the metric tracking object for this virtual host.
• getObject: Retrieve a SoftLayer_Virtual_Host record.
• pauseLiveGuest: Pause a guest.
• powerCycleLiveGuest: Power cycle a guest.
• powerOffLiveGuest: Power off a guest.
• powerOnLiveGuest: Power on a guest.
• rebootSoftLiveGuest: Attempt to complete a soft reboot of a guest by shutting down the operating system.
• resumeLiveGuest: Resume a guest.
In short, I would say that a cloud service is only as good as its API because cloud is about automation and doing things faster. If the cloud service provider supplies a high number of APIs, it means automation is a strong point. In addition, the customer portal may have several administrative tasks over the environment that can be executed by one mouse click.
You can find additional information on the following websites:
Connect with me on Twitter at @ReynaldoMincov to continue the conversation.