File: Zend_Service_Rackspace_Servers.xml

package info (click to toggle)
zendframework 1.12.9%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 133,584 kB
  • sloc: xml: 1,311,829; php: 570,173; sh: 170; makefile: 125; sql: 121
file content (1049 lines) | stat: -rw-r--r-- 46,251 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
<?xml version="1.0" encoding="utf-8"?>
<sect1 id="zend.service.rackspace.servers">
    <title>Zend_Service_Rackspace_Servers</title>

    <sect2 id="zend.service.rackspace.servers.intro">
        <title>Overview</title>

        <para>
            The <classname>Zend_Service_Rackspace_Servers</classname> is a class that provides a
            simple <acronym>API</acronym> to manage the <ulink url="http://www.rackspace.com/cloud/cloud_hosting_products/servers/">Rackspace
                Cloud Servers</ulink>.  Using this class you can:
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    Create new servers
                </para>
            </listitem>

            <listitem>
                <para>
                    List and get information on each server
                </para>
            </listitem>

            <listitem>
                <para>
                    Delete a server
                </para>
            </listitem>
            
            <listitem>
                <para>
                    Manage the public/private IP addresses of a server
                </para>
            </listitem>

            <listitem>
                <para>
                    Resize the server capacity
                </para>
            </listitem>

            <listitem>
                <para>
                    Reboot a server
                </para>
            </listitem>

            <listitem>
                <para>
                    Create new images for a server
                </para>
            </listitem>

            <listitem>
                <para>
                    Manage the backup of a server
                </para>
            </listitem>

            <listitem>
                <para>
                    Create a group of server to share the IP addresses for High Availability architecture
                </para>
            </listitem>
        </itemizedlist> 
    </sect2>

    <sect2 id="zend.service.rackspace.servers.terminology">
        <title>Terminology</title>
        
        <para>
            A <emphasis>server</emphasis> is a virtual machine instance in the Cloud Servers system. Flavor and image are
            requisite elements when creating a server.
        </para>
        
        <para>
            A <emphasis>server</emphasis> is managed using the the class <classname>Zend_Service_Rackspace_Servers_Server</classname>.
        </para>
        
        <para>
            A <emphasis>flavor</emphasis> is an available hardware configuration for a server. Each flavor has a unique
            combination of disk space, memory capacity and priority for CPU time.
        </para>
        
        <para>
            An <emphasis>image</emphasis> is a collection of files used to create or rebuild a server. Rackspace provides a
            number of pre-built OS images by default. You may also create custom images from cloud
            servers you have launched. These custom images are useful for backup purposes or for
            producing “gold” server images if you plan to deploy a particular server configuration
            frequently.
        </para>
        
        <para>
            An <emphasis>image</emphasis> is managed using the the class <classname>Zend_Service_Rackspace_Servers_Image</classname>.
        </para>
        
        <para>
            A <emphasis>backup schedule</emphasis> can be defined to create server images at regular intervals (daily and
            weekly). Backup schedules are configurable per server.
        </para>
        
        <para>
            <emphasis>Public IP addresses</emphasis> can be shared across multiple servers for use in various high availability
            scenarios. When an IP address is shared to another server, the cloud network restrictions
            are modified to allow each server to listen to and respond on that IP address (you may
            optionally specify that the target server network configuration be modified). Shared
            IP addresses can be used with many standard heartbeat facilities (e.g. keepalived) that
            monitor for failure and manage IP failover.
        </para>    
        
        <para>
            A <emphasis>shared IP group</emphasis> is a collection of servers that can share IPs with other members of the
            group. Any server in a group can share one or more public IPs with any other server in the
            group. With the exception of the first server in a shared IP group, servers must be launched
            into shared IP groups. A server may only be a member of one shared IP group.
        </para>    
        
        <para>
            A <emphasis>shared IP group</emphasis> is managed using the the class <classname>Zend_Service_Rackspace_Servers_SharedIpGroup</classname>.
        </para>
    </sect2>
    
    <sect2 id="zend.service.rackspace.servers.quick-start">
        <title>Quick Start</title>
        
        <para>
            To use this class you have to pass the username and the API's key
            of Rackspace in the construction of the class.
        </para>
        
         <programlisting language="php"><![CDATA[
$user = 'username';
$key  = 'secret key';

$rackspace = new Zend_Service_Rackspace_Servers($user,$key);
]]></programlisting>
                
        <para>
            To create a new server you can use the <emphasis>createServer</emphasis> method.
        </para>
        
        <programlisting language="php"><![CDATA[  
$data = array (
    'name'     => 'test',
    'imageId'  => '49',
    'flavorId' => '1',
);

$server= $rackspace->createServer($data);

if (!$rackspace->isSuccessful()) {
    die('ERROR: '.$rackspace->getErrorMsg());
} 

printf("Server name    : %s\n",$server->getName());
printf("Server Id      : %s\n",$server->getId());
printf("Admin password : %s\n",$server->getAdminPass());
]]></programlisting>

        <para>
            This example create a server with name <emphasis>test</emphasis>, imageId 49, and
            flavorId 1. The attributes <emphasis>name</emphasis>, <emphasis>imageId</emphasis> and
            <emphasis>flavorId</emphasis> are required to create a new server.  The result of
            <emphasis>createServer</emphasis> is an instance of
            <classname>Zend_Service_Rackspace_Servers_Server</classname>.
        </para>
        
        <para>
            To get the public and private IP addresses of a server you can use the
            <emphasis>getServerIp</emphasis> method.
        </para>
        
        <programlisting language="php"><![CDATA[
$id  = '20054631';
$ips = $rackspace->getServerIp($id);

if (!$rackspace->isSuccessful()) {
    die('ERROR: '.$rackspace->getErrorMsg());
} 

echo "Private IPs:\n";
print_r($ips['private']);
echo "Public IPs:\n";
print_r($ips['public']);
]]></programlisting>

        <para>
            This example get the IP addresses of the server with Id <emphasis>20054631</emphasis>.
            The result of <emphasis>getServerIp</emphasis> is an associative arrays with keys
            'private' and 'public' contains all the private IP addresses and the public IP addresses
            of the server.
        </para>
        
        <para>
            To get the list of all the available servers you can use the
            <emphasis>listServers</emphasis> method.
        </para>
        
        <programlisting language="php"><![CDATA[           
$servers= $rackspace->listServer(true);

if (!$rackspace->isSuccessful()) {
    die('ERROR: '.$rackspace->getErrorMsg());
} 

foreach ($servers as $srv) {
    printf("Name      : %s\n",$srv->getName());
    printf("Server Id : %s\n",$srv->getId());
    printf("Image  Id : %s\n",$srv->getImageId());
    printf("Flavor Id : %s\n",$srv->getFlavorId());
    printf("Status    : %s (%d\%)\n",$srv->getStatus(),$srv->getProgress());
}
]]></programlisting>
            
    </sect2>
 
    <sect2 id="zend.service.rackspace.servers.methods">
        <title>Available Methods</title>
 
        <variablelist>
            <varlistentry id="zend.service.rackspace.servers.methods.change-backup-schedule">
                <term>
                    <methodsynopsis>
                        <methodname>changeBackupSchedule</methodname>
                        <methodparam>
                            <funcparams>string $id, string $weekly, string $daily</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        This operation creates a new backup schedule or updates an existing backup schedule for
                        the specified server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the ID of the server
                    </para>    
                    <para>
                        <emphasis>$weekly</emphasis>, the day of the week for the backup (for instance "THURSDAY")
                    </para>
                    <para>
                        <emphasis>$daily</emphasis>, specify the hours for the backup (for instance "H_0400_0600")
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.change-server-name">
                <term>
                    <methodsynopsis>
                        <methodname>changeServerName</methodname>
                        <methodparam>
                            <funcparams>string $id, string $name</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Change the name of a server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the ID of the server
                    </para>    
                    <para>
                        <emphasis>$name</emphasis> is an optional parameter that specify the new name of the server
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.change-server-password">
                <term>
                    <methodsynopsis>
                        <methodname>changeServerPassword</methodname>
                        <methodparam>
                            <funcparams>string $id, string $password</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Change the admin password of a server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the ID of the server
                    </para>    
                    <para>
                        <emphasis>$password</emphasis> is an optional parameter that specify the new admin password of the server
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.confirm-resize-server">
                <term>
                    <methodsynopsis>
                        <methodname>confirmResizeServer</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Confirm the resize of a server. During a resize operation, the original server is saved for a period of time to allow roll
                        back if there is a problem. Once the newly resized server is tested and has been confirmed
                        to be functioning properly, use this operation to confirm the resize. After confirmation,
                        the original server is removed and cannot be rolled back to. All resizes are automatically
                        confirmed after 24 hours if they are not explicitly confirmed or reverted.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.create-image">
                <term>
                    <methodsynopsis>
                        <methodname>createImage</methodname>
                        <methodparam>
                            <funcparams>string $serverId,string $name</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Create an image from a server.
                        Return a new instance of <classname>Zend_Service_Rackspace_Servers_Image</classname>.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$serverId</emphasis> is the Id of the server to use to create the image.
                    </para>    
                    <para>
                        <emphasis>$name</emphasis>, is the name of image to create
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.create-shared-ip-group">
                <term>
                    <methodsynopsis>
                        <methodname>createSharedIpGroup</methodname>
                        <methodparam>
                            <funcparams>string $name, string $serverId</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        This operation creates a new shared IP group. Please note, on a create request, the shared IP
                        group can be created empty or can be initially populated with a single server.
                        Return the shared IP group as instance of <classname>Zend_Service_Rackspace_Servers_SharedIpGroup</classname>
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$name</emphasis> is the name of the shared IP group to create.
                    </para>    
                    <para>
                        <emphasis>$serverId</emphasis> is the Id of the server.
                    </para> 
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.create-server">
                <term>
                    <methodsynopsis>
                        <methodname>createServer</methodname>
                        <methodparam>
                            <funcparams>array $data, $metadata=array(),$files=array()</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Create a server with the attributes specified in <emphasis>$data</emphasis>. You can specify also
                        optional parameters: <emphasis>metadata</emphasis> and <emphasis>files</emphasis>.
                        Metadata is an array contains key/value of metadata related to the server and files is an array
                        contains the paths of some files to upload into the server. The syntax used for the uploading
                        of the files is 'serverPath' =&gt; 'localPath'.
                        Return a new instance of <classname>Zend_Service_Rackspace_Servers_Server</classname>.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$data</emphasis> contains the parameters for the server.
                        The required attributes to create a new server are:
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <emphasis>name</emphasis>, contains the name of the server
                                </para>
                            </listitem>
                            <listitem>
                                <para>
                                    <emphasis>flavorId</emphasis>, contains the flavor's Id to use
                                </para>
                            </listitem>
                            <listitem>
                                <para>
                                    <emphasis>imageId</emphasis>, contains the image's Id to use
                                </para>
                            </listitem>
                        </itemizedlist>   
                    </para>    
                    <para>
                        <emphasis>$metadata</emphasis>, contains the array of metadata information
                    </para>
                    <para>
                        <emphasis>$files</emphasis>, contains the path of the files to upload in the server
                        using the syntax 'serverPath' =&gt; 'localPath'.
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.disable-backup-schedule">
                <term>
                    <methodsynopsis>
                        <methodname>disableBackupSchedule</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Disable the backup of a server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.delete-image">
                <term>
                    <methodsynopsis>
                        <methodname>deleteImage</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Delete a image.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the image.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.delete-shared-ip-group">
                <term>
                    <methodsynopsis>
                        <methodname>deleteSharedIpGroup</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Delete a shared IP group.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the shared IP group.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.delete-server">
                <term>
                    <methodsynopsis>
                        <methodname>deleteServer</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Delete a server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-backup-schedule">
                <term>
                    <methodsynopsis>
                        <methodname>getBackupSchedule</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the backup schedule of a server. The return is an associative array with the following values: enabled, weekly, daily.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-flavor">
                <term>
                    <methodsynopsis>
                        <methodname>getFlavor</methodname>
                        <methodparam>
                            <funcparams>string $flavorId</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the information about a flavor. The return is an associative array with the following values: id, ram, disk, name.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$flavorId</emphasis> is the Id of the flavor.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-image">
                <term>
                    <methodsynopsis>
                        <methodname>getImage</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return an image as instance of <classname>Zend_Service_Rackspace_Servers_Image</classname>.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the image.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-shared-ip-group">
                <term>
                    <methodsynopsis>
                        <methodname>getSharedIpGroup</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the shared IP group as instance of <classname>Zend_Service_Rackspace_Servers_SharedIpGroup</classname>
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the Id of the shared IP group.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-server">
                <term>
                    <methodsynopsis>
                        <methodname>getServer</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the server specified by the Id as instance of <classname>Zend_Service_Rackspace_Servers_Server</classname>.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-server-ip">
                <term>
                    <methodsynopsis>
                        <methodname>getServerIp</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the public and private IP addresses of a server.
                        Return an associative array contains the key <emphasis>'public'</emphasis> and <emphasis>'private'</emphasis> for the IP addresses.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-server-private-ip">
                <term>
                    <methodsynopsis>
                        <methodname>getServerPrivateIp</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the private IP addresses of the server.
                        Return an associative array contains the IP addresses.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.get-server-public-ip">
                <term>
                    <methodsynopsis>
                        <methodname>getServerPublicIp</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return the public IP addresses of the server.
                        Return an associative array contains the IP addresses.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.list-flavors">
                <term>
                    <methodsynopsis>
                        <methodname>listFlavors</methodname>
                        <methodparam>
                            <funcparams>boolean $details=false</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return all the available flavors as associative array. 
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        If <emphasis>$details</emphasis> is <emphasis>true</emphasis> return a detailed list, if is <emphasis>false</emphasis> return only the <emphasis>name</emphasis> and the <emphasis>Id</emphasis> of the flavor.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.list-images">
                <term>
                    <methodsynopsis>
                        <methodname>listImages</methodname>
                        <methodparam>
                            <funcparams>boolean $details=false</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return all the available images as instance of <classname>Zend_Service_Rackspace_Servers_ImageList</classname>
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        If <emphasis>$details</emphasis> is <emphasis>true</emphasis> return a detailed list, if is <emphasis>false</emphasis> return only the <emphasis>name</emphasis> and the <emphasis>Id</emphasis> of the Image.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.list-server">
                <term>
                    <methodsynopsis>
                        <methodname>listServer</methodname>
                        <methodparam>
                            <funcparams>boolean $details=false</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return all the available servers with a new instance of <classname>Zend_Service_Rackspace_Servers_ServerList</classname>.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        If <emphasis>$details</emphasis> is <emphasis>true</emphasis> return a detailed list, if is <emphasis>false</emphasis> return only the <emphasis>name</emphasis> and the <emphasis>Id</emphasis> of the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.list-shared-ip-groups">
                <term>
                    <methodsynopsis>
                        <methodname>listSharedIpGroups</methodname>
                        <methodparam>
                            <funcparams>boolean $details=false</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Return all the shared IP groups as instance of <classname>Zend_Service_Rackspace_Servers_SharedIpGroupList</classname>
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        If <emphasis>$details</emphasis> is <emphasis>true</emphasis> return a detailed list, if is <emphasis>false</emphasis> return only the <emphasis>name</emphasis> and the <emphasis>Id</emphasis> of the shared IP group.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.reboot-server">
                <term>
                    <methodsynopsis>
                        <methodname>rebootServer</methodname>
                        <methodparam>
                            <funcparams>string $id, boolean $hard=false</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Reboot a server. 
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>
                    <para>
                        If <emphasis>$hard</emphasis> is <emphasis>false</emphasis> (default) the server is rebooted in soft mode. 
                        That means the operating system is signaled to restart, which allows for a graceful shutdown of
                        all processes. If <emphasis>$hard</emphasis> is <emphasis>true</emphasis> the server is rebooted in hard mode.
                        A hard reboot is the equivalent of power cycling the server.
                    </para>    
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.rebuild-server">
                <term>
                    <methodsynopsis>
                        <methodname>rebuildServer</methodname>
                        <methodparam>
                            <funcparams>string $id, string $imageId</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Rebuild a server. The rebuild function removes all data on the server and replaces it with the specified image,
                        server's Id and IP addresses will remain the same.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>
                    <para>
                        <emphasis>$imageId</emphasis> is the new Image Id of the server.
                    </para>  
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.resize-server">
                <term>
                    <methodsynopsis>
                        <methodname>resizeServer</methodname>
                        <methodparam>
                            <funcparams>string $id, string $flavorId</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Resize a server. The resize function converts an existing server to a different flavor, in essence, scaling the
                        server up or down. The original server is saved for a period of time to allow rollback if there
                        is a problem. All resizes should be tested and explicitly confirmed, at which time the original
                        server is removed. All resizes are automatically confirmed after 24 hours if they are not
                        explicitly confirmed or reverted.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>
                    <para>
                        <emphasis>$flavorId</emphasis> is the new flavor Id of the server.
                    </para>  
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.revert-resize-server">
                <term>
                    <methodsynopsis>
                        <methodname>revertResizeServer</methodname>
                        <methodparam>
                            <funcparams>string $id</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Revert the resize of a server. During a resize operation, the original server is saved for a period of time to allow for roll
                        back if there is a problem. If you determine there is a problem with a newly resized server,
                        use this operation to revert the resize and roll back to the original server. All resizes are
                        automatically confirmed after 24 hours if they have not already been confirmed explicitly or
                        reverted.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para>
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.share-ip-address">
                <term>
                    <methodsynopsis>
                        <methodname>shareIpAddress</methodname>
                        <methodparam>
                            <funcparams>string $id, string $ip, string $groupId, boolean $configure=true</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Share an IP address for a server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para> 
                    <para>
                        <emphasis>$ip</emphasis> is the IP address to share.
                    </para> 
                    <para>
                        <emphasis>$groupId</emphasis> is the group Id to use.
                    </para> 
                    <para>
                        If <emphasis>$configure</emphasis> attribute is set to true, the server is configured
                        with the new address, though the address is not enabled. Note that configuring the server
                        does require a reboot.
                    </para>     
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.unshare-ip-address">
                <term>
                    <methodsynopsis>
                        <methodname>unshareIpAddress</methodname>
                        <methodparam>
                            <funcparams>string $id, string $ip</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Unshare an IP address for a server.
                        Return <emphasis>true</emphasis> in case of success, <emphasis>false</emphasis> in case of error.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is Id of the server.
                    </para> 
                    <para>
                        <emphasis>$ip</emphasis> is the IP address to share.
                    </para> 
                </listitem>
            </varlistentry>
            
            <varlistentry id="zend.service.rackspace.servers.methods.update-server">
                <term>
                    <methodsynopsis>
                        <methodname>updateServer</methodname>
                        <methodparam>
                            <funcparams>string $id,string $name=null,string $password=null</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>
                
                <listitem>
                    <para>
                        Change the name or/and the admin password of a server.
                        In case of error the return is <emphasis>false</emphasis>.
                    </para>
                    <para>
                        <emphasis>$id</emphasis> is the ID of the server
                    </para>    
                    <para>
                        <emphasis>$name</emphasis> is an optional parameter that specify the new name of the server
                    </para>
                    <para>
                        <emphasis>$password</emphasis> is an optional parameter that specify the new admin password of the server
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </sect2>
 
    <sect2 id="zend.service.rackspace.servers.examples">
        <title>Examples</title>
 
        <example id="zend.service.rackspace.servers.examples.authenticate">
            <title>Authenticate</title>
 
            <para>Check if the username and the key are valid for the Rackspace authentication.</para>
 
            <programlisting language="php"><![CDATA[
$user = 'username';
$key  = 'secret key';

$rackspace = new Zend_Service_Rackspace_Servers($user,$key);

if ($rackspace->authenticate()) {
    printf("Authenticated with token: %s",$rackspace->getToken());
} else {
    printf("ERROR: %s",$rackspace->getErrorMsg());
}
]]></programlisting>
        </example>
        
        <example id="zend.service.rackspace.servers.examples.create-server">
            <title>Create a server with metadata information and upload of a file</title>
            
            <para>
                Create a server with some metadata information and upload the file <emphasis>build.sh</emphasis>
                from the local path <emphasis>/home/user</emphasis> to the remote path <emphasis>/root</emphasis>.
             </para>   
 
            <programlisting language="php"><![CDATA[
$data = array (
    'name'     => 'test',
    'imageId'  => '49',
    'flavorId' => '1',
);
$metadata = array (
    'foo' => 'bar',
);
$files = array (   
    '/root/build.sh' => '/home/user/build.sh',
);
$server= $rackspace->createServer($data,$metadata,$files);

if (!$rackspace->isSuccessful()) {
    die('ERROR: '.$rackspace->getErrorMsg());
} 

$publicIp= $server->getPublicIp();

printf("Server name    : %s\n",$server->getName());
printf("Server Id      : %s\n",$server->getId());
printf("Public IP      : %s\n",$publicIp[0]);
printf("Admin password : %s\n",$server->getAdminPass());
]]></programlisting>
        </example>
        
        <example id="zend.service.rackspace.servers.examples.reboot-server">
            <title>Reboot a server</title>
            
            <para>
                Reboot a server in hard mode (is the equivalent of power cycling the server).
             </para>   
 
            <programlisting language="php"><![CDATA[
$flavors= $rackspace->rebootServer('server id',true)

if (!$rackspace->isSuccessful()) {
    die('ERROR: '.$rackspace->getErrorMsg());
} 

echo "The server has been rebooted successfully";
]]></programlisting>
        </example>

        <example id="zend.service.rackspace.servers.examples.list-flavors">
            <title>List all the available flavors</title>
 
            <para>
                List all the available flavors with all the detailed information.
             </para>   
 
            <programlisting language="php"><![CDATA[
$flavors= $rackspace->listFlavors(true);

if (!$rackspace->isSuccessful()) {
    die('ERROR: '.$rackspace->getErrorMsg());
} 

print_r($flavors);
]]></programlisting>
        </example>
    </sect2>
</sect1>