2 # Copyright 2016 RIFT.IO Inc
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # Author(s): Varun Prasad
17 # Creation Date: 09/28/2016
24 gi
.require_version('RwStagingMgmtYang', '1.0')
25 from gi
.repository
import (
30 class StagingArea(object):
31 """A pythonic wrapper around the GI object StagingArea
33 def __init__(self
, model
=None):
36 self
._model
= RwStagingMgmtYang
.StagingArea
.from_dict({})
40 return self
._model
.area_id
47 def project_name(self
):
48 return self
._model
.project_name
51 def has_expired(self
):
52 current_time
= time
.time()
53 expiry_time
= self
.model
.created_time
+ self
.model
.validity_time
54 if expiry_time
<= current_time
:
59 return self
._model
.as_dict()