Skip to content

Commit

Permalink
add-purpose-field-to-esi-lease
Browse files Browse the repository at this point in the history
  • Loading branch information
Surbhi Kanthed committed Jun 14, 2023
1 parent fda372a commit ff74cf6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions esi_leap/api/controllers/v1/lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Lease(base.ESILEAPBase):
end_time = wsme.wsattr(datetime.datetime)
status = wsme.wsattr(wtypes.text, readonly=True)
properties = {wtypes.text: types.jsontype}
purpose = wsme.wsattr(wtypes.text)
offer_uuid = wsme.wsattr(wtypes.text, readonly=True)
parent_lease_uuid = wsme.wsattr(wtypes.text, readonly=True)

Expand Down
1 change: 1 addition & 0 deletions esi_leap/db/sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Lease(Base):
name = Column(String(35), nullable=True, unique=False)
project_id = Column(String(255), nullable=False)
owner_id = Column(String(255), nullable=False)
purpose = Column(String(255), nullable=True)
resource_type = Column(String(36), nullable=False)
resource_uuid = Column(String(36), nullable=False)
start_time = Column(DateTime)
Expand Down
1 change: 1 addition & 0 deletions esi_leap/objects/lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class LeaseCRUDPayload(notification.NotificationPayloadBase):
'uuid': fields.UUIDField(),
'project_id': fields.StringField(),
'owner_id': fields.StringField(),
'purpose': fields.StringField(),
'resource_type': fields.StringField(),
'resource_uuid': fields.StringField(),
'start_time': fields.DateTimeField(nullable=True),
Expand Down
3 changes: 2 additions & 1 deletion esi_leap/tests/api/controllers/v1/test_lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def test_post(self, mock_create, mock_cra, mock_generate_uuid,
'resource_type': 'test_node',
'resource_uuid': '1234567890',
'start_time': '2016-07-16T19:20:30',
'end_time': '2016-08-16T19:20:30'
'end_time': '2016-08-16T19:20:30',
'purpose': 'test_purpose'
}
return_data = data.copy()
return_data['owner_id'] = self.context.project_id
Expand Down

0 comments on commit ff74cf6

Please sign in to comment.