SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
开发训练营
梁博 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?

Contenu connexe

Tendances

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 NagiosNETWAYS
 
Kubernetes Ingress 101
Kubernetes Ingress 101Kubernetes Ingress 101
Kubernetes Ingress 101Kublr
 
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 premiseHans Duedal
 
A Brief Introduce to WSGI
A Brief Introduce to WSGIA Brief Introduce to WSGI
A Brief Introduce to WSGIMingli Yuan
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overviewrajdeep
 
Python WSGI introduction
Python WSGI introductionPython WSGI introduction
Python WSGI introductionAgeeleshwar 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 ArchitectureAjeet 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 PlayPassPeter 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 2016Chris 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 Clustersmalltown
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available DrupalBram Vogelaar
 
Puppet in the Pipeline
Puppet in the PipelinePuppet in the Pipeline
Puppet in the PipelinePuppet
 
Nova: Openstack Compute-as-a-service
Nova: Openstack Compute-as-a-serviceNova: Openstack Compute-as-a-service
Nova: Openstack Compute-as-a-servicePratik Bandarkar
 
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-2015reallavalamp
 
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 2011leo 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 InstallationNagios
 

Tendances (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
 

Similaire à how to use openstack api

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 APIsJoe 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 2014Puppet
 
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 MinutesFederico 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 MinutesCodemotion
 
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 GitDanilo Poccia
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 
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 2013Matt 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 KubernetesSreenivas 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 exampleRailwaymen
 
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, TADSummitAlan Quayle
 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPSACA 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-ITStijn 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 SystemsFIWARE
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeBen Hall
 

Similaire à 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
 

Plus de Liang Bo

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

Plus de 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
 

Dernier

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Dernier (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

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.