# geni.urn¶

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

Authority(authorities, name)[source]

Create a new GENI URN with type ‘authority’.

class 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
__repr__()

x.__str__() <==> str(x)

__str__() <==> str(x)[source]
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(*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

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.

Image(authorities, name, version=None)[source]

Create a new GENI URN with type ‘image’.

Interface(authorities, name)[source]

Create a new GENI URN with type ‘interface’.

Create a new GENI URN with type ‘link’.

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 MalformedURNError(val)[source]

Exception indicating that a string is not a proper URN.

__init__(val)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

__str__() <==> str(x)[source]
Node(authorities, name)[source]

Create a new GENI URN with type ‘node’.

Slice(authorities, name)[source]

Create a new GENI URN with type ‘slice’.

Sliver(authorities, name)[source]

Create a new GENI URN with type ‘sliver’.

User(authorities, name)[source]

Create a new GENI URN with type ‘user’.