@@ -27,10 +27,10 @@ the following lines to your composer.json:
2727
2828 {
2929 "require": {
30- "vmwarephp/vmwarephp": "dev-master "
30+ "vmwarephp/vmwarephp": "~0.1@ dev"
3131 }
3232 }
33-
33+
3434** Using Git / GitHub**
3535
3636You can clone the latest development branch from its github repository:
@@ -41,10 +41,10 @@ Usage
4141--------
4242
4343Vmwarephp aims to provide the least boilerplate code possibile for handling vSphere objects. The ESX/vCenter on which
44- the operations are performed is represented by a \Vmwarephp\Vhost object. A Vhost object provides two finder methods to
44+ the operations are performed is represented by a \Vmwarephp\Vhost object. A Vhost object provides two finder methods to
4545obtain server side ManagedObjects. The following example describes a way to collect all virtual machines from a ESX/vCenter
4646with their config status prefetched:
47-
47+
4848 $vhost = new \Vmwarephp\Vhost('vcenter:443', 'Admin', 'password');
4949 $virtualMachines = $vhost->findAllManagedObjects('VirtualMachine', array('configStatus'));
5050
@@ -63,39 +63,33 @@ A managed object can also be found by name:
6363
6464 $vhost = new \Vmwarephp\Vhost('vcenter:443', 'Admin', 'password');
6565 $datastore = $vhost->findManagedObjectByName('VirtualMachine', 'myvmname', array('configStatus'));
66-
66+
6767Managed objects can be a generic managed object represented by \Vmwarephp\ManagedObject or a user defined extension of a
6868managed object defined in Extensions directory. Each managed object depending on its managed object reference type ('VirtualMachine',
69- 'Datastore', etc.) can execute any of methods defined by the vSphere api on that reference type. For example taking a
69+ 'Datastore', etc.) can execute any of methods defined by the vSphere api on that reference type. For example taking a
7070virtual machine snapshot can be as easy as:
7171
7272 $vhost = new \Vmwarephp\Vhost('vcenter:443', 'Admin', 'password');
7373 $virtualMachine = $vhost->findOneManagedObject('VirtualMachine', 'vm-192', array());
7474 $snapshotTask = $virtualMachine->CreateSnapshot_Task(array('name' => 'snapshot_name', 'memory' => false, 'quiesce' => false));
75-
75+
7676or considering that the VirtualMachine managed object type has a built in extension already:
7777
7878 $snapshotTask = $virtualMachine->takeSnapshot(array('name' => 'snapshot_name', 'memory' => false, 'quiesce' => false));
79-
80- All managed object properties are defined as object accessors. You can pre-fetch all accessors when looking for the object or
79+
80+ All managed object properties are defined as object accessors. You can pre-fetch all accessors when looking for the object or
8181you can query an object property on the fly (note that we are not pre-fetching the configStatus property):
8282
8383 $virtualMachine = $vhost->findOneManagedObject('VirtualMachine', 'vm-192', array());
8484 $configStatus = $virtualMachine->configStatus;
85-
85+
8686Or prefetching the configStatus:
87-
87+
8888 $virtualMachine = $vhost->findOneManagedObject('VirtualMachine', 'vm-192', array('configStatus'));
89-
89+
9090As you can see working with managed objects is extremely easy. Each method supported by a managed object on the server side
9191is mapped to a method on \Vmwarephp\ManagedObject or an extension. Properties are exposed as simple accessor methods. All data
9292object properties are also mapped to their respective types. A full list of defined types can be found in TypeDefinitions.inc file.
9393
94- You can write your own extensions by extending the \Vmwarephp\ManagedObject and adding it to Extensions directory.
94+ You can write your own extensions by extending the \Vmwarephp\ManagedObject and adding it to Extensions directory.
9595If you consider the extensions is really useful we can easily integrate it in the main branch. Enjoy!
96-
97-
98-
99-
100-
101-
0 commit comments