Support age
and confirmed
for subscription
Change-Id: Ie3e5774845d1da29ccba160a6b11afbeb6cad7d7
This commit is contained in:
@@ -348,7 +348,7 @@ class ListSubscriptions(command.Lister):
|
|||||||
kwargs["limit"] = parsed_args.limit
|
kwargs["limit"] = parsed_args.limit
|
||||||
|
|
||||||
data = client.subscriptions(**kwargs)
|
data = client.subscriptions(**kwargs)
|
||||||
columns = ('ID', 'Subscriber', 'TTL', 'Options')
|
columns = ('ID', 'Subscriber', 'TTL', 'Age', 'Confirmed', 'Options')
|
||||||
return (columns,
|
return (columns,
|
||||||
(utils.get_item_properties(s, columns) for s in data))
|
(utils.get_item_properties(s, columns) for s in data))
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@ class Subscription(object):
|
|||||||
self.subscriber = subscriber
|
self.subscriber = subscriber
|
||||||
self.ttl = ttl
|
self.ttl = ttl
|
||||||
self.options = kwargs.get('options', {})
|
self.options = kwargs.get('options', {})
|
||||||
|
self.age = kwargs.get('age')
|
||||||
|
self.confirmed = kwargs.get('confirmed')
|
||||||
|
|
||||||
if auto_create:
|
if auto_create:
|
||||||
self.ensure_exists()
|
self.ensure_exists()
|
||||||
@@ -56,6 +58,8 @@ class Subscription(object):
|
|||||||
self.subscriber = sub.get('subscriber')
|
self.subscriber = sub.get('subscriber')
|
||||||
self.ttl = sub.get('ttl')
|
self.ttl = sub.get('ttl')
|
||||||
self.options = sub.get('options')
|
self.options = sub.get('options')
|
||||||
|
self.age = sub.get('age')
|
||||||
|
self.confirmed = sub.get('confirmed')
|
||||||
|
|
||||||
def update(self, subscription_data):
|
def update(self, subscription_data):
|
||||||
req, trans = self.client._request_and_transport()
|
req, trans = self.client._request_and_transport()
|
||||||
@@ -75,5 +79,7 @@ def create_object(parent):
|
|||||||
subscriber=kwargs.pop('subscriber'),
|
subscriber=kwargs.pop('subscriber'),
|
||||||
ttl=kwargs.pop('ttl'),
|
ttl=kwargs.pop('ttl'),
|
||||||
id=kwargs.pop('id'),
|
id=kwargs.pop('id'),
|
||||||
|
age=kwargs.pop('age'),
|
||||||
|
confirmed=kwargs.pop('confirmed'),
|
||||||
auto_create=False,
|
auto_create=False,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
@@ -499,12 +499,16 @@ class QueuesV2QueueUnitTest(QueuesV1_1QueueUnitTest):
|
|||||||
"id": "1",
|
"id": "1",
|
||||||
"subscriber": 'http://trigger.me',
|
"subscriber": 'http://trigger.me',
|
||||||
"ttl": 3600,
|
"ttl": 3600,
|
||||||
|
"age": 1800,
|
||||||
|
"confirmed": False,
|
||||||
"options": {}},
|
"options": {}},
|
||||||
{
|
{
|
||||||
"source": 'test',
|
"source": 'test',
|
||||||
"id": "2",
|
"id": "2",
|
||||||
"subscriber": 'http://trigger.you',
|
"subscriber": 'http://trigger.you',
|
||||||
"ttl": 7200,
|
"ttl": 7200,
|
||||||
|
"age": 1800,
|
||||||
|
"confirmed": False,
|
||||||
"options": {}}]
|
"options": {}}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -142,11 +142,15 @@ class QueuesV2SubscriptionUnitTest(base.QueuesTestBase):
|
|||||||
'id': '568afabb508f153573f6a56f',
|
'id': '568afabb508f153573f6a56f',
|
||||||
'subscriber': 'http://trigger.me',
|
'subscriber': 'http://trigger.me',
|
||||||
'ttl': 3600,
|
'ttl': 3600,
|
||||||
|
'age': 1800,
|
||||||
|
'confirmed': False,
|
||||||
'options': {}},
|
'options': {}},
|
||||||
{'source': 'beijing',
|
{'source': 'beijing',
|
||||||
'id': '568afabb508f153573f6a56x',
|
'id': '568afabb508f153573f6a56x',
|
||||||
'subscriber': 'http://trigger.you',
|
'subscriber': 'http://trigger.you',
|
||||||
'ttl': 7200,
|
'ttl': 7200,
|
||||||
|
'age': 2309,
|
||||||
|
'confirmed': True,
|
||||||
'options': {'oh stop': 'triggering'}}]}
|
'options': {'oh stop': 'triggering'}}]}
|
||||||
|
|
||||||
with mock.patch.object(self.transport, 'send',
|
with mock.patch.object(self.transport, 'send',
|
||||||
|
Reference in New Issue
Block a user