Newer
Older
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
"output_type": "stream",
"text": [
"2024-11-12 13:31:46,752 - __main__ - DEBUG - >>> activate_network_scenario: sbx8rconuz\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"send: b'POST /sandbox-api/v1/sandboxNetworkScenarios/sbx8rconuz?network_scenario_id=4g-5g-macro-v2x HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 2\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{}'\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-12 13:31:47,980 DEBUG https://mec-platform2.etsi.org:443 \"POST /sandbox-api/v1/sandboxNetworkScenarios/sbx8rconuz?network_scenario_id=4g-5g-macro-v2x HTTP/11\" 204 0\n",
"2024-11-12 13:31:47,983 DEBUG response body: b''\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"reply: 'HTTP/1.1 204 No Content\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:31:47 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-12 13:32:07,984 - __main__ - DEBUG - >>> request_application_instance_id: sbx8rconuz\n",
"2024-11-12 13:32:07,986 DEBUG Resetting dropped connection: mec-platform2.etsi.org\n",
"2024-11-12 13:32:08,065 DEBUG https://mec-platform2.etsi.org:443 \"POST /sandbox-api/v1/sandboxAppInstances/sbx8rconuz HTTP/11\" 201 0\n",
"2024-11-12 13:32:08,067 DEBUG response body: b'{\"id\":\"ac6d042f-b52e-4480-b850-33c4c2520474\",\"name\":\"JupyterMecApp\",\"nodeName\":\"mep1\",\"type\":\"USER\"}'\n",
"2024-11-12 13:32:08,071 - __main__ - DEBUG - request_application_instance_id: result: {'id': 'ac6d042f-b52e-4480-b850-33c4c2520474',\n",
" 'name': 'JupyterMecApp',\n",
" 'node_name': 'mep1',\n",
" 'persist': None,\n",
" 'type': 'USER'}\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"send: b'POST /sandbox-api/v1/sandboxAppInstances/sbx8rconuz HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 107\\r\\nAccept: application/json\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{\"id\": \"ac6d042f-b52e-4480-b850-33c4c2520474\", \"name\": \"JupyterMecApp\", \"nodeName\": \"mep1\", \"type\": \"USER\"}'\n",
"reply: 'HTTP/1.1 201 Created\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:08 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Content-Length: 100\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-12 13:32:18,072 - __main__ - DEBUG - >>> send_ready_confirmation: ac6d042f-b52e-4480-b850-33c4c2520474\n",
"2024-11-12 13:32:18,074 - __main__ - DEBUG - send_ready_confirmation: url: /{sandbox_name}/{mec_pltf}/mec_app_support/v2/applications/{app_inst_id}/confirm_ready\n",
"2024-11-12 13:32:18,074 DEBUG Resetting dropped connection: mec-platform2.etsi.org\n",
"2024-11-12 13:32:18,117 DEBUG https://mec-platform2.etsi.org:443 \"POST /sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/confirm_ready HTTP/11\" 204 0\n",
"2024-11-12 13:32:18,118 DEBUG response body: b''\n",
"2024-11-12 13:32:18,119 - __main__ - DEBUG - >>> send_subscribe_termination: ac6d042f-b52e-4480-b850-33c4c2520474\n",
"2024-11-12 13:32:18,120 - __main__ - DEBUG - send_subscribe_termination: url: /{sandbox_name}/{mec_pltf}/mec_app_support/v2/applications/{app_inst_id}/subscriptions\n",
"2024-11-12 13:32:18,126 DEBUG https://mec-platform2.etsi.org:443 \"POST /sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions HTTP/11\" 201 0\n",
"2024-11-12 13:32:18,127 DEBUG response body: b'{\"subscriptionType\":\"AppTerminationNotificationSubscription\",\"callbackReference\":\"http://mec-platform2.etsi.org:31111/sandbox/v1/mec011/v2/termination\",\"_links\":{\"self\":{\"href\":\"https://mec-platform2.etsi.org/sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions/sub-uRWBHjrCD7tGrHc0\"}},\"appInstanceId\":\"ac6d042f-b52e-4480-b850-33c4c2520474\"}'\n",
"2024-11-12 13:32:18,128 - __main__ - DEBUG - >>> extract_sub_id: resource_url: https://mec-platform2.etsi.org/sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions/sub-uRWBHjrCD7tGrHc0\n",
"2024-11-12 13:32:18,128 - __main__ - DEBUG - >>> get_qos_prediction: sandbox_name: sbx8rconuz\n",
"2024-11-12 13:32:18,129 - __main__ - DEBUG - send_uu_unicast_provisioning_info: url: /{sandbox_name}/{mec_pltf}/vis/v2/provide_predicted_qos\n",
"2024-11-12 13:32:18,160 DEBUG https://mec-platform2.etsi.org:443 \"POST /sbx8rconuz/mep1/vis/v2/provide_predicted_qos HTTP/11\" 200 0\n",
"2024-11-12 13:32:18,162 DEBUG response body: b'{\"locationGranularity\":\"30\",\"predictionTarget\":\"SINGLE_UE_PREDICTION\",\"qos\":{\"stream\":[{\"streamId\":\"0\",\"qosKpi\":[{\"confidence\":\"1\",\"kpiName\":\"rsrp\",\"kpiValue\":\"60\"},{\"confidence\":\"1\",\"kpiName\":\"rsrq\",\"kpiValue\":\"20\"}]},{\"streamId\":\"1\",\"qosKpi\":[{\"confidence\":\"1\",\"kpiName\":\"rsrp\",\"kpiValue\":\"55\"},{\"confidence\":\"1\",\"kpiName\":\"rsrq\",\"kpiValue\":\"13\"}]}]},\"routes\":[{\"routeInfo\":[{\"location\":{\"geoArea\":{\"latitude\":43.729416,\"longitude\":7.414853}},\"time\":{\"nanoSeconds\":0,\"seconds\":1653295620}},{\"location\":{\"geoArea\":{\"latitude\":43.732456,\"longitude\":7.418417}},\"time\":{\"nanoSeconds\":0,\"seconds\":1653299220}}]}]}'\n",
"2024-11-12 13:32:18,163 - __main__ - INFO - UU unicast provisioning information: result: b'{\"locationGranularity\":\"30\",\"predictionTarget\":\"SINGLE_UE_PREDICTION\",\"qos\":{\"stream\":[{\"streamId\":\"0\",\"qosKpi\":[{\"confidence\":\"1\",\"kpiName\":\"rsrp\",\"kpiValue\":\"60\"},{\"confidence\":\"1\",\"kpiName\":\"rsrq\",\"kpiValue\":\"20\"}]},{\"streamId\":\"1\",\"qosKpi\":[{\"confidence\":\"1\",\"kpiName\":\"rsrp\",\"kpiValue\":\"55\"},{\"confidence\":\"1\",\"kpiName\":\"rsrq\",\"kpiValue\":\"13\"}]}]},\"routes\":[{\"routeInfo\":[{\"location\":{\"geoArea\":{\"latitude\":43.729416,\"longitude\":7.414853}},\"time\":{\"nanoSeconds\":0,\"seconds\":1653295620}},{\"location\":{\"geoArea\":{\"latitude\":43.732456,\"longitude\":7.418417}},\"time\":{\"nanoSeconds\":0,\"seconds\":1653299220}}]}]}'\n",
"2024-11-12 13:32:18,163 - __main__ - INFO - body: b'{\"locationGranularity\":\"30\",\"predictionTarget\":\"SINGLE_UE_PREDICTION\",\"qos\":{\"stream\":[{\"streamId\":\"0\",\"qosKpi\":[{\"confidence\":\"1\",\"kpiName\":\"rsrp\",\"kpiValue\":\"60\"},{\"confidence\":\"1\",\"kpiName\":\"rsrq\",\"kpiValue\":\"20\"}]},{\"streamId\":\"1\",\"qosKpi\":[{\"confidence\":\"1\",\"kpiName\":\"rsrp\",\"kpiValue\":\"55\"},{\"confidence\":\"1\",\"kpiName\":\"rsrq\",\"kpiValue\":\"13\"}]}]},\"routes\":[{\"routeInfo\":[{\"location\":{\"geoArea\":{\"latitude\":43.729416,\"longitude\":7.414853}},\"time\":{\"nanoSeconds\":0,\"seconds\":1653295620}},{\"location\":{\"geoArea\":{\"latitude\":43.732456,\"longitude\":7.418417}},\"time\":{\"nanoSeconds\":0,\"seconds\":1653299220}}]}]}'\n",
"2024-11-12 13:32:18,164 - __main__ - INFO - data: {'locationGranularity': '30', 'predictionTarget': 'SINGLE_UE_PREDICTION', 'qos': {'stream': [{'streamId': '0', 'qosKpi': [{'confidence': '1', 'kpiName': 'rsrp', 'kpiValue': '60'}, {'confidence': '1', 'kpiName': 'rsrq', 'kpiValue': '20'}]}, {'streamId': '1', 'qosKpi': [{'confidence': '1', 'kpiName': 'rsrp', 'kpiValue': '55'}, {'confidence': '1', 'kpiName': 'rsrq', 'kpiValue': '13'}]}]}, 'routes': [{'routeInfo': [{'location': {'geoArea': {'latitude': 43.729416, 'longitude': 7.414853}}, 'time': {'nanoSeconds': 0, 'seconds': 1653295620}}, {'location': {'geoArea': {'latitude': 43.732456, 'longitude': 7.418417}}, 'time': {'nanoSeconds': 0, 'seconds': 1653299220}}]}]}\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"send: b'POST /sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/confirm_ready HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 23\\r\\nAccept: application/json\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{\"indication\": \"READY\"}'\n",
"reply: 'HTTP/1.1 204 No Content\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:18 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n",
"send: b'POST /sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 212\\r\\nAccept: application/json\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{\"subscriptionType\": \"AppTerminationNotificationSubscription\", \"callbackReference\": \"http://mec-platform2.etsi.org:31111/sandbox/v1/mec011/v2/termination\", \"appInstanceId\": \"ac6d042f-b52e-4480-b850-33c4c2520474\"}'\n",
"reply: 'HTTP/1.1 201 Created\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:18 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Content-Length: 387\n",
"header: Connection: keep-alive\n",
"header: Location: https://mec-platform2.etsi.org/sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions/sub-uRWBHjrCD7tGrHc0\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n",
"send: b'POST /sbx8rconuz/mep1/vis/v2/provide_predicted_qos HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 354\\r\\nAccept: application/json\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{\"locationGranularity\": \"30\", \"predictionTarget\": \"SINGLE_UE_PREDICTION\", \"routes\": [{\"routeInfo\": [{\"location\": {\"geoArea\": {\"latitude\": 43.729416, \"longitude\": 7.414853}}, \"time\": {\"seconds\": 1653295620, \"nanoSeconds\": 0}}, {\"location\": {\"geoArea\": {\"latitude\": 43.732456, \"longitude\": 7.418417}}, \"time\": {\"seconds\": 1653299220, \"nanoSeconds\": 0}}]}]}'\n",
"reply: 'HTTP/1.1 200 OK\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:18 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Content-Length: 610\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-12 13:32:28,170 - __main__ - DEBUG - >>> delete_subscribe_termination: ac6d042f-b52e-4480-b850-33c4c2520474\n",
"2024-11-12 13:32:28,171 - __main__ - DEBUG - delete_subscribe_termination: url: /{sandbox_name}/{mec_pltf}/mec_app_support/v2/applications/{app_inst_id}/subscriptions/{sub_id}\n",
"2024-11-12 13:32:28,183 DEBUG https://mec-platform2.etsi.org:443 \"DELETE /sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions/sub-uRWBHjrCD7tGrHc0 HTTP/11\" 204 0\n",
"2024-11-12 13:32:28,184 DEBUG response body: b''\n",
"2024-11-12 13:32:28,185 - __main__ - DEBUG - >>> delete_application_instance_id: sbx8rconuz\n",
"2024-11-12 13:32:28,186 - __main__ - DEBUG - >>> delete_application_instance_id: ac6d042f-b52e-4480-b850-33c4c2520474\n",
"2024-11-12 13:32:28,340 DEBUG https://mec-platform2.etsi.org:443 \"DELETE /sandbox-api/v1/sandboxAppInstances/sbx8rconuz/ac6d042f-b52e-4480-b850-33c4c2520474 HTTP/11\" 204 0\n",
"2024-11-12 13:32:28,347 DEBUG response body: b''\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"send: b'DELETE /sbx8rconuz/mep1/mec_app_support/v2/applications/ac6d042f-b52e-4480-b850-33c4c2520474/subscriptions/sub-uRWBHjrCD7tGrHc0 HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 2\\r\\nAccept: application/json\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{}'\n",
"reply: 'HTTP/1.1 204 No Content\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:28 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n",
"send: b'DELETE /sandbox-api/v1/sandboxAppInstances/sbx8rconuz/ac6d042f-b52e-4480-b850-33c4c2520474 HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 2\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{}'\n",
"reply: 'HTTP/1.1 204 No Content\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:28 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-12 13:32:38,351 - __main__ - DEBUG - >>> deactivate_network_scenario: sbx8rconuz\n",
"2024-11-12 13:32:38,390 DEBUG https://mec-platform2.etsi.org:443 \"DELETE /sandbox-api/v1/sandboxNetworkScenarios/sbx8rconuz/4g-5g-macro-v2x HTTP/11\" 204 0\n",
"2024-11-12 13:32:38,394 DEBUG response body: b''\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"send: b'DELETE /sandbox-api/v1/sandboxNetworkScenarios/sbx8rconuz/4g-5g-macro-v2x HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 2\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{}'\n",
"reply: 'HTTP/1.1 204 No Content\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:38 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-12 13:32:58,395 - __main__ - DEBUG - >>> process_logout: sandbox=sbx8rconuz\n",
"2024-11-12 13:32:58,397 DEBUG Resetting dropped connection: mec-platform2.etsi.org\n",
"2024-11-12 13:32:58,461 DEBUG https://mec-platform2.etsi.org:443 \"POST /sandbox-api/v1/logout?sandbox_name=sbx8rconuz HTTP/11\" 204 0\n",
"2024-11-12 13:32:58,462 DEBUG response body: b''\n",
"2024-11-12 13:32:58,464 - __main__ - DEBUG - Stopped at 20241112-133258\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"send: b'POST /sandbox-api/v1/logout?sandbox_name=sbx8rconuz HTTP/1.1\\r\\nHost: mec-platform2.etsi.org\\r\\nAccept-Encoding: identity\\r\\nContent-Length: 2\\r\\nContent-Type: application/json\\r\\nUser-Agent: Swagger-Codegen/1.0.0/python\\r\\n\\r\\n'\n",
"send: b'{}'\n",
"reply: 'HTTP/1.1 204 No Content\\r\\n'\n",
"header: Date: Tue, 12 Nov 2024 13:32:58 GMT\n",
"header: Content-Type: application/json; charset=UTF-8\n",
"header: Connection: keep-alive\n",
"header: Strict-Transport-Security: max-age=15724800; includeSubDomains\n"
]
}
],
"def process_main():\n",
" \"\"\"\n",
" This is the fourth sprint of our skeleton of our MEC application:\n",
" - Mec application setup\n",
" - Mec application termination\n",
" \"\"\" \n",
"\n",
" logger.debug('Starting at ' + time.strftime('%Y%m%d-%H%M%S'))\n",
" logger.debug('\\t pwd= ' + os.getcwd())\n",
"\n",
" # Setup the MEC application\n",
" # QoS Prediction\n",
" (result, status, headers) = get_qos_prediction(sandbox_name)\n",
" if status != 200:\n",
" logger.error('Failed to get UU unicast provisioning information')\n",
" else:\n",
" logger.info('UU unicast provisioning information: result: %s', str(result.data))\n",
" \n",
" # Any processing here\n",
" logger.info('body: ' + str(result.data))\n",
" data = json.loads(result.data)\n",
" logger.info('data: %s', str(data))\n",
" time.sleep(STABLE_TIME_OUT)\n",
"\n",
" # Terminate the MEC application\n",
" mec_app_termination(sandbox_name, app_inst_id, sub_id)\n",
"\n",
" logger.debug('Stopped at ' + time.strftime('%Y%m%d-%H%M%S'))\n",
" # End of function process_main\n",
"\n",
"if __name__ == '__main__':\n",
" process_main()\n"
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Our fith MEC application: how to create a new MEC Services\n",
"The purpose of this MEC Service application is to provide a custom MEC service that can be use by other MEC applications. For the purpose of this tutorial, our MEC service is simulating some complex calculation based on a set of data provided by the MEC use. \n",
"We will use a second MEC application to exploit the features of our new MEC services.\n",
"In this clause, we use the following functionalities provided by MEC-011:\n",
"- Register a new service\n",
"- Retrieve the list of the MEC services exposed by the MEC platform\n",
"- Check that our new MEC service is present in the list of the MEC platform services\n",
"- Execute a request to the MEC service\n",
"- Delete the newly created service\n",
"\n",
"**Note:** We will use a second MEC application to exploit the features of our new MEC services.\n",
"\n",
"**Reference:** ETSI GS MEC 011 V3.2.1 (2024-04) Clause 5.2.4 Service availability update and new service registration\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Bases of the creation of a MEC service\n",
"\n",
"#### Introduction\n",
"\n",
"From the user perspective, a MEC service provides a set of endpoints which describe the interface of the MEC service (see [HTTP REST APIs \n",
"concepts](https://blog.postman.com/rest-api-examples/)). These endpoints come usually with a set of data structures used by the one or more endpoints.\n",
"\n",
"Our service is really basic: it provide one endpoint:\n",
"- GET /statistic/v1/quantity: it computes statistical quantities of a set of data (such as average, max, min, standard deviation)\n",
"\n",
"The body of this GET method is a list of datas:\n",
"{\"time\":20180124,\"data1\":\"[1516752000,11590.6,11616.9,11590.4,11616.9,0.25202387,1516752060,11622.4,11651.7,11622.4,11644.6,1.03977764]\"}\n",
"```\n",
"\n",
"The response body is the list of statistical quantities:\n",
"```json\n",
"{\"time\":20180124,\"avg\": 0.0,\"max\": 0.0,\"min\": 0.0,\"stddev\": 0.0 }\n",
"```\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### MEC mechanisms to create a new service\n",
"\n",
"As described in ETSI GS MEC 011 Clause 5.2.4 Service availability update and new service registration, to create a new MEC service, the following information is required:\n",
"- A MEC Aplication instance: this is the MEC application providing the new MEC service (ETSI GS MEC 011 V3.2.1 Clause 8.2.6.3.4 POST)\n",
"- A ServiceInfo instance which describe the MEC service (ETSI GS MEC 011 V3.2.1 Clause 8.1.2.2 Type: ServiceInfo)\n",
"- As part of the ServiceInfo instance, a TransportInfo (ETSI GS MEC 011 V3.2.1 Clause 8.1.2.3 Type: TransportInfo) instance descibes the endpoints to use the MEC service\n",
"\n",
"When created and available, all the other MEC applications are notified about the existance of this MEC service."
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### ServiceInfo data type\n",
"\n",
"The cell below describes the ServiceInfo data structure and its dependencies. It will be used to create our MEC servie.\n"
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [],
"source": [
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
"class ServiceInfo(object):\n",
" swagger_types = {'ser_instance_id': 'str','ser_name': 'str','ser_category': 'CategoryRef','version': 'str','state': 'str','transport_id': 'str','transport_info': 'TransportInfo','serializer': 'string','scope_of_locality': 'LocalityType','consumed_local_only': 'bool','is_local': 'bool','liveness_interval': 'int','links': 'ServiceInfoLinks'}\n",
" attribute_map = {'ser_instance_id': 'serInstanceId','ser_name': 'serName','ser_category': 'serCategory','version': 'version','state': 'state','transport_id': 'transportId','transport_info': 'transportInfo','serializer': 'serializer','scope_of_locality': 'scopeOfLocality','consumed_local_only': 'consumedLocalOnly','is_local': 'isLocal','liveness_interval': 'livenessInterval','links': '_links'}\n",
" def __init__(self, ser_instance_id=None, ser_name=None, ser_category=None, version=None, state=None, transport_id=None, transport_info=None, serializer=None, scope_of_locality=None, consumed_local_only=None, is_local=None, liveness_interval=None, links=None): # noqa: E501\n",
" self._ser_instance_id = None\n",
" self._ser_name = None\n",
" self._ser_category = None\n",
" self._version = None\n",
" self._state = None\n",
" self._transport_id = None\n",
" self._transport_info = None\n",
" self._serializer = None\n",
" self._scope_of_locality = None\n",
" self._consumed_local_only = None\n",
" self._is_local = None\n",
" self._liveness_interval = None\n",
" self._links = None\n",
" self.discriminator = None\n",
" if ser_instance_id is not None:\n",
" self.ser_instance_id = ser_instance_id\n",
" self.ser_name = ser_name\n",
" if ser_category is not None:\n",
" self.ser_category = ser_category\n",
" self.version = version\n",
" self.state = state\n",
" if transport_id is not None:\n",
" self.transport_id = transport_id\n",
" self.transport_info = transport_info\n",
" self.serializer = serializer\n",
" if scope_of_locality is not None:\n",
" self.scope_of_locality = scope_of_locality\n",
" if consumed_local_only is not None:\n",
" self.consumed_local_only = consumed_local_only\n",
" if is_local is not None:\n",
" self.is_local = is_local\n",
" if liveness_interval is not None:\n",
" self.liveness_interval = liveness_interval\n",
" if links is not None:\n",
" self.links = links\n",
" @property\n",
" def ser_instance_id(self):\n",
" return self._ser_instance_id\n",
" @ser_instance_id.setter\n",
" def ser_instance_id(self, ser_instance_id):\n",
" self._ser_instance_id = ser_instance_id\n",
" @property\n",
" def ser_name(self):\n",
" return self._ser_name\n",
" @ser_name.setter\n",
" def ser_name(self, ser_name):\n",
" if ser_name is None:\n",
" raise ValueError(\"Invalid value for `ser_name`, must not be `None`\") # noqa: E501\n",
" self._ser_name = ser_name\n",
" @property\n",
" def ser_category(self):\n",
" return self._ser_category\n",
" @ser_category.setter\n",
" def ser_category(self, ser_category):\n",
" self._ser_category = ser_category\n",
" @property\n",
" def version(self):\n",
" return self._version\n",
" @version.setter\n",
" def version(self, version):\n",
" if version is None:\n",
" raise ValueError(\"Invalid value for `version`, must not be `None`\") # noqa: E501\n",
" self._version = version\n",
" @property\n",
" def state(self):\n",
" return self._state\n",
" @state.setter\n",
" def state(self, state):\n",
" if state is None:\n",
" raise ValueError(\"Invalid value for `state`, must not be `None`\") # noqa: E501\n",
" self._state = state\n",
" @property\n",
" def transport_id(self):\n",
" return self._transport_id\n",
" @transport_id.setter\n",
" def transport_id(self, transport_id):\n",
" self._transport_id = transport_id\n",
" @property\n",
" def transport_info(self):\n",
" return self._transport_info\n",
" @transport_info.setter\n",
" def transport_info(self, transport_info):\n",
" if transport_info is None:\n",
" raise ValueError(\"Invalid value for `transport_info`, must not be `None`\") # noqa: E501\n",
" self._transport_info = transport_info\n",
" @property\n",
" def serializer(self):\n",
" return self._serializer\n",
" @serializer.setter\n",
" def serializer(self, serializer):\n",
" if serializer is None:\n",
" raise ValueError(\"Invalid value for `serializer`, must not be `None`\") # noqa: E501\n",
" self._serializer = serializer\n",
" @property\n",
" def scope_of_locality(self):\n",
" return self._scope_of_locality\n",
" @scope_of_locality.setter\n",
" def scope_of_locality(self, scope_of_locality):\n",
" self._scope_of_locality = scope_of_locality\n",
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
" def consumed_local_only(self):\n",
" return self._consumed_local_only\n",
" @consumed_local_only.setter\n",
" def consumed_local_only(self, consumed_local_only):\n",
" self._consumed_local_only = consumed_local_only\n",
" @property\n",
" def is_local(self):\n",
" return self._is_local\n",
" @is_local.setter\n",
" def is_local(self, is_local):\n",
" self._is_local = is_local\n",
" @property\n",
" def liveness_interval(self):\n",
" return self._liveness_interval\n",
" @liveness_interval.setter\n",
" def liveness_interval(self, liveness_interval):\n",
" self._liveness_interval = liveness_interval\n",
" @property\n",
" def links(self):\n",
" return self._links\n",
" @links.setter\n",
" def links(self, links):\n",
" self._links = links\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, \"to_dict\"):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"class CategoryRef(object):\n",
" swagger_types = {'href': 'str','id': 'str','name': 'str','version': 'str'}\n",
" attribute_map = {'href': 'href','id': 'id','name': 'name','version': 'version'}\n",
" def __init__(self, href=None, id=None, name=None, version=None): # noqa: E501\n",
" self._href = None\n",
" self._id = None\n",
" self._name = None\n",
" self._version = None\n",
" self.discriminator = None\n",
" self.href = href\n",
" self.id = id\n",
" self.name = name\n",
" self.version = version\n",
" def href(self):\n",
" return self._href\n",
" @href.setter\n",
" def href(self, href):\n",
" if href is None:\n",
" raise ValueError(\"Invalid value for `href`, must not be `None`\") # noqa: E501\n",
" self._href = href\n",
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
" def id(self):\n",
" return self._id\n",
" @id.setter\n",
" def id(self, id):\n",
" if id is None:\n",
" raise ValueError(\"Invalid value for `id`, must not be `None`\") # noqa: E501\n",
" self._id = id\n",
" @property\n",
" def name(self):\n",
" return self._name\n",
" @name.setter\n",
" def name(self, name):\n",
" if name is None:\n",
" raise ValueError(\"Invalid value for `name`, must not be `None`\") # noqa: E501\n",
" self._name = name\n",
" @property\n",
" def version(self):\n",
" return self._version\n",
" @version.setter\n",
" def version(self, version):\n",
" if version is None:\n",
" raise ValueError(\"Invalid value for `version`, must not be `None`\") # noqa: E501\n",
" self._version = version\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, \"to_dict\"):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
"class TransportInfo(object):\n",
" swagger_types = {\n",
" 'id': 'str','name': 'str','description': 'str','type': 'str','protocol': 'str','version': 'str','endpoint': 'OneOfTransportInfoEndpoint','security': 'SecurityInfo','impl_specific_info': 'str'}\n",
" attribute_map = {'id': 'id','name': 'name','description': 'description','type': 'type','protocol': 'protocol','version': 'version','endpoint': 'endpoint','security': 'security','impl_specific_info': 'implSpecificInfo'}\n",
" def __init__(self, id=None, name=None, description=None, type=None, protocol=None, version=None, endpoint=None, security=None, impl_specific_info=None): # noqa: E501\n",
" self._id = None\n",
" self._name = None\n",
" self._description = None\n",
" self._type = None\n",
" self._protocol = None\n",
" self._version = None\n",
" self._endpoint = None\n",
" self._security = None\n",
" self._impl_specific_info = None\n",
" self.discriminator = None\n",
" self.id = id\n",
" self.name = name\n",
" if description is not None:\n",
" self.description = description\n",
" self.type = type\n",
" self.protocol = protocol\n",
" self.version = version\n",
" self.endpoint = endpoint\n",
" self.security = security\n",
" if impl_specific_info is not None:\n",
" self.impl_specific_info = impl_specific_info\n",
" def id(self):\n",
" return self._id\n",
" @id.setter\n",
" def id(self, id):\n",
" if id is None:\n",
" raise ValueError(\"Invalid value for `id`, must not be `None`\") # noqa: E501\n",
" self._id = id\n",
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
" def name(self):\n",
" return self._name\n",
" @name.setter\n",
" def name(self, name):\n",
" if name is None:\n",
" raise ValueError(\"Invalid value for `name`, must not be `None`\") # noqa: E501\n",
" self._name = name\n",
" @property\n",
" def description(self):\n",
" return self._description\n",
" @description.setter\n",
" def description(self, description):\n",
" self._description = description\n",
" @property\n",
" def type(self):\n",
" return self._type\n",
" @type.setter\n",
" def type(self, type):\n",
" if type is None:\n",
" raise ValueError(\"Invalid value for `type`, must not be `None`\") # noqa: E501\n",
" self._type = type\n",
" @property\n",
" def protocol(self):\n",
" return self._protocol\n",
" @protocol.setter\n",
" def protocol(self, protocol):\n",
" if protocol is None:\n",
" raise ValueError(\"Invalid value for `protocol`, must not be `None`\") # noqa: E501\n",
" self._protocol = protocol\n",
" @property\n",
" def version(self):\n",
" return self._version\n",
" @version.setter\n",
" def version(self, version):\n",
" if version is None:\n",
" raise ValueError(\"Invalid value for `version`, must not be `None`\") # noqa: E501\n",
" self._version = version\n",
" @property\n",
" def endpoint(self):\n",
" return self._endpoint\n",
" @endpoint.setter\n",
" def endpoint(self, endpoint):\n",
" if endpoint is None:\n",
" raise ValueError(\"Invalid value for `endpoint`, must not be `None`\") # noqa: E501\n",
" self._endpoint = endpoint\n",
" @property\n",
" def security(self):\n",
" return self._security\n",
" @security.setter\n",
" def security(self, security):\n",
" if security is None:\n",
" raise ValueError(\"Invalid value for `security`, must not be `None`\") # noqa: E501\n",
" self._security = security\n",
" @property\n",
" def impl_specific_info(self):\n",
" return self._impl_specific_info\n",
" @impl_specific_info.setter\n",
" def impl_specific_info(self, impl_specific_info):\n",
" self._impl_specific_info = impl_specific_info\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, \"to_dict\"):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class SecurityInfo(object):\n",
" swagger_types = {'o_auth2_info': 'SecurityInfoOAuth2Info'}\n",
" attribute_map = {'o_auth2_info': 'oAuth2Info'}\n",
" def __init__(self, o_auth2_info=None): # noqa: E501\n",
" self._o_auth2_info = None\n",
" self.discriminator = None\n",
" if o_auth2_info is not None:\n",
" self.o_auth2_info = o_auth2_info\n",
" def o_auth2_info(self):\n",
" return self._o_auth2_info\n",
" @o_auth2_info.setter\n",
" def o_auth2_info(self, o_auth2_info):\n",
" self._o_auth2_info = o_auth2_info\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, \"to_dict\"):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class SecurityInfoOAuth2Info(object):\n",
" swagger_types = {'grant_types': 'list[str]','token_endpoint': 'str'}\n",
" attribute_map = {'grant_types': 'grantTypes','token_endpoint': 'tokenEndpoint'}\n",
" def __init__(self, grant_types=None, token_endpoint=None): # noqa: E501\n",
" self._grant_types = None\n",
" self._token_endpoint = None\n",
" self.discriminator = None\n",
" self.grant_types = grant_types\n",
" self.token_endpoint = token_endpoint\n",
" def grant_types(self):\n",
" return self._grant_types\n",
" @grant_types.setter\n",
" def grant_types(self, grant_types):\n",
" if grant_types is None:\n",
" raise ValueError(\"Invalid value for `grant_types`, must not be `None`\") # noqa: E501\n",
" self._grant_types = grant_types\n",
" def token_endpoint(self):\n",
" return self._token_endpoint\n",
" @token_endpoint.setter\n",
" def token_endpoint(self, token_endpoint):\n",
" if token_endpoint is None:\n",
" raise ValueError(\"Invalid value for `token_endpoint`, must not be `None`\") # noqa: E501\n",
" self._token_endpoint = token_endpoint\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, \"to_dict\"):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class OneOfTransportInfoEndpoint(object):\n",
" swagger_types = {}\n",
" attribute_map = {}\n",
" def __init__(self): # noqa: E501\n",
" self.discriminator = None\n",
" def uris(self):\n",
" return self._uris\n",
" @uris.setter\n",
" def uris(self, uris):\n",
" self._uris = uris\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, \"to_dict\"):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" if not isinstance(other, OneOfTransportInfoEndpoint):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class EndPointInfoUris(object):\n",
" swagger_types = {'_uris': 'list[str]'}\n",
" attribute_map = {'_uris': 'uris'}\n",
" def __init__(self, uris:list): # noqa: E501\n",
" self._uris = None\n",
" self.uris = uris\n",
" def uris(self):\n",
" return self._uris\n",
" @uris.setter\n",
" def uris(self, uris):\n",
" self._uris = uris\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x,value))\n",
" elif hasattr(value, 'to_dict'):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" if hasattr(item[1], 'to_dict') else item,\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class EndPointInfoFqdn(object):\n",
" swagger_types = {'_fqdn': 'list[str]'}\n",
" attribute_map = {'_fqdn': 'fqdn'}\n",
" def __init__(self, fqdn:list): # noqa: E501\n",
" self._fqdn = None\n",
" self.fqdn = fqdn\n",
" def fqdn(self):\n",
" return self._fqdn\n",
" @fqdn.setter\n",
" def fqdn(self, fqdn):\n",
" self._fqdn = fqdn\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x,value))\n",
" elif hasattr(value, 'to_dict'):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" if hasattr(item[1], 'to_dict') else item,\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class EndPointInfoAddress(object):\n",
" swagger_types = {'_host': 'str', '_port': 'int'}\n",
" attribute_map = {'_host': 'host', '_port': 'port'}\n",
" def __init__(self, host:str, port:list): # noqa: E501\n",
" self._host = None\n",
" self._port = None\n",
" self.host = host\n",
" self.port = port\n",
" def host(self):\n",
" return self.host\n",
" @host.setter\n",
" def host(self, host):\n",
" self._host = host\n",
" def port(self):\n",
" return self._port\n",
" @port.setter\n",
" def port(self, port):\n",
" self._port = qosport_kpi\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(\n",
" lambda x: x.to_dict() if hasattr(x, 'to_dict') else x,\n",
" value\n",
" ))\n",
" elif hasattr(value, 'to_dict'):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" if hasattr(item[1], 'to_dict') else item,\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",
" return result\n",
" def to_str(self):\n",
" return pprint.pformat(self.to_dict())\n",
" def __repr__(self):\n",
" return self.to_str()\n",
" def __eq__(self, other):\n",
" return False\n",
" return self.__dict__ == other.__dict__\n",
" def __ne__(self, other):\n",
" return not self == other\n",
"\n",
"class EndPointInfoAddresses(object):\n",
" swagger_types = {'_addresses': 'list[EndPointInfoAddress]'}\n",
" attribute_map = {'_addresses': 'addresses'}\n",
" def __init__(self, addresses:list): # noqa: E501\n",
" self._addresses = None\n",
" self.addresses = addresses\n",
" def addresses(self):\n",
" return self._addresses\n",
" @addresses.setter\n",
" def addresses(self, addresses):\n",
" self._addresses = addresses\n",
" def to_dict(self):\n",
" result = {}\n",
" for attr, _ in six.iteritems(self.swagger_types):\n",
" value = getattr(self, attr)\n",
" if isinstance(value, list):\n",
" result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x,value))\n",
" elif hasattr(value, 'to_dict'):\n",
" result[attr] = value.to_dict()\n",
" elif isinstance(value, dict):\n",
" result[attr] = dict(map(\n",
" lambda item: (item[0], item[1].to_dict())\n",
" if hasattr(item[1], 'to_dict') else item,\n",
" value.items()\n",
" ))\n",
" else:\n",
" result[attr] = value\n",
" for key, value in self.items():\n",
" result[key] = value\n",