This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "phing/Task.php"; | |
/** | |
* Classe de creation d'utilisateur Vmware | |
* | |
*/ | |
class VmwareUserCreate extends Task { | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Instanciation | |
$hostAccountSpec = new Vmware\DataObject\Host\AccountSpec(); | |
// Champs obligatoires | |
$hostAccountSpec->setId('userName'); | |
$hostAccountSpec->setPassword('password'); | |
// Modification de la description | |
$hostAccountSpec->setDescription('other fullName'); | |
// Creation de la requete SOAP | |
$soapMessage = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Creation de la requete SOAP | |
$soapMessage = array( | |
'_this' => new SoapVar($accountManager->{'_'}, XSD_STRING, $accountManager->type), | |
'userName' => 'userName' | |
); | |
// Suppression de l'utilisateur | |
$connection->RemoveUser($soapMessage); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Recuperation du "HostLocalAccountManager " pour pouvoir creer l'utilisateur | |
$accountManager = $serviceContent->returnval->accountManager; | |
// Instanciation | |
$hostAccountSpec = new Vmware\DataObject\Host\AccountSpec(); | |
// Configuration de l'utilisateur | |
$hostAccountSpec->setId('userName'); | |
$hostAccountSpec->setPassword('password'); | |
$hostAccountSpec->setDescription("my delegated admin auto-agent software"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Vmware package. | |
* | |
* (c) Nicolas Fabre <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Recuperation du "UserDirectory" pour effectuer la recherche | |
$userDirectory = $serviceContent->returnval->userDirectory; | |
// Chaine de recherche | |
$searchStr ='r'; | |
// Creation de la requete SOAP | |
$soapMessage = array( | |
'_this' => new SoapVar($userDirectory->{'_'}, XSD_STRING, $userDirectory->type), | |
'domain' => null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
// Recuperation du "SessionManager" afin de pouvoir se logger | |
$sessionManager = $result->returnval->sessionManager; | |
// Creation de la requete SOAP | |
$soapMessage = array( | |
"_this" => new SoapVar($sessionManager->{'_'}, XSD_STRING, $sessionManager->type), | |
"userName" => "login", //ou new SoapVar("login", XSD_STRING,'xsd:string'); | |
"password" => "password" //ou new SoapVar("password", XSD_STRING,'xsd:string'); | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vmware\Soap; | |
/** | |
* @author Nicolas Fabre | |
*/ | |
class Client extends \SoapClient { | |
/** | |
* Performs SOAP request over HTTP. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connection = new SoapClient("https://<ip>/sdk/vimService.wsdl", | |
array( | |
"trace" => 1, | |
"location"=>"https://<ip>/sdk/" | |
) | |
); | |
// Preparation des parametres a passer a la methode | |
$soapMessage = array( | |
"_this" => new SoapVar("ServiceInstance", XSD_STRING, "ServiceInstance") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Exemple {} | |
$object = new Exemple(); | |
$object->attribut1 = 1; | |
$object->attribut2 = 2; | |
$object->attributX = 'x'; | |
var_dump($object); |