1 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4 <meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5 <title>The record Module</title>
8 <h1>The record Module</h1>
9 <p>Implements support for geni records
11 TODO: Use existing PLC database methods? or keep this separate?</p>
13 <dt><b>GeniRecord(name=None, gid=None, type=None, pointer=None, dict=None)</b> (class) [<a href='#record.GeniRecord-class'>#</a>]</dt>
15 <p>The GeniRecord class implements a Geni Record.</p>
16 <p>For more information about this class, see <a href='#record.GeniRecord-class'><i>The GeniRecord Class</i></a>.</p>
19 <h2><a id='record.GeniRecord-class' name='record.GeniRecord-class'>The GeniRecord Class</a></h2>
21 <dt><b>GeniRecord(name=None, gid=None, type=None, pointer=None, dict=None)</b> (class) [<a href='#record.GeniRecord-class'>#</a>]</dt>
23 <p>The GeniRecord class implements a Geni Record. A GeniRecord is a tuple
24 (Name, GID, Type, Info).
26 Name specifies the HRN of the object
27 GID is the GID of the object
28 Type is user | sa | ma | slice | component
30 Info is comprised of the following sub-fields
31 pointer = a pointer to the record in the PL database
32 pl_info = planetlab-specific info (when talking to client)
33 geni_info = geni-specific info (when talking to client)
35 The pointer is interpreted depending on the type of the record. For example,
36 if the type=="user", then pointer is assumed to be a person_id that indexes
37 into the persons table.
39 A given HRN may have more than one record, provided that the records are
40 of different types. For example, planetlab.us.arizona may have both an SA
41 and a MA record, but cannot have two SA records.</p>
43 <dt><a id='record.GeniRecord.as_dict-method' name='record.GeniRecord.as_dict-method'><b>as_dict()</b></a> [<a href='#record.GeniRecord.as_dict-method'>#</a>]</dt>
45 <p>Return the record in the form of a dictionary</p>
47 <dt><a id='record.GeniRecord.dump-method' name='record.GeniRecord.dump-method'><b>dump(dump_parents=False)</b></a> [<a href='#record.GeniRecord.dump-method'>#</a>]</dt>
49 <p>Dump the record to stdout</p>
51 <dt><i>dump_parents</i></dt>
53 if true, then the parents of the GID will be dumped</dd>
56 <dt><a id='record.GeniRecord.get_field_names-method' name='record.GeniRecord.get_field_names-method'><b>get_field_names()</b></a> [<a href='#record.GeniRecord.get_field_names-method'>#</a>]</dt>
58 <p>Returns a list of field names in this record. pl_info, geni_info are not
59 included because they are not part of the record that is stored in the
60 database, but are rather computed values from other entities</p>
62 <dt><a id='record.GeniRecord.get_field_value_string-method' name='record.GeniRecord.get_field_value_string-method'><b>get_field_value_string(fieldname)</b></a> [<a href='#record.GeniRecord.get_field_value_string-method'>#</a>]</dt>
64 <p>Given a field name ("name", "gid", ...) return the value of that field.</p>
68 is the name of field to be returned</dd>
71 <dt><a id='record.GeniRecord.get_field_value_strings-method' name='record.GeniRecord.get_field_value_strings-method'><b>get_field_value_strings(fieldnames)</b></a> [<a href='#record.GeniRecord.get_field_value_strings-method'>#</a>]</dt>
73 <p>Given a list of field names, return a list of values for those fields.</p>
75 <dt><i>fieldnames</i></dt>
77 is a list of field names</dd>
80 <dt><a id='record.GeniRecord.get_geni_info-method' name='record.GeniRecord.get_geni_info-method'><b>get_geni_info()</b></a> [<a href='#record.GeniRecord.get_geni_info-method'>#</a>]</dt>
82 <p>Return the geni_info of the record, or an empty dictionary if none exists</p>
84 <dt><a id='record.GeniRecord.get_gid_object-method' name='record.GeniRecord.get_gid_object-method'><b>get_gid_object()</b></a> [<a href='#record.GeniRecord.get_gid_object-method'>#</a>]</dt>
86 <p>Return the GID of the record, in the form of a GID object
87 TODO: not the best name for the function, because we have things called
88 gidObjects in the Cred</p>
90 <dt><a id='record.GeniRecord.get_key-method' name='record.GeniRecord.get_key-method'><b>get_key()</b></a> [<a href='#record.GeniRecord.get_key-method'>#</a>]</dt>
92 <p>Return a key that uniquely identifies this record among all records in
93 Geni. This key is used to uniquely identify the record in the Geni
96 <dt><a id='record.GeniRecord.get_name-method' name='record.GeniRecord.get_name-method'><b>get_name()</b></a> [<a href='#record.GeniRecord.get_name-method'>#</a>]</dt>
98 <p>Return the name (HRN) of the record</p>
100 <dt><a id='record.GeniRecord.get_pl_info-method' name='record.GeniRecord.get_pl_info-method'><b>get_pl_info()</b></a> [<a href='#record.GeniRecord.get_pl_info-method'>#</a>]</dt>
102 <p>Return the pl_info of the record, or an empty dictionary if none exists</p>
104 <dt><a id='record.GeniRecord.get_pointer-method' name='record.GeniRecord.get_pointer-method'><b>get_pointer()</b></a> [<a href='#record.GeniRecord.get_pointer-method'>#</a>]</dt>
106 <p>Return the pointer of the record. The pointer is an integer that may be
107 used to look up the record in the PLC database. The evaluation of pointer
108 depends on the type of the record</p>
110 <dt><a id='record.GeniRecord.get_type-method' name='record.GeniRecord.get_type-method'><b>get_type()</b></a> [<a href='#record.GeniRecord.get_type-method'>#</a>]</dt>
112 <p>Return the type of the record</p>
114 <dt><a id='record.GeniRecord.set_geni_info-method' name='record.GeniRecord.set_geni_info-method'><b>set_geni_info(geni_info)</b></a> [<a href='#record.GeniRecord.set_geni_info-method'>#</a>]</dt>
116 <p>Set the geni info the record</p>
118 <dt><i>geni_info</i></dt>
120 is a dictionary containing geni info</dd>
123 <dt><a id='record.GeniRecord.set_gid-method' name='record.GeniRecord.set_gid-method'><b>set_gid(gid)</b></a> [<a href='#record.GeniRecord.set_gid-method'>#</a>]</dt>
125 <p>Set the GID of the record</p>
129 is a GID object or the string representation of a GID object</dd>
132 <dt><a id='record.GeniRecord.set_name-method' name='record.GeniRecord.set_name-method'><b>set_name(name)</b></a> [<a href='#record.GeniRecord.set_name-method'>#</a>]</dt>
134 <p>Set the name of the record</p>
138 is a string containing the HRN</dd>
141 <dt><a id='record.GeniRecord.set_pl_info-method' name='record.GeniRecord.set_pl_info-method'><b>set_pl_info(pl_info)</b></a> [<a href='#record.GeniRecord.set_pl_info-method'>#</a>]</dt>
143 <p>Set the PLC info of the record</p>
145 <dt><i>pl_info</i></dt>
147 is a dictionary containing planetlab info</dd>
150 <dt><a id='record.GeniRecord.set_pointer-method' name='record.GeniRecord.set_pointer-method'><b>set_pointer(pointer)</b></a> [<a href='#record.GeniRecord.set_pointer-method'>#</a>]</dt>
152 <p>Set the pointer of the record</p>
154 <dt><i>pointer</i></dt>
156 is an integer containing the ID of a PLC record</dd>
159 <dt><a id='record.GeniRecord.set_type-method' name='record.GeniRecord.set_type-method'><b>set_type(type)</b></a> [<a href='#record.GeniRecord.set_type-method'>#</a>]</dt>
161 <p>Set the type of the record</p>
165 is a string: user | sa | ma | slice | component</dd>