SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
0
The SoftLayer API Softlayer API time
get automatedThe Softlayer API time to get automated
Ignacio Daza - IBM Softlayer Architect @Nacho_Daza
Kimmo Hintikka - IBM Softlayer Architect @KimmoHintikka
1
Agenda
• API economy
• Why to use Softlayer API?
• High level overview on SLAPI
• Basic concepts of SLAPI
• Q&A and useful resources to get going
2
API economy
• The API economy emerges when APIs become part of the business model.
• Public and partner APIs have been strategic enablers for several business models, such as
Twitter’s and Amazon’s.
• The Twitter APIs, for example, easily have ten times more traffic than the Twitter website
does.
3
Why to use SoftLayer API?
Pet vs. cattle server management approach
Cost of management vs. cost of automation
Time to market
New business models
4
High level overview on SLAPI
The Main Core Softlayer API v3 which manages mostly infrastructure plus also things like
user accounts, tickets, notifications, access controls
The Object Store API, which sits on top of a powerful multi-tenanted object store hosted and
run by Softlayer
The Message Queue API, which helps with intra-application and inter-system communications
on a global scale. It also runs on infrastructure controlled by SoftLayer.
5
API Scope
260 Services
3183 Methods
15816 Properties
SOAP
REST
XML_RPC
Clients : C#, Python, PHP, Perl, Ruby
6
Basic concepts of SoftLayer API
Softlayer APIs are organized into a hierarchical structure of Services with each service
containing various methods
Ability to Limit Results (rows filtering. Generally used for pagination)
Object Masks (properties filtering)
Softlayer Services use data structures and Data types for parameters and return results.
•Data types define the data model of Softlayer cloud.
•Simple data types include : Integer, Boolean, String
•Complex data types can be constructed of various simple types
7
Getting started examples
Command Line Interface
Virtual server list : sl cci list
Bare Metal server list : sl server List
List hardware options : sl hardware list-chassis
Show available command: sl ?
Chrome REST interface
Virtual server list : https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getVirtualGuests (GET)
Bare Metal Server list : https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getHardware (GET)
List Hardware options: https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package_Server/getAllObjects (GET)
Python Client ( more code snippets to follow)
import SoftLayer
usr = “yourId” (make sure to include the quotes )
key = “yourApiKey”
client = SoftLayer.Client(username=usr, api_key=key)
account = client['Account'].getObject()
print(account)
8
The SoftLayer CLI (Python)
https://softlayer-api-python-client.readthedocs.org/en/latest/install/  INSTRUCTIONS
T420 nacho # sl ?
usage: sl <module> [<args>...]
sl help <module>
sl help <module> <command>
sl [-h | --help]
SoftLayer Command-line Client
The available modules are:
Compute:
bmc Bare Metal Cloud
cci Cloud Compute Instances
image Manages compute and flex images
metadata Get details about this machine. Also available with 'my' and 'meta'
server Hardware servers
sshkey Manage SSH keys on your account
Networking:
dns Domain Name System
firewall Firewall rule and security management
globalip Global IP address management
rwhois RWhoIs operations
ssl Manages SSL
subnet Subnet ordering and management
vlan Manage VLANs on your account
Storage:
iscsi View iSCSI details
nas View NAS details
General:
config View and edit configuration for this tool
summary Display an overall summary of your account
help Show help
See 'sl help <module>' for more information on a specific module.
To use most commands your SoftLayer username and api_key need to be configured.
The easiest way to do that is to use: 'sl config setup'
Invalid module: "#"
(To test, once you have the python-softlayer
libraries)
# sl config show
::::::::::::::::::::::::::
# sl config setup
Username []: ‘YOUR USERNAME’
API Key or Password []: ‘YOUR API KEY’
::::::::::::::::::::::::::
9
Using Chrome Postman for REST
• Install Chrome browser
• Install Postman Chrome plugin
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en
• Create collection for your API calls
JSON calls can be exported / imported from Postman
• Add a new entry to the collection
✓ Click on Collections in upper left and select “Add new Collection”
✓ Enter a url: https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account
✓ Where yourId and yourApiKey are the credentials you were provided
✓ Select type of Get. Add to Collection and save. Send the call and view the JSON results at the bottom
10
List of users in my account
We can call other methods of
SoftLayerAccount such as
getVirtualGuests(),
getHardware(),
getTickets(),
getBareMetalInstances()
The Client object takes four parameters: the name of the service to call
(SoftLayerAccount is the default), the id of a specific object to work with, api username
and key.
## getUsers.py
import SoftLayer.API
username = "your username"
apyt_key = "your API key"
# Create a client to the Softlayer_Account API service
client = SoftLayer.Client(username = username, api_key=api_key)
# Now we can call the methods of the SoftLayer Account
users =
client['Account'].getusers(mask="firstName,lastName,username")
for user in users:
print("username is: "+ user['username'])
11
List of bare metal and virtual servers
We can call other methods of
SoftLayerAccount such as
getVirtualGuests(),
getHardware(),
getTickets(),
getBareMetalInstances()
## getAccountInformation.py
import SoftLayer.API
from pprint import pprint as pp
api_username = 'xxx'
api_key = 'xxx'
client = SoftLayer.Client(
username=api_username,
api_key=api_key,
)
## Get list of VirtualServers
server_list = client[‘Account’].getVirtualGuests()
For server in server_list:
print (“id: ”+str(server[‘id’]) + “hostname: ”+ server[‘hostanme’] + “.” + server[‘domain’])
## Get list of BareMetalInstances
server_list = client[‘Account’].getBareMetalInstances()
For server in server_list:
print (“id: ”+str(server[‘id’]) + “hostname: ”+ server[‘hostanme’] + “.” + server[‘domain’])
## Get list the Hardware on the account
hardware = client['Account'].getHardware()
pp(hardware)
## Get list of Tickets
Ticketlist = client[‘Account’].getTickets()
for ticket in Ticketlist:
print (“Tickect id: ”+str(ticket[‘id’]) + “Title: ”+ server[‘title’])
12
Managing the amount of information
The limit and offset variables limit the number of
return objects and the starting object
Object Masks specify the relational properties that
need to be returned along with the target objects
13
Create / Delete a virtual Instance
Logical Steps:
1.Import SoftLayer module
2.Get a authenticate client object connected to
the VirtualGuest service
3.Pass it to the createObject method of the
VirtualGuest service.
4.Call deleteObject with the id of the instance
to remove it
14
Creating a Network monitor
Logical Steps:
1.Import SoftLayer module
2.Bind to the
Network_Monitor_Version1_Query_Host
service
3.Create an object of the same type
4.call createObject()
5.More information is provided here
15
Object Storage – Create, store, search
Logical Steps
1.pip install softlayer-object-storage
2.Import Object Storage module
3.Set authentication
4.Create a storage container
5.Create and populate a file within a storage
container
6.Read a file from a storage container
7.Query for files within a storage container
print ("searching....")
s_results = sl_storage.search('sample')
print ("found " + str(len(s_results)) + " hits....")
print ("found " + str(s_results['total']) + " hits....")
rs = s_results['results']
16
Typical Scenarios for using APIs
The following scenarios are examples of how to use SoftLayer APIs:
• Invoke 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.
• Handle cloud monitoring events, such as re-instantiating servers, rebooting, and OS loads.
• Programmatic cloud management, including upgrading and downgrading, adding storage, backup and restore, and Object Store
usage.
• Write cloud-native software applications.
• Implement business workflows (Message Queues).
17
Creating message queues
The Client object takes four parameters: the name of the service to call
(SoftLayerAccount is the default), the id of a specific object to work with, api username
and key.
Message Queue
$my_queue = $messaging_client->queue('my_queue')-
>create();
Producer
Producer
Producer
Consumer
Consumer
Publish
$my_queue->message() ->setBody(‘Hello World!') -
>create();
18
Useful resources
http://www.softlayer.com/about/automation/open-api
http://sldn.softlayer.com/article/SoftLayer-API-Overview
http://sldn.softlayer.com/
https://github.com/softlayer/
https://gist.github.com/softlayer
http://blog.softlayer.com/
https://softlayer-api-python-client.readthedocs.org/en/latest/
https://softlayer-api-python-client.readthedocs.org/en/latest/cli/
Python tutorial
Python in SoftLayer
19

Weitere ähnliche Inhalte

Was ist angesagt?

SoftLayer Value Proposition v1.04
SoftLayer Value Proposition v1.04SoftLayer Value Proposition v1.04
SoftLayer Value Proposition v1.04Avinaba Basu
 
SoftLayer at IBM Company [March 2016] - Ignacio Daza
SoftLayer at IBM Company [March 2016]   - Ignacio DazaSoftLayer at IBM Company [March 2016]   - Ignacio Daza
SoftLayer at IBM Company [March 2016] - Ignacio DazaIgnacio Daza
 
IBM Cloud SoftLayer Introduction & Hands-on 2016
IBM Cloud SoftLayer Introduction & Hands-on 2016IBM Cloud SoftLayer Introduction & Hands-on 2016
IBM Cloud SoftLayer Introduction & Hands-on 2016Atsumori Sasaki
 
IBM Cloud Solution - Blue Box
IBM Cloud Solution - Blue BoxIBM Cloud Solution - Blue Box
IBM Cloud Solution - Blue BoxDaniele Bolletta
 
Media Workloads in the Cloud
Media Workloads in the CloudMedia Workloads in the Cloud
Media Workloads in the CloudCloudSigma
 
Microsoft Azure Hybrid Cloud - Getting Started For Techies
Microsoft Azure Hybrid Cloud - Getting Started For TechiesMicrosoft Azure Hybrid Cloud - Getting Started For Techies
Microsoft Azure Hybrid Cloud - Getting Started For TechiesAidan Finn
 
DEVNET-1187 Cisco Intercloud Services: Delivering a Solution that Enables Hi...
DEVNET-1187	Cisco Intercloud Services:  Delivering a Solution that Enables Hi...DEVNET-1187	Cisco Intercloud Services:  Delivering a Solution that Enables Hi...
DEVNET-1187 Cisco Intercloud Services: Delivering a Solution that Enables Hi...Cisco DevNet
 
Multitenant Full Deck Jan 2015 Cloud Team AJ Linkedin
Multitenant Full Deck Jan 2015 Cloud Team AJ LinkedinMultitenant Full Deck Jan 2015 Cloud Team AJ Linkedin
Multitenant Full Deck Jan 2015 Cloud Team AJ LinkedinArush Jain
 
AWS Summit Auckland - Running your Enterprise Windows Workload on AWS
AWS Summit Auckland  - Running your Enterprise Windows Workload on AWSAWS Summit Auckland  - Running your Enterprise Windows Workload on AWS
AWS Summit Auckland - Running your Enterprise Windows Workload on AWSAmazon Web Services
 
IBM Cloud OpenStack Services
IBM Cloud OpenStack ServicesIBM Cloud OpenStack Services
IBM Cloud OpenStack ServicesOpenStack_Online
 
VMWare and SoftLayer Hybrid IT
VMWare and SoftLayer Hybrid ITVMWare and SoftLayer Hybrid IT
VMWare and SoftLayer Hybrid ITBenjamin Shrive
 
IBM SmartCloud Orchestration
IBM SmartCloud OrchestrationIBM SmartCloud Orchestration
IBM SmartCloud OrchestrationIBM Danmark
 
2015: The Year Hybrid Cloud Goes Mainstream
2015: The Year Hybrid Cloud Goes Mainstream2015: The Year Hybrid Cloud Goes Mainstream
2015: The Year Hybrid Cloud Goes MainstreamIngram Micro Cloud
 
SoftLayer Storage Services Overview (for Interop Las Vegas 2015)
SoftLayer Storage Services Overview (for Interop Las Vegas 2015)SoftLayer Storage Services Overview (for Interop Las Vegas 2015)
SoftLayer Storage Services Overview (for Interop Las Vegas 2015)Michael Fork
 
IBM Private Modular Cloud
IBM Private Modular CloudIBM Private Modular Cloud
IBM Private Modular CloudHerb Hernandez
 
OpenStack, SDN, and the Future of Software Defined Infrastructure
OpenStack, SDN, and the Future of Software Defined InfrastructureOpenStack, SDN, and the Future of Software Defined Infrastructure
OpenStack, SDN, and the Future of Software Defined InfrastructureLew Tucker
 
Client presentation ibm private modular cloud_082013
Client presentation ibm private modular cloud_082013Client presentation ibm private modular cloud_082013
Client presentation ibm private modular cloud_082013jimmykibm
 
Maintaining a Healthy OpenStack Cloud: What does it take?
Maintaining a Healthy OpenStack Cloud: What does it take?Maintaining a Healthy OpenStack Cloud: What does it take?
Maintaining a Healthy OpenStack Cloud: What does it take?Tyler Britten
 

Was ist angesagt? (20)

SoftLayer Value Proposition v1.04
SoftLayer Value Proposition v1.04SoftLayer Value Proposition v1.04
SoftLayer Value Proposition v1.04
 
Softlayer 07.nov.2014 en
Softlayer 07.nov.2014 enSoftlayer 07.nov.2014 en
Softlayer 07.nov.2014 en
 
SoftLayer at IBM Company [March 2016] - Ignacio Daza
SoftLayer at IBM Company [March 2016]   - Ignacio DazaSoftLayer at IBM Company [March 2016]   - Ignacio Daza
SoftLayer at IBM Company [March 2016] - Ignacio Daza
 
IBM Cloud SoftLayer Introduction & Hands-on 2016
IBM Cloud SoftLayer Introduction & Hands-on 2016IBM Cloud SoftLayer Introduction & Hands-on 2016
IBM Cloud SoftLayer Introduction & Hands-on 2016
 
IBM Cloud Solution - Blue Box
IBM Cloud Solution - Blue BoxIBM Cloud Solution - Blue Box
IBM Cloud Solution - Blue Box
 
Media Workloads in the Cloud
Media Workloads in the CloudMedia Workloads in the Cloud
Media Workloads in the Cloud
 
Microsoft Azure Hybrid Cloud - Getting Started For Techies
Microsoft Azure Hybrid Cloud - Getting Started For TechiesMicrosoft Azure Hybrid Cloud - Getting Started For Techies
Microsoft Azure Hybrid Cloud - Getting Started For Techies
 
DEVNET-1187 Cisco Intercloud Services: Delivering a Solution that Enables Hi...
DEVNET-1187	Cisco Intercloud Services:  Delivering a Solution that Enables Hi...DEVNET-1187	Cisco Intercloud Services:  Delivering a Solution that Enables Hi...
DEVNET-1187 Cisco Intercloud Services: Delivering a Solution that Enables Hi...
 
Multitenant Full Deck Jan 2015 Cloud Team AJ Linkedin
Multitenant Full Deck Jan 2015 Cloud Team AJ LinkedinMultitenant Full Deck Jan 2015 Cloud Team AJ Linkedin
Multitenant Full Deck Jan 2015 Cloud Team AJ Linkedin
 
AWS Summit Auckland - Running your Enterprise Windows Workload on AWS
AWS Summit Auckland  - Running your Enterprise Windows Workload on AWSAWS Summit Auckland  - Running your Enterprise Windows Workload on AWS
AWS Summit Auckland - Running your Enterprise Windows Workload on AWS
 
IBM Cloud OpenStack Services
IBM Cloud OpenStack ServicesIBM Cloud OpenStack Services
IBM Cloud OpenStack Services
 
VMWare and SoftLayer Hybrid IT
VMWare and SoftLayer Hybrid ITVMWare and SoftLayer Hybrid IT
VMWare and SoftLayer Hybrid IT
 
IBM SmartCloud Orchestration
IBM SmartCloud OrchestrationIBM SmartCloud Orchestration
IBM SmartCloud Orchestration
 
2015: The Year Hybrid Cloud Goes Mainstream
2015: The Year Hybrid Cloud Goes Mainstream2015: The Year Hybrid Cloud Goes Mainstream
2015: The Year Hybrid Cloud Goes Mainstream
 
SoftLayer Storage Services Overview (for Interop Las Vegas 2015)
SoftLayer Storage Services Overview (for Interop Las Vegas 2015)SoftLayer Storage Services Overview (for Interop Las Vegas 2015)
SoftLayer Storage Services Overview (for Interop Las Vegas 2015)
 
IBM Private Modular Cloud
IBM Private Modular CloudIBM Private Modular Cloud
IBM Private Modular Cloud
 
OpenStack, SDN, and the Future of Software Defined Infrastructure
OpenStack, SDN, and the Future of Software Defined InfrastructureOpenStack, SDN, and the Future of Software Defined Infrastructure
OpenStack, SDN, and the Future of Software Defined Infrastructure
 
Client presentation ibm private modular cloud_082013
Client presentation ibm private modular cloud_082013Client presentation ibm private modular cloud_082013
Client presentation ibm private modular cloud_082013
 
Pmc juniper
Pmc juniperPmc juniper
Pmc juniper
 
Maintaining a Healthy OpenStack Cloud: What does it take?
Maintaining a Healthy OpenStack Cloud: What does it take?Maintaining a Healthy OpenStack Cloud: What does it take?
Maintaining a Healthy OpenStack Cloud: What does it take?
 

Ähnlich wie SoftLayer API 12032015

(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIsAmazon Web Services
 
A Detailed Guide to Securing React applications with Keycloak - WalkingTree ...
A Detailed Guide to Securing React applications with Keycloak  - WalkingTree ...A Detailed Guide to Securing React applications with Keycloak  - WalkingTree ...
A Detailed Guide to Securing React applications with Keycloak - WalkingTree ...Ganesh Kumar
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesGaston Cruz
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19aminmesbahi
 
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 minsAWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 minsAWS User Group - Thailand
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsTom Johnson
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...CA API Management
 
DF12 - Process Orchestration using Streaming API and Heroku
DF12 - Process Orchestration using Streaming API and HerokuDF12 - Process Orchestration using Streaming API and Heroku
DF12 - Process Orchestration using Streaming API and Herokuafawcett
 
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Amazon Web Services
 
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...Amazon Web Services
 
Lamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api GatewayLamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api GatewayMike Becker
 
Cloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFECloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFEPrabath Siriwardena
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APIDavid Keener
 
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resources
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resourcesJavaScript & Cloud: the AWS JS SDK and how to work with cloud resources
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resourcesCorley S.r.l.
 
Developer Tutorial: WebAuthn for Web & FIDO2 for Android
Developer Tutorial: WebAuthn for Web & FIDO2 for AndroidDeveloper Tutorial: WebAuthn for Web & FIDO2 for Android
Developer Tutorial: WebAuthn for Web & FIDO2 for AndroidFIDO Alliance
 
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAMHow to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAMProvectus
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Kris Wagner
 

Ähnlich wie SoftLayer API 12032015 (20)

Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
 
A Detailed Guide to Securing React applications with Keycloak - WalkingTree ...
A Detailed Guide to Securing React applications with Keycloak  - WalkingTree ...A Detailed Guide to Securing React applications with Keycloak  - WalkingTree ...
A Detailed Guide to Securing React applications with Keycloak - WalkingTree ...
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
 
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 minsAWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
 
DF12 - Process Orchestration using Streaming API and Heroku
DF12 - Process Orchestration using Streaming API and HerokuDF12 - Process Orchestration using Streaming API and Heroku
DF12 - Process Orchestration using Streaming API and Heroku
 
Building Secure Mobile APIs
Building Secure Mobile APIsBuilding Secure Mobile APIs
Building Secure Mobile APIs
 
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
 
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
 
Lamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api GatewayLamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api Gateway
 
Cloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFECloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFE
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resources
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resourcesJavaScript & Cloud: the AWS JS SDK and how to work with cloud resources
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resources
 
Developer Tutorial: WebAuthn for Web & FIDO2 for Android
Developer Tutorial: WebAuthn for Web & FIDO2 for AndroidDeveloper Tutorial: WebAuthn for Web & FIDO2 for Android
Developer Tutorial: WebAuthn for Web & FIDO2 for Android
 
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAMHow to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAM
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365
 

Kürzlich hochgeladen

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

SoftLayer API 12032015

  • 1. 0 The SoftLayer API Softlayer API time get automatedThe Softlayer API time to get automated Ignacio Daza - IBM Softlayer Architect @Nacho_Daza Kimmo Hintikka - IBM Softlayer Architect @KimmoHintikka
  • 2. 1 Agenda • API economy • Why to use Softlayer API? • High level overview on SLAPI • Basic concepts of SLAPI • Q&A and useful resources to get going
  • 3. 2 API economy • The API economy emerges when APIs become part of the business model. • Public and partner APIs have been strategic enablers for several business models, such as Twitter’s and Amazon’s. • The Twitter APIs, for example, easily have ten times more traffic than the Twitter website does.
  • 4. 3 Why to use SoftLayer API? Pet vs. cattle server management approach Cost of management vs. cost of automation Time to market New business models
  • 5. 4 High level overview on SLAPI The Main Core Softlayer API v3 which manages mostly infrastructure plus also things like user accounts, tickets, notifications, access controls The Object Store API, which sits on top of a powerful multi-tenanted object store hosted and run by Softlayer The Message Queue API, which helps with intra-application and inter-system communications on a global scale. It also runs on infrastructure controlled by SoftLayer.
  • 6. 5 API Scope 260 Services 3183 Methods 15816 Properties SOAP REST XML_RPC Clients : C#, Python, PHP, Perl, Ruby
  • 7. 6 Basic concepts of SoftLayer API Softlayer APIs are organized into a hierarchical structure of Services with each service containing various methods Ability to Limit Results (rows filtering. Generally used for pagination) Object Masks (properties filtering) Softlayer Services use data structures and Data types for parameters and return results. •Data types define the data model of Softlayer cloud. •Simple data types include : Integer, Boolean, String •Complex data types can be constructed of various simple types
  • 8. 7 Getting started examples Command Line Interface Virtual server list : sl cci list Bare Metal server list : sl server List List hardware options : sl hardware list-chassis Show available command: sl ? Chrome REST interface Virtual server list : https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getVirtualGuests (GET) Bare Metal Server list : https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getHardware (GET) List Hardware options: https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package_Server/getAllObjects (GET) Python Client ( more code snippets to follow) import SoftLayer usr = “yourId” (make sure to include the quotes ) key = “yourApiKey” client = SoftLayer.Client(username=usr, api_key=key) account = client['Account'].getObject() print(account)
  • 9. 8 The SoftLayer CLI (Python) https://softlayer-api-python-client.readthedocs.org/en/latest/install/  INSTRUCTIONS T420 nacho # sl ? usage: sl <module> [<args>...] sl help <module> sl help <module> <command> sl [-h | --help] SoftLayer Command-line Client The available modules are: Compute: bmc Bare Metal Cloud cci Cloud Compute Instances image Manages compute and flex images metadata Get details about this machine. Also available with 'my' and 'meta' server Hardware servers sshkey Manage SSH keys on your account Networking: dns Domain Name System firewall Firewall rule and security management globalip Global IP address management rwhois RWhoIs operations ssl Manages SSL subnet Subnet ordering and management vlan Manage VLANs on your account Storage: iscsi View iSCSI details nas View NAS details General: config View and edit configuration for this tool summary Display an overall summary of your account help Show help See 'sl help <module>' for more information on a specific module. To use most commands your SoftLayer username and api_key need to be configured. The easiest way to do that is to use: 'sl config setup' Invalid module: "#" (To test, once you have the python-softlayer libraries) # sl config show :::::::::::::::::::::::::: # sl config setup Username []: ‘YOUR USERNAME’ API Key or Password []: ‘YOUR API KEY’ ::::::::::::::::::::::::::
  • 10. 9 Using Chrome Postman for REST • Install Chrome browser • Install Postman Chrome plugin https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en • Create collection for your API calls JSON calls can be exported / imported from Postman • Add a new entry to the collection ✓ Click on Collections in upper left and select “Add new Collection” ✓ Enter a url: https://yourId:yourApiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account ✓ Where yourId and yourApiKey are the credentials you were provided ✓ Select type of Get. Add to Collection and save. Send the call and view the JSON results at the bottom
  • 11. 10 List of users in my account We can call other methods of SoftLayerAccount such as getVirtualGuests(), getHardware(), getTickets(), getBareMetalInstances() The Client object takes four parameters: the name of the service to call (SoftLayerAccount is the default), the id of a specific object to work with, api username and key. ## getUsers.py import SoftLayer.API username = "your username" apyt_key = "your API key" # Create a client to the Softlayer_Account API service client = SoftLayer.Client(username = username, api_key=api_key) # Now we can call the methods of the SoftLayer Account users = client['Account'].getusers(mask="firstName,lastName,username") for user in users: print("username is: "+ user['username'])
  • 12. 11 List of bare metal and virtual servers We can call other methods of SoftLayerAccount such as getVirtualGuests(), getHardware(), getTickets(), getBareMetalInstances() ## getAccountInformation.py import SoftLayer.API from pprint import pprint as pp api_username = 'xxx' api_key = 'xxx' client = SoftLayer.Client( username=api_username, api_key=api_key, ) ## Get list of VirtualServers server_list = client[‘Account’].getVirtualGuests() For server in server_list: print (“id: ”+str(server[‘id’]) + “hostname: ”+ server[‘hostanme’] + “.” + server[‘domain’]) ## Get list of BareMetalInstances server_list = client[‘Account’].getBareMetalInstances() For server in server_list: print (“id: ”+str(server[‘id’]) + “hostname: ”+ server[‘hostanme’] + “.” + server[‘domain’]) ## Get list the Hardware on the account hardware = client['Account'].getHardware() pp(hardware) ## Get list of Tickets Ticketlist = client[‘Account’].getTickets() for ticket in Ticketlist: print (“Tickect id: ”+str(ticket[‘id’]) + “Title: ”+ server[‘title’])
  • 13. 12 Managing the amount of information The limit and offset variables limit the number of return objects and the starting object Object Masks specify the relational properties that need to be returned along with the target objects
  • 14. 13 Create / Delete a virtual Instance Logical Steps: 1.Import SoftLayer module 2.Get a authenticate client object connected to the VirtualGuest service 3.Pass it to the createObject method of the VirtualGuest service. 4.Call deleteObject with the id of the instance to remove it
  • 15. 14 Creating a Network monitor Logical Steps: 1.Import SoftLayer module 2.Bind to the Network_Monitor_Version1_Query_Host service 3.Create an object of the same type 4.call createObject() 5.More information is provided here
  • 16. 15 Object Storage – Create, store, search Logical Steps 1.pip install softlayer-object-storage 2.Import Object Storage module 3.Set authentication 4.Create a storage container 5.Create and populate a file within a storage container 6.Read a file from a storage container 7.Query for files within a storage container print ("searching....") s_results = sl_storage.search('sample') print ("found " + str(len(s_results)) + " hits....") print ("found " + str(s_results['total']) + " hits....") rs = s_results['results']
  • 17. 16 Typical Scenarios for using APIs The following scenarios are examples of how to use SoftLayer APIs: • Invoke 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. • Handle cloud monitoring events, such as re-instantiating servers, rebooting, and OS loads. • Programmatic cloud management, including upgrading and downgrading, adding storage, backup and restore, and Object Store usage. • Write cloud-native software applications. • Implement business workflows (Message Queues).
  • 18. 17 Creating message queues The Client object takes four parameters: the name of the service to call (SoftLayerAccount is the default), the id of a specific object to work with, api username and key. Message Queue $my_queue = $messaging_client->queue('my_queue')- >create(); Producer Producer Producer Consumer Consumer Publish $my_queue->message() ->setBody(‘Hello World!') - >create();
  • 20. 19