Top Banner
May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer Technologies, Inc.
19

May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Dec 24, 2015

Download

Documents

Elijah Todd
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

May 19-20 l Washington, DC l Omni Shoreham

Extending Plesk Functionality to Control External Web ServicesA SoftLayer API Case Study

Nathan Day

CTO, SoftLayer Technologies, Inc.

Page 2: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Introduction

How to extend the functionality of Plesk for Linuxto talk to an external web service—the SoftLayer API.

1.Plesk Modules Overview

2.SoftLayer API Overview

3.Example: SoftLayer Demo Module

4.Questions

Softlayer—Extending Plesk Functionality to Control External Web Services2

Page 3: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Introduction

A global, on-demand data centerand hosting service provider

The SoftLayer difference:

– Automated Services and Solutions

– Industry-leading Customer Portal and Open API

– Industry’s First Secure Network-within-a-Network Topology

– On-demand Scalability

– Integrated Geographical Diversity

www.SoftLayer.com

Softlayer—Extending Plesk Functionality to Control External Web Services3

Page 4: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Introduction

Long-standing partnership across multiple Parallels product lines

– Gold Partner

– Member of Service Provider Alliance Program

– Sponsor of Parallels Summit

Softlayer—Extending Plesk Functionality to Control External Web Services4

&

Page 5: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Plesk Modules Overview

“The main advantage of Plesk is the opportunity to manage a wide range of functionality from a single control panel. In this sense, integrating additional applications and services with Plesk via the mechanism of modules gains benefit as follows:

– PCP (Plesk Control Panel) provides means for installing/uninstalling modules easily

– Modules integrate with Plesk Language system – Modules integrate with Plesk Help system – Modules use skins provided by Plesk – Plesk provides Modules API specially designed to create Plesk-specific modules – Modules are registered in Plesk, which prevents from casual deletion of 'module’

applications”Plesk 8.3 Modules Development Guide

Softlayer—Extending Plesk Functionality to Control External Web Services5

Page 6: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Plesk Modules

– Consist of Front-end, Back-end, Resource Files, Install scripts, Third-party code

– Controlled by a GUI Using Module Manager

Plesk Modules Overview

Softlayer—Extending Plesk Functionality to Control External Web Services6

Page 7: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

SoftLayer API Web Service

– Used for infrastructure management

▪ Control Servers or Services (DNS, iSCSI, CDN, etc.)

– SOAP or XML-RPC

– Same functionality available as SoftLayer customer portal

– Details available at SoftLayer Developer Network http://www.softlayer.com/devnet.html

Softlayer—Extending Plesk Functionality to Control External Web Services7

Page 8: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

SoftLayer Plesk Module Example

– Server Details

– Bandwidth Graph from Switch Data

– Server Power and Reboot Management

– Accounting

▪ Previous Invoices

▪ Current Balance

– Support Ticket

▪ New

▪ Previous

Softlayer—Extending Plesk Functionality to Control External Web Services8

Page 9: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

How we did it

– Written in PHP

– Built a class extending PHP SOAP Client

– Uses built in Plesk templating

– References built-in Plesk Module API

– Uses built-in Plesk Global Constants

– Created a template file per tab

– Created a controller file per tab

– Stores data in Plesk backend database

Softlayer—Extending Plesk Functionality to Control External Web Services9

Page 10: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

File listing

Softlayer—Extending Plesk Functionality to Control External Web Services10

Page 11: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Code to access SoftLayer API$client = new SoftLayer_API_SoapClient('SoftLayer_Hardware_Server');$objectMask = new SoftLayer_API_ObjectMask();

// General$objectMask->datacenter;$objectMask->serverRoom;$objectMask->provisionDate;$objectMask->lastOperatingSystemReload;

// Hardware Components$objectMask->components->hardwareComponentModel->hardwareGenericComponentModel->hardwareComponentType;$objectMask->hardwareChassis;

//software components$objectMask->softwareComponents->softwareLicense->softwareDescription->drivers;

//network component$objectMask->primaryBackendIpAddress;$objectMask->primaryIpAddress;$objectMask->frontendNetworkComponents->uplinkComponent->networkVlan;$objectMask->frontendNetworkComponents->primarySubnet;$objectMask->frontendNetworkComponents->uplinkComponent->hardware;$objectMask->backendNetworkComponents->uplinkComponent->networkVlan;$objectMask->backendNetworkComponents->primarySubnet;$objectMask->backendNetworkComponents->uplinkComponent->hardware;$objectMask->bandwidthAllocation;

// Billing cycle for bandwidth calculation$objectMask->account->billingInfo;

$client->setObjectMask($objectMask);$server = $client->findByIpAddress($_SERVER['SERVER_ADDR']);

Softlayer—Extending Plesk Functionality to Control External Web Services11

Page 12: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Module Page

Softlayer—Extending Plesk Functionality to Control External Web Services12

Page 13: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

General Tab

Softlayer—Extending Plesk Functionality to Control External Web Services13

Page 14: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

General Tab (continued)

Softlayer—Extending Plesk Functionality to Control External Web Services14

Page 15: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Account Tab

Softlayer—Extending Plesk Functionality to Control External Web Services15

Page 16: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Tickets Tab

Softlayer—Extending Plesk Functionality to Control External Web Services16

Page 17: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Settings Tab

Softlayer—Extending Plesk Functionality to Control External Web Services17

Page 18: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

Conclusion

Plesk functionality can be extendedbeyond the server using the modules subsystem

– Next Steps for SoftLayer

▪ Publish SoftLayer Demo

▪ Encourage/Develop Integration Projects

Softlayer—Extending Plesk Functionality to Control External Web Services18

Page 19: May 19-20 l Washington, DC l Omni Shoreham Extending Plesk Functionality to Control External Web Services A SoftLayer API Case Study Nathan Day CTO, SoftLayer.

References

– Plesk 8.3 Unix Modules Guide

– Plesk 8.3 Unix Modules Reference

– SoftLayer API User’s Guide Wiki, http://sldn.softlayer.com/wiki

– Kevin Laude, SoftLayer API Evangelist, [email protected]

Softlayer—Extending Plesk Functionality to Control External Web Services19