geni.urn

Simple library for manipulating URNs, particularly those used for GENI objects

geni.urn.Authority(authorities, name)[source]

Create a new GENI URN with type ‘authority’.

class geni.urn.Base(*args)[source]

Base class representing any URN (RFC 2141).

__init__(*args)[source]

Create a new generic URN

URNs can be initialized in one of two ways:

  1. Passing a single string in URN format (‘urn:NID:NSS‘)
  2. Passing two strings (the NID and the NSS) separately
static isValidNID(s)[source]

Returns True if the string is a valid NID, False if not.

static isValidNSS(s)[source]

Returns True if the string is a valid NSS, False if not.

static isValidURN(s)[source]

Returns True if the string is a valid URN, False if not.

class geni.urn.GENI(*args)[source]

Class representing the URNs used by GENI, which use the publicid NID and IDN (domain name) scheme, then impose some additional strucutre.

static GENIURNType(s)[source]

Returns the type of the object if the URN is a valid GENI URN, or None otherwise.

TYPE_AUTHORITY = 'authority'

Aggregate Managers, Slice Authorities, etc.

TYPE_IMAGE = 'image'

Disk images

TYPE_INTERFACE = 'interface'

Network interfaces

Point-to-point and multipoint links

TYPE_NODE = 'node'

Physical and virtual machines

TYPE_SLICE = 'slice'

Container for allocated resources

TYPE_SLIVER = 'sliver'

Slice of a specific resource

TYPE_USER = 'user'

Principal

__init__(*args)[source]

Create a URN in the format used for GENI objects

There are four forms of this constructor:

  1. Pass a single string in GENI URN format (‘urn:publicid:IDN+auth+type+name‘)
  2. Pass three arguments: the authority (a single string), the type (see the TYPE_ variables in this class), and the object name
  3. Pass three arguments: as #2, but the authorit(ies) are passed as a list, with the top-level authority coming first, followed by any subauthorities
  4. Pass three arguments: as #2, but the authority is a geni.aggregate.core.AM object, and the authority is taken from that object
authorities

Returns a list containing at least one authority string (the top level authority) and possibly additional subauthorities.

authority

Return a single string capturing the entire authority/subauthority chain

static isValidGENIURN(s)[source]

Returns True if the given string is a valid URN in GENI format, False otherwise.

name

Returns the ‘name’ part of a GENI URN.

type

Returns the ‘type’ part of a GENI URN.

geni.urn.Image(authorities, name)[source]

Create a new GENI URN with type ‘image’.

geni.urn.Interface(authorities, name)[source]

Create a new GENI URN with type ‘interface’.

Create a new GENI URN with type ‘link’.

geni.urn.Make(s)[source]

Returns the ‘most specific’ URN object that it can for the given string.

Specifically, returns a GENI URN if the string is in GENI format, or a Base URN if it is not. May throw a MalformedURNError exception if the string is not a valid URN at all.

exception geni.urn.MalformedURNError(val)[source]

Exception indicating that a string is not a proper URN.

geni.urn.Node(authorities, name)[source]

Create a new GENI URN with type ‘node’.

geni.urn.Slice(authorities, name)[source]

Create a new GENI URN with type ‘slice’.

geni.urn.Sliver(authorities, name)[source]

Create a new GENI URN with type ‘sliver’.

geni.urn.User(authorities, name)[source]

Create a new GENI URN with type ‘user’.