Add tag support for vpn-related objects
Tag appendixes in describe operations are already implemented. Change-Id: Ia05e6b400a5675bdab3f8dbcc6c834e543824f9b
This commit is contained in:
parent
f64151e821
commit
bac2ad9de1
@ -31,6 +31,7 @@ RESOURCE_TYPES = {
|
|||||||
'ami': 'image',
|
'ami': 'image',
|
||||||
'aki': 'image',
|
'aki': 'image',
|
||||||
'ari': 'image',
|
'ari': 'image',
|
||||||
|
'cgw': 'customer-gateway',
|
||||||
'i': 'instance',
|
'i': 'instance',
|
||||||
'igw': 'internet-gateway',
|
'igw': 'internet-gateway',
|
||||||
'eni': 'network-interface',
|
'eni': 'network-interface',
|
||||||
@ -38,8 +39,10 @@ RESOURCE_TYPES = {
|
|||||||
'snap': 'snapshot',
|
'snap': 'snapshot',
|
||||||
'subnet': 'subnet',
|
'subnet': 'subnet',
|
||||||
'sg': 'security-group',
|
'sg': 'security-group',
|
||||||
|
'vgw': 'vpn-gateway',
|
||||||
'vol': 'volume',
|
'vol': 'volume',
|
||||||
'vpc': 'vpc',
|
'vpc': 'vpc',
|
||||||
|
'vpn': 'vpn-connection',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ class TagTestCase(base.ApiTestCase):
|
|||||||
|
|
||||||
# NOTE(ft): check a tag can be created for all valid resource types
|
# NOTE(ft): check a tag can be created for all valid resource types
|
||||||
resource_ids = [fakes.random_ec2_id(r_t)
|
resource_ids = [fakes.random_ec2_id(r_t)
|
||||||
for r_t in ['dopt', 'ami', 'aki', 'ari', 'i', 'igw',
|
for r_t in ['dopt', 'ami', 'aki', 'ari', 'cgw', 'i',
|
||||||
'eni', 'rtb', 'snap', 'subnet', 'sg',
|
'igw', 'eni', 'rtb', 'snap', 'subnet',
|
||||||
'vol', 'vpc']]
|
'sg', 'vgw', 'vol', 'vpc', 'vpn']]
|
||||||
self.assertEqual(len(resource_ids), len(tag_api.RESOURCE_TYPES))
|
self.assertEqual(len(resource_ids), len(tag_api.RESOURCE_TYPES))
|
||||||
|
|
||||||
params = {'ResourceId.%s' % num: r_id
|
params = {'ResourceId.%s' % num: r_id
|
||||||
@ -183,6 +183,7 @@ class TagTestCase(base.ApiTestCase):
|
|||||||
('ami', 'image'),
|
('ami', 'image'),
|
||||||
('aki', 'image'),
|
('aki', 'image'),
|
||||||
('ari', 'image'),
|
('ari', 'image'),
|
||||||
|
('cgw', 'customer-gateway'),
|
||||||
('i', 'instance'),
|
('i', 'instance'),
|
||||||
('igw', 'internet-gateway'),
|
('igw', 'internet-gateway'),
|
||||||
('eni', 'network-interface'),
|
('eni', 'network-interface'),
|
||||||
@ -190,8 +191,10 @@ class TagTestCase(base.ApiTestCase):
|
|||||||
('snap', 'snapshot'),
|
('snap', 'snapshot'),
|
||||||
('subnet', 'subnet'),
|
('subnet', 'subnet'),
|
||||||
('sg', 'security-group'),
|
('sg', 'security-group'),
|
||||||
|
('vgw', 'vpn-gateway'),
|
||||||
('vol', 'volume'),
|
('vol', 'volume'),
|
||||||
('vpc', 'vpc')]:
|
('vpc', 'vpc'),
|
||||||
|
('vpn', 'vpn-connection')]:
|
||||||
item_id = fakes.random_ec2_id(r_id)
|
item_id = fakes.random_ec2_id(r_id)
|
||||||
self.db_api.get_tags.return_value = [{'item_id': item_id,
|
self.db_api.get_tags.return_value = [{'item_id': item_id,
|
||||||
'key': 'fake-key',
|
'key': 'fake-key',
|
||||||
|
Loading…
Reference in New Issue
Block a user