Manage2 API. by: J. Nick Koston

Similar documents
Secure Messaging Server Console... 2

Using Microsoft Windows Authentication for Microsoft SQL Server Connections in Data Archive

Extending Remote Desktop for Large Installations. Distributed Package Installs

Oracle EXAM - 1Z Oracle Weblogic Server 11g: System Administration I. Buy Full Product.

imhosted Web Hosting Knowledge Base

About This Document 3. Integration Overview 4. Prerequisites and Requirements 6

Creating a DUO MFA Service in AWS

Linux VPS with cpanel. Getting Started Guide

Creating Custom Nameservers Contents

Server Account Management

What s New in MySQL 5.7 Security Georgi Joro Kodinov Team Lead MySQL Server General Team

When choosing where to install and run the log analyzer, be aware that it requires access to the following log files:

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

WHM Administrator s Guide

SMT v4.0 Users Guide (Linux version)

Setting Up the Device and Domain Administration

Backup of ESXi Virtual Machines using Affa

Configure Backup Server for Cisco Unified Communications Manager

Matrix Logic WirelessDMS Service 2.0

Configuring MailArchiva with Insight Server

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

Client Code Installation Guide. Client Code: Version 1.3 Date: 8 th January, 2003

How To - Implement Single Sign On Authentication with Active Directory

Solr Bridge Search Installation Guide

Livezilla How to Install on Shared Hosting By: Jon Manning

Create a New Account Contents

SEAGATE BUSINESS NAS ACCESSING THE SHELL. February 1, 2014 by Jeroen Diel IT Nerdbox

Setting up a Scheduled task to upload pupil records to ParentPay

SendMIME Pro Installation & Users Guide

Backing Up TestTrack Native Project Databases

Portals and Hosted Files

WebPanel Manual DRAFT

NovaBACKUP Central Management Console

NAS 253 Introduction to Backup Plan

SSH and Basic Commands

LT Auditor Windows Assessment SP1 Installation & Configuration Guide

Contents Release Notes System Requirements Administering Jive for Office

SYMANTEC BACKUPEXEC2010 WITH StorTrends

Camilyo APS package by Techno Mango Service Provide Deployment Guide Version 1.0

We begin with a number of definitions, and follow through to the conclusion of the installation.

Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5

MIGS Payment Client Installation Guide. EGate User Manual

Oracle Exam 1z0-102 Oracle Weblogic Server 11g: System Administration I Version: 9.0 [ Total Questions: 111 ]

Binary Upgrade Procedure

GestióIP IPAM v3.0 IP address management software Installation Guide v0.1

Administering Jive for Outlook

White Paper BMC Remedy Action Request System Security

BF2CC Daemon Linux Installation Guide

OneLogin Integration User Guide

FTP Accounts Contents

Integrating LANGuardian with Active Directory

SETTING UP REMOTE ACCESS ON EYEMAX PC BASED DVR.

PCI Compliance. by: David Koston

Cloud9 Quick Start Guide for CRG

Installing the ASP.NET VETtrak APIs onto IIS 5 or 6

SchoolBooking SSO Integration Guide

How to Install SMTPSwith Mailer on Centos Server/VPS

VPS Remote Computing. Connecting to a Windows Server for the first time. 1 Your Server has been installed. 2 Finding the login details for your Server

IBM Security Access Manager for Enterprise Single Sign-On V8.2 Implementation Exam.

IceWarp Server. Log Analyzer. Version 10

GeBro-BACKUP. Die Online-Datensicherung. Manual Pro Backup Client on a NAS

Log Analyzer Reference

Setting Up Your Team-SQL Database for ORACLE 8.05

File Transfer Examples. Running commands on other computers and transferring files between computers

/ Preparing to Manage a VMware Environment Page 1

Domain Controller Failover When Using Active Directory

Configuring the BIG-IP LTM v11 for Oracle Database and RAC

Installing a Symantec Backup Exec Agent on a SnapScale Cluster X2 Node or SnapServer DX1 or DX2. Summary

NovaBACKUP xsp Version 15.0 Upgrade Guide

Alert Notification of Critical Results (ANCR) Public Domain Deployment Instructions

Installing LearningBay Enterprise Part 2

WEB BASED Access Control/Time Attendance Software Manual V 1.0

OpenCart AliExpress Affiliate Plugin User Guide

TECHNICAL NOTE SETTING UP A STRM UPDATE SERVER. Configuring your Update Server

Comtrend 1 Port Router Installation Guide CT-5072T

Lab 2 : Basic File Server. Introduction

Host your websites. The process to host a single website is different from having multiple sites.

How to Configure edgebox as a Web Server

Authorize.net modules for oscommerce Online Merchant.

Compiere ERP & CRM Installation Instructions Linux System - EnterpriseDB

Disaster Recovery on the Sun Cobalt RaQ 3 Server Appliance with Third-Party Software

Decision Support System to MODEM communications

Magento Search Extension TECHNICAL DOCUMENTATION

WebsitePanel Installation Guide

How to Setup Auto Recording for MyPBX U100/200/300

<Insert Picture Here> MySQL Security In A Cloudy World

Using Authorize.net for Credit Card Processing in YogaReg

Using Internet or Windows Explorer to Upload Your Site

WEB2CS INSTALLATION GUIDE

Installation Guide of the Change Management API Reference Implementation

Dell SupportAssist Version 2.0 for Dell OpenManage Essentials Quick Start Guide

Indian Standards on DVDs. Installation Manual Version 1.0. Prepared by Everonn Education Ltd

CafePilot has 3 components: the Client, Server and Service Request Monitor (or SRM for short).

Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide

AccuPOS to MAS90/200 Integration Guide

EMR Link Server Interface Installation

EVault for Data Protection Manager. Course 361 Protecting Linux and UNIX with EVault

Transcription:

Manage2 API by: J. Nick Koston Training Seminar 2006

Introduction! Hello, My name is Nick! This presentation is about the Manage2 API.! This also covers basic ideas behind our Manage2 system.! Our Manage2 system is a live system, so changes made on the system have immediate effects. Training Seminar 2006

Main Topics! Basic Manage2 Concepts! Installation of the Manage2 API Package! Basic use of the Manage2 API! Integration of the Manage2 API with your existing systems. Training Seminar 2006

Basic Concepts (Groups)! Groups are added through the Manage2 web interface.! Grouping is at your sole discretion.! By default, your account will have a group by the same as your company name.! Creating additional groups is for convenience.

Basic Concepts (Packages)! Packages are configured on your account by us. These are basically rate plans for a specific type of license. For example:! COMPANY-INTERNAL would be for your standard dedicated server.

Basic Concepts (Packages) COMPANY-EXTERNAL would be for your standard externally sold dedicated server (distributors only). More Samples:! COMPANY-INTERNAL-VPS! COMPANY-INTERNAL-WIN32

Basic Concepts (Packages)! Importance of setting the right package Determines Pricing Type of Server Setting the incorrect package may cause the license to auto expire (vps on non-vps), or be unusable (unix on win32).

Numeric IDs! Numeric IDs For quick access and long term substainability. Knowing the numeric id of an item can save time when working with the API.! Which items have numeric ids Packages Licenses Groups

Obtaining the Manage2 API Package! https://manage2.cpanel.net At the time of this document, the current version was 1.0 The latest version is listed at the top of your manage2 interface when you login. For a quick download, https://manage2.cpanel.net/xmlcpl-1.0.tar.gz

Getting it Up and Running! Prerequisites *nix based system Perl 5.6.2 or later Openssl & Development Libraries Perl Modules! Socket (base)! Carp (base)! Data::Dumper! XML::Simple! LWP::UserAgent! Net::SSLeay

Installation on a Non-cPanel Based Machine! The quickest way to get everything installed, is to first install cpanel's base script package.! cpanel's base script package is designed to operate on most *nix machines without a base cpanel install. Use of these scripts without cpanel is only permitted if you are a cpanel license holder.! In a root shell: cd ~ wget -O - http://httpupdate.cpanel.net/cpanelsync/edge/scripts.tar.bz2 tar -x -f - -j -v -C /

Installation! Installing the Prerequisites /scripts/ensurerpm openssl-devel /scripts/perlinstaller Data::Dumper XML::Simple LWP::UserAgent Net::SSLeay! Simple Install wget -O XMLCPL-1.0.tar.gz https://manage2.cpanel.net/xmlcpl-1.0.tar.gz tar -f XMLCPL-1.0.tar.gz -z -x -v -C /usr/local (cd /usr/local;ln -s XMLCPL-1.0 XMLCPL)

Basic Use! The perl module is called 'cpanellicensing'! By default, we install in /usr/local/xmlcpl! If you'll be running your perl script outside of / usr/local/xmlcpl, you will need to add / usr/local/xmlcpl to the include path as shown: BEGIN { push(@inc,'/usr/local/xmlcpl'); }

Manage2 Security and Sub Accounts! Its not necessary to use your main manage2 account with the API.! You can create a sub-account with less privileges when logged in from your main account.! Sub accounts can be limited to only working with pre configured groups and packages. You can also limit viewing billing data.

The cpanellicensing Object! Constructing the object my $licensemanager = new cpanellicensing (user => 'YOURUSERNAME', pass=> 'YOUR- PASSWORD');! Your Username and Password are the ones you use to access https://manage2.cpanel.net Be sure to login to manage2 from the server that you will be using the API Package on before attempting to connect. You will need to do this so the ip address of the server will be added to the access list.

Methods for Obtaining License Data! fetchlicenses! fetchpackages! fetchgroups! fetchlicenseid

Methods: fetchlicenses! Returns a hash of all active licenses that you have access to.! fetchexpiredlicenses is also available. This method returns the same type of hash, but only shows licenses that are expired.

Methods: fetchgroups! Returns a hash of all groups that you have access to.

Methods: fetchpackages! Returns a hash of all packages that you have access to.

Methods: fetchlicenseid! Takes one argument: a hash with a single key called 'ip' with the ip address of the server to lookup! Returns a scalar with the license id (liscid).! Sample my $liscid = $licensemanager->fetchlicenseid(ip => '127.0.0.1');

Methods for Processing Data! findkey

Methods: findkey! Convenience function! Used for a quick lookup of the packageid or groupid from the hashes returned from fetchpackages & fetchgroups respectively.! Two Arguments: Name to Lookup (scalar) Hash reference (from fetchgroups,fetchpackages)! Sample: $groupid = $licensemanager->findkey('samplegroup',\% GROUPS);

Methods for Manipulating Licenses! activatelicense! expirelicense! reactivatelicense

Methods: activatelicense! Activates a cpanel license on a given IP. OFAC compliance is required! Four Arguments ip: The Ip Address for the license. groupid: The Group Id your wish to add the license under (fetchgroups+findkey) packageid: The Package Id to use. (fetchpackages+findkey) force: Should a new license be added if one already exists? (overwrites discounts)

Methods: activatelicense! Sample: $licensemanager->activatelicense(ip => '69.90.250.18',groupid => 256,packageid => 12,force => 0);! Quick Notes: You can lookup the Package Id, and Group Id every time with the fetchgroups+findkey and fetchpackages+findkey logic, but if you already know their numeric values, adding a license will be a lot faster.

Sample #1: Adding a License #!/usr/bin/perl use cpanellicensing; my $ip = $ARGV[0]; if ($ip!~ /^\d+\.\d+\.\d+\.\d+$/) { print "Usage: $0: <ip>"; } my $licensemanager = new cpanellicensing(user => ' YOU@HOST.COM ', pass => ' YOURPASS '); #It might be prudent to include your username and password from some other file #outside of the web root if you are using this as part of a cgi script. my (%GROUPS) = $licensemanager->fetchgroups(); my (%PACKAGES) = $licensemanager->fetchpackages(); my $groupid = $licensemanager->findkey(' GROUPNAME ',\%GROUPS); my $packageid = $licensemanager->findkey(' PACKAGENAME ',\%PACKAGES); #Here we resolve the predetermined group name and package name to their numeric #equivalents. my $liscid = $licensemanager->activatelicense(ip => $ip, groupid => $groupid, packageid => $packageid, force => 1); print "Added license with id: ${liscid}\n";

Sample #1a: Adding a License with Numeric Ids #!/usr/bin/perl use cpanellicensing; my $ip = $ARGV[0]; if ($ip!~ /^\d+\.\d+\.\d+\.\d+$/) { print "Usage: $0: <ip>"; } my $licensemanager = new cpanellicensing(user => ' YOU@HOST.COM ', pass => ' YOURPASS '); #It might be prudent to include your username and password from some other file #outside of the web root if you are using this as part of a cgi script. my $groupid = 12233; my $packageid = 254; #Here we already known which groupid and packageid to use so we can save some time by #not querying the server. my $liscid = $licensemanager->activatelicense(ip => $ip, groupid => $groupid, packageid => $packageid, force => 1); print "Added license with id: ${liscid}\n";

Methods: expirelicense! Sample: $licensemanager->expirelicense(liscid => 2000,reason => 'Customer switched to cpanel for win32');! Returns a numeric result Any value greater then zero indicated success! Quick Notes: You need to pass this license id (liscid) to this function, and not the ip address. You should use the fetchlicenseid function that we talked about earlier to get this id.

Methods: reactivatelicense! Sample: $licensemanager->reactivatelicense(liscid => 2000);! Returns a numeric result Any value greater then zero indicated success! Quick Notes: You need to pass this license id (liscid) to this function, and not the ip address. You should use the fetchlicenseid function that we talked about earlier to get this id.

Questions? Discussion? Ask away! Training Seminar 2006