diff --git a/openstack/network/v2/floating_ip.py b/openstack/network/v2/floating_ip.py index fac89876b..dfc0c366b 100644 --- a/openstack/network/v2/floating_ip.py +++ b/openstack/network/v2/floating_ip.py @@ -30,6 +30,8 @@ class FloatingIP(resource.Resource): allow_list = True # Properties + #: Timestamp when the floating IP was created. + created_at = resource.prop('created_at') #: The floating IP description. description = resource.prop('description') #: The fixed IP address associated with the floating IP. If you @@ -47,10 +49,14 @@ class FloatingIP(resource.Resource): port_id = resource.prop('port_id') #: The ID of the project this floating IP is associated with. project_id = resource.prop('tenant_id') + #: Revision number of the floating IP. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: The ID of an associated router. router_id = resource.prop('router_id') #: The floating IP status. Value is ``ACTIVE`` or ``DOWN``. status = resource.prop('status') + #: Timestamp when the floating IP was last updated. + updated_at = resource.prop('updated_at') @classmethod def find_available(cls, session): diff --git a/openstack/network/v2/network.py b/openstack/network/v2/network.py index be9ff8160..537f83d0a 100644 --- a/openstack/network/v2/network.py +++ b/openstack/network/v2/network.py @@ -76,6 +76,8 @@ class Network(resource.Resource): #: An isolated segment ID on the physical network. The provider #: network type defines the segmentation model. provider_segmentation_id = resource.prop('provider:segmentation_id') + #: Revision number of the network. *Type: int* + revision_number = resource.prop('revision_number', type=int) segments = resource.prop('segments') #: The network status. status = resource.prop('status') diff --git a/openstack/network/v2/port.py b/openstack/network/v2/port.py index 85a93999f..0d0d7a167 100644 --- a/openstack/network/v2/port.py +++ b/openstack/network/v2/port.py @@ -91,6 +91,8 @@ class Port(resource.Resource): project_id = resource.prop('tenant_id') #: The ID of the QoS policy attached to the port. qos_policy_id = resource.prop('qos_policy_id') + #: Revision number of the port. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: The IDs of any attached security groups. #: *Type: list of strs of the security group IDs* security_group_ids = resource.prop('security_groups', type=list) diff --git a/openstack/network/v2/router.py b/openstack/network/v2/router.py index d593acb6b..6eba1626a 100644 --- a/openstack/network/v2/router.py +++ b/openstack/network/v2/router.py @@ -35,6 +35,8 @@ class Router(resource.Resource): #: Availability zones for the router. #: *Type: list of availability zone names* availability_zones = resource.prop('availability_zones') + #: Timestamp when the router was created. + created_at = resource.prop('created_at') #: The router description. description = resource.prop('description') #: The ``network_id``, for the external gateway. *Type: dict* @@ -52,10 +54,14 @@ class Router(resource.Resource): name = resource.prop('name') #: The ID of the project this router is associated with. project_id = resource.prop('tenant_id') + #: Revision number of the router. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: The extra routes configuration for the router. routes = resource.prop('routes', type=list) #: The router status. status = resource.prop('status') + #: Timestamp when the router was last updated. + updated_at = resource.prop('updated_at') def add_interface(self, session, **body): """Add an internal interface to a logical router. diff --git a/openstack/network/v2/security_group.py b/openstack/network/v2/security_group.py index da919da44..c9cda0ba5 100644 --- a/openstack/network/v2/security_group.py +++ b/openstack/network/v2/security_group.py @@ -29,16 +29,22 @@ class SecurityGroup(resource.Resource): allow_list = True # Properties + #: Timestamp when the security group was created. + created_at = resource.prop('created_at') #: The security group description. description = resource.prop('description') #: The security group name. name = resource.prop('name') #: The ID of the project this security group is associated with. project_id = resource.prop('tenant_id') + #: Revision number of the security group. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: A list of #: :class:`~openstack.network.v2.security_group_rule.SecurityGroupRule` #: objects. *Type: list* security_group_rules = resource.prop('security_group_rules') + #: Timestamp when the security group was last updated. + updated_at = resource.prop('updated_at') def __init__(self, attrs=None, loaded=False): super(SecurityGroup, self).__init__(attrs=attrs, loaded=loaded) diff --git a/openstack/network/v2/security_group_rule.py b/openstack/network/v2/security_group_rule.py index 04a56bb3b..bb0532944 100644 --- a/openstack/network/v2/security_group_rule.py +++ b/openstack/network/v2/security_group_rule.py @@ -28,6 +28,8 @@ class SecurityGroupRule(resource.Resource): allow_list = True # Properties + #: Timestamp when the security group rule was created. + created_at = resource.prop('created_at') #: ``ingress`` or ``egress``: The direction in which the security group #: rule is applied. For a compute instance, an ingress security group #: rule is applied to incoming ingress traffic for that instance. @@ -62,5 +64,9 @@ class SecurityGroupRule(resource.Resource): #: in the request body. This attribute matches the specified IP prefix #: as the source IP address of the IP packet. remote_ip_prefix = resource.prop('remote_ip_prefix') + #: Revision number of the security group rule. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: The security group ID to associate with this security group rule. security_group_id = resource.prop('security_group_id') + #: Timestamp when the security group rule was last updated. + updated_at = resource.prop('updated_at') diff --git a/openstack/network/v2/subnet.py b/openstack/network/v2/subnet.py index d0c00fee4..b8219061e 100644 --- a/openstack/network/v2/subnet.py +++ b/openstack/network/v2/subnet.py @@ -58,6 +58,8 @@ class Subnet(resource.Resource): network_id = resource.prop('network_id') #: The ID of the project this subnet is associated with. project_id = resource.prop('tenant_id') + #: Revision number of the subnet. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: The ID of the segment this subnet is associated with. segment_id = resource.prop('segment_id') #: Service types for this subnet diff --git a/openstack/network/v2/subnet_pool.py b/openstack/network/v2/subnet_pool.py index e25e51ae0..274eb6a29 100644 --- a/openstack/network/v2/subnet_pool.py +++ b/openstack/network/v2/subnet_pool.py @@ -66,5 +66,7 @@ class SubnetPool(resource.Resource): #: The adjacent prefixes are merged and treated as a single prefix. #: *Type: list* prefixes = resource.prop('prefixes', type=list) + #: Revision number of the subnet pool. *Type: int* + revision_number = resource.prop('revision_number', type=int) #: Timestamp when the subnet pool was last updated. updated_at = resource.prop('updated_at') diff --git a/openstack/tests/unit/network/v2/test_floating_ip.py b/openstack/tests/unit/network/v2/test_floating_ip.py index 7919dc5d1..5390c1a58 100644 --- a/openstack/tests/unit/network/v2/test_floating_ip.py +++ b/openstack/tests/unit/network/v2/test_floating_ip.py @@ -26,6 +26,9 @@ EXAMPLE = { 'router_id': '7', 'description': '8', 'status': 'ACTIVE', + 'created_at': '2016-10-04T12:14:57.233772', + 'updated_at': '2016-10-12T12:15:34.233222', + 'revision_number': 12, } @@ -56,6 +59,9 @@ class TestFloatingIP(testtools.TestCase): self.assertEqual(EXAMPLE['router_id'], sot.router_id) self.assertEqual(EXAMPLE['description'], sot.description) self.assertEqual(EXAMPLE['status'], sot.status) + self.assertEqual(EXAMPLE['created_at'], sot.created_at) + self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) def test_find_available(self): mock_session = mock.Mock() diff --git a/openstack/tests/unit/network/v2/test_network.py b/openstack/tests/unit/network/v2/test_network.py index 17692342c..ab7682285 100644 --- a/openstack/tests/unit/network/v2/test_network.py +++ b/openstack/tests/unit/network/v2/test_network.py @@ -38,6 +38,7 @@ EXAMPLE = { 'created_at': '2016-03-09T12:14:57.233772', 'updated_at': '2016-07-09T12:14:57.233772', 'is_default': False, + 'revision_number': 23, } @@ -86,3 +87,4 @@ class TestNetwork(testtools.TestCase): self.assertEqual(EXAMPLE['created_at'], sot.created_at) self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) self.assertFalse(sot.is_default) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) diff --git a/openstack/tests/unit/network/v2/test_port.py b/openstack/tests/unit/network/v2/test_port.py index 1b6436aca..c0e4321d3 100644 --- a/openstack/tests/unit/network/v2/test_port.py +++ b/openstack/tests/unit/network/v2/test_port.py @@ -41,6 +41,7 @@ EXAMPLE = { 'qos_policy_id': '22', 'created_at': '2016-03-09T12:14:57.233772', 'updated_at': '2016-07-09T12:14:57.233772', + 'revision_number': 25, } @@ -87,3 +88,4 @@ class TestPort(testtools.TestCase): self.assertEqual(EXAMPLE['qos_policy_id'], sot.qos_policy_id) self.assertEqual(EXAMPLE['created_at'], sot.created_at) self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) diff --git a/openstack/tests/unit/network/v2/test_router.py b/openstack/tests/unit/network/v2/test_router.py index 3990f5b30..e9f92e355 100644 --- a/openstack/tests/unit/network/v2/test_router.py +++ b/openstack/tests/unit/network/v2/test_router.py @@ -27,6 +27,9 @@ EXAMPLE = { 'availability_zone_hints': [], 'availability_zones': [], 'description': '10', + 'created_at': '2016-10-04T12:14:57.233772', + 'updated_at': '2016-10-12T12:15:34.233222', + 'revision_number': 13, } EXAMPLE_WITH_OPTIONAL = { @@ -78,6 +81,9 @@ class TestRouter(testtools.TestCase): self.assertEqual(EXAMPLE['availability_zones'], sot.availability_zones) self.assertEqual(EXAMPLE['description'], sot.description) + self.assertEqual(EXAMPLE['created_at'], sot.created_at) + self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) def test_make_it_with_optional(self): sot = router.Router(EXAMPLE_WITH_OPTIONAL) diff --git a/openstack/tests/unit/network/v2/test_security_group.py b/openstack/tests/unit/network/v2/test_security_group.py index a8b18279c..a07ee4d57 100644 --- a/openstack/tests/unit/network/v2/test_security_group.py +++ b/openstack/tests/unit/network/v2/test_security_group.py @@ -28,6 +28,9 @@ RULES = [ "port_range_min": None, "id": "5", "security_group_id": IDENTIFIER, + "created_at": "2016-10-04T12:14:57.233772", + "updated_at": "2016-10-12T12:15:34.233222", + "revision_number": 6, }, { "remote_group_id": "9", @@ -40,6 +43,9 @@ RULES = [ "port_range_min": None, "id": "6", "security_group_id": IDENTIFIER, + "created_at": "2016-10-04T12:14:57.233772", + "updated_at": "2016-10-12T12:15:34.233222", + "revision_number": 7, }, ] EXAMPLE = { diff --git a/openstack/tests/unit/network/v2/test_security_group_rule.py b/openstack/tests/unit/network/v2/test_security_group_rule.py index fc5ad6d63..1d20f60d0 100644 --- a/openstack/tests/unit/network/v2/test_security_group_rule.py +++ b/openstack/tests/unit/network/v2/test_security_group_rule.py @@ -27,6 +27,9 @@ EXAMPLE = { 'remote_ip_prefix': '9', 'security_group_id': '10', 'description': '11', + 'created_at': '2016-10-04T12:14:57.233772', + 'updated_at': '2016-10-12T12:15:34.233222', + 'revision_number': 14, } @@ -57,3 +60,6 @@ class TestSecurityGroupRule(testtools.TestCase): self.assertEqual(EXAMPLE['remote_ip_prefix'], sot.remote_ip_prefix) self.assertEqual(EXAMPLE['security_group_id'], sot.security_group_id) self.assertEqual(EXAMPLE['description'], sot.description) + self.assertEqual(EXAMPLE['created_at'], sot.created_at) + self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) diff --git a/openstack/tests/unit/network/v2/test_subnet.py b/openstack/tests/unit/network/v2/test_subnet.py index 2edbb1d5b..fabe0b3b7 100644 --- a/openstack/tests/unit/network/v2/test_subnet.py +++ b/openstack/tests/unit/network/v2/test_subnet.py @@ -35,6 +35,7 @@ EXAMPLE = { 'created_at': '2016-03-09T12:14:57.233772', 'updated_at': '2016-07-09T12:14:57.233772', 'segment_id': '16', + 'revision_number': 17, } @@ -73,3 +74,4 @@ class TestSubnet(testtools.TestCase): self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) self.assertEqual(EXAMPLE['segment_id'], sot.segment_id) self.assertEqual(EXAMPLE['service_types'], sot.service_types) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) diff --git a/openstack/tests/unit/network/v2/test_subnet_pool.py b/openstack/tests/unit/network/v2/test_subnet_pool.py index cd1fd51d9..3660837cf 100644 --- a/openstack/tests/unit/network/v2/test_subnet_pool.py +++ b/openstack/tests/unit/network/v2/test_subnet_pool.py @@ -31,6 +31,7 @@ EXAMPLE = { 'created_at': '2016-03-09T12:14:57.233772', 'updated_at': '2016-07-09T12:14:57.233772', 'is_default': True, + 'revision_number': 16, } @@ -68,3 +69,4 @@ class TestSubnetpool(testtools.TestCase): self.assertEqual(EXAMPLE['created_at'], sot.created_at) self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) self.assertTrue(sot.is_default) + self.assertEqual(EXAMPLE['revision_number'], sot.revision_number)