SlideShare une entreprise Scribd logo
1  sur  13
Use build service API in your program
Max Lin – Software Engineer
mlin@suse.com
2
What is build service api?
• RESTful API of Open Build Service
• https://api.opensuse.org/apidocs
• open-build-service/docs/api/api/api.txt
• open-build-service/src/api/config/routes.rb
• Client side usage:
‒ osc : Command Line Interface to work with Open Build
Service
‒ osc api /route + arguments
3
Benefits
• `osc command` is wrapped
‒ see core.py in osc
• `osc api` is returned the xml data
• Not that easily to do post-processing from the
output of osc command
• The usage does not provided by osc command
4
`osc command` example
5
`osc api` example
6
`osc api` example(cont.)
• # osc api -X POST -d "hello 2016"
/comments/project/home:mlin7442
• Returned:
‒ <status code="ok">
‒ <summary>Ok</summary>
‒ </status>
7
For Perl
• Wrapped your http request(eg. HTTP::Request)
and send it to right place and grab the return data
• Call `osc api` in system(), open()
• Cares of authentication part or using public api
route instead
8
For Python
• Wrapped your http request(eg. httplib) and sent
by urlopen()
‒ Make sure go with authorisation header or go with public
api route then.
• Easy way: use existing osc python api
‒ import osc.core
‒ import osc.conf
‒ http_{GET, PUT, POST, DELETE} available
‒ Some existing functions, do not need to re-do the wheel!
‒ makeurl() help you to get the specific result if no existing
function can adopt your requirement
9
Real case
• Changelog Checker -
https://github.com/openSUSE/osc-plugin-factory/blob/ma
• Goal
‒ Make sure it has valid tag within submission, eg. bsc#,
fate#, if not, decline then.
‒ Accept the the submission had same revision was
submitted to openSUSE Factory or merged already.
‒ Accept new package submissions
‒ Accept delete request and add_role request
Questions?
Thank you.
Join the conversation,
contribute & have a lot of fun!
www.opensuse.org
12
Have a Lot of Fun, and Join Us
At:
www.opensuse.org
General Disclaimer
This document is not to be construed as a promise by any participating organisation to
develop, deliver, or market a product. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing decisions. openSUSE
makes no representations or warranties with respect to the contents of this document, and
specifically disclaims any express or implied warranties of merchantability or fitness for
any particular purpose. The development, release, and timing of features or functionality
described for openSUSE products remains at the sole discretion of openSUSE. Further,
openSUSE reserves the right to revise this document and to make changes to its content,
at any time, without obligation to notify any person or entity of such revisions or changes.
All openSUSE marks referenced in this presentation are trademarks or registered
trademarks of SUSE LLC, in the United States and other countries. All third-party
trademarks are the property of their respective owners.
License
This slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0
International license. It can be shared and adapted for any purpose (even
commercially) as long as Attribution is given and any derivative work is distributed
under the same license.
Details can be found at https://creativecommons.org/licenses/by-sa/4.0/
Credits
Template
Richard Brown
rbrown@opensuse.org
Design & Inspiration
openSUSE Design Team
http://opensuse.github.io/branding-
guidelines/

Contenu connexe

Tendances

Robert collins openstack on openstack 201304162
Robert collins   openstack on openstack 201304162Robert collins   openstack on openstack 201304162
Robert collins openstack on openstack 201304162
OpenStack Foundation
 
CentOS Virt SIG - Community virtualization packages on an immutable core
CentOS Virt SIG - Community virtualization packages on an immutable coreCentOS Virt SIG - Community virtualization packages on an immutable core
CentOS Virt SIG - Community virtualization packages on an immutable core
The Linux Foundation
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
railsconf
 

Tendances (20)

Robert collins openstack on openstack 201304162
Robert collins   openstack on openstack 201304162Robert collins   openstack on openstack 201304162
Robert collins openstack on openstack 201304162
 
Instalar MySQL CentOS
Instalar MySQL CentOSInstalar MySQL CentOS
Instalar MySQL CentOS
 
Mesos DC/OS on opensuse
Mesos DC/OS on opensuseMesos DC/OS on opensuse
Mesos DC/OS on opensuse
 
CentOS Virt SIG - Community virtualization packages on an immutable core
CentOS Virt SIG - Community virtualization packages on an immutable coreCentOS Virt SIG - Community virtualization packages on an immutable core
CentOS Virt SIG - Community virtualization packages on an immutable core
 
IPS: Image Packaging System
IPS: Image Packaging SystemIPS: Image Packaging System
IPS: Image Packaging System
 
XPDS13: Xenserver-core: What it is, how it is built and how to get involved -...
XPDS13: Xenserver-core: What it is, how it is built and how to get involved -...XPDS13: Xenserver-core: What it is, how it is built and how to get involved -...
XPDS13: Xenserver-core: What it is, how it is built and how to get involved -...
 
Introduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John Hixson
 
Habilitar repositorio EPEL RHEL
Habilitar repositorio EPEL RHELHabilitar repositorio EPEL RHEL
Habilitar repositorio EPEL RHEL
 
install mosquitto-auth-plug - cheat sheet -
install mosquitto-auth-plug - cheat sheet -install mosquitto-auth-plug - cheat sheet -
install mosquitto-auth-plug - cheat sheet -
 
Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners
 
Anthony McKeown Drupal Presentation
Anthony McKeown Drupal PresentationAnthony McKeown Drupal Presentation
Anthony McKeown Drupal Presentation
 
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack: DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)OpenStack: DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
 
Network Security
Network SecurityNetwork Security
Network Security
 
Sweden11
Sweden11Sweden11
Sweden11
 
Hadoop single cluster installation
Hadoop single cluster installationHadoop single cluster installation
Hadoop single cluster installation
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
 
Fosscon2013
Fosscon2013Fosscon2013
Fosscon2013
 
Amis puppet building blocks demo for Oracle Database and Weblogic cluster
Amis puppet building blocks demo for Oracle Database and Weblogic clusterAmis puppet building blocks demo for Oracle Database and Weblogic cluster
Amis puppet building blocks demo for Oracle Database and Weblogic cluster
 
Installing Loopback Adapter
Installing Loopback AdapterInstalling Loopback Adapter
Installing Loopback Adapter
 
Snort296x centos6x 2
Snort296x centos6x 2Snort296x centos6x 2
Snort296x centos6x 2
 

Similaire à Use build service API in your program

Running SAP on SUSE Cloud 2.0
Running SAP on SUSE Cloud 2.0Running SAP on SUSE Cloud 2.0
Running SAP on SUSE Cloud 2.0
Dirk Oppenkowski
 

Similaire à Use build service API in your program (20)

osc2
osc2osc2
osc2
 
OBS in numbers
OBS in numbersOBS in numbers
OBS in numbers
 
Hands-On with Heat: Service Orchestration in SUSE Cloud
Hands-On with Heat: Service Orchestration in SUSE CloudHands-On with Heat: Service Orchestration in SUSE Cloud
Hands-On with Heat: Service Orchestration in SUSE Cloud
 
Power Your Directory with openSUSE and Samba
Power Your Directory with openSUSE and SambaPower Your Directory with openSUSE and Samba
Power Your Directory with openSUSE and Samba
 
Development of BlankOn packages whit OpenSUSE
Development of BlankOn packages whit OpenSUSEDevelopment of BlankOn packages whit OpenSUSE
Development of BlankOn packages whit OpenSUSE
 
Reproducible Builds on openSUSE
Reproducible Builds on openSUSEReproducible Builds on openSUSE
Reproducible Builds on openSUSE
 
OpenStack: Past, Present, and Future
OpenStack: Past, Present, and FutureOpenStack: Past, Present, and Future
OpenStack: Past, Present, and Future
 
Egkatastasis
EgkatastasisEgkatastasis
Egkatastasis
 
Build Platform as a Service (PaaS) with SUSE Studio, WSO2 Middleware, and EC2
Build Platform as a Service (PaaS) with SUSE Studio, WSO2 Middleware, and EC2 Build Platform as a Service (PaaS) with SUSE Studio, WSO2 Middleware, and EC2
Build Platform as a Service (PaaS) with SUSE Studio, WSO2 Middleware, and EC2
 
Creating an openSUSE powered Robot
Creating an openSUSE powered RobotCreating an openSUSE powered Robot
Creating an openSUSE powered Robot
 
openSUSE Conference 2017 - The Atom Presentation
openSUSE Conference 2017 - The Atom PresentationopenSUSE Conference 2017 - The Atom Presentation
openSUSE Conference 2017 - The Atom Presentation
 
Build Image Using KIWI! Customize What You Want!
Build Image Using KIWI! Customize What You Want!Build Image Using KIWI! Customize What You Want!
Build Image Using KIWI! Customize What You Want!
 
Dockerzing Your Infrastructure with Machinery | LinuxCon 2016
Dockerzing Your Infrastructure with Machinery | LinuxCon 2016Dockerzing Your Infrastructure with Machinery | LinuxCon 2016
Dockerzing Your Infrastructure with Machinery | LinuxCon 2016
 
The new SUSE Academic Program explained!
The new SUSE Academic Program explained!The new SUSE Academic Program explained!
The new SUSE Academic Program explained!
 
openSUSE Infrastructure 2015
openSUSE Infrastructure 2015openSUSE Infrastructure 2015
openSUSE Infrastructure 2015
 
SUSE Open Stack Cloud.
SUSE Open Stack Cloud.SUSE Open Stack Cloud.
SUSE Open Stack Cloud.
 
Running SAP on SUSE Cloud 2.0
Running SAP on SUSE Cloud 2.0Running SAP on SUSE Cloud 2.0
Running SAP on SUSE Cloud 2.0
 
Wordpress docker on openSUSE Leap
Wordpress docker on openSUSE LeapWordpress docker on openSUSE Leap
Wordpress docker on openSUSE Leap
 
Manage Virtual Machines with WebVirtMgr on openSUSE
Manage Virtual Machines with WebVirtMgr on openSUSEManage Virtual Machines with WebVirtMgr on openSUSE
Manage Virtual Machines with WebVirtMgr on openSUSE
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 

Plus de SUSE Labs Taipei

Plus de SUSE Labs Taipei (17)

Locked down openSUSE Tumbleweed kernel
Locked down openSUSE Tumbleweed kernelLocked down openSUSE Tumbleweed kernel
Locked down openSUSE Tumbleweed kernel
 
SUSE shim and things related to it
SUSE shim and things related to itSUSE shim and things related to it
SUSE shim and things related to it
 
Multi-signed Kernel Module
Multi-signed Kernel ModuleMulti-signed Kernel Module
Multi-signed Kernel Module
 
ACPI Debugging from Linux Kernel
ACPI Debugging from Linux KernelACPI Debugging from Linux Kernel
ACPI Debugging from Linux Kernel
 
Profiling the ACPICA Namespace and Event Handing
Profiling the ACPICA Namespace and Event HandingProfiling the ACPICA Namespace and Event Handing
Profiling the ACPICA Namespace and Event Handing
 
Kernel debug log and console on openSUSE
Kernel debug log and console on openSUSEKernel debug log and console on openSUSE
Kernel debug log and console on openSUSE
 
The bright future of SUSE and openSUSE
The bright future of SUSE and openSUSEThe bright future of SUSE and openSUSE
The bright future of SUSE and openSUSE
 
EFI Secure Key
EFI Secure KeyEFI Secure Key
EFI Secure Key
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
Convert your package to multibuild on Open Build Service
Convert your package to multibuild on Open Build ServiceConvert your package to multibuild on Open Build Service
Convert your package to multibuild on Open Build Service
 
Ixgbe internals
Ixgbe internalsIxgbe internals
Ixgbe internals
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic Control
 
Looking into trusted and encrypted keys
Looking into trusted and encrypted keysLooking into trusted and encrypted keys
Looking into trusted and encrypted keys
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
 
openSUSE12.2 Review
openSUSE12.2 ReviewopenSUSE12.2 Review
openSUSE12.2 Review
 
oS KDE Repos & MM
oS KDE Repos & MMoS KDE Repos & MM
oS KDE Repos & MM
 

Dernier

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Dernier (20)

Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

Use build service API in your program

  • 1. Use build service API in your program Max Lin – Software Engineer mlin@suse.com
  • 2. 2 What is build service api? • RESTful API of Open Build Service • https://api.opensuse.org/apidocs • open-build-service/docs/api/api/api.txt • open-build-service/src/api/config/routes.rb • Client side usage: ‒ osc : Command Line Interface to work with Open Build Service ‒ osc api /route + arguments
  • 3. 3 Benefits • `osc command` is wrapped ‒ see core.py in osc • `osc api` is returned the xml data • Not that easily to do post-processing from the output of osc command • The usage does not provided by osc command
  • 6. 6 `osc api` example(cont.) • # osc api -X POST -d "hello 2016" /comments/project/home:mlin7442 • Returned: ‒ <status code="ok"> ‒ <summary>Ok</summary> ‒ </status>
  • 7. 7 For Perl • Wrapped your http request(eg. HTTP::Request) and send it to right place and grab the return data • Call `osc api` in system(), open() • Cares of authentication part or using public api route instead
  • 8. 8 For Python • Wrapped your http request(eg. httplib) and sent by urlopen() ‒ Make sure go with authorisation header or go with public api route then. • Easy way: use existing osc python api ‒ import osc.core ‒ import osc.conf ‒ http_{GET, PUT, POST, DELETE} available ‒ Some existing functions, do not need to re-do the wheel! ‒ makeurl() help you to get the specific result if no existing function can adopt your requirement
  • 9. 9 Real case • Changelog Checker - https://github.com/openSUSE/osc-plugin-factory/blob/ma • Goal ‒ Make sure it has valid tag within submission, eg. bsc#, fate#, if not, decline then. ‒ Accept the the submission had same revision was submitted to openSUSE Factory or merged already. ‒ Accept new package submissions ‒ Accept delete request and add_role request
  • 11. Thank you. Join the conversation, contribute & have a lot of fun! www.opensuse.org
  • 12. 12 Have a Lot of Fun, and Join Us At: www.opensuse.org
  • 13. General Disclaimer This document is not to be construed as a promise by any participating organisation to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. openSUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for openSUSE products remains at the sole discretion of openSUSE. Further, openSUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All openSUSE marks referenced in this presentation are trademarks or registered trademarks of SUSE LLC, in the United States and other countries. All third-party trademarks are the property of their respective owners. License This slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. It can be shared and adapted for any purpose (even commercially) as long as Attribution is given and any derivative work is distributed under the same license. Details can be found at https://creativecommons.org/licenses/by-sa/4.0/ Credits Template Richard Brown rbrown@opensuse.org Design & Inspiration openSUSE Design Team http://opensuse.github.io/branding- guidelines/