Skip to content

Commit f2809e3

Browse files
Merge pull request #1585 from zhaoqin-github/websocket-3.0.11
Support Websocket profile (v3.0.11-dev)
2 parents 92776fe + 2e0f320 commit f2809e3

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

f5/bigip/tm/ltm/profile.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def __init__(self, ltm):
9292
Wa_Caches,
9393
Web_Accelerations,
9494
Web_Securitys,
95+
Websockets,
9596
Xmls]
9697

9798

@@ -1188,6 +1189,23 @@ def delete(self, **kwargs):
11881189
)
11891190

11901191

1192+
class Websockets(Collection):
1193+
"""BIG-IP® Websocket profile collection."""
1194+
def __init__(self, profile):
1195+
super(Websockets, self).__init__(profile)
1196+
self._meta_data['allowed_lazy_attributes'] = [Websocket]
1197+
self._meta_data['attribute_registry'] = \
1198+
{'tm:ltm:profile:websocket:websocketstate': Websocket}
1199+
1200+
1201+
class Websocket(Resource):
1202+
"""BIG-IP® Websocket profile resource."""
1203+
def __init__(self, Websockets):
1204+
super(Websocket, self).__init__(Websockets)
1205+
self._meta_data['required_json_kind'] = \
1206+
'tm:ltm:profile:websocket:websocketstate'
1207+
1208+
11911209
class Xmls(Collection):
11921210
"""BIG-IP® Xml profile collection."""
11931211
def __init__(self, profile):

f5/bigip/tm/ltm/test/functional/test_profile.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,18 @@ def test_load(self, request, mgmt_root):
11531153

11541154
# End Web Security tests
11551155

1156+
# Begin Websocket tests
1157+
1158+
1159+
class TestWebsocket(object):
1160+
def test_load(self, request, mgmt_root):
1161+
ws1 = mgmt_root.tm.ltm.profile.\
1162+
websockets.websocket.load(name='websocket')
1163+
assert ws1.name == 'websocket'
1164+
1165+
1166+
# End Websocket tests
1167+
11561168
# Begin Xml tests
11571169

11581170

0 commit comments

Comments
 (0)