Administration methods

The following is a list of methods available for the Administration feature:

  • userAuthenticateSettings
  • userSetPassword
  • setPassword
  • apiKeysGetList
  • apiKeysAddKey
  • apiKeyRemove
  • serverValidateLicense
  • aclSetGroups
  • bootstrapSingleServer

The userAuthenticateSettings Method

Modify current authentication settings, allowing the user to switch between simple and extended authentication and authorization schemes.

Method userAuthenticateSettings definition

<?php
public function userAuthenticateSettings($type, $password, $confirmNewPassword, $ldap = array()) { }
Parameter
Parameter Data Type Default value Required Description
$type string   yes One of : simple, extended
$password string   yes Current user’s password for authentication
$confirmNewPassword string   yes Confirmation of new password
$ldap array   no

Array of ldap properties: host: host, ip or location of the active directory

port: port part of the URL above

encryption:

ssl: use SSL to secure communications

tls: start TLS to secure communications

none: no encryption is used

username: directory username, broken to CN and DC parts for use in querying the active directory

password: matching password for the above username

baseDn: DN broken down to CN and DC parts for using during user authentication

userAuthenticateSettings information

Return value \ZendService\ZendServerAPI\DataTypes\AuthenticationType (AuthenticationType api doc)
Online reference userAuthenticateSettings online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$administration->userAuthenticateSettings("extended", "currentPassword", "newPassword",
    array(
        "host" => "internalldap",
        "port" => 636,
        "encryption" => "ssl",
        "username" => "admin",
        "password" => "currentPassword",
        "baseDn" => "internal"
    )
);

The userSetPassword Method

Modify a specific user password. This action changes any user password and is an administrative action. Note that a separate action exists for the user to modify his own password and has a lower permission level.

Method userSetPassword definition

<?php
public function userSetPassword($username, $password, $newPassword, $confirmNewPassword) { }
Parameter
Parameter Data Type Default value Required Description
$username string   yes

admin (for Administrator)

testuser (for Developer)

$password string   yes Current password
$newPassword string   yes New password
$confirmNewPassword string   yes Confirmation of new password

userSetPassword information

Return value \ZendService\ZendServerAPI\DataTypes\UserInfo (UserInfo api doc)
Online reference userSetPassword online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$administration->userSetPassword("admin", "oldpassword", "newpassword", "newpassword");

The setPassword Method

Modify a current user password.

Method setPassword definition

<?php
public function setPassword($password, $newPassword, $confirmNewPassword) { }
Parameter
Parameter Data Type Default value Required Description
$password string   yes Current password
$newPassword string   yes New password
$confirmNewPassword string   yes Confirmation of new password

setPassword information

Return value \ZendService\ZendServerAPI\DataTypes\UserInfo (UserInfo api doc)
Online reference setPassword online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$administration->setPassword("oldpassword", "newpassword", "newpassword");

The ApiKeysGetList Method

Get a list of api keys.

Method apiKeysGetList definition

<?php
public function apiKeysGetList() { }

apiKeysGetList information

Return value \ZendService\ZendServerAPI\DataTypes\UserInfo (ApiKeys api doc)
Online reference apiKeysGetList online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$apiKeys = $administration->apiKeysGetList();

The apiKeysAddKey Method

Add a WebAPI Key.

Method apiKeysAddKey definition

<?php
public function apiKeysAddKey($name, $username) { }
Parameter
Parameter Data Type Default value Required Description
$name string   yes The name of the key
$username string   yes Any username supplied for retrieving ACL information

apiKeysAddKey information

Return value \ZendService\ZendServerAPI\DataTypes\ApiKeys (ApiKeys api doc)
Online reference apiKeysAddKey online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$apiKeys = $administration->apiKeysAddKey("foo", "admin");

The apiKeysRemoveKey Method

Remove a WebAPI Key.

Method apiKeysRemoveKey definition

<?php
public function apiKeysRemoveKey($ids) { }
Parameter
Parameter Data Type Default value Required Description
$ids array   yes array of api key ids to remove

apiKeysRemoveKey information

Return value \ZendService\ZendServerAPI\DataTypes\ApiKeys (ApiKeys api doc)
Online reference apiKeysRemoveKey online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$apiKeys = $administration->apiKeysRemoveKey(array(5, 6, 7));

The serverValidateLicense Method

Validate a Zend Server license.

Method serverValidateLicense definition

<?php
public function serverValidateLicense($licenseName, $licenseValue) { }
Parameter
Parameter Data Type Default value Required Description
$licenseName string   yes The name of the license
$licenseValue string   yes The value of the license

serverValidateLicense information

Return value \ZendService\ZendServerAPI\DataTypes\LicenseValidated (LicenseValidated api doc)
Online reference serverValidateLicense online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$licenseValidated = $administration->serverValidateLicense("TRIAL-1795-69", "V1Q26G1VUK185031C5ACF7165686C91B");

The serverStoreLicense Method

Stores a Zend Server license.

Method serverStoreLicense definition

<?php
public function serverStoreLicense($licenseName, $licenseValue) { }
Parameter
Parameter Data Type Default value Required Description
$licenseName string   yes The name of the license
$licenseValue string   yes The value of the license

serverStoreLicense information

Return value \ZendService\ZendServerAPI\DataTypes\LicenseValidated (LicenseValidated api doc)
Online reference serverValidateLicense online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$licenseValidated = $administration->serverStoreLicense("TRIAL-1795-69", "V1Q26G1VUK185031C5ACF7165686C91B");

The aclSetGroups Method

Store a set of group mappings for resolving user roles during authentication. These groups correspond to roles within the system or to applications that implicitly grant the developerLimited role to the user.

Method aclSetGroups definition

<?php
public function aclSetGroups($roleGroups, $appGroups = null) { }
Parameter
Parameter Data Type Default value Required Description
$roleGroups array   yes An associative list of role names and their corresponding group.
$appGroups array   no An associative list of application IDs (numbers) and their corresponding group.

aclSetGroups information

Return value \ZendService\ZendServerAPI\DataTypes\LicenseValidated (LicenseValidated api doc)
Online reference aclSetGroups online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$roleGroups = $administration->->aclSetGroups(array("developer" => "bar"));

The bootstrapSingleServer Method

Bootstrap a server for standalone usage in production or development environment. This action is designed to give an automated process the option to bootstrap a server with particular settings. Note that once a server has been bootstrapped, it may not be added passively into a cluster using clusterAddServer. It may still join a cluster using a direct WebAPI -serverAddToCluster, or a UI call. This WebAPI action is explicitly accessible without a WebAPI Key, but only during the bootstrap stage. Unlike the UI bootstrap/launching process, this bootstrap action does not restart Zend Server nor perform any authentication. A WebAPI key with administrative permissions is created as part of the bootstrap process so that you may immediately continue working. It is up to the user to decide what to do with this key once the bootstrap is completed. Read a certain number of log lines from the end of the file log. If serverId is passed, then the request will be performed against that cluster member, otherwise it is performed locally.

Method bootstrapSingleServer definition

<?php
public function bootstrapSingleServer(
        $adminPassword,
        $orderNumber,
        $licenseKey,
        $acceptEula,
        $production = null,
        $applicationUrl = null,
        $adminEmail = null,
        $developerPassword = null
    ) { }
Parameter
Parameter Data Type Default value Required Description
$adminPassword string   yes The new administrator password to store for authentication
$orderNumber string   yes License order number to store in the server’s configuration. This license can be obtained from zend.com
$licenseKey string   yes License key to store in the server’s configuration. This license can be obtained from zend.com
$acceptEula bool   yes Must be set to true to accept ZS6’s EULA
$production bool   no Bootstrap this server using the factory “production” usage profile. Default value: true
$applicationUrl string   no The default application URL to use when displaying and handling deployed application URLs in the UI. Default: empty
$adminEmail string   no The default Email to use when sending notifications about events, audit entries and other features
$developerPassword string   no The new developer user password to be stored for authentication. If no password is supplied, the developer user will not be created

bootstrapSingleServer information

Return value \ZendService\ZendServerAPI\DataTypes\Bootstrap (Bootstrap api doc)
Online reference bootstrapSingleServer online reference
Available in Version
  • 1.3

Example

<?php
use ZendService\ZendServerAPI\Administration;

$administration = new Administration();
$bootstrap = $administration->bootstrapSingleServer("test", "ON", "LC", true);