Package expedient :: Package clearinghouse :: Package resources :: Module models :: Class Resource
[hide private]
[frames] | no frames]

Class Resource

source code


Generic model of a resource.

Nested Classes [hide private]
  DoesNotExist
  Extend
  MultipleObjectsReturned

Inherited from common.extendable.models.Extendable: Meta, __metaclass__

Instance Methods [hide private]
 
update_timestamp(self)
Set the resource's status change timestamp to now.
source code
 
__unicode__(self) source code
 
_base_manager(...)
 
get_next_by_status_change_timestamp(*moreargs, **morekwargs)
 
get_previous_by_status_change_timestamp(*moreargs, **morekwargs)
 
objects(...)

Inherited from common.extendable.models.Extendable: __init__, as_leaf_class, is_instance_of

Inherited from django.db.models.base.Model: __eq__, __hash__, __ne__, __reduce__, __repr__, __str__, clean, clean_fields, date_error_message, delete, full_clean, prepare_database_save, save, save_base, serializable_value, unique_error_message, validate_unique

Inherited from django.db.models.base.Model (private): _collect_sub_objects, _get_FIELD_display, _get_next_or_previous_by_FIELD, _get_next_or_previous_in_order, _get_pk_val, _get_unique_checks, _perform_date_checks, _perform_unique_checks, _set_pk_val

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  _default_manager = <expedient.common.extendable.models.Extenda...
  _meta = <Options for Resource>
  dummyresource = <django.db.models.fields.related.SingleRelated...
  openflow_connections = <django.db.models.fields.related.Foreig...
  openflowinterface = <django.db.models.fields.related.SingleRel...
  openflowswitch = <django.db.models.fields.related.SingleRelate...
  planetlabnode = <django.db.models.fields.related.SingleRelated...
  sliver_set = <django.db.models.fields.related.ForeignRelatedOb...

Inherited from common.extendable.models.Extendable: leaf_name, module_name

Inherited from django.db.models.base.Model (private): _deferred

Instance Variables [hide private]
str name = models.CharField(max_length= 200)
A human-readable name for the resource
bool available = models.BooleanField("Available", default= True, ed...
Is the resources available?
datetime.datetime status_change_timestamp = models.DateTimeField(editable= False...
The time when available changed.
models.ForeignKey to Aggregate aggregate = models.ForeignKey(Aggregate, verbose_name= "Aggreg...
The Aggregate that controls/owns this resource
a models.ManyToManyField to Slice. slice_set = models.ManyToManyField(Slice, through= "Sliver", v...
The set of slices this resource is in
Properties [hide private]

Inherited from django.db.models.base.Model: pk

Inherited from object: __class__

Method Details [hide private]

update_timestamp(self)

source code 

Set the resource's status change timestamp to now.

This method does not save the object, so the object still needs to be manually saved.

objects(...)

 
Overrides: common.extendable.models.Extendable.objects

Class Variable Details [hide private]

_default_manager

Value:
<expedient.common.extendable.models.ExtendableManager object at 0x8d89\
22c>

dummyresource

Value:
<django.db.models.fields.related.SingleRelatedObjectDescriptor object \
at 0x9a5486c>

openflow_connections

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8f9b40c>

openflowinterface

Value:
<django.db.models.fields.related.SingleRelatedObjectDescriptor object \
at 0x8f9baac>

openflowswitch

Value:
<django.db.models.fields.related.SingleRelatedObjectDescriptor object \
at 0x8f74dac>

planetlabnode

Value:
<django.db.models.fields.related.SingleRelatedObjectDescriptor object \
at 0x900e18c>

sliver_set

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8d896ec>

Instance Variable Details [hide private]

available

Is the resources available?
Type:
bool
Value:
models.BooleanField("Available", default= True, editable= False)

status_change_timestamp

The time when available changed.
Type:
datetime.datetime
Value:
models.DateTimeField(editable= False, auto_now_add= True)

aggregate

The Aggregate that controls/owns this resource
Type:
models.ForeignKey to Aggregate
Value:
models.ForeignKey(Aggregate, verbose_name= "Aggregate the resource bel\
ongs to")

slice_set

The set of slices this resource is in
Type:
a models.ManyToManyField to Slice.
Value:
models.ManyToManyField(Slice, through= "Sliver", verbose_name= "Slices\
 this resource is used in")