SlideShare a Scribd company logo
开发训练营
梁博 liangbo@trystack.cn
OPENSTACK API DEVELOPMENT WORKSHOP
Conveniently procrastinate client-centric technology via highly
efficient manufactured
Conveniently procrastinate client-centric technology via highly
efficient manufactured products. Seamlesslyproductivate go forward
benefits
COURSE INTRODUCTION
DAY 01
• Before Developing
• Developing OpenStack
• Developer’s Tools
• OpenStack API (RESTful API)
• How to use OpenStack API
• OpenStack API Binding
DAY 02
• Workshop (Use OpenStack API)
• OpenStack API SDKs
• Workshop (A tiny project)
梁博 在云计算领域有8年以上的项⺫⽬目经验,熟悉OpenStack架构设计,
具有在中⼤大型集成项⺫⽬目应⽤用OpenStack及相关架构设计和项⺫⽬目实
施经验,曾负责设计实施过国内⾸首个基于OpenStack的公有云平
台,并在OpenStack⾹香港峰会上做过专题报告,有丰富的培训和
咨询服务经验。
liangbo@trystack.cn
http://github.com/onetown
http://liangbo.me
Infrastructure 90%
Storage, Network 40%
Front-end, HTML, CSS, Javascript 60%
Python, C Sharp, Go-lang Development 90%Liang Bo (TRYSTACK.CN架构师)
Talk is cheap, show me the code.
Python – Before Developing
Python For Beginners
An experienced programmer in any programming language(whatever it may be ) can pick up Python very quickly.
03
Looking for Something Specific
The Python Package Index provides many libraries for particular
application, you just need to know howto findit.
04
Looking for Help
Use Google instead any other search engines.
02
Learning
Before getting started, you may want to findout which IDEs or
Text Editors are tailored to make Python editing easy.
01
Installing
Installing Python is generally easy, and nowadays many Linux
and UNIX distributions include a recent Python.
OpenStack – Developer’s tools
!
Libraries
• Cliff
• Debtcollector
• Keystonemiddleware
• Pbr
• PyCADF
• Pylockfile
• Stevedore
• TaskFlow
• Tooz
• Oslo.concurrency
• Oslo.config
• Oslo.db
• Oslo.i18n
• Oslo.log
• Oslo.policy
• Oslo.rootwrap
• Oslo.serialization
• Oslo.utils
• oslo.sphinx
IDEs & Text Editors
It is necessary to have effective tools todogood work.
IDE
Pycharm
Text Editor
Sublime Text
IDE
Eclipse
Text Editor
Vim
OpenStack SDKs
OpenStack provides a lot ofSDKsto make programming cloud
application easy. You don’t need deal with RESTfulAPIs.
PHP
Php-
opencloud
.Net
Openstack.net
Java
jClouds Golang
gophercloud
"
It’sYour Style !
Pick any programming language you like.
AROUND THE WORLD
Most OpenStack Applicationmade bypython
Most OpenStack
Portfolio
You can use ANY LANGUAGE, ANY TOOLS to
build your own cloud application
UI
Specific UI Integration
Skills Needed:
• CSS
• HTML
• Javascript
• Web Development
• RESTful API
Application
Specific Function Integration
Skills Needed:
• Python
• TaskFlow
• RESTful API
RESTful API
#
$
API
%
JAVA
Your System
REQUEST:  curl  -­‐i -­‐X  GET  
http://172.16.103.7:35357/v2.0/users  -­‐
H  "User-­‐Agent:  python-­‐keystoneclient"  
-­‐H  "X-­‐Auth-­‐Token:  TOKEN_REDACTED"
HEAD:{'date':  'Mon,  18  May  2015  04:30:52  GMT',  
'content-­‐type':   'application/json',   'content-­‐length':   '2038',  
'vary':  'X-­‐Auth-­‐Token'}
BODY:{"users":  [{"username":  "liangbo",   "name":  
"liangbo",   "id":  "00a6d76201b7461490cfa96794ce3d7b",  
"enabled":  true,   "email":  "liangbo@trystack.cn",  
"tenantId":  "76e9492941f34034b380ec936490adcb"},
Use RESTful APIs
$
API
%
JAVA
Your System
REQUEST:  curl  -­‐i -­‐X  GET  
http://172.16.103.7:35357/v2.0/users  -­‐
H  "User-­‐Agent:  python-­‐keystoneclient"  
-­‐H  "X-­‐Auth-­‐Token:  TOKEN_REDACTED"
HEAD:{'date':  'Mon,  18  May  2015  04:30:52  GMT',  
'content-­‐type':   'application/json',   'content-­‐length':   '2038',  
'vary':  'X-­‐Auth-­‐Token'}
BODY:{"users":  [{"username":  "liangbo",   "name":  
"liangbo",   "id":  "00a6d76201b7461490cfa96794ce3d7b",  
"enabled":  true,   "email":  "liangbo@trystack.cn",  
"tenantId":  "76e9492941f34034b380ec936490adcb"},
SDK
Keystone.userlist(); Use SDKs
Auth Token Request
curl-i'http://cloud.trystack.cn:5000/v2.0/tokens'
-X POST
-H "Content-Type:application/json"
-H "Accept:application/json"
-d '{"auth":{"tenantName":"99cloud",
"passwordCredentials":
{"username":"liangbo","password":"lb23zx"}
}
}’
HTTP/1.1 200 OK
Vary:X-Auth-Token
Content-Type:application/json
Content-Length:2881
Date: Mon, 18 May 2015 05:04:30 GMT
Auth Token Response
{"access": {"token": {"issued_at": "2015-05-18T05:04:30.749551", "expires": "2015-05-18T06:04:30Z", "id": "c1eddcbe9b39413aa9838957d2c6912f", "tenant": {"description":
"u4e5du5ddeu4e91u5728u7ebfu670du52a1u63d0u4f9b","enabled": true, "id": "76e9492941f34034b380ec936490adcb", "name": "99cloud"}, "audit_ids": ["08I-
DEsQTtyN8oECsZzhCQ"]}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://172.16.103.7:8774/v2/76e9492941f34034b380ec936490adcb", "region": "regionOne",
"internalURL": "http://172.16.103.7:8774/v2/76e9492941f34034b380ec936490adcb", "id": "00fb6ad4d7814ce9b82a9be2f585f05c", "publicURL":
"http://172.16.103.7:8774/v2/76e9492941f34034b380ec936490adcb"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://172.16.103.7:9696", "region": "regionOne", "internalURL": "http://172.16.103.7:9696", "id": "44ee9426b83b4f57b0b25b5eeeb3840a", "publicURL":
"http://172.16.103.7:9696"}], "endpoints_links": [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://172.16.103.7:9292", "region": "regionOne",
"internalURL": "http://172.16.103.7:9292", "id": "aac4cad8e89d49ba83a7c37ac52499c5", "publicURL": "http://172.16.103.7:9292"}], "endpoints_links": [], "type": "image",
"name": "glance"}, {"endpoints": [{"adminURL": "http://172.16.103.7:8000/v1", "region": "regionOne", "internalURL": "http://172.16.103.7:8000/v1", "id":
"04b4d9582fc8474f94488c6dfa7faba7", "publicURL": "http://172.16.103.7:8000/v1"}], "endpoints_links": [], "type": "cloudformation", "name": "heat-cfn"}, {"endpoints":
[{"adminURL": "http://172.16.103.7:8776/v1/76e9492941f34034b380ec936490adcb", "region": "regionOne", "internalURL":
"http://172.16.103.7:8776/v1/76e9492941f34034b380ec936490adcb", "id": "110c884741dc4817b2ff025729994781", "publicURL":
"http://172.16.103.7:8776/v1/76e9492941f34034b380ec936490adcb"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL":
"http://172.16.103.7:8004/v1/76e9492941f34034b380ec936490adcb", "region": "regionOne", "internalURL":
"http://172.16.103.7:8004/v1/76e9492941f34034b380ec936490adcb", "id": "2b17c5290b044743ab5871c2761a37fe", "publicURL":
"http://172.16.103.7:8004/v1/76e9492941f34034b380ec936490adcb"}], "endpoints_links": [], "type": "orchestration", "name": "heat"}, {"endpoints": [{"adminURL":
"http://172.16.103.7:35357/v2.0", "region": "regionOne", "internalURL": "http://172.16.103.7:5000/v2.0", "id": "5daf9e9e4cf24bf6876547dd8f8be78b", "publicURL":
"http://172.16.103.7:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "liangbo", "roles_links": [], "id":
"00a6d76201b7461490cfa96794ce3d7b", "roles": [{"name": "admin"}, {"name": "_member_"}], "name": "liangbo"}, "metadata": {"is_admin": 0, "roles":
["7a38637226bd4ab293f1cdeb9d8892a7", "e5a8b1766760491caf66eff2f8f8d654"]}}}
User
Keystone
Nova
Glance
Neutron
Credentials
Token
Toekn + request for VM
Verify token
Token + request for images
Verify token
Images
Token + request to plug VIF into net
Verify token
Token + verify user accessto VIF
Successful response
Successful response
Keystoneflowchart
Use Python Requests
>>> import requests
>>> r = requests.get('https://api.github.com/user',auth=('onetown@gmail.com',‘password'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf-8’
>>> r.text
u'{"login":"onetown","id":62006,"avatar_url":"https://avatars.githubusercontent.com/u/62006?v=3","gravatar_id":"","url":"https://api.gith
ub.com/users/onetown","html_url":"https://github.com/onetown","followers_url":"https://api.github.com/users/onetown/followers","fol
lowing_url":"https://api.github.com/users/onetown/following{/other_user}","gists_url":"https://api.github.com/users/onetown/gists{/gis
t_id}","starred_url":"https://api.github.com/users/onetown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/
onetown/subscriptions","organizations_url":"https://api.github.com/users/onetown/orgs","repos_url":"https://api.github.com/users/onet
own/repos","events_url":"https://api.github.com/users/onetown/events{/privacy}","received_events_url":"https://api.github.com/users/o
netown/received_events","type":"User","site_admin":false,"name":"oNeToWn","company":null,"blog":"http://liangbo.me","location":”
…
>>>
Use Python JSON
>>> import json
>>> data = [{'a':"A",'b':(2,4),'c':3.0}]
>>> data_string = json.dumps(data)
>>> print data_string
[{"a": "A", "c": 3.0, "b": [2, 4]}]
>>> decoded = json.loads(data_string)
>>> decoded
[{u'a': u'A', u'c': 3.0, u'b': [2, 4]}]
>>>
Launch an Instance?
>>> import os
>>> creds= {}
>>> creds['username']='liangbo‘
>>> creds['api_key']= ‚‘********‘
>>> creds['auth_url']='http://cloud.trystack.cn:5000/v2.0‘
>>> creds['project_id']='99cloud‘
>>> nova = client.Client(**creds)
>>> nova.security_groups.list()
[<SecurityGroup description=DMZ SecurityGroup, id=366dc2df-07af-409f-9841-d8b0dd75f379, name=DMZ, rules=[{u'from_port': 3389,
u'group': {}, u'ip_protocol': u'tcp', u'to_port': 3389, u'parent_group_id': u'366dc2df-07af-409f-9841-d8b0dd75f379', u'ip_range': {u'cidr':
u'0.0.0.0/0'}, u'id': u'122a4212-a1a6-44d4-a924-b433612cda42'}, {u'from_port': 22, u'group': {}, u'ip_protocol': u'tcp', u'to_port': 22,
u'parent_group_id': u'366dc2df-07af-409f-9841-d8b0dd75f379', u'ip_range': {u'cidr': u'0.0.0.0/0'}, u'id': u'7685cebf-e1ee-4e5a-a32e-
7a4ab897febc'}, {u'from_port': 80, u'group': {}, u'ip_protocol': u'tcp', u'to_port': 80, u'parent_group_id': u'366dc2df-07af-409f-9841-
d8b0dd75f379', u'ip_range':{u'cidr': u'0.0.0.0/0'}, u'id': u'80ef4de3-0cf9-479c-8d06-73eef4cdea6e'}, {u'from_port': -1, u'group': {},
...
Ready to go!!!!
Make Your Own
Design  Your  Own
• Python
• Flask
• A  micro  python  web  framework
Design Your Own
OneSingle App.py
Fully functional Read-only OpenStack
& Static folder for javascripts, css and fonts
♥ Templates folder for rendered html
( App.py is the real webapplication
IMAGE INFO : SimpleSmart Design Office
It should looks like this
With This Demo
Image
Compute
Network
!
$
"
ImageService
This is a client for the OpenStack Images API.There’s a Python API (the
glanceclient module) and a command-line script (installed as glance).
Network Service
In order to use the python neutron client directly,youmust first obtain an
auth token and identify whichendpoint you wishto speak to. Once you
have done so, you can use the API like so:
Compute Service
This is a client for OpenStack Nova API.There’s a Python API (the
novaclient module), and a command-line script (installed as
nova). Each implements the entire OpenStack Nova API.
Coding
2  hours
Questions?

More Related Content

What's hot

OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over NagiosOSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
NETWAYS
 
Kubernetes Ingress 101
Kubernetes Ingress 101Kubernetes Ingress 101
Kubernetes Ingress 101
Kublr
 
LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions
LF_APIStrat
 
Network services on Kubernetes on premise
Network services on Kubernetes on premiseNetwork services on Kubernetes on premise
Network services on Kubernetes on premise
Hans Duedal
 
A Brief Introduce to WSGI
A Brief Introduce to WSGIA Brief Introduce to WSGI
A Brief Introduce to WSGI
Mingli Yuan
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overview
rajdeep
 
Python WSGI introduction
Python WSGI introductionPython WSGI introduction
Python WSGI introduction
Ageeleshwar K
 
Demystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes ArchitectureDemystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes Architecture
Ajeet Singh Raina
 
Lessons learned with kubernetes in production at PlayPass
Lessons learned with kubernetes in productionat PlayPassLessons learned with kubernetes in productionat PlayPass
Lessons learned with kubernetes in production at PlayPass
Peter Vandenabeele
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016
Chris Tankersley
 
Kubernetes Summit 2019 - Harden Your Kubernetes Cluster
Kubernetes Summit 2019 - Harden Your Kubernetes ClusterKubernetes Summit 2019 - Harden Your Kubernetes Cluster
Kubernetes Summit 2019 - Harden Your Kubernetes Cluster
smalltown
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available Drupal
Bram Vogelaar
 
Puppet in the Pipeline
Puppet in the PipelinePuppet in the Pipeline
Puppet in the Pipeline
Puppet
 
Techzone 2014 presentation rundeck
Techzone 2014 presentation rundeckTechzone 2014 presentation rundeck
Techzone 2014 presentation rundeck
Joel Richard Moya Lupe
 
Nova: Openstack Compute-as-a-service
Nova: Openstack Compute-as-a-serviceNova: Openstack Compute-as-a-service
Nova: Openstack Compute-as-a-service
Pratik Bandarkar
 
RunDeck
RunDeckRunDeck
RunDeck
Bruno Bonfils
 
Kubernetes intro public - kubernetes user group 4-21-2015
Kubernetes intro   public - kubernetes user group 4-21-2015Kubernetes intro   public - kubernetes user group 4-21-2015
Kubernetes intro public - kubernetes user group 4-21-2015
reallavalamp
 
Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011
leo lapworth
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Nagios
 

What's hot (20)

OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over NagiosOSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
 
Kubernetes Ingress 101
Kubernetes Ingress 101Kubernetes Ingress 101
Kubernetes Ingress 101
 
LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions
 
Network services on Kubernetes on premise
Network services on Kubernetes on premiseNetwork services on Kubernetes on premise
Network services on Kubernetes on premise
 
A Brief Introduce to WSGI
A Brief Introduce to WSGIA Brief Introduce to WSGI
A Brief Introduce to WSGI
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overview
 
Python WSGI introduction
Python WSGI introductionPython WSGI introduction
Python WSGI introduction
 
Demystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes ArchitectureDemystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes Architecture
 
Lessons learned with kubernetes in production at PlayPass
Lessons learned with kubernetes in productionat PlayPassLessons learned with kubernetes in productionat PlayPass
Lessons learned with kubernetes in production at PlayPass
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016
 
Kubernetes Summit 2019 - Harden Your Kubernetes Cluster
Kubernetes Summit 2019 - Harden Your Kubernetes ClusterKubernetes Summit 2019 - Harden Your Kubernetes Cluster
Kubernetes Summit 2019 - Harden Your Kubernetes Cluster
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available Drupal
 
Puppet in the Pipeline
Puppet in the PipelinePuppet in the Pipeline
Puppet in the Pipeline
 
Techzone 2014 presentation rundeck
Techzone 2014 presentation rundeckTechzone 2014 presentation rundeck
Techzone 2014 presentation rundeck
 
Nova: Openstack Compute-as-a-service
Nova: Openstack Compute-as-a-serviceNova: Openstack Compute-as-a-service
Nova: Openstack Compute-as-a-service
 
RunDeck
RunDeckRunDeck
RunDeck
 
Kubernetes intro public - kubernetes user group 4-21-2015
Kubernetes intro   public - kubernetes user group 4-21-2015Kubernetes intro   public - kubernetes user group 4-21-2015
Kubernetes intro public - kubernetes user group 4-21-2015
 
Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
 

Similar to how to use openstack api

MesosCon - Be a microservices hero
MesosCon - Be a microservices heroMesosCon - Be a microservices hero
MesosCon - Be a microservices hero
Dragos Dascalita Haut
 
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIsWorking with PowerVC via its REST APIs
Working with PowerVC via its REST APIs
Joe Cropper
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)
Wade Minter
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca
 
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 MinutesFederico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Codemotion
 
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
Cisco DevNet
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
Puppet
 
Chef and OpenStack Workshop from ChefConf 2013
Chef and OpenStack Workshop from ChefConf 2013Chef and OpenStack Workshop from ChefConf 2013
Chef and OpenStack Workshop from ChefConf 2013
Matt Ray
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
NGINX, Inc.
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Henning Jacobs
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
RoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails exampleRoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails example
Railwaymen
 
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Anna Klepacka
 
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitMatrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Alan Quayle
 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPS
ACA IT-Solutions
 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-IT
Stijn Wijndaele
 
FIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart SystemsFIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud Native
Ben Hall
 

Similar to how to use openstack api (20)

MesosCon - Be a microservices hero
MesosCon - Be a microservices heroMesosCon - Be a microservices hero
MesosCon - Be a microservices hero
 
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIsWorking with PowerVC via its REST APIs
Working with PowerVC via its REST APIs
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
 
OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 Minutes
 
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 MinutesFederico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
 
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Chef and OpenStack Workshop from ChefConf 2013
Chef and OpenStack Workshop from ChefConf 2013Chef and OpenStack Workshop from ChefConf 2013
Chef and OpenStack Workshop from ChefConf 2013
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
RoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails exampleRoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails example
 
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
 
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitMatrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPS
 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-IT
 
FIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart SystemsFIWARE Wednesday Webinars - Short Term History within Smart Systems
FIWARE Wednesday Webinars - Short Term History within Smart Systems
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud Native
 

More from Liang Bo

99cloud training material
99cloud training material99cloud training material
99cloud training material
Liang Bo
 
Your first c# app on OpenStack
Your first c# app on OpenStackYour first c# app on OpenStack
Your first c# app on OpenStack
Liang Bo
 
99cloud openstack ci
99cloud openstack ci99cloud openstack ci
99cloud openstack ci
Liang Bo
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
Liang Bo
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang Bo
 
OpenStack Neutron Introduction
OpenStack Neutron IntroductionOpenStack Neutron Introduction
OpenStack Neutron Introduction
Liang Bo
 
Docker with openstack
Docker with openstackDocker with openstack
Docker with openstack
Liang Bo
 

More from Liang Bo (7)

99cloud training material
99cloud training material99cloud training material
99cloud training material
 
Your first c# app on OpenStack
Your first c# app on OpenStackYour first c# app on OpenStack
Your first c# app on OpenStack
 
99cloud openstack ci
99cloud openstack ci99cloud openstack ci
99cloud openstack ci
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
OpenStack Neutron Introduction
OpenStack Neutron IntroductionOpenStack Neutron Introduction
OpenStack Neutron Introduction
 
Docker with openstack
Docker with openstackDocker with openstack
Docker with openstack
 

Recently uploaded

Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
aisafed42
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
anfaltahir1010
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 

Recently uploaded (20)

Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 

how to use openstack api

  • 2. Conveniently procrastinate client-centric technology via highly efficient manufactured Conveniently procrastinate client-centric technology via highly efficient manufactured products. Seamlesslyproductivate go forward benefits COURSE INTRODUCTION DAY 01 • Before Developing • Developing OpenStack • Developer’s Tools • OpenStack API (RESTful API) • How to use OpenStack API • OpenStack API Binding DAY 02 • Workshop (Use OpenStack API) • OpenStack API SDKs • Workshop (A tiny project)
  • 4. Talk is cheap, show me the code.
  • 5. Python – Before Developing
  • 6. Python For Beginners An experienced programmer in any programming language(whatever it may be ) can pick up Python very quickly. 03 Looking for Something Specific The Python Package Index provides many libraries for particular application, you just need to know howto findit. 04 Looking for Help Use Google instead any other search engines. 02 Learning Before getting started, you may want to findout which IDEs or Text Editors are tailored to make Python editing easy. 01 Installing Installing Python is generally easy, and nowadays many Linux and UNIX distributions include a recent Python.
  • 8. Libraries • Cliff • Debtcollector • Keystonemiddleware • Pbr • PyCADF • Pylockfile • Stevedore • TaskFlow • Tooz • Oslo.concurrency • Oslo.config • Oslo.db • Oslo.i18n • Oslo.log • Oslo.policy • Oslo.rootwrap • Oslo.serialization • Oslo.utils • oslo.sphinx
  • 9. IDEs & Text Editors It is necessary to have effective tools todogood work. IDE Pycharm Text Editor Sublime Text IDE Eclipse Text Editor Vim
  • 10. OpenStack SDKs OpenStack provides a lot ofSDKsto make programming cloud application easy. You don’t need deal with RESTfulAPIs. PHP Php- opencloud .Net Openstack.net Java jClouds Golang gophercloud " It’sYour Style ! Pick any programming language you like. AROUND THE WORLD Most OpenStack Applicationmade bypython Most OpenStack
  • 11. Portfolio You can use ANY LANGUAGE, ANY TOOLS to build your own cloud application UI Specific UI Integration Skills Needed: • CSS • HTML • Javascript • Web Development • RESTful API Application Specific Function Integration Skills Needed: • Python • TaskFlow • RESTful API
  • 13. $ API % JAVA Your System REQUEST:  curl  -­‐i -­‐X  GET   http://172.16.103.7:35357/v2.0/users  -­‐ H  "User-­‐Agent:  python-­‐keystoneclient"   -­‐H  "X-­‐Auth-­‐Token:  TOKEN_REDACTED" HEAD:{'date':  'Mon,  18  May  2015  04:30:52  GMT',   'content-­‐type':   'application/json',   'content-­‐length':   '2038',   'vary':  'X-­‐Auth-­‐Token'} BODY:{"users":  [{"username":  "liangbo",   "name":   "liangbo",   "id":  "00a6d76201b7461490cfa96794ce3d7b",   "enabled":  true,   "email":  "liangbo@trystack.cn",   "tenantId":  "76e9492941f34034b380ec936490adcb"}, Use RESTful APIs
  • 14. $ API % JAVA Your System REQUEST:  curl  -­‐i -­‐X  GET   http://172.16.103.7:35357/v2.0/users  -­‐ H  "User-­‐Agent:  python-­‐keystoneclient"   -­‐H  "X-­‐Auth-­‐Token:  TOKEN_REDACTED" HEAD:{'date':  'Mon,  18  May  2015  04:30:52  GMT',   'content-­‐type':   'application/json',   'content-­‐length':   '2038',   'vary':  'X-­‐Auth-­‐Token'} BODY:{"users":  [{"username":  "liangbo",   "name":   "liangbo",   "id":  "00a6d76201b7461490cfa96794ce3d7b",   "enabled":  true,   "email":  "liangbo@trystack.cn",   "tenantId":  "76e9492941f34034b380ec936490adcb"}, SDK Keystone.userlist(); Use SDKs
  • 15. Auth Token Request curl-i'http://cloud.trystack.cn:5000/v2.0/tokens' -X POST -H "Content-Type:application/json" -H "Accept:application/json" -d '{"auth":{"tenantName":"99cloud", "passwordCredentials": {"username":"liangbo","password":"lb23zx"} } }’ HTTP/1.1 200 OK Vary:X-Auth-Token Content-Type:application/json Content-Length:2881 Date: Mon, 18 May 2015 05:04:30 GMT
  • 16. Auth Token Response {"access": {"token": {"issued_at": "2015-05-18T05:04:30.749551", "expires": "2015-05-18T06:04:30Z", "id": "c1eddcbe9b39413aa9838957d2c6912f", "tenant": {"description": "u4e5du5ddeu4e91u5728u7ebfu670du52a1u63d0u4f9b","enabled": true, "id": "76e9492941f34034b380ec936490adcb", "name": "99cloud"}, "audit_ids": ["08I- DEsQTtyN8oECsZzhCQ"]}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://172.16.103.7:8774/v2/76e9492941f34034b380ec936490adcb", "region": "regionOne", "internalURL": "http://172.16.103.7:8774/v2/76e9492941f34034b380ec936490adcb", "id": "00fb6ad4d7814ce9b82a9be2f585f05c", "publicURL": "http://172.16.103.7:8774/v2/76e9492941f34034b380ec936490adcb"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://172.16.103.7:9696", "region": "regionOne", "internalURL": "http://172.16.103.7:9696", "id": "44ee9426b83b4f57b0b25b5eeeb3840a", "publicURL": "http://172.16.103.7:9696"}], "endpoints_links": [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://172.16.103.7:9292", "region": "regionOne", "internalURL": "http://172.16.103.7:9292", "id": "aac4cad8e89d49ba83a7c37ac52499c5", "publicURL": "http://172.16.103.7:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://172.16.103.7:8000/v1", "region": "regionOne", "internalURL": "http://172.16.103.7:8000/v1", "id": "04b4d9582fc8474f94488c6dfa7faba7", "publicURL": "http://172.16.103.7:8000/v1"}], "endpoints_links": [], "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"adminURL": "http://172.16.103.7:8776/v1/76e9492941f34034b380ec936490adcb", "region": "regionOne", "internalURL": "http://172.16.103.7:8776/v1/76e9492941f34034b380ec936490adcb", "id": "110c884741dc4817b2ff025729994781", "publicURL": "http://172.16.103.7:8776/v1/76e9492941f34034b380ec936490adcb"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://172.16.103.7:8004/v1/76e9492941f34034b380ec936490adcb", "region": "regionOne", "internalURL": "http://172.16.103.7:8004/v1/76e9492941f34034b380ec936490adcb", "id": "2b17c5290b044743ab5871c2761a37fe", "publicURL": "http://172.16.103.7:8004/v1/76e9492941f34034b380ec936490adcb"}], "endpoints_links": [], "type": "orchestration", "name": "heat"}, {"endpoints": [{"adminURL": "http://172.16.103.7:35357/v2.0", "region": "regionOne", "internalURL": "http://172.16.103.7:5000/v2.0", "id": "5daf9e9e4cf24bf6876547dd8f8be78b", "publicURL": "http://172.16.103.7:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "liangbo", "roles_links": [], "id": "00a6d76201b7461490cfa96794ce3d7b", "roles": [{"name": "admin"}, {"name": "_member_"}], "name": "liangbo"}, "metadata": {"is_admin": 0, "roles": ["7a38637226bd4ab293f1cdeb9d8892a7", "e5a8b1766760491caf66eff2f8f8d654"]}}}
  • 17. User Keystone Nova Glance Neutron Credentials Token Toekn + request for VM Verify token Token + request for images Verify token Images Token + request to plug VIF into net Verify token Token + verify user accessto VIF Successful response Successful response Keystoneflowchart
  • 18. Use Python Requests >>> import requests >>> r = requests.get('https://api.github.com/user',auth=('onetown@gmail.com',‘password')) >>> r.status_code 200 >>> r.headers['content-type'] 'application/json; charset=utf-8’ >>> r.text u'{"login":"onetown","id":62006,"avatar_url":"https://avatars.githubusercontent.com/u/62006?v=3","gravatar_id":"","url":"https://api.gith ub.com/users/onetown","html_url":"https://github.com/onetown","followers_url":"https://api.github.com/users/onetown/followers","fol lowing_url":"https://api.github.com/users/onetown/following{/other_user}","gists_url":"https://api.github.com/users/onetown/gists{/gis t_id}","starred_url":"https://api.github.com/users/onetown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ onetown/subscriptions","organizations_url":"https://api.github.com/users/onetown/orgs","repos_url":"https://api.github.com/users/onet own/repos","events_url":"https://api.github.com/users/onetown/events{/privacy}","received_events_url":"https://api.github.com/users/o netown/received_events","type":"User","site_admin":false,"name":"oNeToWn","company":null,"blog":"http://liangbo.me","location":” … >>>
  • 19. Use Python JSON >>> import json >>> data = [{'a':"A",'b':(2,4),'c':3.0}] >>> data_string = json.dumps(data) >>> print data_string [{"a": "A", "c": 3.0, "b": [2, 4]}] >>> decoded = json.loads(data_string) >>> decoded [{u'a': u'A', u'c': 3.0, u'b': [2, 4]}] >>>
  • 20. Launch an Instance? >>> import os >>> creds= {} >>> creds['username']='liangbo‘ >>> creds['api_key']= ‚‘********‘ >>> creds['auth_url']='http://cloud.trystack.cn:5000/v2.0‘ >>> creds['project_id']='99cloud‘ >>> nova = client.Client(**creds) >>> nova.security_groups.list() [<SecurityGroup description=DMZ SecurityGroup, id=366dc2df-07af-409f-9841-d8b0dd75f379, name=DMZ, rules=[{u'from_port': 3389, u'group': {}, u'ip_protocol': u'tcp', u'to_port': 3389, u'parent_group_id': u'366dc2df-07af-409f-9841-d8b0dd75f379', u'ip_range': {u'cidr': u'0.0.0.0/0'}, u'id': u'122a4212-a1a6-44d4-a924-b433612cda42'}, {u'from_port': 22, u'group': {}, u'ip_protocol': u'tcp', u'to_port': 22, u'parent_group_id': u'366dc2df-07af-409f-9841-d8b0dd75f379', u'ip_range': {u'cidr': u'0.0.0.0/0'}, u'id': u'7685cebf-e1ee-4e5a-a32e- 7a4ab897febc'}, {u'from_port': 80, u'group': {}, u'ip_protocol': u'tcp', u'to_port': 80, u'parent_group_id': u'366dc2df-07af-409f-9841- d8b0dd75f379', u'ip_range':{u'cidr': u'0.0.0.0/0'}, u'id': u'80ef4de3-0cf9-479c-8d06-73eef4cdea6e'}, {u'from_port': -1, u'group': {}, ...
  • 22. Design  Your  Own • Python • Flask • A  micro  python  web  framework
  • 23. Design Your Own OneSingle App.py Fully functional Read-only OpenStack & Static folder for javascripts, css and fonts ♥ Templates folder for rendered html ( App.py is the real webapplication IMAGE INFO : SimpleSmart Design Office
  • 24. It should looks like this
  • 25. With This Demo Image Compute Network ! $ " ImageService This is a client for the OpenStack Images API.There’s a Python API (the glanceclient module) and a command-line script (installed as glance). Network Service In order to use the python neutron client directly,youmust first obtain an auth token and identify whichendpoint you wishto speak to. Once you have done so, you can use the API like so: Compute Service This is a client for OpenStack Nova API.There’s a Python API (the novaclient module), and a command-line script (installed as nova). Each implements the entire OpenStack Nova API.
  • 27.