The record Module

Implements support for geni records TODO: Use existing PLC database methods? or keep this separate?

GeniRecord(name=None, gid=None, type=None, pointer=None, dict=None) (class) [#]

The GeniRecord class implements a Geni Record.

For more information about this class, see The GeniRecord Class.

The GeniRecord Class

GeniRecord(name=None, gid=None, type=None, pointer=None, dict=None) (class) [#]

The GeniRecord class implements a Geni Record. A GeniRecord is a tuple (Name, GID, Type, Info). Name specifies the HRN of the object GID is the GID of the object Type is user | sa | ma | slice | component Info is comprised of the following sub-fields pointer = a pointer to the record in the PL database pl_info = planetlab-specific info (when talking to client) geni_info = geni-specific info (when talking to client) The pointer is interpreted depending on the type of the record. For example, if the type=="user", then pointer is assumed to be a person_id that indexes into the persons table. A given HRN may have more than one record, provided that the records are of different types. For example, planetlab.us.arizona may have both an SA and a MA record, but cannot have two SA records.

as_dict() [#]

Return the record in the form of a dictionary

dump(dump_parents=False) [#]

Dump the record to stdout

dump_parents
if true, then the parents of the GID will be dumped

get_field_names() [#]

Returns a list of field names in this record. pl_info, geni_info are not included because they are not part of the record that is stored in the database, but are rather computed values from other entities

get_field_value_string(fieldname) [#]

Given a field name ("name", "gid", ...) return the value of that field.

name
is the name of field to be returned

get_field_value_strings(fieldnames) [#]

Given a list of field names, return a list of values for those fields.

fieldnames
is a list of field names

get_geni_info() [#]

Return the geni_info of the record, or an empty dictionary if none exists

get_gid_object() [#]

Return the GID of the record, in the form of a GID object TODO: not the best name for the function, because we have things called gidObjects in the Cred

get_key() [#]

Return a key that uniquely identifies this record among all records in Geni. This key is used to uniquely identify the record in the Geni database.

get_name() [#]

Return the name (HRN) of the record

get_pl_info() [#]

Return the pl_info of the record, or an empty dictionary if none exists

get_pointer() [#]

Return the pointer of the record. The pointer is an integer that may be used to look up the record in the PLC database. The evaluation of pointer depends on the type of the record

get_type() [#]

Return the type of the record

set_geni_info(geni_info) [#]

Set the geni info the record

geni_info
is a dictionary containing geni info

set_gid(gid) [#]

Set the GID of the record

gid
is a GID object or the string representation of a GID object

set_name(name) [#]

Set the name of the record

name
is a string containing the HRN

set_pl_info(pl_info) [#]

Set the PLC info of the record

pl_info
is a dictionary containing planetlab info

set_pointer(pointer) [#]

Set the pointer of the record

pointer
is an integer containing the ID of a PLC record

set_type(type) [#]

Set the type of the record

type
is a string: user | sa | ma | slice | component