Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2558)

Unified Diff: appengine/machine_provider/models.py

Issue 2196623004: Add basic Machine Provider UI (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/machine_provider/main.py ('k') | appengine/machine_provider/static/style.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/machine_provider/models.py
diff --git a/appengine/machine_provider/models.py b/appengine/machine_provider/models.py
index d2c95e54c2ee17064a67e537a61d3c666342792d..e0d8339e07481fe1e4fdac62265ef1aa9644a23f 100644
--- a/appengine/machine_provider/models.py
+++ b/appengine/machine_provider/models.py
@@ -39,6 +39,8 @@ class LeaseRequest(ndb.Model):
# Checksum of the rpc_messages.LeaseRequest instance. Used to compare incoming
# LeaseRequets for deduplication.
deduplication_checksum = ndb.StringProperty(required=True, indexed=False)
+ # DateTime indicating the last modification time.
+ last_modified_ts = ndb.DateTimeProperty(auto_now=True)
# ID of the CatalogMachineEntry provided for this lease.
machine_id = ndb.StringProperty()
# auth.model.Identity of the issuer of the original request.
@@ -103,6 +105,8 @@ class CatalogEntry(ndb.Model):
field.name for field in rpc_messages.Dimensions.all_fields()
],
)
+ # DateTime indicating the last modified time.
+ last_modified_ts = ndb.DateTimeProperty(auto_now=True)
class CatalogCapacityEntry(CatalogEntry):
@@ -190,6 +194,9 @@ class CatalogMachineEntry(CatalogEntry):
pubsub_topic = ndb.StringProperty(indexed=False)
# Project the Cloud Pub/Sub topic exists in.
pubsub_topic_project = ndb.StringProperty(indexed=False)
+ # Determines sorted order relative to other CatalogMachineEntries.
+ sort_ordering = ndb.ComputedProperty(lambda self: '%s:%s' % (
+ self.dimensions.backend, self.dimensions.hostname))
# Element of CatalogMachineEntryStates giving the state of this entry.
state = ndb.StringProperty(
choices=CatalogMachineEntryStates,
« no previous file with comments | « appengine/machine_provider/main.py ('k') | appengine/machine_provider/static/style.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698