Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Use OpenStack with Zend Framework 2

Use OpenStack with Zend Framework 2

OpenStack is becoming the open source standard for cloud computing. Most of the cloud vendors use OpenStack and the community of users is growing every day. In this talk we will give a brief introduction to OpenStack and we will present the new library service for Zend Framework 2 that supports the last version of the OpenStack API. You will see how is easy to use the OpenStack API with ZF2 thanks to a friendly object oriented interface.
This talk has been presented at ZendCon 2013 in Santa Clara (California).

Enrico Zimuel

October 09, 2013
Tweet

More Decks by Enrico Zimuel

Other Decks in Programming

Transcript

  1. 2 About me • Enrico Zimuel (@ezimuel) • Software Engineer

    since 1996 • PHP Engineer at Zend Technologies in the Zend Framework and Apigility Team • International speaker, author of books and technical articles • I was a Researcher programmer at Informatics Institute of University of Amsterdam • Co-founder of PUG Torino (Italy)
  2. OpenStack • OpenStack is an open source cloud computing platform

    for public and private clouds • The goal is to enable any organization to create and offer cloud computing services running on standard hardware • Founded by Rackspace Hosting and NASA • http://www.openstack.org/
  3. OpenStack API • Identity Service (v. 2, 3) • Compute

    and Extensions (v. 2) • Image Service (v. 1, 2) • Block Storage Service (v. 2) • Networking (v. 2) • Object Storage (v. 1) • Orchestration (v. 1)
  4. Do you want to try OpenStack? • http://www.trystack.org • A

    set up of clusters running OpenStack on both x86 and ARM architectures • It's totally free for you to try & test your apps
  5. 11 Status of the project • ZendService\OpenStack is a PHP

    library to use the API of OpenStack in a OO fashion way • The project started in Feb 2013 • It's 100% compatible with the API specifications of OpenStack • It uses the ZendService\Api component to interact with the HTTP API call https://github.com/zendframework/ZendService_Api
  6. 12 Specification • Right now we support the following API:

    – BlockStorage – Compute – Identity – ObjectStorage • We are going to release these others soon: – Networking – Image
  7. 13 Installation • Using composer: "require": { "zendframework/zendservice­openstack": "dev­master" }

    • Or from github (download or fork) https://github.com/zendframework/ZendService_OpenStack – curl ­s https://getcomposer.org/installer | php – php composer.phar install
  8. Identity API – Auth and Token • authenticate($name, $password, $tenantName

    = null) • autenticateByKey($name, $key) • validateToken($token, $belongsTo = null) • checkToken($token, $belongsTo = null) • listEndpointsToken($token, $belongsTo = null)
  9. 16 Identity API – User and Tenant • listUsers() •

    addUser(array $user) • updateUser(array $user) • deleteUser($id) • listGlobalRoles($id, $serviceId = null) • addTenant(array $tenant) • updateTenant(array $tenant) • deleteTenant($id)
  10. ObjectStorage API - containers • listContainers(array $options = array()) •

    createContainer($name, $metadata = array()) • deleteContainer($name) • getContainerMetadata($container) • setContainerMetadata($container, array $metadata) • deleteContainerMetadata($container, array $metadata)
  11. ObjectStorage API - objects • listObjects($container, $options= array()) • getObject($container,

    $object) • setObject($container, $object, $content, $metadata = array(), $expire = null) • deleteObject($container, $object) • copyObject($containerFrom, $objectFrom, $containerTo, $objectTo) • setObjectMetadata($container, $object, array $metadata) • getObjectMetadata($container, $object)
  12. Compute API - servers • listServers(array $options = array(), $details

    = false) • createServer(array $options) • getServer($id) • updateServer($id, array $options) • deleteServer($id) • listAddresses($id) • listAddressesByNetwork($id, $network)
  13. Compute API – server actions • changeAdminPass($id, $password) • rebootServer($id,

    $soft = true) • rebuildServer($id, array $options) • resizeServer($id, $flavorRef) • confirmResizeServer($id) • revertResizeServer($id)
  14. Compute API – flavor and image • createImage($id, array $options)

    • listFlavors(array $options = array(), $details = false) • getFlavor($id) • listImages(array $options = array(), $details = false) • getImage($id) • deleteImage($id)
  15. Compute API – metadata • listServerMetadata($id) • listImageMetadata($id) • setServerMetadata($id,

    array $metadata) • setImageMetadata($id, array $metadata) • updateServerMetadata($id, array $metadata) • updateImageMetadata($id, array $metadata) • getServerMetadataItem($id, $key) • getImageMetadataItem($id, $key) • setServerMetadataItem($id, $key, $value = '') • setImageMetadataItem($id, $key, $value = '') • deleteServerMetadataItem($id, $key) • deleteImageMetadataItem($id, $key)
  16. 29 Under the hood • We use ZendService\Api library to

    consume the OpenStack API • Simple PHP configuration file to build HTTP request. For instance: https://github.com/zendframework/ZendService_OpenSta ck/blob/master/library/ZendService/OpenStack/api/ide ntity/authenticate.php
  17. 30 Future works • Complete the Networking and Image services

    • Support API versioning (?) • Documentation! Do you want to contribute? Fork the project on github and contact me!