6 // the optimization done for nodes was *not* merged here, because of the following bug
8 //root@onelab-private /tmp # api
9 //PlanetLab Central Direct API Access
10 //Type "system.listMethods()" or "help(method)" for more information.
11 //>>> GetSlices({'name':'o*','~expires':0})
12 //Database error 52cfdd40-b57e-43cb-ace0-406d49408527:
15 //SELECT creator_person_id, instantiation, slice_tag_ids, name, slice_id, created, url, max_nodes, person_ids, expires, site_id, peer_slice_id, node_ids, peer_id, description FROM view_slices WHERE is_deleted IS False AND expires > 1175085968 AND (True AND name LIKE 'o%' AND ( NOT expires = 0 ) )
17 //{'api': <PLC.API.PLCAPI instance at 0xb7b466ac>,
19 // 'expires': 1175085968,
21 // 'slice_filter': {'creator_person_id': (<type 'int'>, [<type 'int'>]), 'instantiation': (<type 'str'>, [<type 'str'>]), 'name': (<type 'str'>, [<type 'str'>]), 'slice_id': (<type 'int'>, [<type 'int'>]), 'created': (<type 'int'>, [<type 'int'>]), 'url': (<type 'str'>, [<type 'str'>]), 'max_nodes': (<type 'int'>, [<type 'int'>]), 'expires': (<type 'int'>, [<type 'int'>]), 'site_id': (<type 'int'>, [<type 'int'>]), 'peer_slice_id': (<type 'int'>, [<type 'int'>]), 'peer_id': (<type 'int'>, [<type 'int'>]), 'description': (<type 'str'>, [<type 'str'>])},
22 // 'sql': "SELECT creator_person_id, instantiation, slice_tag_ids, name, slice_id, created, url, max_nodes, person_ids, expires, site_id, peer_slice_id, node_ids, peer_id, description FROM view_slices WHERE is_deleted IS False AND expires > 1175085968 AND (True AND name LIKE 'o%' AND ( NOT expires = 0 ) )"}
23 //Traceback (most recent call last):
24 // File "/usr/bin/plcsh", line 139, in ?
25 // result = eval(command)
26 // File "<string>", line 0, in ?
27 // File "/usr/share/plc_api/PLC/Shell.py", line 51, in __call__
28 // return self.func(*args, **kwds)
29 // File "/usr/share/plc_api/PLC/Method.py", line 105, in __call__
31 //PLCDBError: <Fault 106: 'GetSlices: Database error: Please contact OneLabPrivate Support <support@one-lab.org> and reference 52cfdd40-b57e-43cb-ace0-406d49408527'>
33 // Get session and API handles
34 require_once 'plc_session.php';
35 global $plc, $api, $adm;
38 $arr= $adm->GetSlices( NULL, array( "name" ) );
40 foreach( $arr as $slices ) {
41 $useArr[]= $slices['name'];
45 $input = strtolower( $_GET['input'] );
46 $len = strlen($input);
51 for ( $i=0; $i<count($useArr); $i++ ) {
52 if ( strtolower( substr( $useArr[$i], 0, $len ) ) == $input )
53 $aResults[] = $useArr[$i];
58 header("Content-Type: text/xml");
60 echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>
62 for ( $i=0; $i<count($aResults); $i++ )
63 echo" <rs>". $aResults[$i] ."</rs>";