add masakari enabled to segment
Add 'enabled' to Masakari segment in microversion 1.2. It returns "enabled" flag in segments API. Change-Id: I445774a8af60a75c6b936d25fbab858233c632e9
This commit is contained in:
parent
eecefcf6e9
commit
736f3aa16c
openstack
releasenotes/notes
@ -32,6 +32,9 @@ class Segment(resource.Resource):
|
|||||||
allow_commit = True
|
allow_commit = True
|
||||||
allow_delete = True
|
allow_delete = True
|
||||||
|
|
||||||
|
# add enabled flag to segment in 1.2
|
||||||
|
_max_microversion = '1.2'
|
||||||
|
|
||||||
#: A ID of representing this segment.
|
#: A ID of representing this segment.
|
||||||
id = resource.Body("id")
|
id = resource.Body("id")
|
||||||
#: A Uuid of representing this segment.
|
#: A Uuid of representing this segment.
|
||||||
@ -48,7 +51,9 @@ class Segment(resource.Resource):
|
|||||||
recovery_method = resource.Body("recovery_method")
|
recovery_method = resource.Body("recovery_method")
|
||||||
#: The service type of this segment.
|
#: The service type of this segment.
|
||||||
service_type = resource.Body("service_type")
|
service_type = resource.Body("service_type")
|
||||||
|
#: The enabled flag of this segment.
|
||||||
|
is_enabled = resource.Body("enabled", type=bool)
|
||||||
|
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
"sort_key", "sort_dir", recovery_method="recovery_method",
|
"sort_key", "sort_dir", recovery_method="recovery_method",
|
||||||
service_type="service_type")
|
service_type="service_type", is_enabled="enabled")
|
||||||
|
@ -25,7 +25,8 @@ SEGMENT = {
|
|||||||
"name": "my_segment",
|
"name": "my_segment",
|
||||||
"description": "something",
|
"description": "something",
|
||||||
"recovery_method": "auto",
|
"recovery_method": "auto",
|
||||||
"service_type": "COMPUTE_HOST"
|
"service_type": "COMPUTE_HOST",
|
||||||
|
"enabled": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ class TestSegment(base.TestCase):
|
|||||||
"marker": "marker",
|
"marker": "marker",
|
||||||
"recovery_method": "recovery_method",
|
"recovery_method": "recovery_method",
|
||||||
"service_type": "service_type",
|
"service_type": "service_type",
|
||||||
|
"is_enabled": "enabled",
|
||||||
"sort_dir": "sort_dir",
|
"sort_dir": "sort_dir",
|
||||||
"sort_key": "sort_key"},
|
"sort_key": "sort_key"},
|
||||||
sot._query_mapping._mapping)
|
sot._query_mapping._mapping)
|
||||||
@ -60,3 +62,4 @@ class TestSegment(base.TestCase):
|
|||||||
self.assertEqual(SEGMENT["description"], sot.description)
|
self.assertEqual(SEGMENT["description"], sot.description)
|
||||||
self.assertEqual(SEGMENT["recovery_method"], sot.recovery_method)
|
self.assertEqual(SEGMENT["recovery_method"], sot.recovery_method)
|
||||||
self.assertEqual(SEGMENT["service_type"], sot.service_type)
|
self.assertEqual(SEGMENT["service_type"], sot.service_type)
|
||||||
|
self.assertEqual(SEGMENT["enabled"], sot.is_enabled)
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Add support for the ``enabled`` field of the ``Segment`` resource for
|
||||||
|
the instance HA service (Masakari).
|
Loading…
x
Reference in New Issue
Block a user