The geniclient Module

This module implements the client-side of the Geni API. Stubs are provided that convert the supplied parameters to the necessary format and send them via XMLRPC to a Geni Server. TODO: Investigate ways to combine this with existing PLC API?

GeniClient(url, key_file, cert_file) (class) [#]

The GeniClient class provides stubs for executing Geni operations.

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

GeniTransport (class) [#]

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

ServerException (class) [#]

ServerException, ExceptionUnmarshaller Used to convert server exception strings back to an exception.

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

The GeniClient Class

GeniClient(url, key_file, cert_file) (class) [#]

The GeniClient class provides stubs for executing Geni operations. A given client object connects to one server. To connect to multiple servers, create multiple GeniClient objects. The Geni protocol uses an HTTPS connection, and the client's side of the connection uses his private key. Generally, this private key must match the public key that is containing in the GID that the client is providing for those functions that take a GID.

create_gid(cred, name, uuid, pkey_string) [#]

Create a new GID. For MAs and SAs that are physically located on the registry, this allows a owner/operator/PI to create a new GID and have it signed by his respective authority.

cred
credential of caller
name
hrn for new GID
uuid
unique identifier for new GID
pkey_string
public-key string (TODO: why is this a string and not a keypair object?)
Returns:
a GID object

delete_slice(cred) [#]

Delete a slice.

cred
a credential identifying the caller (callerGID) and the slice (objectGID)

get_credential(cred, type, name) [#]

Retrieve a credential for an object. If cred==None, then the behavior reverts to get_self_credential()

cred
credential object specifying rights of the caller
type
type of object (user | slice | sa | ma | node)
name
human readable name of object
Returns:
a credental object

get_gid(name) [#]

Retrieve the GID for an object. This function looks up a record in the registry and returns the GID of the record if it exists. TODO: Is this function needed? It's a shortcut for Resolve()

name
hrn to look up
Returns:
a GID object

get_self_credential(type, name) [#]

Get_self_credential a degenerate version of get_credential used by a client to get his initial credential when he doesn't have one. This is the same as get_credential(..., cred=None,...). The registry ensures that the client is the principal that is named by (type, name) by comparing the public key in the record's GID to the private key used to encrypt the client-side of the HTTPS connection. Thus it is impossible for one principal to retrieve another principal's credential without having the appropriate private key.

type
type of object (user | slice | sa | ma | node
name
human readable name of object
Returns:
a credential object

get_ticket(cred, name, rspec) [#]

Retrieve a ticket. This operation is currently implemented on the registry (see SFA, engineering decisions), and is not implemented on components. The ticket is filled in with information from the PLC database. This information includes resources, and attributes such as user keys and initscripts.

cred
credential object
name
name of the slice to retrieve a ticket for
rspec
resource specification dictionary
Returns:
a ticket object

list(cred) [#]

List the records in an authority. The objectGID in the supplied credential should name the authority that will be listed.

cred
credential object specifying rights of the caller
Returns:
list of record objects

list_slices(cred) [#]

List the slices on a component.

cred
credential object that authorizes the caller
Returns:
a list of slice names

redeem_ticket(ticket) [#]

Redeem a ticket. This operation is currently implemented on the component. The ticket is submitted to the node manager, and the slice is instantiated or updated as appropriate. TODO: This operation should return a sliver credential and indicate whether or not the component will accept only sliver credentials, or will accept both sliver and slice credentials.

ticket
a ticket object containing the ticket

register(cred, record) [#]

Register an object with the registry. In addition to being stored in the Geni database, the appropriate records will also be created in the PLC databases. The geni_info and/or pl_info fields must in the record must be filled out correctly depending on the type of record that is being registered. TODO: The geni_info member of the record should be parsed and the pl_info adjusted as necessary (add/remove users from a slice, etc)

cred
credential object specifying rights of the caller
Returns:
record to register

remove(cred, record) [#]

Remove an object from the registry. If the object represents a PLC object, then the PLC records will also be removed.

cred
credential object specifying rights of the caller
record
record to register. The only relevant fields of the record are 'name' and 'type', which are used to lookup the current copy of the record in the Geni database, to make sure that the appopriate record is removed.

reset_slice(cred) [#]

Reset a slice.

cred
a credential identifying the caller (callerGID) and the slice (objectGID)

resolve(cred, name) [#]

Resolve an object in the registry. A given HRN may have multiple records associated with it, and therefore multiple records may be returned. The caller should check the type fields of the records to find the one that he is interested in.

cred
credential object specifying rights of the caller
name
human readable name of object

start_slice(cred) [#]

Start a slice.

cred
a credential identifying the caller (callerGID) and the slice (objectGID)

stop_slice(cred) [#]

Stop a slice.

cred
a credential identifying the caller (callerGID) and the slice (objectGID)

update(cred, record) [#]

Update an object in the registry. Currently, this only updates the PLC information associated with the record. The Geni fields (name, type, GID) are fixed. The record is expected to have the pl_info field filled in with the data that should be updated. TODO: The geni_info member of the record should be parsed and the pl_info adjusted as necessary (add/remove users from a slice, etc)

cred
credential object specifying rights of the caller
record
a record object to be updated

The GeniTransport Class

GeniTransport (class) [#]

GeniTransport A transport for XMLRPC that works on top of HTTPS

The ServerException Class

ServerException (class) [#]

ServerException, ExceptionUnmarshaller Used to convert server exception strings back to an exception. from usenet, Raghuram Devarakonda