Package DE_EPAGES::FlexVirtuozzoProvider::API::Parallels
Provides web access to a Parallels Hardware Node to clone and configure a Container
Functions
- CreateContainer
- CreateContainerShop
- GetContainerInfo
- GetNextContainerID
- UpdateContainer
CreateContainer
Establish a SSH connection to the specified HardwareNode (HM)
On the HN some files for cloning and configuring a Container are created ans executed
Some parameters are read fro config files located in $ENV{'EPAGES_CONFIG'}/Flex
Syntax |
$ContainerID = CreateContainer($HNParams,$hCTParams);
$ContainerID = CreateContainer({
HNScriptDir => '~/scripts'
HNIPOrName => '',
HNID => 'HN1' ,
SSHLogin => 'root',
SSHPassword => 'qwert6',
SSHIdentity => '/keys/pub.key',
SSHThisHost => 'mytesthost',
SSHThisUser => 'testuser',
},
{
Provider => 'Distributor',
WebServicePassword => 'wsadmin'
ContainerHostName => 'CentOS.intern.epages.de'
ContainerIP => '172.20.128.111'
ContainerID => '999'
ContainerLogin => 'root',
ContainerPassword => 'qwert6',
ContainerType => 'MerchantPro',
SourceContainerID => '1000',
ContainerNoDNSEntry => 1,
});
|
Input |
- $Shop (object)
- shop object
- $hHNParams (ref.hash)
- HardwareNode parameters
- HNScriptDir - (optional) - scripts are written to this dir - string
- HNID (optional if HNIPOrName) - HardwareNode ID - string
- HNIPOrName (optional if HNID) - (better use HNID) HardwareNode name or ip adress - string
- SSHIdentity (optional) - ssh identity file - string
- SSHThisHost (optional) - the name of this host - string
- SSHThisUser (optional) - the current user of this host - string
- SSHLogin (optional) - ssh server login - string
- SSHPassword (optional) - ssh server password - string
- $hCTParams (ref.hash)
- Container parameters
- Provider (optional) - new Container was assigned to this provider - string
- WebServicePassword (optional) - the WebService password for the Store - string
- ContainerHostName - Hostname for new Container - string
- ContainerIP - IP Address for new Container - string
- ContainerID (optional) - VZ container ID for new Container (was generated if not given) - int
- ContainerLogin - login for new container - string
- ContainerPassword - password for new Container - string
- ContainerType (optional) - Type for new Container - string
- SourceContainerID (optional) - the template Container ID - int
- ContainerNoDNSEntry (optional) - the container has no DNS entry yet - int
|
Return |
- $ContainerID (int)
- container id of the new container
|
CreateContainerShop
Establish a SSH connection to the specified HardwareNode (HM)
On the HN some some imformations abozt the container was collected
If epages is running on the container, the cartidges are syncronized with the
site database and a shop with the given params was created with a webservice request
Syntax |
$result = CreateContainerShop($hHNParams,$hCTParams,$hShopParams);
CreateContainerShop({
HNIPOrName => '',
HNID => 'HN1' ,
SSHLogin => 'root',
SSHPassword => 'qwert6',
},
{
ContainerID => '999',
ContainerNoDNSEntry => '1',
},
{
WSUser => '/Providers/Distributor/Users/admin',
WSPassword => 'admin',
ShopType => 'Demo',
Alias => 'TestShop',
});
|
Input |
- $hHNParams (ref.hash)
- HardwareNode parameters
- HNIPOrName (optional if HNID) - HardwareNode name or ip adress - string
- HNID (optional if HNIPOrName) - HardwareNode ID - string
- SSHIdentity (optional) - ssh identity file - string
- SSHThisHost (optional) - the name of this host - string
- SSHThisUser (optional) - the current user of this host - string
- SSHLogin (optional) - ssh server login - string
- SSHPassword (optional) - ssh server password - string
- $hCTParams (ref.hash)
- Container parameters
- ContainerHostName (optional if ContainerID ) - Hostname for Container - string
- ContainerID (optional if ContainerHostName ) - VZ container ID for Container - int
- ContainerNoDNSEntry (optional default:0) - the container has no DNS entry yet - int
- $hShopParams (ref.hash)
- Shop parameters
- WSUser (optional) - site web service user path - string
- WSPassword (optional) - site web service user password - int
- ShopType - shoptype alias - int
- Alias - uniques shop alias for the provider - int
- ShopAlias (optional) - shop alias in store database - string
- DomainName (optional) - vainty domain name ot the shop - string
- HasSSLCertificate (optional) - the domain specified by -domainname is SSL-enabled - boolean
- WebServerScriptNamePart (optional) - web server script name part - string
- IsTrialShop (optional) - the shop is in trial period - boolean
- IsInternalTestShop (optional) - the shop is used for test or support purposes - boolean
- IsClosed (optional) - created shop is closed - boolean
- ImportFiles (optional) - files to import - string
- PublicFilesDir (optional) - directory with public files, e.g. images - string
- MerchantLogin (optional) - merchant login - string
- MerchantPassword (optional) - merchant password - string
- MerchantEMail (optional) - merchant email address - string
|
GetContainerInfo
Establish a SSH connection to the specified HardwareNode (HM)
On the HN some some imformations about the container and the
epages installation was collected
the hash ref hEpagesParams was filled
some parameters of the hash hCTParams are added and completed
Syntax |
$result = GetContainerInfo($hHNParams,$hCTParams,$hEpagesParams);
GetContainerInfo({
HNIPOrName => '',
HNID => 'HN1' ,
SSHLogin => 'root',
SSHPassword => 'qwert6',
},
{
ContainerID => '999'
},
{ });
|
Input |
- $hHNParams (ref.hash)
- HardwareNode parameters
- HNScriptDir - (optional) - scripts are written to this dir - string
- HNIPOrName (optional if HNID) - HardwareNode name or ip adress - string
- HNID (optional if HNIPOrName) - HardwareNode ID - string
- SSHIdentity (optional) - ssh identity file - string
- SSHThisHost (optional) - the name of this host - string
- SSHThisUser (optional) - the current user of this host - string
- SSHLogin (optional) - ssh server login - string
- SSHPassword (optional) - ssh server password - string
- $hCTParams (ref.hash)
- Container parameters
- ContainerHostName (out and optional if ContainerID ) - Hostname for Container - string
- ContainerID (out and optional if ContainerHostName ) - VZ container ID for Container - int
- Exists (out) - VZ container exists - int
- Status (out) - VZ container status - string
- Nproc (out) - VZ container running program count - int
- ContainerIP (out) - VZ container ip address - string
|
Output |
- $hEpagesParams (ref.hash)
- epages parameters
- AppServerCount (out) - number of running appserver processes - int
- RRouterCount (out) - number of running request router processes - int
- WebServerCount (out) - number of running webserver processes - int
- Service (out) - number of running appserver processes - int
- configured (out) - the epages configuration process was ok - int
|
GetNextContainerID
Establish a SSH connection to the specified HardwareNode (HM)
and get a new free container id for create a new container
Syntax |
$result = GetNextContainerID($hHNParamsGetNextContainerID);
UpdateContainer({
HNIPOrName => '',
HNID => 'HN1' ,
SSHLogin => 'root',
SSHPassword => 'qwert6',
}
|
Input |
- $hHNParams (ref.hash)
- HardwareNode parameters
- HNScriptDir - (optional) - scripts are written to this dir - string
- HNIPOrName (optional if HNID) - HardwareNode name or ip adress - string
- HNID (optional if HNIPOrName) - HardwareNode ID - string
- SSHIdentity (optional) - ssh identity file - string
- SSHThisHost (optional) - the name of this host - string
- SSHThisUser (optional) - the current user of this host - string
- SSHLogin (optional) - ssh server login - string
- SSHPassword (optional) - ssh server password - string
|
Return |
- $ContainerID (int)
- next free container id
|
UpdateContainer
Establish a SSH connection to the specified HardwareNode (HM)
and update parameters for the container like cpu usuage
disk and memory params
epages parameters are also changed like maxmemory, appservercount
The parameters are specified in the config file for the container
in the section <$ContainerType>_VZ and <$ContainerType>_EPAGES
Syntax |
$result = UpdateContainer($hHNParams,hCTParams,$ContainerType);
UpdateContainer({
HNIPOrName => '',
HNID => 'HN1' ,
SSHLogin => 'root',
SSHPassword => 'qwert6',
},
{
ContainerID => '999'
},
'MerchantProPlus'
|
Input |
- $hHNParams (ref.hash)
- HardwareNode parameters
- HNScriptDir - (optional) - scripts are written to this dir - string
- HNIPOrName (optional if HNID) - HardwareNode name or ip adress - string
- HNID (optional if HNIPOrName) - HardwareNode ID - string
- SSHIdentity (optional) - ssh identity file - string
- SSHThisHost (optional) - the name of this host - string
- SSHThisUser (optional) - the current user of this host - string
- SSHLogin (optional) - ssh server login - string
- SSHPassword (optional) - ssh server password - string
- $hCTParams (ref.hash)
- Container parameters
- ContainerHostName (optional if ContainerID ) - Hostname for Container - string
- ContainerID (optional if ContainerHostName ) - VZ container ID for Container - int
- $ContainerType (string)
- the container type to apply on the container
|