From 8b79b64346df924c7c603e205750ce8ae990eeb5 Mon Sep 17 00:00:00 2001 From: Ayesha Ayub Date: Thu, 22 Dec 2022 15:10:12 +0500 Subject: [PATCH 1/3] Implement MEC015 Traffic Management APIs --- .meepctl-repocfg.yaml | 91 +- charts/meep-tm/.helmignore | 21 + charts/meep-tm/Chart.yaml | 5 + charts/meep-tm/templates/_helpers.tpl | 32 + .../meep-tm/templates/clusterrolebinding.yaml | 12 + charts/meep-tm/templates/codecov-pv.yaml | 35 + charts/meep-tm/templates/deployment.yaml | 65 + charts/meep-tm/templates/ingress.yaml | 39 + charts/meep-tm/templates/monitor.yaml | 33 + charts/meep-tm/templates/service.yaml | 28 + charts/meep-tm/templates/serviceaccount.yaml | 4 + charts/meep-tm/values-template.yaml | 91 + docs/api-bwm/.openapi-generator-ignore | 23 + docs/api-bwm/.openapi-generator/FILES | 14 + docs/api-bwm/.openapi-generator/VERSION | 1 + docs/api-bwm/Apis/BwmApi.md | 191 ++ docs/api-bwm/Apis/LocationApi.md | 36 + .../Models/AppTerminationNotification.md | 12 + .../Models/AppTerminationNotificationLinks.md | 10 + docs/api-bwm/Models/BwInfo.md | 17 + docs/api-bwm/Models/BwInfoDeltas.md | 15 + .../Models/BwInfoDeltasSessionFilter.md | 13 + docs/api-bwm/Models/BwInfoSessionFilter.md | 13 + docs/api-bwm/Models/BwInfoTimeStamp.md | 10 + docs/api-bwm/Models/LinkType.md | 9 + docs/api-bwm/Models/OperationActionType.md | 8 + docs/api-bwm/Models/ProblemDetails.md | 13 + docs/api-bwm/README.md | 53 + docs/api-mts/.openapi-generator-ignore | 23 + docs/api-mts/.openapi-generator/FILES | 15 + docs/api-mts/.openapi-generator/VERSION | 1 + docs/api-mts/Apis/MtsApi.md | 215 ++ .../Models/AppTerminationNotification.md | 12 + .../Models/AppTerminationNotificationLinks.md | 10 + docs/api-mts/Models/LinkType.md | 9 + docs/api-mts/Models/MtsCapabilityInfo.md | 11 + .../Models/MtsCapabilityInfoMtsAccessInfo.md | 11 + .../Models/MtsCapabilityInfoTimeStamp.md | 10 + docs/api-mts/Models/MtsSessionInfo.md | 17 + .../Models/MtsSessionInfoFlowFilter.md | 15 + docs/api-mts/Models/MtsSessionInfoQosD.md | 13 + .../api-mts/Models/MtsSessionInfoTimeStamp.md | 10 + docs/api-mts/Models/OperationActionType.md | 8 + docs/api-mts/Models/ProblemDetails.md | 13 + docs/api-mts/README.md | 55 + go-apps/meep-tm/Dockerfile | 23 + go-apps/meep-tm/api/bwm/swagger.yaml | 803 ++++++ go-apps/meep-tm/api/mts/swagger.yaml | 876 +++++++ go-apps/meep-tm/entrypoint.sh | 41 + go-apps/meep-tm/go.mod | 42 + go-apps/meep-tm/go.sum | 442 ++++ go-apps/meep-tm/main.go | 96 + go-apps/meep-tm/main_test.go | 58 + go-apps/meep-tm/server/bwm/README.md | 25 + go-apps/meep-tm/server/bwm/api_bwm.go | 57 + go-apps/meep-tm/server/bwm/bwm.go | 2173 +++++++++++++++++ go-apps/meep-tm/server/bwm/convert.go | 51 + .../bwm/model_app_termination_notification.go | 37 + ...del_app_termination_notification__links.go | 32 + go-apps/meep-tm/server/bwm/model_bw_info.go | 46 + .../server/bwm/model_bw_info_deltas.go | 42 + .../model_bw_info_deltas_session_filter.go | 38 + .../bwm/model_bw_info_session_filter.go | 38 + .../server/bwm/model_bw_info_time_stamp.go | 33 + go-apps/meep-tm/server/bwm/model_link_type.go | 30 + .../server/bwm/model_operation_action_type.go | 33 + .../server/bwm/model_problem_details.go | 38 + go-apps/meep-tm/server/logger.go | 39 + go-apps/meep-tm/server/mts/README.md | 25 + go-apps/meep-tm/server/mts/api_mts.go | 57 + go-apps/meep-tm/server/mts/convert.go | 60 + .../mts/model_app_termination_notification.go | 36 + ...del_app_termination_notification__links.go | 31 + go-apps/meep-tm/server/mts/model_link_type.go | 29 + .../server/mts/model_mts_capability_info.go | 33 + ...del_mts_capability_info_mts_access_info.go | 33 + .../model_mts_capability_info_time_stamp.go | 32 + .../server/mts/model_mts_session_info.go | 45 + .../mts/model_mts_session_info_flow_filter.go | 47 + .../mts/model_mts_session_info_qos_d.go | 38 + .../mts/model_mts_session_info_time_stamp.go | 32 + .../server/mts/model_operation_action_type.go | 33 + .../server/mts/model_problem_details.go | 37 + go-apps/meep-tm/server/mts/mts.go | 1415 +++++++++++ go-apps/meep-tm/server/routers.go | 188 ++ go-apps/meep-tm/server/traffic-mgmt.go | 335 +++ go-apps/meep-tm/server/traffic-mgmt_test.go | 1585 ++++++++++++ .../meep-applications/application-store.go | 2 +- go-packages/meep-bwm-client/.gitignore | 24 + .../meep-bwm-client/.swagger-codegen-ignore | 23 + .../meep-bwm-client/.swagger-codegen/VERSION | 1 + go-packages/meep-bwm-client/.travis.yml | 8 + go-packages/meep-bwm-client/README.md | 53 + go-packages/meep-bwm-client/api/swagger.yaml | 803 ++++++ go-packages/meep-bwm-client/api_bwm.go | 816 +++++++ go-packages/meep-bwm-client/client.go | 488 ++++ go-packages/meep-bwm-client/configuration.go | 86 + .../docs/AppTerminationNotification.md | 12 + .../docs/AppTerminationNotificationLinks.md | 10 + go-packages/meep-bwm-client/docs/BwInfo.md | 17 + .../meep-bwm-client/docs/BwInfoDeltas.md | 15 + .../docs/BwInfoDeltasSessionFilter.md | 13 + .../docs/BwInfoSessionFilter.md | 13 + .../meep-bwm-client/docs/BwInfoTimeStamp.md | 10 + go-packages/meep-bwm-client/docs/BwmApi.md | 191 ++ go-packages/meep-bwm-client/docs/LinkType.md | 9 + .../meep-bwm-client/docs/LocationApi.md | 36 + .../docs/OperationActionType.md | 8 + .../meep-bwm-client/docs/ProblemDetails.md | 13 + go-packages/meep-bwm-client/git_push.sh | 52 + go-packages/meep-bwm-client/go.mod | 15 + go-packages/meep-bwm-client/go.sum | 639 +++++ .../model_app_termination_notification.go | 34 + ...del_app_termination_notification__links.go | 30 + go-packages/meep-bwm-client/model_bw_info.go | 44 + .../meep-bwm-client/model_bw_info_deltas.go | 41 + .../model_bw_info_deltas_session_filter.go | 37 + .../model_bw_info_session_filter.go | 37 + .../model_bw_info_time_stamp.go | 32 + .../meep-bwm-client/model_link_type.go | 29 + .../model_operation_action_type.go | 33 + .../meep-bwm-client/model_problem_details.go | 37 + go-packages/meep-bwm-client/response.go | 57 + go-packages/meep-mts-client/.gitignore | 24 + .../meep-mts-client/.swagger-codegen-ignore | 23 + .../meep-mts-client/.swagger-codegen/VERSION | 1 + go-packages/meep-mts-client/.travis.yml | 8 + go-packages/meep-mts-client/README.md | 53 + go-packages/meep-mts-client/api/swagger.yaml | 876 +++++++ go-packages/meep-mts-client/api_mts.go | 805 ++++++ go-packages/meep-mts-client/client.go | 488 ++++ go-packages/meep-mts-client/configuration.go | 86 + .../docs/AppTerminationNotification.md | 12 + .../docs/AppTerminationNotificationLinks.md | 10 + go-packages/meep-mts-client/docs/LinkType.md | 9 + go-packages/meep-mts-client/docs/MtsApi.md | 215 ++ .../meep-mts-client/docs/MtsCapabilityInfo.md | 11 + .../docs/MtsCapabilityInfoMtsAccessInfo.md | 11 + .../docs/MtsCapabilityInfoTimeStamp.md | 10 + .../meep-mts-client/docs/MtsSessionInfo.md | 17 + .../docs/MtsSessionInfoFlowFilter.md | 15 + .../docs/MtsSessionInfoQosD.md | 13 + .../docs/MtsSessionInfoTimeStamp.md | 10 + .../docs/OperationActionType.md | 8 + .../meep-mts-client/docs/ProblemDetails.md | 13 + go-packages/meep-mts-client/git_push.sh | 52 + go-packages/meep-mts-client/go.mod | 12 + go-packages/meep-mts-client/go.sum | 638 +++++ .../model_app_termination_notification.go | 34 + ...del_app_termination_notification__links.go | 30 + .../meep-mts-client/model_link_type.go | 29 + .../model_mts_capability_info.go | 32 + ...del_mts_capability_info_mts_access_info.go | 33 + .../model_mts_capability_info_time_stamp.go | 32 + .../meep-mts-client/model_mts_session_info.go | 43 + .../model_mts_session_info_flow_filter.go | 41 + .../model_mts_session_info_qos_d.go | 38 + .../model_mts_session_info_time_stamp.go | 32 + .../model_operation_action_type.go | 33 + .../meep-mts-client/model_problem_details.go | 37 + go-packages/meep-mts-client/response.go | 57 + 161 files changed, 18183 insertions(+), 2 deletions(-) create mode 100644 charts/meep-tm/.helmignore create mode 100644 charts/meep-tm/Chart.yaml create mode 100644 charts/meep-tm/templates/_helpers.tpl create mode 100644 charts/meep-tm/templates/clusterrolebinding.yaml create mode 100644 charts/meep-tm/templates/codecov-pv.yaml create mode 100644 charts/meep-tm/templates/deployment.yaml create mode 100644 charts/meep-tm/templates/ingress.yaml create mode 100644 charts/meep-tm/templates/monitor.yaml create mode 100644 charts/meep-tm/templates/service.yaml create mode 100644 charts/meep-tm/templates/serviceaccount.yaml create mode 100644 charts/meep-tm/values-template.yaml create mode 100644 docs/api-bwm/.openapi-generator-ignore create mode 100644 docs/api-bwm/.openapi-generator/FILES create mode 100644 docs/api-bwm/.openapi-generator/VERSION create mode 100644 docs/api-bwm/Apis/BwmApi.md create mode 100644 docs/api-bwm/Apis/LocationApi.md create mode 100644 docs/api-bwm/Models/AppTerminationNotification.md create mode 100644 docs/api-bwm/Models/AppTerminationNotificationLinks.md create mode 100644 docs/api-bwm/Models/BwInfo.md create mode 100644 docs/api-bwm/Models/BwInfoDeltas.md create mode 100644 docs/api-bwm/Models/BwInfoDeltasSessionFilter.md create mode 100644 docs/api-bwm/Models/BwInfoSessionFilter.md create mode 100644 docs/api-bwm/Models/BwInfoTimeStamp.md create mode 100644 docs/api-bwm/Models/LinkType.md create mode 100644 docs/api-bwm/Models/OperationActionType.md create mode 100644 docs/api-bwm/Models/ProblemDetails.md create mode 100644 docs/api-bwm/README.md create mode 100644 docs/api-mts/.openapi-generator-ignore create mode 100644 docs/api-mts/.openapi-generator/FILES create mode 100644 docs/api-mts/.openapi-generator/VERSION create mode 100644 docs/api-mts/Apis/MtsApi.md create mode 100644 docs/api-mts/Models/AppTerminationNotification.md create mode 100644 docs/api-mts/Models/AppTerminationNotificationLinks.md create mode 100644 docs/api-mts/Models/LinkType.md create mode 100644 docs/api-mts/Models/MtsCapabilityInfo.md create mode 100644 docs/api-mts/Models/MtsCapabilityInfoMtsAccessInfo.md create mode 100644 docs/api-mts/Models/MtsCapabilityInfoTimeStamp.md create mode 100644 docs/api-mts/Models/MtsSessionInfo.md create mode 100644 docs/api-mts/Models/MtsSessionInfoFlowFilter.md create mode 100644 docs/api-mts/Models/MtsSessionInfoQosD.md create mode 100644 docs/api-mts/Models/MtsSessionInfoTimeStamp.md create mode 100644 docs/api-mts/Models/OperationActionType.md create mode 100644 docs/api-mts/Models/ProblemDetails.md create mode 100644 docs/api-mts/README.md create mode 100644 go-apps/meep-tm/Dockerfile create mode 100644 go-apps/meep-tm/api/bwm/swagger.yaml create mode 100644 go-apps/meep-tm/api/mts/swagger.yaml create mode 100644 go-apps/meep-tm/entrypoint.sh create mode 100644 go-apps/meep-tm/go.mod create mode 100644 go-apps/meep-tm/go.sum create mode 100644 go-apps/meep-tm/main.go create mode 100644 go-apps/meep-tm/main_test.go create mode 100644 go-apps/meep-tm/server/bwm/README.md create mode 100644 go-apps/meep-tm/server/bwm/api_bwm.go create mode 100644 go-apps/meep-tm/server/bwm/bwm.go create mode 100644 go-apps/meep-tm/server/bwm/convert.go create mode 100644 go-apps/meep-tm/server/bwm/model_app_termination_notification.go create mode 100644 go-apps/meep-tm/server/bwm/model_app_termination_notification__links.go create mode 100644 go-apps/meep-tm/server/bwm/model_bw_info.go create mode 100644 go-apps/meep-tm/server/bwm/model_bw_info_deltas.go create mode 100644 go-apps/meep-tm/server/bwm/model_bw_info_deltas_session_filter.go create mode 100644 go-apps/meep-tm/server/bwm/model_bw_info_session_filter.go create mode 100644 go-apps/meep-tm/server/bwm/model_bw_info_time_stamp.go create mode 100644 go-apps/meep-tm/server/bwm/model_link_type.go create mode 100644 go-apps/meep-tm/server/bwm/model_operation_action_type.go create mode 100644 go-apps/meep-tm/server/bwm/model_problem_details.go create mode 100644 go-apps/meep-tm/server/logger.go create mode 100644 go-apps/meep-tm/server/mts/README.md create mode 100644 go-apps/meep-tm/server/mts/api_mts.go create mode 100644 go-apps/meep-tm/server/mts/convert.go create mode 100644 go-apps/meep-tm/server/mts/model_app_termination_notification.go create mode 100644 go-apps/meep-tm/server/mts/model_app_termination_notification__links.go create mode 100644 go-apps/meep-tm/server/mts/model_link_type.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_capability_info.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_capability_info_mts_access_info.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_capability_info_time_stamp.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_session_info.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_session_info_flow_filter.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_session_info_qos_d.go create mode 100644 go-apps/meep-tm/server/mts/model_mts_session_info_time_stamp.go create mode 100644 go-apps/meep-tm/server/mts/model_operation_action_type.go create mode 100644 go-apps/meep-tm/server/mts/model_problem_details.go create mode 100644 go-apps/meep-tm/server/mts/mts.go create mode 100644 go-apps/meep-tm/server/routers.go create mode 100644 go-apps/meep-tm/server/traffic-mgmt.go create mode 100644 go-apps/meep-tm/server/traffic-mgmt_test.go create mode 100644 go-packages/meep-bwm-client/.gitignore create mode 100644 go-packages/meep-bwm-client/.swagger-codegen-ignore create mode 100644 go-packages/meep-bwm-client/.swagger-codegen/VERSION create mode 100644 go-packages/meep-bwm-client/.travis.yml create mode 100644 go-packages/meep-bwm-client/README.md create mode 100644 go-packages/meep-bwm-client/api/swagger.yaml create mode 100644 go-packages/meep-bwm-client/api_bwm.go create mode 100644 go-packages/meep-bwm-client/client.go create mode 100644 go-packages/meep-bwm-client/configuration.go create mode 100644 go-packages/meep-bwm-client/docs/AppTerminationNotification.md create mode 100644 go-packages/meep-bwm-client/docs/AppTerminationNotificationLinks.md create mode 100644 go-packages/meep-bwm-client/docs/BwInfo.md create mode 100644 go-packages/meep-bwm-client/docs/BwInfoDeltas.md create mode 100644 go-packages/meep-bwm-client/docs/BwInfoDeltasSessionFilter.md create mode 100644 go-packages/meep-bwm-client/docs/BwInfoSessionFilter.md create mode 100644 go-packages/meep-bwm-client/docs/BwInfoTimeStamp.md create mode 100644 go-packages/meep-bwm-client/docs/BwmApi.md create mode 100644 go-packages/meep-bwm-client/docs/LinkType.md create mode 100644 go-packages/meep-bwm-client/docs/LocationApi.md create mode 100644 go-packages/meep-bwm-client/docs/OperationActionType.md create mode 100644 go-packages/meep-bwm-client/docs/ProblemDetails.md create mode 100644 go-packages/meep-bwm-client/git_push.sh create mode 100644 go-packages/meep-bwm-client/go.mod create mode 100644 go-packages/meep-bwm-client/go.sum create mode 100644 go-packages/meep-bwm-client/model_app_termination_notification.go create mode 100644 go-packages/meep-bwm-client/model_app_termination_notification__links.go create mode 100644 go-packages/meep-bwm-client/model_bw_info.go create mode 100644 go-packages/meep-bwm-client/model_bw_info_deltas.go create mode 100644 go-packages/meep-bwm-client/model_bw_info_deltas_session_filter.go create mode 100644 go-packages/meep-bwm-client/model_bw_info_session_filter.go create mode 100644 go-packages/meep-bwm-client/model_bw_info_time_stamp.go create mode 100644 go-packages/meep-bwm-client/model_link_type.go create mode 100644 go-packages/meep-bwm-client/model_operation_action_type.go create mode 100644 go-packages/meep-bwm-client/model_problem_details.go create mode 100644 go-packages/meep-bwm-client/response.go create mode 100644 go-packages/meep-mts-client/.gitignore create mode 100644 go-packages/meep-mts-client/.swagger-codegen-ignore create mode 100644 go-packages/meep-mts-client/.swagger-codegen/VERSION create mode 100644 go-packages/meep-mts-client/.travis.yml create mode 100644 go-packages/meep-mts-client/README.md create mode 100644 go-packages/meep-mts-client/api/swagger.yaml create mode 100644 go-packages/meep-mts-client/api_mts.go create mode 100644 go-packages/meep-mts-client/client.go create mode 100644 go-packages/meep-mts-client/configuration.go create mode 100644 go-packages/meep-mts-client/docs/AppTerminationNotification.md create mode 100644 go-packages/meep-mts-client/docs/AppTerminationNotificationLinks.md create mode 100644 go-packages/meep-mts-client/docs/LinkType.md create mode 100644 go-packages/meep-mts-client/docs/MtsApi.md create mode 100644 go-packages/meep-mts-client/docs/MtsCapabilityInfo.md create mode 100644 go-packages/meep-mts-client/docs/MtsCapabilityInfoMtsAccessInfo.md create mode 100644 go-packages/meep-mts-client/docs/MtsCapabilityInfoTimeStamp.md create mode 100644 go-packages/meep-mts-client/docs/MtsSessionInfo.md create mode 100644 go-packages/meep-mts-client/docs/MtsSessionInfoFlowFilter.md create mode 100644 go-packages/meep-mts-client/docs/MtsSessionInfoQosD.md create mode 100644 go-packages/meep-mts-client/docs/MtsSessionInfoTimeStamp.md create mode 100644 go-packages/meep-mts-client/docs/OperationActionType.md create mode 100644 go-packages/meep-mts-client/docs/ProblemDetails.md create mode 100644 go-packages/meep-mts-client/git_push.sh create mode 100644 go-packages/meep-mts-client/go.mod create mode 100644 go-packages/meep-mts-client/go.sum create mode 100644 go-packages/meep-mts-client/model_app_termination_notification.go create mode 100644 go-packages/meep-mts-client/model_app_termination_notification__links.go create mode 100644 go-packages/meep-mts-client/model_link_type.go create mode 100644 go-packages/meep-mts-client/model_mts_capability_info.go create mode 100644 go-packages/meep-mts-client/model_mts_capability_info_mts_access_info.go create mode 100644 go-packages/meep-mts-client/model_mts_capability_info_time_stamp.go create mode 100644 go-packages/meep-mts-client/model_mts_session_info.go create mode 100644 go-packages/meep-mts-client/model_mts_session_info_flow_filter.go create mode 100644 go-packages/meep-mts-client/model_mts_session_info_qos_d.go create mode 100644 go-packages/meep-mts-client/model_mts_session_info_time_stamp.go create mode 100644 go-packages/meep-mts-client/model_operation_action_type.go create mode 100644 go-packages/meep-mts-client/model_problem_details.go create mode 100644 go-packages/meep-mts-client/response.go diff --git a/.meepctl-repocfg.yaml b/.meepctl-repocfg.yaml index de2442fba..88c183f4e 100644 --- a/.meepctl-repocfg.yaml +++ b/.meepctl-repocfg.yaml @@ -298,7 +298,9 @@ repo: - meep-loc-serv - meep-metrics-engine - meep-mg-manager - - meep-rnis + - meep-rnis + - meep-dai + - meep-tm - meep-wais - meep-ams - meep-sandbox-ctrl @@ -377,6 +379,8 @@ repo: meep-metrics-engine: charts/meep-metrics-engine meep-mg-manager: charts/meep-mg-manager meep-rnis: charts/meep-rnis + meep-dai: charts/meep-dai + meep-tm: charts/meep-tm meep-wais: charts/meep-wais meep-ams: charts/meep-ams meep-sandbox-ctrl: charts/meep-sandbox-ctrl @@ -391,6 +395,8 @@ repo: - meep-metrics-engine - meep-mg-manager - meep-rnis + - meep-dai + - meep-tm - meep-wais - meep-ams - meep-sandbox-ctrl @@ -741,6 +747,40 @@ repo: codecov: false # supports linting lint: true + meep-tm: + # location of source code + src: go-apps/meep-tm + # location of binary + bin: bin/meep-tm + # location of deployment chart + chart: charts/meep-tm + # user supplied value file located @ .meep/user/values (use below file name) + chart-user-values: meep-tm.yaml + # extra build flags + build-flags: + - -mod=vendor + # enable meepctl build + build: true + # enable meepctl dockerize + dockerize: true + # enable meepctl deploy/delete + deploy: true + # supports code coverage measurement when built in codecov mode + codecov: true + # supports linting + lint: true + # location of API specifications + api: + - name: 'AdvantEDGE MEC Bandwidth Management REST API' + file: go-apps/meep-tm/api/bwm/swagger.yaml + - name: 'AdvantEDGE MEC Multi-access Traffic Steering REST API' + file: go-apps/meep-tm/api/mts/swagger.yaml + # location of user supplied API specifications + user-api: + # resources available to docker container image + docker-data: + # location of entry script + 'entrypoint.sh': go-apps/meep-tm/entrypoint.sh meep-wais: # location of source code src: go-apps/meep-wais @@ -805,6 +845,40 @@ repo: docker-data: # location of entry script 'entrypoint.sh': go-apps/meep-vis/entrypoint.sh + meep-dai: + # location of source code + src: go-apps/meep-dai + # location of binary + bin: bin/meep-dai + # location of deployment chart + chart: charts/meep-dai + # user supplied value file located @ .meep/user/values (use below file name) + chart-user-values: meep-dai.yaml + # extra build flags + build-flags: + - -mod=vendor + # enable meepctl build + build: true + # enable meepctl dockerize + dockerize: true + # enable meepctl deploy/delete + deploy: true + # supports code coverage measurement when built in codecov mode + codecov: true + # supports onboarded device application instantiation + onboardedapp: true + # supports linting + lint: true + # location of API specifications + api: + - name: 'AdvantEDGE Device Application Interface Service REST API' + file: go-apps/meep-dai/api/swagger.yaml + # location of user supplied API specifications + user-api: + # resources available to docker container image + docker-data: + # location of entry script + 'entrypoint.sh': go-apps/meep-dai/entrypoint.sh #------------------------------ # Dependencies @@ -975,6 +1049,11 @@ repo: src: go-packages/meep-applications # supports linting lint: true + meep-bwm-client: + # location of source code + src: go-packages/meep-bwm-client + # supports linting + lint: false meep-couch: # location of source code src: go-packages/meep-couch @@ -1055,6 +1134,11 @@ repo: src: go-packages/meep-model # supports linting lint: true + meep-mts-client: + # location of source code + src: go-packages/meep-mts-client + # supports linting + lint: false meep-mq: # location of source code src: go-packages/meep-mq @@ -1145,6 +1229,11 @@ repo: src: go-packages/meep-websocket # supports linting lint: true + meep-dai-client: + # location of source code + src: go-packages/meep-dai-client + # supports linting + lint: false # Javascript Packages js-packages: diff --git a/charts/meep-tm/.helmignore b/charts/meep-tm/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/charts/meep-tm/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/charts/meep-tm/Chart.yaml b/charts/meep-tm/Chart.yaml new file mode 100644 index 000000000..f854ea40a --- /dev/null +++ b/charts/meep-tm/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: '1.0.0' +description: MEEP Edge Platform Traffic Management Service Helm chart for Kubernetes +name: meep-tm +version: 1.0.0 diff --git a/charts/meep-tm/templates/_helpers.tpl b/charts/meep-tm/templates/_helpers.tpl new file mode 100644 index 000000000..674008691 --- /dev/null +++ b/charts/meep-tm/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meep-tm.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "meep-tm.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "meep-tm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/charts/meep-tm/templates/clusterrolebinding.yaml b/charts/meep-tm/templates/clusterrolebinding.yaml new file mode 100644 index 000000000..6a6f208f3 --- /dev/null +++ b/charts/meep-tm/templates/clusterrolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: "{{ .Release.Namespace }}:{{ template "meep-tm.fullname" . }}" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: +- kind: ServiceAccount + name: {{ template "meep-tm.fullname" . }} + namespace: {{ .Release.Namespace }} diff --git a/charts/meep-tm/templates/codecov-pv.yaml b/charts/meep-tm/templates/codecov-pv.yaml new file mode 100644 index 000000000..a74a3088b --- /dev/null +++ b/charts/meep-tm/templates/codecov-pv.yaml @@ -0,0 +1,35 @@ +{{- if .Values.codecov.enabled}} +kind: PersistentVolume +apiVersion: v1 +metadata: + name: meep-tm-codecov-pv +spec: + storageClassName: meep-tm-codecov-sc + capacity: + storage: 100Mi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: {{ .Values.codecov.location }} + +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: meep-tm-codecov-sc +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: meep-tm-codecov-pvc +spec: + storageClassName: meep-tm-codecov-sc + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +{{- end}} diff --git a/charts/meep-tm/templates/deployment.yaml b/charts/meep-tm/templates/deployment.yaml new file mode 100644 index 000000000..887a2b63b --- /dev/null +++ b/charts/meep-tm/templates/deployment.yaml @@ -0,0 +1,65 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "meep-tm.fullname" . }} + labels: + app: {{ template "meep-tm.name" . }} + chart: {{ template "meep-tm.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + meepOrigin: {{ .Values.meepOrigin }} +spec: + replicas: {{ .Values.deployment.replicas }} + selector: + matchLabels: + app: {{ template "meep-tm.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "meep-tm.name" . }} + release: {{ .Release.Name }} + meepOrigin: {{ .Values.meepOrigin }} + spec: + serviceAccountName: {{ .Values.serviceAccount }} + {{- if .Values.codecov.enabled}} + volumes: + - name: codecov-storage + persistentVolumeClaim: + claimName: meep-tm-codecov-pvc + {{- end}} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- if .Values.codecov.enabled}} + command: [ "/meep-tm" ] + args: [ "-test.coverprofile=/codecov/codecov-meep-tm.out", "__DEVEL--code-cov" ] + {{- end}} + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.deployment.port }} + protocol: {{ .Values.deployment.protocol }} + env: + {{- range $key, $value := .Values.image.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- if .Values.codecov.enabled}} + volumeMounts: + - name: codecov-storage + mountPath: /codecov + {{- end}} + terminationGracePeriodSeconds: 5 + initContainers: + {{- range $value := .Values.deployment.dependencies.system }} + - name: init-system-{{ $value }} + image: busybox:1.28 + imagePullPolicy: IfNotPresent + command: ['sh', '-c', 'until nslookup {{ $value }}.kube-system ; do echo waiting for {{ $value }}; sleep 0.25; done;'] + {{- end}} + {{- range $value := .Values.deployment.dependencies.namespace }} + - name: init-{{ $value }} + image: busybox:1.28 + imagePullPolicy: IfNotPresent + command: ['sh', '-c', 'until nslookup {{ $value }} ; do echo waiting for {{ $value }}; sleep 0.25; done;'] + {{- end}} diff --git a/charts/meep-tm/templates/ingress.yaml b/charts/meep-tm/templates/ingress.yaml new file mode 100644 index 000000000..2febb4988 --- /dev/null +++ b/charts/meep-tm/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ingress.enabled -}} +{{- $serviceName := .Values.service.name -}} +{{- $servicePort := .Values.service.port -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $serviceName }} + labels: + app: {{ template "meep-tm.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.ingress.labels }} +{{ toYaml .Values.ingress.labels | indent 4 }} +{{- end }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + rules: + {{- range .Values.ingress.hosts }} + - http: + paths: + {{- range $path := .paths }} + - path: {{ $path }} + backend: + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end -}} + {{- if .name }} + host: {{ .name }} + {{- end }} + {{- end -}} + {{- if .Values.ingress.tls }} + tls: +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end -}} +{{- end -}} diff --git a/charts/meep-tm/templates/monitor.yaml b/charts/meep-tm/templates/monitor.yaml new file mode 100644 index 000000000..32f0e3d1c --- /dev/null +++ b/charts/meep-tm/templates/monitor.yaml @@ -0,0 +1,33 @@ +{{- if .Values.prometheus.monitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "meep-tm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "meep-tm.name" . }} + chart: {{ template "meep-tm.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + meepOrigin: {{ .Values.meepOrigin }} + {{- if .Values.prometheus.monitor.additionalLabels }} +{{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }} + {{- end }} +spec: + selector: + matchLabels: + app: {{ template "meep-tm.name" . }} + release: {{ .Release.Name }} + endpoints: + - port: metrics + {{- if .Values.prometheus.monitor.interval }} + interval: {{ .Values.prometheus.monitor.interval }} + {{- end }} + {{- if .Values.prometheus.monitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }} + {{- end }} +{{- if .Values.prometheus.monitor.relabelings }} + relabelings: +{{ toYaml .Values.prometheus.monitor.relabelings | indent 6 }} +{{- end }} +{{- end }} diff --git a/charts/meep-tm/templates/service.yaml b/charts/meep-tm/templates/service.yaml new file mode 100644 index 000000000..fcb62ba35 --- /dev/null +++ b/charts/meep-tm/templates/service.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.service.name }} + labels: + app: {{ template "meep-tm.name" . }} + chart: {{ template "meep-tm.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + meepOrigin: {{ .Values.meepOrigin }} +spec: + type: {{ .Values.service.type }} + selector: + app: {{ template "meep-tm.name" . }} + release: {{ .Release.Name }} + ports: + - name: tm + port: {{ .Values.service.port }} + targetPort: {{ .Values.deployment.port }} + {{- if .Values.service.nodePort }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + {{- if .Values.prometheus.monitor.enabled}} + - name: metrics + port: {{ .Values.prometheus.monitor.port }} + targetPort: {{ .Values.prometheus.monitor.port }} + protocol: TCP + {{- end}} diff --git a/charts/meep-tm/templates/serviceaccount.yaml b/charts/meep-tm/templates/serviceaccount.yaml new file mode 100644 index 000000000..941747128 --- /dev/null +++ b/charts/meep-tm/templates/serviceaccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "meep-tm.fullname" . }} diff --git a/charts/meep-tm/values-template.yaml b/charts/meep-tm/values-template.yaml new file mode 100644 index 000000000..e6118813c --- /dev/null +++ b/charts/meep-tm/values-template.yaml @@ -0,0 +1,91 @@ +# Default values for meep-tm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +deployment: + replicas: 1 + port: 80 + protocol: TCP + dependencies: + system: + {{- if not .IsMepService }} + - kube-dns + {{- end }} + namespace: + +image: + repository: meep-docker-registry:30001/meep-tm + tag: latest + pullPolicy: Always + env: + MEEP_INSTANCE_ID: {{.InstanceId}} + MEEP_SANDBOX_NAME: {{.SandboxName}} + MEEP_SVC_PATH: /bwm/v1 + MEEP_HOST_URL: {{.HostUrl}} + {{- if .IsMepService }} + MEEP_MEP_NAME: {{.MepName}} + {{- end }} + {{- if eq .AppEnablement "local" }} + MEEP_APP_ENABLEMENT: {{.MepName}}-meep-app-enablement + {{- else if eq .AppEnablement "global" }} + MEEP_APP_ENABLEMENT: meep-app-enablement + {{- end }} + {{- range .Env}} + {{.}} + {{- end}} + +service: + {{- if .IsMepService }} + name: {{.MepName}}-meep-tm + {{- else }} + name: meep-tm + {{- end }} + type: ClusterIP + port: 80 + +ingress: + enabled: true + hosts: + - name: '' + paths: + {{- if .IsMepService }} + - /{{.SandboxName}}/{{.MepName}}/bwm + - /{{.SandboxName}}/{{.MepName}}/mts + {{- else }} + - /{{.SandboxName}}/bwm + - /{{.SandboxName}}/mts + {{- end }} + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + nginx.ingress.kubernetes.io/force-ssl-redirect: {{ .HttpsOnly }} + {{- if .IsMepService }} + nginx.ingress.kubernetes.io/configuration-snippet: | + rewrite ^/{{.SandboxName}}/{{.MepName}}/bwm(/|$)(.*)$ /bwm/$2 break; + rewrite ^/{{.SandboxName}}/{{.MepName}}/mts(/|$)(.*)$ /mts/$2 break; + {{- else }} + nginx.ingress.kubernetes.io/configuration-snippet: | + rewrite ^/{{.SandboxName}}/bwm(/|$)(.*)$ /bwm/$2 break; + rewrite ^/{{.SandboxName}}/mts(/|$)(.*)$ /mts/$2 break; + {{- end }} + {{- if .AuthEnabled }} + nginx.ingress.kubernetes.io/auth-url: https://$http_host/auth/v1/authenticate?svc=meep-tm&sbox={{.SandboxName}}&mep={{.MepName}} + {{- end }} + labels: {} + tls: + +prometheus: + monitor: + enabled: true + port: 9000 + interval: 10s + additionalLabels: {} + relabelings: [] + scrapeTimeout: 5s + +codecov: + enabled: false + location: "/codecov/meep-tm" + +meepOrigin: core diff --git a/docs/api-bwm/.openapi-generator-ignore b/docs/api-bwm/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/docs/api-bwm/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/docs/api-bwm/.openapi-generator/FILES b/docs/api-bwm/.openapi-generator/FILES new file mode 100644 index 000000000..16fd07f24 --- /dev/null +++ b/docs/api-bwm/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.openapi-generator-ignore +Apis/BwmApi.md +Apis/LocationApi.md +Models/AppTerminationNotification.md +Models/AppTerminationNotificationLinks.md +Models/BwInfo.md +Models/BwInfoDeltas.md +Models/BwInfoDeltasSessionFilter.md +Models/BwInfoSessionFilter.md +Models/BwInfoTimeStamp.md +Models/LinkType.md +Models/OperationActionType.md +Models/ProblemDetails.md +README.md diff --git a/docs/api-bwm/.openapi-generator/VERSION b/docs/api-bwm/.openapi-generator/VERSION new file mode 100644 index 000000000..1a487e1a2 --- /dev/null +++ b/docs/api-bwm/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-beta2 \ No newline at end of file diff --git a/docs/api-bwm/Apis/BwmApi.md b/docs/api-bwm/Apis/BwmApi.md new file mode 100644 index 000000000..ae365633c --- /dev/null +++ b/docs/api-bwm/Apis/BwmApi.md @@ -0,0 +1,191 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/bwm/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**BandwidthAllocationDELETE**](BwmApi.md#BandwidthAllocationDELETE) | **Delete** /bw_allocations/{allocationId} | Remove a specific bandwidthAllocation +[**BandwidthAllocationGET**](BwmApi.md#BandwidthAllocationGET) | **Get** /bw_allocations/{allocationId} | Retrieve information about a specific bandwidthAllocation +[**BandwidthAllocationListGET**](BwmApi.md#BandwidthAllocationListGET) | **Get** /bw_allocations | Retrieve information about a list of bandwidthAllocation resources +[**BandwidthAllocationPATCH**](BwmApi.md#BandwidthAllocationPATCH) | **Patch** /bw_allocations/{allocationId} | Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure +[**BandwidthAllocationPOST**](BwmApi.md#BandwidthAllocationPOST) | **Post** /bw_allocations | Create a bandwidthAllocation resource +[**BandwidthAllocationPUT**](BwmApi.md#BandwidthAllocationPUT) | **Put** /bw_allocations/{allocationId} | Update the information about a specific bandwidthAllocation + +# **BandwidthAllocationDELETE** +> BandwidthAllocationDELETE(ctx, allocationId) +Remove a specific bandwidthAllocation + +Used in 'Unregister from Bandwidth Management Service' procedure as described in clause 6.2.3. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationGET** +> BwInfo BandwidthAllocationGET(ctx, allocationId) +Retrieve information about a specific bandwidthAllocation + +Retrieves information about a bandwidthAllocation resource. Typically used in 'Get configured bandwidth allocation from Bandwidth Management Service' procedure as described in clause 6.2.5. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationListGET** +> []BwInfo BandwidthAllocationListGET(ctx, optional) +Retrieve information about a list of bandwidthAllocation resources + +Retrieves information about a list of bandwidthAllocation resources. Typically used in 'Get configured bandwidth allocation from Bandwidth Management Service' procedure as described in clause 6.2.5. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BwmApiBandwidthAllocationListGETOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BwmApiBandwidthAllocationListGETOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appInstanceId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note. | + **appName** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note. | + **sessionId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note. | + +### Return type + +[**[]BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationPATCH** +> BwInfo BandwidthAllocationPATCH(ctx, body, allocationId) +Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure + +Updates the information about a bandwidthAllocation resource. As specified in ETSI GS MEC 009 [6], the PATCH HTTP method updates a resource on top of the existing resource state by just including the changes ('deltas') in the request body. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**BwInfoDeltas**](BwInfoDeltas.md)| Description of the changes to instruct the server how to modify the resource representation. | + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationPOST** +> BwInfo BandwidthAllocationPOST(ctx, body) +Create a bandwidthAllocation resource + +Used to create a bandwidthAllocation resource. Typically used in 'Register to Bandwidth Management Service' procedure as described in clause 6.2.1. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**BwInfo**](BwInfo.md)| Entity body in the request contains BwInfo to be created. | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationPUT** +> BwInfo BandwidthAllocationPUT(ctx, body, allocationId) +Update the information about a specific bandwidthAllocation + +Updates the information about a bandwidthAllocation resource. As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**BwInfo**](BwInfo.md)| BwInfo with updated information is included as entity body of the request. | + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Apis/LocationApi.md b/docs/api-bwm/Apis/LocationApi.md new file mode 100644 index 000000000..a17fcd8a1 --- /dev/null +++ b/docs/api-bwm/Apis/LocationApi.md @@ -0,0 +1,36 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/bwm/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Mec011AppTerminationPOST**](LocationApi.md#Mec011AppTerminationPOST) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination + +# **Mec011AppTerminationPOST** +> Mec011AppTerminationPOST(ctx, body) +MEC011 Application Termination notification for self termination + +Terminates itself. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppTerminationNotification**](AppTerminationNotification.md)| Termination notification details | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/AppTerminationNotification.md b/docs/api-bwm/Models/AppTerminationNotification.md new file mode 100644 index 000000000..8156e455d --- /dev/null +++ b/docs/api-bwm/Models/AppTerminationNotification.md @@ -0,0 +1,12 @@ +# AppTerminationNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationType** | **string** | Shall be set to AppTerminationNotification. | [default to null] +**OperationAction** | [***OperationActionType**](OperationActionType.md) | | [default to null] +**MaxGracefulTimeout** | **int32** | Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. | [default to null] +**Links** | [***AppTerminationNotificationLinks**](AppTerminationNotification__links.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/AppTerminationNotificationLinks.md b/docs/api-bwm/Models/AppTerminationNotificationLinks.md new file mode 100644 index 000000000..67d7f0d90 --- /dev/null +++ b/docs/api-bwm/Models/AppTerminationNotificationLinks.md @@ -0,0 +1,10 @@ +# AppTerminationNotificationLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | [***LinkType**](LinkType.md) | | [default to null] +**ConfirmTermination** | [***LinkType**](LinkType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/BwInfo.md b/docs/api-bwm/Models/BwInfo.md new file mode 100644 index 000000000..e30234abf --- /dev/null +++ b/docs/api-bwm/Models/BwInfo.md @@ -0,0 +1,17 @@ +# BwInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllocationId** | **string** | Bandwidth allocation instance identifier | [optional] [default to null] +**AllocationDirection** | **string** | The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical | [default to null] +**AppInsId** | **string** | Application instance identifier | [default to null] +**AppName** | **string** | Name of the application | [optional] [default to null] +**FixedAllocation** | **string** | Size of requested fixed BW allocation in [bps] | [default to null] +**FixedBWPriority** | **string** | Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document | [optional] [default to null] +**RequestType** | **int32** | Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION | [default to null] +**SessionFilter** | [**[]BwInfoSessionFilter**](BwInfo_sessionFilter.md) | Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected | [optional] [default to null] +**TimeStamp** | [***BwInfoTimeStamp**](BwInfo_timeStamp.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/BwInfoDeltas.md b/docs/api-bwm/Models/BwInfoDeltas.md new file mode 100644 index 000000000..913fc95ed --- /dev/null +++ b/docs/api-bwm/Models/BwInfoDeltas.md @@ -0,0 +1,15 @@ +# BwInfoDeltas + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllocationId** | **string** | Bandwidth allocation instance identifier | [optional] [default to null] +**AllocationDirection** | **string** | The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical | [optional] [default to null] +**AppInsId** | **string** | Application instance identifier | [default to null] +**FixedAllocation** | **string** | Size of requested fixed BW allocation in [bps] | [optional] [default to null] +**FixedBWPriority** | **string** | Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document | [optional] [default to null] +**RequestType** | **int32** | Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION | [default to null] +**SessionFilter** | [**[]BwInfoDeltasSessionFilter**](BwInfoDeltas_sessionFilter.md) | Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/BwInfoDeltasSessionFilter.md b/docs/api-bwm/Models/BwInfoDeltasSessionFilter.md new file mode 100644 index 000000000..01e34e8ff --- /dev/null +++ b/docs/api-bwm/Models/BwInfoDeltasSessionFilter.md @@ -0,0 +1,13 @@ +# BwInfoDeltasSessionFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DstAddress** | **string** | Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**DstPort** | **string** | Destination port identity of session | [optional] [default to null] +**Protocol** | **string** | Protocol number | [optional] [default to null] +**SourceIp** | **string** | Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**SourcePort** | **string** | Source port identity of session | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/BwInfoSessionFilter.md b/docs/api-bwm/Models/BwInfoSessionFilter.md new file mode 100644 index 000000000..81498c3ac --- /dev/null +++ b/docs/api-bwm/Models/BwInfoSessionFilter.md @@ -0,0 +1,13 @@ +# BwInfoSessionFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DstAddress** | **string** | Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**DstPort** | **string** | Destination port identity of session | [optional] [default to null] +**Protocol** | **string** | Protocol number | [optional] [default to null] +**SourceIp** | **string** | Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**SourcePort** | **string** | Source port identity of session | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/BwInfoTimeStamp.md b/docs/api-bwm/Models/BwInfoTimeStamp.md new file mode 100644 index 000000000..6c5af850b --- /dev/null +++ b/docs/api-bwm/Models/BwInfoTimeStamp.md @@ -0,0 +1,10 @@ +# BwInfoTimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NanoSeconds** | **int32** | The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] +**Seconds** | **int32** | The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/LinkType.md b/docs/api-bwm/Models/LinkType.md new file mode 100644 index 000000000..a8945efcd --- /dev/null +++ b/docs/api-bwm/Models/LinkType.md @@ -0,0 +1,9 @@ +# LinkType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | URI referring to a resource | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/OperationActionType.md b/docs/api-bwm/Models/OperationActionType.md new file mode 100644 index 000000000..4078c9e76 --- /dev/null +++ b/docs/api-bwm/Models/OperationActionType.md @@ -0,0 +1,8 @@ +# OperationActionType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/Models/ProblemDetails.md b/docs/api-bwm/Models/ProblemDetails.md new file mode 100644 index 000000000..d6f1dfeb6 --- /dev/null +++ b/docs/api-bwm/Models/ProblemDetails.md @@ -0,0 +1,13 @@ +# ProblemDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | **string** | A human-readable explanation specific to this occurrence of the problem | [optional] [default to null] +**Instance** | **string** | A URI reference that identifies the specific occurrence of the problem | [optional] [default to null] +**Status** | **int32** | The HTTP status code for this occurrence of the problem | [optional] [default to null] +**Title** | **string** | A short, human-readable summary of the problem type | [optional] [default to null] +**Type_** | **string** | A URI reference according to IETF RFC 3986 that identifies the problem type | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-bwm/README.md b/docs/api-bwm/README.md new file mode 100644 index 000000000..540275e1e --- /dev/null +++ b/docs/api-bwm/README.md @@ -0,0 +1,53 @@ +# Go API client for swagger + +Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 2.2.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./swagger" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/sandboxname/bwm/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BwmApi* | [**BandwidthAllocationDELETE**](docs/BwmApi.md#bandwidthallocationdelete) | **Delete** /bw_allocations/{allocationId} | Remove a specific bandwidthAllocation +*BwmApi* | [**BandwidthAllocationGET**](docs/BwmApi.md#bandwidthallocationget) | **Get** /bw_allocations/{allocationId} | Retrieve information about a specific bandwidthAllocation +*BwmApi* | [**BandwidthAllocationListGET**](docs/BwmApi.md#bandwidthallocationlistget) | **Get** /bw_allocations | Retrieve information about a list of bandwidthAllocation resources +*BwmApi* | [**BandwidthAllocationPATCH**](docs/BwmApi.md#bandwidthallocationpatch) | **Patch** /bw_allocations/{allocationId} | Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure +*BwmApi* | [**BandwidthAllocationPOST**](docs/BwmApi.md#bandwidthallocationpost) | **Post** /bw_allocations | Create a bandwidthAllocation resource +*BwmApi* | [**BandwidthAllocationPUT**](docs/BwmApi.md#bandwidthallocationput) | **Put** /bw_allocations/{allocationId} | Update the information about a specific bandwidthAllocation +*LocationApi* | [**Mec011AppTerminationPOST**](docs/LocationApi.md#mec011appterminationpost) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination + +## Documentation For Models + + - [AppTerminationNotification](docs/AppTerminationNotification.md) + - [AppTerminationNotificationLinks](docs/AppTerminationNotificationLinks.md) + - [BwInfo](docs/BwInfo.md) + - [BwInfoDeltas](docs/BwInfoDeltas.md) + - [BwInfoDeltasSessionFilter](docs/BwInfoDeltasSessionFilter.md) + - [BwInfoSessionFilter](docs/BwInfoSessionFilter.md) + - [BwInfoTimeStamp](docs/BwInfoTimeStamp.md) + - [LinkType](docs/LinkType.md) + - [OperationActionType](docs/OperationActionType.md) + - [ProblemDetails](docs/ProblemDetails.md) + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + +InterDigital Communications Inc +xFlow Research Inc. +FSCOM \ No newline at end of file diff --git a/docs/api-mts/.openapi-generator-ignore b/docs/api-mts/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/docs/api-mts/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/docs/api-mts/.openapi-generator/FILES b/docs/api-mts/.openapi-generator/FILES new file mode 100644 index 000000000..55f139cd4 --- /dev/null +++ b/docs/api-mts/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.openapi-generator-ignore +Apis/MtsApi.md +Models/AppTerminationNotification.md +Models/AppTerminationNotificationLinks.md +Models/LinkType.md +Models/MtsCapabilityInfo.md +Models/MtsCapabilityInfoMtsAccessInfo.md +Models/MtsCapabilityInfoTimeStamp.md +Models/MtsSessionInfo.md +Models/MtsSessionInfoFlowFilter.md +Models/MtsSessionInfoQosD.md +Models/MtsSessionInfoTimeStamp.md +Models/OperationActionType.md +Models/ProblemDetails.md +README.md diff --git a/docs/api-mts/.openapi-generator/VERSION b/docs/api-mts/.openapi-generator/VERSION new file mode 100644 index 000000000..1a487e1a2 --- /dev/null +++ b/docs/api-mts/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-beta2 \ No newline at end of file diff --git a/docs/api-mts/Apis/MtsApi.md b/docs/api-mts/Apis/MtsApi.md new file mode 100644 index 000000000..aa7adf5bf --- /dev/null +++ b/docs/api-mts/Apis/MtsApi.md @@ -0,0 +1,215 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/mts/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Mec011AppTerminationPOST**](MtsApi.md#Mec011AppTerminationPOST) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination +[**MtsCapabilityInfoGET**](MtsApi.md#MtsCapabilityInfoGET) | **Get** /mts_capability_info | Retrieve the MTS capability informations +[**MtsSessionDELETE**](MtsApi.md#MtsSessionDELETE) | **Delete** /mts_sessions/{sessionId} | Remove specific MTS session +[**MtsSessionGET**](MtsApi.md#MtsSessionGET) | **Get** /mts_sessions/{sessionId} | Retrieve information about specific MTS session +[**MtsSessionPOST**](MtsApi.md#MtsSessionPOST) | **Post** /mts_sessions | Create a MTS session +[**MtsSessionPUT**](MtsApi.md#MtsSessionPUT) | **Put** /mts_sessions/{sessionId} | Update the information about specific MTS session +[**MtsSessionsListGET**](MtsApi.md#MtsSessionsListGET) | **Get** /mts_sessions | Retrieve information about a list of MTS sessions + +# **Mec011AppTerminationPOST** +> Mec011AppTerminationPOST(ctx, body) +MEC011 Application Termination notification for self termination + +Terminates itself. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppTerminationNotification**](AppTerminationNotification.md)| Termination notification details | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsCapabilityInfoGET** +> MtsCapabilityInfo MtsCapabilityInfoGET(ctx, ) +Retrieve the MTS capability informations + +Used to query information about the MTS information. Typically used in the 'Get MTS service Info from the MTS Service' procedure as described in clause 6.2.6. + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**MtsCapabilityInfo**](MtsCapabilityInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionDELETE** +> MtsSessionDELETE(ctx, sessionId) +Remove specific MTS session + +DELETE method is typically used in 'Unregister from the MTS Service' procedure as described in clause 6.2.8. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sessionId** | **string**| Represents a MTS session instance | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionGET** +> MtsSessionInfo MtsSessionGET(ctx, sessionId) +Retrieve information about specific MTS session + +Retrieves information about an individual MTS session. Typically used in the 'Get configured MTS Session Info from the MTS Service' procedure as described in clause 6.2.10. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sessionId** | **string**| Represents a MTS session instance | + +### Return type + +[**MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionPOST** +> MtsSessionInfo MtsSessionPOST(ctx, body) +Create a MTS session + +Used to create a MTS session. This method is typically used in 'Register application to the MTS Service' procedure as described in clause 6.2.7. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**MtsSessionInfo**](MtsSessionInfo.md)| Entity body in the request contains MtsSessionInfo to be created. | + +### Return type + +[**MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionPUT** +> MtsSessionInfo MtsSessionPUT(ctx, body, sessionId) +Update the information about specific MTS session + +Updates the information about an individual MTS session. As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**MtsSessionInfo**](MtsSessionInfo.md)| MtsSessionInfo with updated information is included as entity body of the request. | + **sessionId** | **string**| Represents a MTS session instance | + +### Return type + +[**MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionsListGET** +> []MtsSessionInfo MtsSessionsListGET(ctx, optional) +Retrieve information about a list of MTS sessions + +Retrieves information about a list of MTS sessions. Typically used in the 'Get configured MTS Session Info from the MTS Service' procedure as described in clause 6.2.10. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***MtsApiMtsSessionsListGETOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a MtsApiMtsSessionsListGETOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appInstanceId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note. | + **appName** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note. | + **sessionId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note. | + +### Return type + +[**[]MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/AppTerminationNotification.md b/docs/api-mts/Models/AppTerminationNotification.md new file mode 100644 index 000000000..8156e455d --- /dev/null +++ b/docs/api-mts/Models/AppTerminationNotification.md @@ -0,0 +1,12 @@ +# AppTerminationNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationType** | **string** | Shall be set to AppTerminationNotification. | [default to null] +**OperationAction** | [***OperationActionType**](OperationActionType.md) | | [default to null] +**MaxGracefulTimeout** | **int32** | Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. | [default to null] +**Links** | [***AppTerminationNotificationLinks**](AppTerminationNotification__links.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/AppTerminationNotificationLinks.md b/docs/api-mts/Models/AppTerminationNotificationLinks.md new file mode 100644 index 000000000..67d7f0d90 --- /dev/null +++ b/docs/api-mts/Models/AppTerminationNotificationLinks.md @@ -0,0 +1,10 @@ +# AppTerminationNotificationLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | [***LinkType**](LinkType.md) | | [default to null] +**ConfirmTermination** | [***LinkType**](LinkType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/LinkType.md b/docs/api-mts/Models/LinkType.md new file mode 100644 index 000000000..a8945efcd --- /dev/null +++ b/docs/api-mts/Models/LinkType.md @@ -0,0 +1,9 @@ +# LinkType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | URI referring to a resource | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsCapabilityInfo.md b/docs/api-mts/Models/MtsCapabilityInfo.md new file mode 100644 index 000000000..9fb7c9eaf --- /dev/null +++ b/docs/api-mts/Models/MtsCapabilityInfo.md @@ -0,0 +1,11 @@ +# MtsCapabilityInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MtsAccessInfo** | [**[]MtsCapabilityInfoMtsAccessInfo**](MtsCapabilityInfo_mtsAccessInfo.md) | The information on access network connection as defined below | [default to null] +**MtsMode** | **[]int32** | Numeric value corresponding to a specific MTS operation supported by the TMS 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or/and multiple access network connection simultaneously if supported 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for highreliability and low-latency applications 4 = QoS, i.e. performing MTS based on the specific QoS requirements from the app | [default to null] +**TimeStamp** | [***MtsCapabilityInfoTimeStamp**](MtsCapabilityInfo_timeStamp.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsCapabilityInfoMtsAccessInfo.md b/docs/api-mts/Models/MtsCapabilityInfoMtsAccessInfo.md new file mode 100644 index 000000000..9ac351ca9 --- /dev/null +++ b/docs/api-mts/Models/MtsCapabilityInfoMtsAccessInfo.md @@ -0,0 +1,11 @@ +# MtsCapabilityInfoMtsAccessInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessId** | **int32** | Unique identifier for the access network connection | [optional] [default to null] +**AccessType** | **int32** | Numeric value (0-255) corresponding to specific type of access network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11 a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11 b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33 = 3GPP NR (5G) | [optional] [default to null] +**Metered** | **int32** | Numeric value (0-255) corresponding to the following: 0: the connection is not metered (see note) 1: the connection is metered 2: unknown | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsCapabilityInfoTimeStamp.md b/docs/api-mts/Models/MtsCapabilityInfoTimeStamp.md new file mode 100644 index 000000000..0c9f3c7d3 --- /dev/null +++ b/docs/api-mts/Models/MtsCapabilityInfoTimeStamp.md @@ -0,0 +1,10 @@ +# MtsCapabilityInfoTimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NanoSeconds** | **int32** | Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] +**Seconds** | **int32** | Time in seconds in Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsSessionInfo.md b/docs/api-mts/Models/MtsSessionInfo.md new file mode 100644 index 000000000..41db6be4c --- /dev/null +++ b/docs/api-mts/Models/MtsSessionInfo.md @@ -0,0 +1,17 @@ +# MtsSessionInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SessionId** | **string** | MTS session instance identifier | [optional] [default to null] +**AppInsId** | **string** | Application instance identifier | [default to null] +**AppName** | **string** | Name of the application | [optional] [default to null] +**FlowFilter** | [**[]MtsSessionInfoFlowFilter**](MtsSessionInfo_flowFilter.md) | Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering | [default to null] +**MtsMode** | **int32** | Numeric value (0 - 255) corresponding to a specific MTS mode of the MTS session: 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or multiple access network connection simultaneously 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for high-reliability and low-latency applications 4 = QoS, i.e. performing MTS based on the QoS requirement (qosD) | [default to null] +**QosD** | [***MtsSessionInfoQosD**](MtsSessionInfo_qosD.md) | | [default to null] +**RequestType** | **int32** | Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION | [default to null] +**TimeStamp** | [***MtsSessionInfoTimeStamp**](MtsSessionInfo_timeStamp.md) | | [optional] [default to null] +**TrafficDirection** | **string** | The direction of the requested MTS session: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical (see note) | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsSessionInfoFlowFilter.md b/docs/api-mts/Models/MtsSessionInfoFlowFilter.md new file mode 100644 index 000000000..27822e66e --- /dev/null +++ b/docs/api-mts/Models/MtsSessionInfoFlowFilter.md @@ -0,0 +1,15 @@ +# MtsSessionInfoFlowFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dscp** | **int32** | DSCP in the IPv4 header or Traffic Class in the IPv6 header | [optional] [default to null] +**DstIp** | **string** | Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**DstPort** | **int32** | Destination port identity of session | [optional] [default to null] +**Flowlabel** | **int32** | Flow Label in the IPv6 header, applicable only if the flow is IPv6 | [optional] [default to null] +**Protocol** | **int32** | Protocol number | [optional] [default to null] +**SourceIp** | **string** | Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**SourcePort** | **int32** | Source port identity of session | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsSessionInfoQosD.md b/docs/api-mts/Models/MtsSessionInfoQosD.md new file mode 100644 index 000000000..b45f5c648 --- /dev/null +++ b/docs/api-mts/Models/MtsSessionInfoQosD.md @@ -0,0 +1,13 @@ +# MtsSessionInfoQosD + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MaxJitter** | **int32** | tolerable jitter in [10 nanoseconds] | [optional] [default to null] +**MaxLatency** | **int32** | tolerable (one-way) delay in [10 nanoseconds] | [optional] [default to null] +**MaxLoss** | **int32** | tolerable packet loss rate in [1/10^x] | [optional] [default to null] +**MinTpt** | **int32** | minimal throughput in [kbps] | [optional] [default to null] +**Priority** | **int32** | numeric value (0 - 255) corresponding to the traffic priority 0: low; 1: medium; 2: high; 3: critical | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/MtsSessionInfoTimeStamp.md b/docs/api-mts/Models/MtsSessionInfoTimeStamp.md new file mode 100644 index 000000000..3c9552dac --- /dev/null +++ b/docs/api-mts/Models/MtsSessionInfoTimeStamp.md @@ -0,0 +1,10 @@ +# MtsSessionInfoTimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NanoSeconds** | **int32** | The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] +**Seconds** | **int32** | The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/OperationActionType.md b/docs/api-mts/Models/OperationActionType.md new file mode 100644 index 000000000..4078c9e76 --- /dev/null +++ b/docs/api-mts/Models/OperationActionType.md @@ -0,0 +1,8 @@ +# OperationActionType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/Models/ProblemDetails.md b/docs/api-mts/Models/ProblemDetails.md new file mode 100644 index 000000000..d6f1dfeb6 --- /dev/null +++ b/docs/api-mts/Models/ProblemDetails.md @@ -0,0 +1,13 @@ +# ProblemDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | **string** | A human-readable explanation specific to this occurrence of the problem | [optional] [default to null] +**Instance** | **string** | A URI reference that identifies the specific occurrence of the problem | [optional] [default to null] +**Status** | **int32** | The HTTP status code for this occurrence of the problem | [optional] [default to null] +**Title** | **string** | A short, human-readable summary of the problem type | [optional] [default to null] +**Type_** | **string** | A URI reference according to IETF RFC 3986 that identifies the problem type | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-mts/README.md b/docs/api-mts/README.md new file mode 100644 index 000000000..df5377fe0 --- /dev/null +++ b/docs/api-mts/README.md @@ -0,0 +1,55 @@ +# Go API client for swagger + +Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 2.2.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./swagger" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/sandboxname/mts/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*MtsApi* | [**Mec011AppTerminationPOST**](docs/MtsApi.md#mec011appterminationpost) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination +*MtsApi* | [**MtsCapabilityInfoGET**](docs/MtsApi.md#mtscapabilityinfoget) | **Get** /mts_capability_info | Retrieve the MTS capability informations +*MtsApi* | [**MtsSessionDELETE**](docs/MtsApi.md#mtssessiondelete) | **Delete** /mts_sessions/{sessionId} | Remove specific MTS session +*MtsApi* | [**MtsSessionGET**](docs/MtsApi.md#mtssessionget) | **Get** /mts_sessions/{sessionId} | Retrieve information about specific MTS session +*MtsApi* | [**MtsSessionPOST**](docs/MtsApi.md#mtssessionpost) | **Post** /mts_sessions | Create a MTS session +*MtsApi* | [**MtsSessionPUT**](docs/MtsApi.md#mtssessionput) | **Put** /mts_sessions/{sessionId} | Update the information about specific MTS session +*MtsApi* | [**MtsSessionsListGET**](docs/MtsApi.md#mtssessionslistget) | **Get** /mts_sessions | Retrieve information about a list of MTS sessions + +## Documentation For Models + + - [AppTerminationNotification](docs/AppTerminationNotification.md) + - [AppTerminationNotificationLinks](docs/AppTerminationNotificationLinks.md) + - [LinkType](docs/LinkType.md) + - [MtsCapabilityInfo](docs/MtsCapabilityInfo.md) + - [MtsCapabilityInfoMtsAccessInfo](docs/MtsCapabilityInfoMtsAccessInfo.md) + - [MtsCapabilityInfoTimeStamp](docs/MtsCapabilityInfoTimeStamp.md) + - [MtsSessionInfo](docs/MtsSessionInfo.md) + - [MtsSessionInfoFlowFilter](docs/MtsSessionInfoFlowFilter.md) + - [MtsSessionInfoQosD](docs/MtsSessionInfoQosD.md) + - [MtsSessionInfoTimeStamp](docs/MtsSessionInfoTimeStamp.md) + - [OperationActionType](docs/OperationActionType.md) + - [ProblemDetails](docs/ProblemDetails.md) + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + +InterDigital Communications Inc +xFlow Research Inc. +FSCOM diff --git a/go-apps/meep-tm/Dockerfile b/go-apps/meep-tm/Dockerfile new file mode 100644 index 000000000..2e6bdcd53 --- /dev/null +++ b/go-apps/meep-tm/Dockerfile @@ -0,0 +1,23 @@ +# Copyright (c) 2022 InterDigital Communications, Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM debian:9.6-slim +COPY ./meep-tm /meep-tm +COPY ./api /api +COPY ./user-api /user-api +COPY ./data / + +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/go-apps/meep-tm/api/bwm/swagger.yaml b/go-apps/meep-tm/api/bwm/swagger.yaml new file mode 100644 index 000000000..a3ae8cea3 --- /dev/null +++ b/go-apps/meep-tm/api/bwm/swagger.yaml @@ -0,0 +1,803 @@ +openapi: 3.0.0 +info: + title: AdvantEDGE Bandwidth Management API + description: "Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI\ + \ MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)\ + \

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)\ + \

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)\ + \

**Type & Usage**
Edge Service used by edge applications that want to get\ + \ information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE\ + \ supports all Bandwidth Management API endpoints." + contact: + name: InterDigital AdvantEDGE Support + email: AdvantEDGE@InterDigital.com + license: + name: Apache 2.0 + url: https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE + version: 2.2.1 +externalDocs: + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf +servers: +- url: https://localhost/sandboxname/bwm/v1 +tags: +- name: bwm +paths: + /bw_allocations: + get: + tags: + - bwm + summary: Retrieve information about a list of bandwidthAllocation resources + description: Retrieves information about a list of bandwidthAllocation resources. + Typically used in 'Get configured bandwidth allocation from Bandwidth Management + Service' procedure as described in clause 6.2.5. + operationId: bandwidthAllocationListGET + parameters: + - name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids + as an input parameter to query the bandwidth allocation of a list of MEC + application instances. app_instance_id corresponds to appInsId defined in + table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the bandwidth allocation of a list of MEC application + instances. app_name corresponds to appName defined in table 7.2.2-1. See + note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the bandwidth allocation of a list of sessions. session_id corresponds + to allocationId defined in table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: "Upon success, a response body containing an array of the bandwidthAllocations\ + \ is returned." + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BwInfo' + x-content-type: application/json + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + post: + tags: + - bwm + summary: Create a bandwidthAllocation resource + description: Used to create a bandwidthAllocation resource. Typically used in + 'Register to Bandwidth Management Service' procedure as described in clause + 6.2.1. + operationId: bandwidthAllocationPOST + parameters: [] + requestBody: + description: Entity body in the request contains BwInfo to be created. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + required: true + responses: + "201": + description: "Upon success, the HTTP response shall include a 'Location'\ + \ HTTP header that contains the resource URI of the created resource." + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /bw_allocations/{allocationId}: + get: + tags: + - bwm + summary: Retrieve information about a specific bandwidthAllocation + description: Retrieves information about a bandwidthAllocation resource. Typically + used in 'Get configured bandwidth allocation from Bandwidth Management Service' + procedure as described in clause 6.2.5. + operationId: bandwidthAllocationGET + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + put: + tags: + - bwm + summary: Update the information about a specific bandwidthAllocation + description: "Updates the information about a bandwidthAllocation resource.\ + \ As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics." + operationId: bandwidthAllocationPUT + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: BwInfo with updated information is included as entity body of + the request. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + required: true + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts\ + \ when using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + delete: + tags: + - bwm + summary: Remove a specific bandwidthAllocation + description: Used in 'Unregister from Bandwidth Management Service' procedure + as described in clause 6.2.3. + operationId: bandwidthAllocationDELETE + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + patch: + tags: + - bwm + summary: Modify the information about a specific existing bandwidthAllocation + by sending updates on the data structure + description: "Updates the information about a bandwidthAllocation resource.\ + \ As specified in ETSI GS MEC 009 [6], the PATCH HTTP method updates a resource\ + \ on top of the existing resource state by just including the changes ('deltas')\ + \ in the request body." + operationId: bandwidthAllocationPATCH + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: Description of the changes to instruct the server how to modify + the resource representation. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfoDeltas' + required: true + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts\ + \ when using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /notifications/mec011/appTermination: + post: + tags: + - location + summary: MEC011 Application Termination notification for self termination + description: Terminates itself. + operationId: mec011AppTerminationPOST + requestBody: + description: Termination notification details + content: + application/json: + schema: + $ref: '#/components/schemas/AppTerminationNotification' + example: + notificationType: AppTerminationNotification + operationAction: TERMINATING + maxGracefulTimeout: 10 + links: + subscription: + href: http://mec011Server.example.com/mec_app_support/v1/applications/appId1234/subscriptions/sub123 + confirmTermination: + href: http://mec011Server.example.com/mec_app_support/v1/confirm_termination + required: true + responses: + "204": + description: No Content + x-swagger-router-controller: notifications +components: + schemas: + BwInfo: + required: + - allocationDirection + - appInsId + - fixedAllocation + - requestType + type: object + properties: + allocationId: + type: string + description: Bandwidth allocation instance identifier + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + allocationDirection: + type: string + description: "The direction of the requested BW allocation: 00 = Downlink\ + \ (towards the UE) 01 = Uplink (towards the application/session) 10 =\ + \ Symmetrical" + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appInsId: + type: string + description: Application instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appName: + type: string + description: Name of the application + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + fixedAllocation: + type: string + description: "Size of requested fixed BW allocation in [bps]" + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + fixedBWPriority: + type: string + description: Indicates the allocation priority when dealing with several + applications or sessions in parallel. Values are not defined in the present + document + enum: + - SEE_DESCRIPTION + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Enum + requestType: + type: integer + description: "Numeric value (0 - 255) corresponding to specific type of\ + \ consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION" + enum: + - 0 + - 1 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Enum_inlined + sessionFilter: + minItems: 0 + type: array + description: "Session filtering criteria, applicable when requestType is\ + \ set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall\ + \ define a single session only. In case multiple sessions match sessionFilter\ + \ the request shall be rejected" + items: + $ref: '#/components/schemas/BwInfo_sessionFilter' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: Structure (inlined) + timeStamp: + $ref: '#/components/schemas/BwInfo_timeStamp' + example: + timeStamp: + seconds: 1 + nanoSeconds: 6 + allocationDirection: allocationDirection + fixedBWPriority: SEE_DESCRIPTION + requestType: 0 + sessionFilter: + - protocol: protocol + sourcePort: sourcePort + dstPort: dstPort + sourceIp: sourceIp + dstAddress: dstAddress + - protocol: protocol + sourcePort: sourcePort + dstPort: dstPort + sourceIp: sourceIp + dstAddress: dstAddress + appName: appName + allocationId: allocationId + appInsId: appInsId + fixedAllocation: fixedAllocation + x-etsi-ref: 7.2.2 + BwInfoDeltas: + required: + - appInsId + - requestType + type: object + properties: + allocationId: + type: string + description: Bandwidth allocation instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + allocationDirection: + type: string + description: "The direction of the requested BW allocation: 00 = Downlink\ + \ (towards the UE) 01 = Uplink (towards the application/session) 10 =\ + \ Symmetrical" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appInsId: + type: string + description: Application instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + fixedAllocation: + type: string + description: "Size of requested fixed BW allocation in [bps]" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + fixedBWPriority: + type: string + description: Indicates the allocation priority when dealing with several + applications or sessions in parallel. Values are not defined in the present + document + enum: + - SEE DESCRIPTION + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Enum_inlined + requestType: + type: integer + description: "Numeric value (0 - 255) corresponding to specific type of\ + \ consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION" + enum: + - 0 + - 1 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Enum_inlined + sessionFilter: + minItems: 0 + type: array + description: "Session filtering criteria, applicable when requestType is\ + \ set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall\ + \ define a single session only. In case multiple sessions match sessionFilter\ + \ the request shall be rejected" + items: + $ref: '#/components/schemas/BwInfoDeltas_sessionFilter' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: Structure (inlined) + x-etsi-ref: 7.2.3 + ProblemDetails: + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + description: A URI reference that identifies the specific occurrence of + the problem + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + status: + type: integer + description: The HTTP status code for this occurrence of the problem + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + title: + type: string + description: "A short, human-readable summary of the problem type" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + type: + type: string + description: A URI reference according to IETF RFC 3986 that identifies + the problem type + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + AppTerminationNotification: + required: + - _links + - maxGracefulTimeout + - notificationType + - operationAction + type: object + properties: + notificationType: + type: string + description: Shall be set to AppTerminationNotification. + operationAction: + $ref: '#/components/schemas/OperationActionType' + maxGracefulTimeout: + type: integer + description: Maximum timeout value in seconds for graceful termination or + graceful stop of an application instance. + format: uint32 + _links: + $ref: '#/components/schemas/AppTerminationNotification__links' + description: This type represents the information that the MEC platform notifies + the subscribed application instance about the corresponding application instance + termination/stop. + OperationActionType: + type: string + description: Operation that is being performed on the MEC application instance. + enum: + - STOPPING + - TERMINATING + LinkType: + required: + - href + type: object + properties: + href: + type: string + description: URI referring to a resource + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uri + x-etsi-ref: 6.5.2 + BwInfo_sessionFilter: + type: object + properties: + dstAddress: + type: string + description: "Destination address identity of session. The string for a\ + \ IPv4 address shall be formatted in the \"dotted decimal\" notation as\ + \ defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be\ + \ formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR\ + \ notation [12] used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + dstPort: + type: string + description: Destination port identity of session + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + protocol: + type: string + description: Protocol number + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourceIp: + type: string + description: "Source address identity of session. The string for a IPv4\ + \ address shall be formatted in the \"dotted decimal\" notation as defined\ + \ in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted\ + \ according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12]\ + \ used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourcePort: + type: string + description: Source port identity of session + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + example: + protocol: protocol + sourcePort: sourcePort + dstPort: dstPort + sourceIp: sourceIp + dstAddress: dstAddress + BwInfo_timeStamp: + required: + - nanoSeconds + - seconds + type: object + properties: + nanoSeconds: + type: integer + description: "The nanoseconds part of the Time. Time is defined as Unix-time\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + seconds: + type: integer + description: "The seconds part of the Time. Time is defined as Unixtime\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + description: Time stamp to indicate when the corresponding information elements + are sent + example: + seconds: 1 + nanoSeconds: 6 + BwInfoDeltas_sessionFilter: + type: object + properties: + dstAddress: + type: string + description: "Destination address identity of session. The string for a\ + \ IPv4 address shall be formatted in the \"dotted decimal\" notation as\ + \ defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be\ + \ formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR\ + \ notation [12] used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + dstPort: + type: string + description: Destination port identity of session + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + protocol: + type: string + description: Protocol number + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourceIp: + type: string + description: "Source address identity of session. The string for a IPv4\ + \ address shall be formatted in the \"dotted decimal\" notation as defined\ + \ in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted\ + \ according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12]\ + \ used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourcePort: + type: string + description: 'Source port identity of session ' + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + AppTerminationNotification__links: + required: + - subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/LinkType' + confirmTermination: + $ref: '#/components/schemas/LinkType' + description: Object containing hyperlinks related to the resource. + responses: + "204": + description: "Upon success, a response 204 No Content without any response body\ + \ is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot be\ + \ mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts when\ + \ using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Path.allocationId: + name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + Query.app_instance_id: + name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids as + an input parameter to query the bandwidth allocation of a list of MEC application + instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.app_name: + name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the bandwidth allocation of a list of MEC application instances. + app_name corresponds to appName defined in table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.session_id: + name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the bandwidth allocation of a list of sessions. session_id corresponds + to allocationId defined in table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string diff --git a/go-apps/meep-tm/api/mts/swagger.yaml b/go-apps/meep-tm/api/mts/swagger.yaml new file mode 100644 index 000000000..f4da7d460 --- /dev/null +++ b/go-apps/meep-tm/api/mts/swagger.yaml @@ -0,0 +1,876 @@ +openapi: 3.0.0 +info: + title: AdvantEDGE Multi-access Traffic Steering API + description: "Multi-access Traffic Steering Sercice is AdvantEDGE's implementation\ + \ of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)\ + \

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)\ + \

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)\ + \

**Type & Usage**
Edge Service used by edge applications that want to get\ + \ information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE\ + \ supports all Multi-access Traffic Steering API endpoints." + contact: + name: InterDigital AdvantEDGE Support + email: AdvantEDGE@InterDigital.com + license: + name: Apache 2.0 + url: https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE + version: 2.2.1 +externalDocs: + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf +servers: +- url: https://localhost/sandboxname/mts/v1 +tags: +- name: mts +paths: + /mts_capability_info: + get: + tags: + - mts + summary: Retrieve the MTS capability informations + description: Used to query information about the MTS information. Typically + used in the 'Get MTS service Info from the MTS Service' procedure as described + in clause 6.2.6. + operationId: mtsCapabilityInfoGET + parameters: [] + responses: + "200": + description: "Upon success, a response body containing the MTS capability\ + \ information is returned." + content: + application/json: + schema: + $ref: '#/components/schemas/MtsCapabilityInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /mts_sessions: + get: + tags: + - mts + summary: Retrieve information about a list of MTS sessions + description: Retrieves information about a list of MTS sessions. Typically used + in the 'Get configured MTS Session Info from the MTS Service' procedure as + described in clause 6.2.10. + operationId: mtsSessionsListGET + parameters: + - name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids + as an input parameter to query the MTS session of a list of MEC application + instances. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the MTS session of a list of MEC application instances. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the information of a list of MTS sessions. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: "Upon success, a response body containing an array of the MTS\ + \ sessions is returned." + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MtsSessionInfo' + x-content-type: application/json + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + post: + tags: + - mts + summary: Create a MTS session + description: Used to create a MTS session. This method is typically used in + 'Register application to the MTS Service' procedure as described in clause + 6.2.7. + operationId: mtsSessionPOST + parameters: [] + requestBody: + description: Entity body in the request contains MtsSessionInfo to be created. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + required: true + responses: + "201": + description: "Upon success, the HTTP response shall include a 'Location'\ + \ HTTP header that contains the resource URI of the created resource." + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /mts_sessions/{sessionId}: + get: + tags: + - mts + summary: Retrieve information about specific MTS session + description: Retrieves information about an individual MTS session. Typically + used in the 'Get configured MTS Session Info from the MTS Service' procedure + as described in clause 6.2.10. + operationId: mtsSessionGET + parameters: + - name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + put: + tags: + - mts + summary: Update the information about specific MTS session + description: "Updates the information about an individual MTS session. As specified\ + \ in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. " + operationId: mtsSessionPUT + parameters: + - name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: MtsSessionInfo with updated information is included as entity + body of the request. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + required: true + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts\ + \ when using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + delete: + tags: + - mts + summary: Remove specific MTS session + description: DELETE method is typically used in 'Unregister from the MTS Service' + procedure as described in clause 6.2.8. + operationId: mtsSessionDELETE + parameters: + - name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /notifications/mec011/appTermination: + post: + tags: + - mts + summary: MEC011 Application Termination notification for self termination + description: Terminates itself. + operationId: mec011AppTerminationPOST + requestBody: + description: Termination notification details + content: + application/json: + schema: + $ref: '#/components/schemas/AppTerminationNotification' + example: + notificationType: AppTerminationNotification + operationAction: TERMINATING + maxGracefulTimeout: 10 + links: + subscription: + href: http://mec011Server.example.com/mec_app_support/v1/applications/appId1234/subscriptions/sub123 + confirmTermination: + href: http://mec011Server.example.com/mec_app_support/v1/confirm_termination + required: true + responses: + "204": + description: No Content + x-swagger-router-controller: notifications +components: + schemas: + MtsCapabilityInfo: + required: + - mtsAccessInfo + - mtsMode + type: object + properties: + mtsAccessInfo: + minItems: 1 + required: + - accessId + - accessType + - metered + type: array + description: The information on access network connection as defined below + items: + $ref: '#/components/schemas/MtsCapabilityInfo_mtsAccessInfo' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: Structure (inlined) + mtsMode: + minItems: 1 + type: array + description: "Numeric value corresponding to a specific MTS operation supported\ + \ by the TMS 0 = low cost, i.e. using the unmetered access network connection\ + \ whenever it is available 1 = low latency, i.e. using the access network\ + \ connection with lower latency 2 = high throughput, i.e. using the access\ + \ network connection with higher throughput, or/and multiple access network\ + \ connection simultaneously if supported 3 = redundancy, i.e. sending\ + \ duplicated (redundancy) packets over multiple access network connections\ + \ for highreliability and low-latency applications 4 = QoS, i.e. performing\ + \ MTS based on the specific QoS requirements from the app" + items: + type: integer + format: uint32 + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: Uint32 + timeStamp: + $ref: '#/components/schemas/MtsCapabilityInfo_timeStamp' + example: + timeStamp: + seconds: 2 + nanoSeconds: 5 + mtsMode: + - 5 + - 5 + mtsAccessInfo: + - accessId: 0 + accessType: 6 + metered: 1 + - accessId: 0 + accessType: 6 + metered: 1 + x-etsi-notes: "NOTE:\tA metered connection is a network connection that has\ + \ a maximum data usage in a specific period, e.g. per hour/day/week/month.\ + \ The user may get billed extra charges if they go over the allotted amount." + x-etsi-ref: 7.2.4 + MtsSessionInfo: + required: + - appInsId + - flowFilter + - mtsMode + - qosD + - requestType + - trafficDirection + type: object + properties: + sessionId: + type: string + description: MTS session instance identifier + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appInsId: + type: string + description: Application instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appName: + type: string + description: Name of the application + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + flowFilter: + minItems: 1 + type: array + description: "Traffic flow filtering criteria, applicable only if when requestType\ + \ is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define\ + \ a single session only. In case multiple sessions match flowFilter the\ + \ request shall be rejected. If the flowFilter field is included, at least\ + \ one of its subfields shall be included. Any flowFilter subfield that\ + \ is not included shall be ignored in traffic flow filtering" + items: + $ref: '#/components/schemas/MtsSessionInfo_flowFilter' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: Structure (inlined) + mtsMode: + type: integer + description: "Numeric value (0 - 255) corresponding to a specific MTS mode\ + \ of the MTS session: 0 = low cost, i.e. using the unmetered access network\ + \ connection whenever it is available 1 = low latency, i.e. using the\ + \ access network connection with lower latency 2 = high throughput, i.e.\ + \ using the access network connection with higher throughput, or multiple\ + \ access network connection simultaneously 3 = redundancy, i.e. sending\ + \ duplicated (redundancy) packets over multiple access network connections\ + \ for high-reliability and low-latency applications 4 = QoS, i.e. performing\ + \ MTS based on the QoS requirement (qosD)" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + qosD: + $ref: '#/components/schemas/MtsSessionInfo_qosD' + requestType: + type: integer + description: "Numeric value (0 - 255) corresponding to specific type of\ + \ consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION" + enum: + - 0 + - 1 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Enum_inlined + timeStamp: + $ref: '#/components/schemas/MtsSessionInfo_timeStamp' + trafficDirection: + type: string + description: "The direction of the requested MTS session: 00 = Downlink\ + \ (towards the UE) 01 = Uplink (towards the application/session) 10 =\ + \ Symmetrical (see note) " + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + timeStamp: + seconds: 1 + nanoSeconds: 1 + flowFilter: + - flowlabel: 1 + protocol: 5 + sourcePort: 5 + dscp: 0 + dstPort: 6 + sourceIp: sourceIp + dstIp: dstIp + - flowlabel: 1 + protocol: 5 + sourcePort: 5 + dscp: 0 + dstPort: 6 + sourceIp: sourceIp + dstIp: dstIp + requestType: 7 + appName: appName + qosD: + maxJitter: 7 + maxLatency: 9 + maxLoss: 3 + priority: 4 + minTpt: 2 + sessionId: sessionId + appInsId: appInsId + trafficDirection: trafficDirection + mtsMode: 2 + x-etsi-notes: "NOTE:\tFor the downlink direction of a symmetrical flow, \"sourceIp\"\ + \ and \"sourcePort\" in the \"flowFilter\" structure are used for source address\ + \ and port, respectively; \"dstIp\" and \"dstPort\" are used for destination\ + \ address and port, respectively. For the uplink direction of a symmetrical\ + \ flow, \"sourceIp\" and \"sourcePort\" are used for destination address and\ + \ port, respectively; \"dstIp\" and \"dstPort\" are used for source address\ + \ and port, respectively." + x-etsi-ref: 7.2.5 + ProblemDetails: + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + description: A URI reference that identifies the specific occurrence of + the problem + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + status: + type: integer + description: The HTTP status code for this occurrence of the problem + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + title: + type: string + description: "A short, human-readable summary of the problem type" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + type: + type: string + description: A URI reference according to IETF RFC 3986 that identifies + the problem type + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + AppTerminationNotification: + required: + - _links + - maxGracefulTimeout + - notificationType + - operationAction + type: object + properties: + notificationType: + type: string + description: Shall be set to AppTerminationNotification. + operationAction: + $ref: '#/components/schemas/OperationActionType' + maxGracefulTimeout: + type: integer + description: Maximum timeout value in seconds for graceful termination or + graceful stop of an application instance. + format: uint32 + _links: + $ref: '#/components/schemas/AppTerminationNotification__links' + description: This type represents the information that the MEC platform notifies + the subscribed application instance about the corresponding application instance + termination/stop. + OperationActionType: + type: string + description: Operation that is being performed on the MEC application instance. + enum: + - STOPPING + - TERMINATING + LinkType: + required: + - href + type: object + properties: + href: + type: string + description: URI referring to a resource + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uri + x-etsi-ref: 6.5.2 + MtsCapabilityInfo_mtsAccessInfo: + type: object + properties: + accessId: + type: integer + description: Unique identifier for the access network connection + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + accessType: + type: integer + description: "Numeric value (0-255) corresponding to specific type of access\ + \ network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology\ + \ 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11\ + \ a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac\ + \ WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11\ + \ b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33\ + \ = 3GPP NR (5G)" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + metered: + type: integer + description: "Numeric value (0-255) corresponding to the following: 0: the\ + \ connection is not metered (see note) 1: the connection is metered 2:\ + \ unknown " + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + example: + accessId: 0 + accessType: 6 + metered: 1 + MtsCapabilityInfo_timeStamp: + required: + - nanoSeconds + - seconds + type: object + properties: + nanoSeconds: + type: integer + description: "Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00\ + \ UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + seconds: + type: integer + description: "Time in seconds in Unix-time since January 1, 1970, 00:00:00\ + \ UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + description: Time stamp to indicate when the corresponding information elements + are sent + example: + seconds: 2 + nanoSeconds: 5 + MtsSessionInfo_flowFilter: + type: object + properties: + dscp: + type: integer + description: DSCP in the IPv4 header or Traffic Class in the IPv6 header + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + dstIp: + type: string + description: "Destination address identity of session. The string for a\ + \ IPv4 address shall be formatted in the \"dotted decimal\" notation as\ + \ defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be\ + \ formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR\ + \ notation [12] used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + dstPort: + type: integer + description: Destination port identity of session + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + flowlabel: + type: integer + description: "Flow Label in the IPv6 header, applicable only if the flow\ + \ is IPv6" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + protocol: + type: integer + description: Protocol number + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + sourceIp: + type: string + description: "Source address identity of session. The string for a IPv4\ + \ address shall be formatted in the \"dotted decimal\" notation as defined\ + \ in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted\ + \ according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12]\ + \ used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourcePort: + type: integer + description: Source port identity of session + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + example: + flowlabel: 1 + protocol: 5 + sourcePort: 5 + dscp: 0 + dstPort: 6 + sourceIp: sourceIp + dstIp: dstIp + MtsSessionInfo_qosD: + type: object + properties: + maxJitter: + type: integer + description: "tolerable jitter in [10 nanoseconds]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + maxLatency: + type: integer + description: "tolerable (one-way) delay in [10 nanoseconds]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + maxLoss: + type: integer + description: "tolerable packet loss rate in [1/10^x]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + minTpt: + type: integer + description: "minimal throughput in [kbps]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + priority: + type: integer + description: "numeric value (0 - 255) corresponding to the traffic priority\ + \ 0: low; 1: medium; 2: high; 3: critical" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + description: "QoS requirement description of the MTS session, applicable only\ + \ if mtsMode = 4 (QoS). If the qosD field is included, at least one of its\ + \ subfields shall be included. Any qosD subfield that is not included shall\ + \ be ignored in Multi-access Traffic Steering (MTS)" + example: + maxJitter: 7 + maxLatency: 9 + maxLoss: 3 + priority: 4 + minTpt: 2 + MtsSessionInfo_timeStamp: + required: + - nanoSeconds + - seconds + type: object + properties: + nanoSeconds: + type: integer + description: "The nanoseconds part of the Time. Time is defined as Unix-time\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + seconds: + type: integer + description: "The seconds part of the Time. Time is defined as Unixtime\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + description: 'Time stamp to indicate when the corresponding information elements + are sent ' + example: + seconds: 1 + nanoSeconds: 1 + AppTerminationNotification__links: + required: + - subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/LinkType' + confirmTermination: + $ref: '#/components/schemas/LinkType' + description: Object containing hyperlinks related to the resource. + responses: + "204": + description: "Upon success, a response 204 No Content without any response body\ + \ is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot be\ + \ mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts when\ + \ using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Path.sessionId: + name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + Query.app_instance_id: + name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids as + an input parameter to query the MTS session of a list of MEC application instances. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.app_name: + name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the MTS session of a list of MEC application instances. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.session_id: + name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the information of a list of MTS sessions. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string diff --git a/go-apps/meep-tm/entrypoint.sh b/go-apps/meep-tm/entrypoint.sh new file mode 100644 index 000000000..20fd10595 --- /dev/null +++ b/go-apps/meep-tm/entrypoint.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e + +echo "MEEP_HOST_URL: ${MEEP_HOST_URL}" +echo "MEEP_SANDBOX_NAME: ${MEEP_SANDBOX_NAME}" +echo "MEEP_MEP_NAME: ${MEEP_MEP_NAME}" + +if [[ ! -z "${MEEP_MEP_NAME}" ]]; then + svcPath="${MEEP_SANDBOX_NAME}/${MEEP_MEP_NAME}" +else + svcPath="${MEEP_SANDBOX_NAME}" +fi + +# Update API yaml basepaths to enable "Try-it-out" feature +# OAS2: Set relative path to sandbox name + endpoint path (origin will be derived from browser URL) +# OAS3: Set full path to provided Host URL + sandbox name + endpoint path +setBasepath() { + # OAS3 + hostName=$(echo "${MEEP_HOST_URL}" | sed -E 's/^\s*.*:\/\///g') + echo "Replacing [localhost] with ${hostName} to url in: '$1'" + sed -i "s,localhost,${hostName},g" "$1"; + + # OAS2 and OAS3 + echo "Replacing [sandboxname] with ${svcPath} to basepath or url in: '$1'" + sed -i "s,sandboxname,${svcPath},g" "$1"; +} + +# Set basepath for API files +for file in /api/*; do + if [[ ! -e "$file" ]]; then continue; fi + setBasepath "$file" +done + +# Set basepath for user-supplied API files +for file in /user-api/*; do + if [[ ! -e "$file" ]]; then continue; fi + setBasepath "$file" +done + +# Start service +exec /meep-tm diff --git a/go-apps/meep-tm/go.mod b/go-apps/meep-tm/go.mod new file mode 100644 index 000000000..9b481edd7 --- /dev/null +++ b/go-apps/meep-tm/go.mod @@ -0,0 +1,42 @@ +module github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm + +go 1.16 + +require ( + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client v0.0.0-00010101000000-000000000000 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger v0.0.0-00010101000000-000000000000 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model v0.0.0-00010101000000-000000000000 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client v0.0.0-00010101000000-000000000000 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client v0.0.0-00010101000000-000000000000 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr v0.0.0-00010101000000-000000000000 + github.com/gorilla/handlers v1.5.1 + github.com/gorilla/mux v1.8.0 + github.com/prometheus/client_golang v1.9.0 +) + +replace ( + github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/bwm => ../../go-apps/meep-tm/server/bwm + github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/mts => ../../go-apps/meep-tm/server/mts + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client => ../../go-packages/meep-app-support-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr => ../../go-packages/meep-data-key-mgr + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model => ../../go-packages/meep-data-model + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache => ../../go-packages/meep-gis-cache + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client => ../../go-packages/meep-gis-engine-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger => ../../go-packages/meep-http-logger + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger => ../../go-packages/meep-logger + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics => ../../go-packages/meep-metrics + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model => ../../go-packages/meep-model + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq => ../../go-packages/meep-mq + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis => ../../go-packages/meep-redis + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client => ../../go-packages/meep-sandbox-ctrl-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client => ../../go-packages/meep-service-mgmt-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions => ../../go-packages/meep-subscriptions + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr => ../../go-packages/meep-swagger-api-mgr + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-websocket => ../../go-packages/meep-websocket +) diff --git a/go-apps/meep-tm/go.sum b/go-apps/meep-tm/go.sum new file mode 100644 index 000000000..e51a81bc5 --- /dev/null +++ b/go-apps/meep-tm/go.sum @@ -0,0 +1,442 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/RyanCarrier/dijkstra v0.0.0-20190726134004-b51cadb5ae52 h1:trnwuu/Q8T59kgRjXcSDBODnyZP9wes+bnLn0lx4PgM= +github.com/RyanCarrier/dijkstra v0.0.0-20190726134004-b51cadb5ae52/go.mod h1:DdR6ymcLl8+sN/XOVNjnYO1NDYfgHskGjreZUDuQCTY= +github.com/RyanCarrier/dijkstra-1 v0.0.0-20170512020943-0e5801a26345 h1:fgSpoKViTSqRb4hjDNj10ig5wUvO0CayCzFdLf6fuRM= +github.com/RyanCarrier/dijkstra-1 v0.0.0-20170512020943-0e5801a26345/go.mod h1:OK4EvWJ441LQqGzed5NGB6vKBAE34n3z7iayPcEwr30= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/albertorestifo/dijkstra v0.0.0-20160910063646-aba76f725f72 h1:uGeGZl8PxSq8VZGG4QK5njJTFA4/G/x5CYORvQVXtAE= +github.com/albertorestifo/dijkstra v0.0.0-20160910063646-aba76f725f72/go.mod h1:o+JdB7VetTHjLhU0N57x18B9voDBQe0paApdEAEoEfw= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4= +github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattomatic/dijkstra v0.0.0-20130617153013-6f6d134eb237 h1:acuCHBjzG7MFTugvx3buC4m5rLDLaKC9J8C9jtlraRc= +github.com/mattomatic/dijkstra v0.0.0-20130617153013-6f6d134eb237/go.mod h1:UOnLAUmVG5paym8pD3C4B9BQylUDC2vXFJJpT7JrlEA= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/go-apps/meep-tm/main.go b/go-apps/meep-tm/main.go new file mode 100644 index 000000000..7bab8f29c --- /dev/null +++ b/go-apps/meep-tm/main.go @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "net/http" + "os" + "os/signal" + "syscall" + "time" + + server "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + "github.com/prometheus/client_golang/prometheus/promhttp" + + "github.com/gorilla/handlers" +) + +func init() { + // Log as JSON instead of the default ASCII formatter. + log.MeepJSONLogInit("meep-tm") +} + +func main() { + log.Info(os.Args) + + log.Info("Starting Traffic Management Service") + + run := true + go func() { + sigchan := make(chan os.Signal, 10) + signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM) + <-sigchan + log.Info("Program killed !") + // do last actions and wait for all write operations to end + run = false + }() + + go func() { + // Initialize Traffic Management Service + err := server.Init() + if err != nil { + log.Error("Failed to initialize Traffic Management Service") + run = false + return + } + + // Start Traffic Management Service Service Event Handler thread + err = server.Run() + if err != nil { + log.Error("Failed to start Traffic Management Service") + run = false + return + } + + // Start Traffic Management Service REST API Server + router := server.NewRouter() + methods := handlers.AllowedMethods([]string{"OPTIONS", "DELETE", "GET", "HEAD", "POST", "PUT", "PATCH"}) + header := handlers.AllowedHeaders([]string{"Content-Type"}) + log.Fatal(http.ListenAndServe(":80", handlers.CORS(methods, header)(router))) + run = false + }() + + go func() { + // Initialize Metrics Endpoint + http.Handle("/metrics", promhttp.Handler()) + log.Fatal(http.ListenAndServe(":9000", nil)) + run = false + }() + + count := 0 + for { + if !run { + _ = server.Stop() + log.Info("Ran for ", count, " seconds") + break + } + time.Sleep(time.Second) + count++ + } + +} diff --git a/go-apps/meep-tm/main_test.go b/go-apps/meep-tm/main_test.go new file mode 100644 index 000000000..04e894a5b --- /dev/null +++ b/go-apps/meep-tm/main_test.go @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "os" + "strings" + "testing" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +// Build: +// $ go test -covermode=count -coverpkg=./... -c -o +// Run: +// $ ./ -test.coverprofile=cover.out __DEVEL--code-cov + +// TestMain is a hack that allows us to figure out what the coverage is during +// integration tests. I would not recommend that you use a binary built using +// this hack outside of a test suite. +func TestMain(t *testing.T) { + var ( + args []string + run bool + ) + + log.Info(os.Args) + for _, arg := range os.Args { + switch { + case arg == "__DEVEL--code-cov": + run = true + case strings.HasPrefix(arg, "-test"): + case strings.HasPrefix(arg, "__DEVEL"): + default: + args = append(args, arg) + } + } + os.Args = args + log.Info(os.Args) + + if run { + main() + } +} diff --git a/go-apps/meep-tm/server/bwm/README.md b/go-apps/meep-tm/server/bwm/README.md new file mode 100644 index 000000000..117fa81df --- /dev/null +++ b/go-apps/meep-tm/server/bwm/README.md @@ -0,0 +1,25 @@ +# Go API Server for swagger + +Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + +## Overview +This server was generated by the [swagger-codegen] +(https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) + +- API version: 2.2.1 +- Build date: 2022-11-22T14:18:41.624678100+05:00[Asia/Karachi] + + +### Running the server +To run the server, follow these simple steps: + +``` +go run main.go +``` + diff --git a/go-apps/meep-tm/server/bwm/api_bwm.go b/go-apps/meep-tm/server/bwm/api_bwm.go new file mode 100644 index 000000000..f7fcb7922 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/api_bwm.go @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "net/http" +) + +func Mec011AppTerminationPOST(w http.ResponseWriter, r *http.Request) { + mec011AppTerminationPost(w, r) +} + +func BandwidthAllocationDELETE(w http.ResponseWriter, r *http.Request) { + bandwidthAllocationDelete(w, r) +} + +func BandwidthAllocationGET(w http.ResponseWriter, r *http.Request) { + bandwidthAllocationGet(w, r) +} + +func BandwidthAllocationListGET(w http.ResponseWriter, r *http.Request) { + bandwidthAllocationListGet(w, r) +} + +func BandwidthAllocationPATCH(w http.ResponseWriter, r *http.Request) { + bandwidthAllocationPatch(w, r) +} + +func BandwidthAllocationPOST(w http.ResponseWriter, r *http.Request) { + bandwidthAllocationPost(w, r) +} + +func BandwidthAllocationPUT(w http.ResponseWriter, r *http.Request) { + bandwidthAllocationPut(w, r) +} diff --git a/go-apps/meep-tm/server/bwm/bwm.go b/go-apps/meep-tm/server/bwm/bwm.go new file mode 100644 index 000000000..3140f8b8f --- /dev/null +++ b/go-apps/meep-tm/server/bwm/bwm.go @@ -0,0 +1,2173 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net" + "net/http" + "net/url" + "os" + "reflect" + "strconv" + "strings" + "time" + + asc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client" + dkm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr" + dataModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + mod "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model" + redis "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis" + scc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client" + smc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client" + sam "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr" + "github.com/gorilla/mux" +) + +const moduleName = "meep-tm" +const bwmBasePath = "bwm/v1/" +const globalMepName = "global" + +const defaultMepName = "global" +const defaultScopeOfLocality = "MEC_SYSTEM" +const defaultConsumedLocalOnly = true +const appTerminationPath = "notifications/mec011/appTermination" + +const serviceCategory = "BWM" + +var sbxCtrlUrl string = "http://meep-sandbox-ctrl" + +var instanceId string +var instanceName string + +var appEnablementUrl string +var appEnablementEnabled bool + +// LinkBuff to initialize uplink/downlink buffer values +var LinkBuff = make(map[string]uint64) + +//i.e. 100 Gbits/s equal to 100 * 1024 * 1024 * 1024 b/s shows maximum Bandwidth Resorce +var maxBuff = uint64(107374182400) +var nextBwAllocIdAvailable uint32 = 1 + +type sessionFilterListCheck struct { + sessionBool bool + SessionList []BwInfoSessionFilter +} + +type BwAllocInfoResp struct { + AppInstanceId []string + SessionId []string + AppName []string + SessionList []BwInfo +} +type SessionFilterPostResp struct { + SessionFilterList []BwInfoSessionFilter + SessionMatch bool +} + +type SessionFilterResp struct { + SessionFilterList []BwInfoSessionFilter + SessionMatch bool + AllocationId string + AllocationIdMatch bool +} + +var localityEnabled bool +var mapLocality map[string]bool + +// App Ins ID fields +const fieldState = "state" +const APP_STATE_READY = "READY" +const appEnablementKey = "app-enablement" + +var activeModel *mod.Model +var apiMgr *sam.SwaggerApiMgr +var appSupportClient *asc.APIClient +var svcMgmtClient *smc.APIClient +var sbxCtrlClient *scc.APIClient +var appEnablementServiceId string +var appTermSubId string +var sendAppTerminationWhenDone bool = false +var serviceAppInstanceId string + +var registrationTicker *time.Ticker +var rc *redis.Connector +var hostUrl *url.URL +var sandboxName string +var mepName string = defaultMepName +var scopeOfLocality string = defaultScopeOfLocality +var consumedLocalOnly bool = defaultConsumedLocalOnly +var locality []string +var basePath string +var baseKey string + +const serviceAppVersion = "2.2.1" + +type InitCfg struct { + SandboxName string + MepName string + InstanceId string + InstanceName string + BaseKey string + HostUrl *url.URL + RedisConn *redis.Connector + Model *mod.Model +} + +func getAppInstanceId() (id string, err error) { + var appInfo scc.ApplicationInfo + appInfo.Id = instanceId + appInfo.Name = serviceCategory + appInfo.Type_ = "SYSTEM" + appInfo.NodeName = mepName + if mepName == defaultMepName { + appInfo.Persist = true + } else { + appInfo.Persist = false + } + response, _, err := sbxCtrlClient.ApplicationsApi.ApplicationsPOST(context.TODO(), appInfo) + if err != nil { + log.Error("Failed to get App Instance ID with error: ", err) + return "", err + } + return response.Id, nil +} + +func registerService(appInstanceId string) error { + // Build Service Info + state := smc.ACTIVE_ServiceState + serializer := smc.JSON_SerializerType + transportType := smc.REST_HTTP_TransportType + localityType := smc.LocalityType(scopeOfLocality) + srvInfo := smc.ServiceInfoPost{ + SerName: instanceName, + Version: serviceAppVersion, + State: &state, + Serializer: &serializer, + ScopeOfLocality: &localityType, + ConsumedLocalOnly: consumedLocalOnly, + TransportInfo: &smc.TransportInfo{ + Id: "sandboxTransport", + Name: "REST", + Type_: &transportType, + Protocol: "HTTP", + Version: "2.0", + Endpoint: &smc.OneOfTransportInfoEndpoint{}, + }, + SerCategory: &smc.CategoryRef{ + Href: "catalogueHref", + Id: "bwmId", + Name: serviceCategory, + Version: "v1", + }, + } + srvInfo.TransportInfo.Endpoint.Uris = append(srvInfo.TransportInfo.Endpoint.Uris, hostUrl.String()+basePath) + + appServicesPostResponse, _, err := svcMgmtClient.MecServiceMgmtApi.AppServicesPOST(context.TODO(), srvInfo, appInstanceId) + if err != nil { + log.Error("Failed to register the service to app enablement registry: ", err) + return err + } + log.Info("Application Enablement Service instance Id: ", appServicesPostResponse.SerInstanceId) + appEnablementServiceId = appServicesPostResponse.SerInstanceId + return nil +} + +func sendReadyConfirmation(appInstanceId string) error { + var appReady asc.AppReadyConfirmation + appReady.Indication = "READY" + _, err := appSupportClient.MecAppSupportApi.ApplicationsConfirmReadyPOST(context.TODO(), appReady, appInstanceId) + if err != nil { + log.Error("Failed to send a ready confirm acknowlegement: ", err) + return err + } + return nil +} + +func subscribeAppTermination(appInstanceId string) error { + var sub asc.AppTerminationNotificationSubscription + sub.SubscriptionType = "AppTerminationNotificationSubscription" + sub.AppInstanceId = appInstanceId + if mepName == defaultMepName { + sub.CallbackReference = "http://" + moduleName + "/" + bwmBasePath + appTerminationPath + } else { + sub.CallbackReference = "http://" + mepName + "-" + moduleName + "/" + bwmBasePath + appTerminationPath + } + subscription, _, err := appSupportClient.MecAppSupportApi.ApplicationsSubscriptionsPOST(context.TODO(), sub, appInstanceId) + if err != nil { + log.Error("Failed to register to App Support subscription: ", err) + return err + } + appTermSubLink := subscription.Links.Self.Href + appTermSubId = appTermSubLink[strings.LastIndex(appTermSubLink, "/")+1:] + return nil +} + +func Init(bwmCfg InitCfg) (err error) { + sandboxName = bwmCfg.SandboxName + hostUrl = bwmCfg.HostUrl + mepName = bwmCfg.MepName + instanceId = bwmCfg.InstanceId + instanceName = bwmCfg.InstanceName + baseKey = bwmCfg.BaseKey + rc = bwmCfg.RedisConn + activeModel = bwmCfg.Model + + // Get App Enablement URL + appEnablementEnabled = false + appEnablementEnv := strings.TrimSpace(os.Getenv("MEEP_APP_ENABLEMENT")) + if appEnablementEnv != "" { + appEnablementUrl = "http://" + appEnablementEnv + appEnablementEnabled = true + } + log.Info("MEEP_APP_ENABLEMENT: ", appEnablementUrl) + + // Get scope of locality + scopeOfLocalityEnv := strings.TrimSpace(os.Getenv("MEEP_SCOPE_OF_LOCALITY")) + if scopeOfLocalityEnv != "" { + scopeOfLocality = scopeOfLocalityEnv + } + log.Info("MEEP_SCOPE_OF_LOCALITY: ", scopeOfLocality) + + // Get local consumption + consumedLocalOnlyEnv := strings.TrimSpace(os.Getenv("MEEP_CONSUMED_LOCAL_ONLY")) + if consumedLocalOnlyEnv != "" { + value, err := strconv.ParseBool(consumedLocalOnlyEnv) + if err == nil { + consumedLocalOnly = value + } + } + log.Info("MEEP_CONSUMED_LOCAL_ONLY: ", consumedLocalOnly) + + // Get locality + localityEnv := strings.TrimSpace(os.Getenv("MEEP_LOCALITY")) + if localityEnv != "" { + locality = strings.Split(localityEnv, ":") + } + log.Info("MEEP_LOCALITY: ", locality) + + // Set base path + if mepName == globalMepName { + basePath = "/" + sandboxName + "/" + bwmBasePath + } else { + basePath = "/" + sandboxName + "/" + mepName + "/" + bwmBasePath + } + + // Create App Enablement REST clients + if appEnablementEnabled { + // Create Sandbox Controller client + sbxCtrlClientCfg := scc.NewConfiguration() + sbxCtrlClientCfg.BasePath = sbxCtrlUrl + "/sandbox-ctrl/v1" + sbxCtrlClient = scc.NewAPIClient(sbxCtrlClientCfg) + if sbxCtrlClient == nil { + return errors.New("Failed to create Sandbox Controller REST API client") + } + log.Info("Create Sandbox Controller REST API client") + + // Create App Support client + appSupportClientCfg := asc.NewConfiguration() + appSupportClientCfg.BasePath = appEnablementUrl + "/mec_app_support/v1" + appSupportClient = asc.NewAPIClient(appSupportClientCfg) + if appSupportClient == nil { + return errors.New("Failed to create App Enablement App Support REST API client") + } + log.Info("Create App Enablement App Support REST API client") + + // Create App Info client + srvMgmtClientCfg := smc.NewConfiguration() + srvMgmtClientCfg.BasePath = appEnablementUrl + "/mec_service_mgmt/v1" + svcMgmtClient = smc.NewAPIClient(srvMgmtClientCfg) + if svcMgmtClient == nil { + return errors.New("Failed to create App Enablement Service Management REST API client") + } + log.Info("Create App Enablement Service Management REST API client") + } + + log.Info("BWM successfully initialized") + + err = IntializeBwBuffer() + if err != nil { + log.Error("Failed to initialize Bandwidth Buffer: ", err) + return err + } + + return nil +} + +// Run - Starts Bandwidth Management +func Run() (err error) { + + // Start MEC Service registration ticker + if appEnablementEnabled { + startRegistrationTicker() + } + + return nil +} + +// Stop - Stops Bandwidth Management +func Stop() (err error) { + // Stop MEC Service registration ticker + if appEnablementEnabled { + stopRegistrationTicker() + } + + if apiMgr != nil { + // Remove APIs + err = apiMgr.RemoveApis() + if err != nil { + log.Error("Failed to remove APIs with err: ", err.Error()) + return err + } + } + + return nil +} + +func startRegistrationTicker() { + // Make sure ticker is not running + if registrationTicker != nil { + log.Warn("Registration ticker already running") + return + } + + // Wait a few seconds to allow App Enablement Service to start. + // This is done to avoid the default 20 second TCP socket connect timeout + // if the App Enablement Service is not yet running. + log.Info("Waiting for App Enablement Service to start") + time.Sleep(5 * time.Second) + + // Start registration ticker + registrationTicker = time.NewTicker(5 * time.Second) + go func() { + mecAppReadySent := false + registrationSent := false + subscriptionSent := false + for range registrationTicker.C { + // Get Application instance ID + if serviceAppInstanceId == "" { + // If a sandbox service, request an app instance ID from Sandbox Controller + // Otherwise use the scenario-provisioned instance ID + if mepName == defaultMepName { + var err error + serviceAppInstanceId, err = getAppInstanceId() + if err != nil || serviceAppInstanceId == "" { + continue + } + } else { + serviceAppInstanceId = instanceId + } + } + + // Send App Ready message + if !mecAppReadySent { + err := sendReadyConfirmation(serviceAppInstanceId) + if err != nil { + log.Error("Failure when sending the MecAppReady message. Error: ", err) + continue + } + mecAppReadySent = true + } + + // Register service instance + if !registrationSent { + err := registerService(serviceAppInstanceId) + if err != nil { + log.Error("Failed to register to appEnablement DB, keep trying. Error: ", err) + continue + } + registrationSent = true + } + + // Register for graceful termination + if !subscriptionSent { + err := subscribeAppTermination(serviceAppInstanceId) + if err != nil { + log.Error("Failed to subscribe to graceful termination. Error: ", err) + continue + } + sendAppTerminationWhenDone = true + subscriptionSent = true + } + + if mecAppReadySent && registrationSent && subscriptionSent { + + // Registration complete + log.Info("Successfully registered with App Enablement Service") + stopRegistrationTicker() + return + } + } + }() +} + +func stopRegistrationTicker() { + if registrationTicker != nil { + log.Info("Stopping App Enablement registration ticker") + registrationTicker.Stop() + registrationTicker = nil + } +} + +/** +* IntializeBwBuffer initializes bandwidth buffer with maximum value and stores bandwidth buffer in redis +* @return {String} error It returns error message if bandwidth buffer is not stored properly in redis + */ +func IntializeBwBuffer() error { + + //Convert value type to interface{} before storing bandwidth buffer information + + LinkBuff["up"] = maxBuff + LinkBuff["down"] = maxBuff + + entry := make(map[string]interface{}, len(LinkBuff)) + for k, v := range LinkBuff { + entry[k] = v + } + + key := baseKey + "linkbuf:" + err := rc.SetEntry(key, entry) + if err != nil { + return err + } + + return nil +} + +/* +* updateBuffer stores the updated values of bandwidth buffer +* @param map[string]string buff Bandwidth buffer +* @return {String} error It returns error message if bandwidth buffer is not stored properly in redis + */ +func updateBuffer(buff map[string]string) error { + entry := make(map[string]interface{}, len(buff)) + for k, v := range buff { + entry[k] = v + } + + key := baseKey + "linkbuf:" + err := rc.SetEntry(key, entry) + if err != nil { + return err + } + + return nil +} + +func mec011AppTerminationPost(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) +} + +// bandwidthAllocationDelete removes a specific bandwidthAllocation at /bw_allocations/{allocationId} endpoint +func bandwidthAllocationDelete(w http.ResponseWriter, r *http.Request) { + log.Info("Delete bwInfo by allocationId") + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + vars := mux.Vars(r) + bwallocIdStr := vars["allocationId"] + + // Information of bandwidth allocation of specific allocationId is fetched + keyName := baseKey + "bw_alloc:" + bwallocIdStr + jsonBwInfo, err := rc.JSONGetEntry(keyName, ".") + + if err != nil { + err = errors.New("bwInfo not found against the provided allocationId") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + var bwInfo BwInfo + err = json.Unmarshal([]byte(jsonBwInfo), &bwInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // adding/updating the same Bandwidth Resource in Buffer + switch bwInfo.AllocationDirection { + + // downlink + case "00": + + bufferInfo, valBuff, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return + } + var valFixedBuff uint64 + valFixedBuff, _ = strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + bufferInfo["down"] = strconv.FormatUint(valBuff+valFixedBuff, 10) + + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } else { + log.Info("Allocation downlink buffer is updated") + } + + // uplink + case "01": + + bufferInfo, valBuff, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return + } + var valFixedBuff uint64 + valFixedBuff, _ = strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + bufferInfo["up"] = strconv.FormatUint(valBuff+valFixedBuff, 10) + + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } else { + log.Info("Allocation uplink buffer is updated") + } + + // symmetrical + case "10": + + _, valBuffup, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return + } + + bufferInfo, valBuffdown, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return + } + + var valFixedBuff uint64 + valFixedBuff, _ = strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + bufferInfo["down"] = strconv.FormatUint(valBuffdown+(valFixedBuff/2), 10) + bufferInfo["up"] = strconv.FormatUint(valBuffup+(valFixedBuff/2), 10) + + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } else { + log.Info("Allocation buffer is updated") + } + } + + // Information of bandwidth allocation of specific allocationId is deleted from redis + err = rc.JSONDelEntry(keyName, ".") + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + w.WriteHeader(http.StatusNoContent) +} + +// bandwidthAllocationGet retrieves information about a specific bandwidthAllocation at /bw_allocations/{allocationId} endpoint +func bandwidthAllocationGet(w http.ResponseWriter, r *http.Request) { + log.Info("bandwidthAllocationGet") + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + vars := mux.Vars(r) + bwallocIdStr := vars["allocationId"] + + // Information of bandwidth allocation of specific allocationId is fetched + keyName := baseKey + "bw_alloc:" + bwallocIdStr + jsonBwInfo, err := rc.JSONGetEntry(keyName, ".") + + if err != nil { + err = errors.New("bwInfo not found against the provided the allocationId") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + var bwInfo BwInfo + err = json.Unmarshal([]byte(jsonBwInfo), &bwInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + jsonResponse := convertBandwidthInfoToJson(&bwInfo) + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, jsonResponse) +} + +// bandwidthAllocationListGet retrieves information about a list of bandwidthAllocation resources at /bw_allocations endpoint +func bandwidthAllocationListGet(w http.ResponseWriter, r *http.Request) { + log.Info("bandwidthAllocationListGet") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + u, _ := url.Parse(r.URL.String()) + q := u.Query() + + appInstanceId := q["app_instance_id"] + appName := q["app_name"] + sessionId := q["session_id"] + + validQueryParams := []string{"app_instance_id", "app_name", "session_id"} + err := validateQueryParams(q, validQueryParams) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + bwInfoList := &BwAllocInfoResp{ + AppInstanceId: appInstanceId, + AppName: appName, + SessionId: sessionId, + SessionList: make([]BwInfo, 0), + } + + // Make sure only 1 or none of the following are present: appInstanceId, appName, allocationId + err = validateBwInfoQueryParams(appInstanceId, appName, sessionId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Get all Bandwidth Allocation Info from DB + keyName := baseKey + "bw_alloc:*" + err = rc.ForEachJSONEntry(keyName, populateBwInfo, bwInfoList) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // Prepare & send response + jsonResponse, err := json.Marshal(bwInfoList.SessionList) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, string(jsonResponse)) +} + +// bandwidthAllocationPatch modifies the information about a specific existing bandwidthAllocation +// by sending updates on the data structure at /bw_allocations/{allocationId} endpoint +func bandwidthAllocationPatch(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + log.Info("bandwidthAllocationPut") + vars := mux.Vars(r) + bwallocIdStr := vars["allocationId"] + + //Request body is of BwInfoDeltas Type + var bwInfoDeltaInput BwInfoDeltas + // Read JSON input stream provided in the Request, and stores it in the buffer of a Decoder object + decoder := json.NewDecoder(r.Body) + // Decode function return strings containing the text provided in the request body + err := decoder.Decode(&bwInfoDeltaInput) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Information of bandwidth allocation of specific allocationId is fetched + keyName := baseKey + "bw_alloc:" + bwallocIdStr + jsonBwInfo, _ := rc.JSONGetEntry(keyName, ".") + + if jsonBwInfo == "" { + log.Error("BW Allocation Info not found against the provided allocationId") + errHandlerProblemDetails(w, "BW Allocation Info not found against the provided allocationId", http.StatusNotFound) + return + } + + // Bandwidth Information stored for specific allocation + var bwInfoStored BwInfo + err = json.Unmarshal([]byte(jsonBwInfo), &bwInfoStored) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // for copying response from request body of type BwInfoDeltas to BwInfo + var newBwInfo BwInfo + + if bwInfoDeltaInput.AllocationId == "" { + log.Error("Mandatory attribute allocationId is missing") + errHandlerProblemDetails(w, "Mandatory attribute allocationId is missing", http.StatusBadRequest) + return + } + + if bwInfoDeltaInput.AppInsId == "" { + log.Error("Mandatory attribute appInsId is missing") + errHandlerProblemDetails(w, "Mandatory attribute appInsId is missing", http.StatusBadRequest) + return + } + + if bwInfoDeltaInput.RequestType == nil { + log.Error("Mandatory attribute requestType is Missing") + errHandlerProblemDetails(w, "Mandatory attribute requestType is Missing", http.StatusBadRequest) + return + } + + if (*bwInfoDeltaInput.RequestType != 0) && (*bwInfoDeltaInput.RequestType != 1) { + log.Error("Invalid Mandatory attribute") + errHandlerProblemDetails(w, "Invalid Mandatory attribute", http.StatusBadRequest) + return + } + + //Validating Mandatory attribute + if bwInfoDeltaInput.AllocationId != "" { + if bwInfoDeltaInput.AllocationId != bwallocIdStr { + log.Error("AllocationId in endpoint and in body not matching") + errHandlerProblemDetails(w, "AllocationId in endpoint and in body not matching", http.StatusBadRequest) + return + } else { + // copying response from type BwInfoDeltas to BwInfo + newBwInfo.AllocationId = bwInfoDeltaInput.AllocationId + } + } + + //Validating Mandatory attribute + if bwInfoDeltaInput.AppInsId != "" { + if bwInfoDeltaInput.AppInsId != bwInfoStored.AppInsId { + // Get App instance + appInfo, err := getAppInfo(bwInfoDeltaInput.AppInsId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Validate App info + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error(err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + // copying response from type BwInfoDeltas to BwInfo + newBwInfo.AppInsId = bwInfoDeltaInput.AppInsId + } else if bwInfoDeltaInput.AppInsId == bwInfoStored.AppInsId { + // copying response from type BwInfoDeltas to BwInfo + newBwInfo.AppInsId = bwInfoDeltaInput.AppInsId + } + } + + // Patch method does not allow to change appName + newBwInfo.AppName = bwInfoStored.AppName + + // validate the requested changes in Mandatory attribute requestType (session/application specific) + if (*bwInfoDeltaInput.RequestType == 0) || (*bwInfoDeltaInput.RequestType == 1) { + // copying data to response body of BwInfo type + newBwInfo.RequestType = bwInfoDeltaInput.RequestType + newSessionFilter := make([]BwInfoSessionFilter, 0) + for _, filter := range bwInfoDeltaInput.SessionFilter { + newSessionFilter = append(newSessionFilter, BwInfoSessionFilter(filter)) + } + newBwInfo.SessionFilter = newSessionFilter + + if *bwInfoDeltaInput.RequestType == 1 { + if len(bwInfoDeltaInput.SessionFilter) >= 0 { + sessionSlice := make([]BwInfoSessionFilter, 0) + for index, singleSessionFilter := range newBwInfo.SessionFilter { + if index == 0 { + sessionSlice = append(sessionSlice, singleSessionFilter) + } else { + sessionSlice, err = sessionContains(sessionSlice, singleSessionFilter) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + } + } + + err = validateUpdateRequestType(&newBwInfo, &bwInfoStored, w) + if err != nil { + log.Error(err.Error()) + return + } + } + + seconds := time.Now().Unix() + nanoseconds := time.Now().UnixNano() + newBwInfo.TimeStamp = &BwInfoTimeStamp{ + NanoSeconds: int32(nanoseconds), + Seconds: int32(seconds), + } + + if (bwInfoDeltaInput.AllocationDirection != "") || (bwInfoDeltaInput.FixedAllocation != "") { + // validate and update the request changes in Allocation direction or Fixed Allocation (bps) + if bwInfoDeltaInput.AllocationDirection != "" { + if (bwInfoDeltaInput.AllocationDirection == "00") || (bwInfoDeltaInput.AllocationDirection == "01") || (bwInfoDeltaInput.AllocationDirection == "10") { + newBwInfo.AllocationDirection = bwInfoDeltaInput.AllocationDirection + } + } else { + newBwInfo.AllocationDirection = bwInfoStored.AllocationDirection + } + if bwInfoDeltaInput.FixedAllocation != "" { + newBwInfo.FixedAllocation = bwInfoDeltaInput.FixedAllocation + } else { + newBwInfo.FixedAllocation = bwInfoStored.FixedAllocation + } + err = UpdateAllocationDirection(&newBwInfo, &bwInfoStored, w) + if err != nil { + return + } + } + + // setBwInfo function takes input of new BW allocation information and + // store it in json format in redis with new allocation ID. + var jsonResponse []byte + jsonResponse, err = setBwInfo(newBwInfo) + if err != nil { + log.Error("Unable to store new Allocation in redis") + errHandlerProblemDetails(w, "Unable to store new Allocation in redis", http.StatusInternalServerError) + return + } + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, string(jsonResponse)) + //w.WriteHeader(http.StatusOK) +} + +// bandwidthAllocationPost creates a bandwidthAllocation resource at /bw_allocations endpoint +func bandwidthAllocationPost(w http.ResponseWriter, r *http.Request) { + log.Info("bandwidthAllocationPOST") + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + // Read request body + var bwInfo BwInfo + // Read JSON input stream provided in the Request, and stores it in the buffer of a Decoder object + decoder := json.NewDecoder(r.Body) + // Decode function return strings containing the text provided in the request body + err := decoder.Decode(&bwInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Validating mandatory parameters provided in the request body + + if bwInfo.AppInsId == "" { + log.Error("Mandatory appInsId parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute appInsId is missing in the request body.", http.StatusBadRequest) + return + } + + // verify RequestType attribute is either 1 or 0 + if bwInfo.RequestType != nil { + if (*bwInfo.RequestType == 0) || (*bwInfo.RequestType == 1) { + if (bwInfo.AllocationDirection == "00") || (bwInfo.AllocationDirection == "01") || (bwInfo.AllocationDirection == "10") { + log.Debug("Valid Mandatory attribute allocationDirection") + } else { + log.Error("Valid allocationDirection value should be present") + errHandlerProblemDetails(w, "Valid allocationDirection value should be present in the request body", http.StatusBadRequest) + return + } + } else { + log.Error("Valid requestType value should be present") + errHandlerProblemDetails(w, "Valid requestType value should be present in the request body", http.StatusBadRequest) + return + } + } else { + log.Error("Mandatory attribute requestType should be present") + errHandlerProblemDetails(w, "Mandatory attribute requestType is missing in the request body", http.StatusBadRequest) + return + } + + // Validate Mandatory attribute "FixedAllocation" + if bwInfo.FixedAllocation != "" { + valFixedBuff, err := strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + if err == nil { + _, valUpBuff, _ := getUplinkBuff() + _, valDownBuff, _ := getDownlinkBuff() + + if valFixedBuff == 0 { + log.Error("Value of FixedAllocation should be non-zero") + errHandlerProblemDetails(w, "Value of FixedAllocation should be non-zero", http.StatusBadRequest) + return + } + + // validate if the requested Allocation is within range of Available Bandwidth Resorce + if (bwInfo.AllocationDirection == "01" && valFixedBuff > valUpBuff) || (bwInfo.AllocationDirection == "00" && valFixedBuff > valDownBuff) { + log.Error("Requested Allocation exceeds Resource buffer") + errHandlerProblemDetails(w, "Requested Allocation exceeds Resource buffer.", http.StatusBadRequest) + return + } else { + log.Info("Fixed Allocation is in Allocation Buffer range") + } + } else { + log.Error("Failed to convert value of Fixed allocation: ", err.Error()) + errHandlerProblemDetails(w, "Failed to convert value of Fixed allocation", http.StatusInternalServerError) + return + } + } else { + log.Error("Mandatory fixedAllocation parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute fixedAllocation is missing in the request body", http.StatusBadRequest) + return + } + + // verify if the RequestType attribute is 1 for session specific allocation + // then SessionFilter should also provided in requested body + if *bwInfo.RequestType == 1 && len(bwInfo.SessionFilter) != 0 { + for _, flowFilterVal := range bwInfo.SessionFilter { + if flowFilterVal.SourceIp == "" && flowFilterVal.SourcePort == "" && flowFilterVal.DstAddress == "" && flowFilterVal.DstPort == "" && flowFilterVal.Protocol == "" { + log.Error("At least one of sessionFilter subfields shall be included") + errHandlerProblemDetails(w, "At least one of sessionFilter subfields shall be included in the request body.", http.StatusBadRequest) + return + } + } + } else if *bwInfo.RequestType == 1 && len(bwInfo.SessionFilter) == 0 { + log.Error("sessionFilter attribute is Empty.") + errHandlerProblemDetails(w, "sessionFilter attribute is Empty..", http.StatusBadRequest) + return + } + + if *bwInfo.RequestType == 0 { + bwInfo.SessionFilter = nil + } + + if *bwInfo.RequestType == 1 && bwInfo.SessionFilter != nil { + sessionSlice := make([]BwInfoSessionFilter, 0) + for index, singleSessionFilter := range bwInfo.SessionFilter { + if index == 0 { + sessionSlice = append(sessionSlice, singleSessionFilter) + } else { + sessionSlice, err = sessionContains(sessionSlice, singleSessionFilter) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + } + + // Get App instance + appInfo, err := getAppInfo(bwInfo.AppInsId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Validate App info + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error(err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + + //var newBwInfo BwInfo + var jsonResponse []byte + + sessionFilterList := &sessionFilterListCheck{ + sessionBool: false, + SessionList: bwInfo.SessionFilter, + } + + keyName := baseKey + "bw_alloc:*" + + if *bwInfo.RequestType == 1 { + // Retrieve bwInfo sessions from redis DB one by one and store in the sessionFilterList + // to check if a bwInfo already exists in DB with same sessionFilter + err = rc.ForEachJSONEntry(keyName, compareSessionFilters, sessionFilterList) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + //check bool here + if sessionFilterList.sessionBool { + errHandlerProblemDetails(w, "Provide sessionFilter matches an already existing session", http.StatusBadRequest) + return + } + } + + // Validate IP Address of UE (dstAddress in downlink, sourceIp in uplink and both is symmetrical + // options) with existing UE IP(s), if the request type is session specific + + if *bwInfo.RequestType == 1 { + switch bwInfo.AllocationDirection { + case "00": + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(&bwInfo) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + case "01": + // if the provided source IP range matches with the existing UE IP(s) + err = checkSrcIP(&bwInfo) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + case "10": + // if the provided source IP range matches with the existing UE IP(s) + err = checkSrcIP(&bwInfo) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(&bwInfo) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + + } + + seconds := time.Now().Unix() + nanoseconds := time.Now().UnixNano() + bwInfo.TimeStamp = &BwInfoTimeStamp{ + NanoSeconds: int32(nanoseconds), + Seconds: int32(seconds), + } + + // In APPLICATION_SPECIFIC_BW_ALLOCATION OR SESSION_SPECIFIC_BW_ALLOCATION + // Uplink, Downlink and Symmetrical bandwidth allocation is performed + if bwInfo.AllocationDirection != "" { + err = bandwidthResourceAllocation(&bwInfo, w) + if err != nil { + log.Error(err.Error()) + return + } + } + // setBwInfo function takes input of new BW allocation information and + // store it in json format in redis with new allocation ID. + jsonResponse, err = setBwInfo(bwInfo) + if err != nil { + log.Error("Unable to store new Allocation in redis") + errHandlerProblemDetails(w, "Unable to store new Allocation in redis", http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusCreated) + fmt.Fprint(w, string(jsonResponse)) +} + +// bandwidthAllocationPut updates the information about a specific bandwidthAllocation at /bw_allocations/{allocationId} endpoint +func bandwidthAllocationPut(w http.ResponseWriter, r *http.Request) { + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + log.Info("bandwidthAllocationPut") + vars := mux.Vars(r) + bwallocIdStr := vars["allocationId"] + + var bwInfoInput BwInfo + + // Read JSON input stream provided in the Request, and stores it in the buffer of a Decoder object + decoder := json.NewDecoder(r.Body) + // Decode function return strings containing the text provided in the request body + err := decoder.Decode(&bwInfoInput) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + //Body content not matching parameters + if bwInfoInput.AllocationId != "" { + if bwInfoInput.AllocationId != bwallocIdStr { + log.Error("AllocationId in the endpoint and Request body does not matched") + errHandlerProblemDetails(w, "AllocationId in the endpoint and Request body does not matched", http.StatusBadRequest) + return + } + } + + // Information of bandwidth allocation of specific allocationId is fetched + keyName := baseKey + "bw_alloc:" + bwallocIdStr + jsonBwInfo, _ := rc.JSONGetEntry(keyName, ".") + + if jsonBwInfo == "" { + log.Error("BW Allocation Information not found against the provided allocationId") + errHandlerProblemDetails(w, "BW Allocation Information not found against the provided allocationId", http.StatusNotFound) + return + } + + if bwInfoInput.RequestType == nil { + log.Error("Mandatory attribute requestType is Missing") + errHandlerProblemDetails(w, "Mandatory attribute requestType is Missing", http.StatusBadRequest) + return + } + + if bwInfoInput.AppInsId == "" { + log.Error("Mandatory attribute appInsId is Missing") + errHandlerProblemDetails(w, "Mandatory attribute appInsId is Missing", http.StatusBadRequest) + return + } + + if bwInfoInput.RequestType != nil { + if (*bwInfoInput.RequestType != 0) && (*bwInfoInput.RequestType != 1) { + log.Error("Invalid Mandatory attribute requestType") + errHandlerProblemDetails(w, "Invalid Mandatory attribute requestType", http.StatusBadRequest) + return + } + } + + if (bwInfoInput.AllocationDirection == "") || (bwInfoInput.FixedAllocation == "") { + log.Error("Mandatory attribute allocationDirection or fixedAllocation is Missing") + errHandlerProblemDetails(w, "Mandatory attribute allocationDirection or fixedAllocation is Missing", http.StatusBadRequest) + return + } + + var bwInfoStored BwInfo + err = json.Unmarshal([]byte(jsonBwInfo), &bwInfoStored) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // validate the requested changes in application Instance Id + if bwInfoInput.AppInsId != "" { + if bwInfoInput.AppInsId != bwInfoStored.AppInsId { + // Get App instance + appInfo, err := getAppInfo(bwInfoInput.AppInsId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Validate App info + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error(err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + } + } + + // validate the requested changes in Request Type (session/application specific) + if bwInfoInput.RequestType != nil { + if (*bwInfoInput.RequestType == 0) || (*bwInfoInput.RequestType == 1) { + + if *bwInfoInput.RequestType == 1 { + if len(bwInfoInput.SessionFilter) > 0 { + sessionSlice := make([]BwInfoSessionFilter, 0) + for index, singleSessionFilter := range bwInfoInput.SessionFilter { + if index == 0 { + sessionSlice = append(sessionSlice, singleSessionFilter) + } else { + sessionSlice, err = sessionContains(sessionSlice, singleSessionFilter) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + } + } + + err = validateUpdateRequestType(&bwInfoInput, &bwInfoStored, w) + if err != nil { + log.Error(err.Error()) + //errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + } + } + + seconds := time.Now().Unix() + nanoseconds := time.Now().UnixNano() + bwInfoInput.TimeStamp = &BwInfoTimeStamp{ + NanoSeconds: int32(nanoseconds), + Seconds: int32(seconds), + } + bwInfoInput.AllocationId = bwInfoStored.AllocationId + + // validate and update the request changes in Allocation direction or Fixed Allocation (bps) + if (bwInfoInput.AllocationDirection != "") && (bwInfoInput.FixedAllocation != "") { + if (bwInfoInput.AllocationDirection == "00") || (bwInfoInput.AllocationDirection == "01") || (bwInfoInput.AllocationDirection == "10") { + err = UpdateAllocationDirection(&bwInfoInput, &bwInfoStored, w) + if err != nil { + return + } + } else { + log.Error("Invalid Mandatory attribute allocationDirection") + errHandlerProblemDetails(w, "Invalid Mandatory attribute allocationDirection", http.StatusBadRequest) + return + } + } + + // setBwInfo function takes input of new BW allocation information and + // store it in json format in redis with new allocation ID. + var jsonResponse []byte + jsonResponse, err = setBwInfo(bwInfoInput) + if err != nil { + log.Error("Unable to store new Allocation in redis") + errHandlerProblemDetails(w, "Unable to store new Allocation in redis", http.StatusInternalServerError) + return + } + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, string(jsonResponse)) +} + +/* +* populateSessionFilter compares the requested session filters against session filters of the allocated resource allocations stored in redis +* @param {string} key Bandwidth allocation stored with this key +* @param {string} jsonInfo Bandwidth allocation information +* @param {interface{}} response Bandwidth allocation information +* @return {String} error error message + */ +func populateSessionFilter(key string, jsonInfo string, response interface{}) error { + resp := response.(*SessionFilterResp) + if resp == nil { + return errors.New("Response not defined") + } + var bwInfo BwInfo + err := json.Unmarshal([]byte(jsonInfo), &bwInfo) + if err != nil { + return err + } + + if len(bwInfo.SessionFilter) > 0 { + for _, singleSessionInput := range resp.SessionFilterList { + for _, singleSessionStored := range bwInfo.SessionFilter { + if reflect.DeepEqual(singleSessionInput, singleSessionStored) { + resp.SessionMatch = true + if resp.AllocationId == bwInfo.AllocationId { + resp.AllocationIdMatch = true + } + } + } + } + } + return nil +} + +/* +* Function that list down all the bandwidth allocations based on query parameters +* @param {string} key Bandwidth allocation stored with this key +* @param {string} jsonInfo Bandwidth allocation information +* @param {*BwAllocInfoResp} response Bandwidth allocation information +* @return {String} error error message + */ +func populateBwInfo(key string, jsonInfo string, bwInfoList interface{}) error { + resp := bwInfoList.(*BwAllocInfoResp) + if resp == nil { + return errors.New("Response not defined") + } + var bwInfo BwInfo + err := json.Unmarshal([]byte(jsonInfo), &bwInfo) + if err != nil { + return err + } + + paramFound := false + + if len(resp.AppInstanceId) > 0 { + paramFound = false + for _, QueryAppInstanceId := range resp.AppInstanceId { + if bwInfo.AppInsId == QueryAppInstanceId { + paramFound = true + } + } + if !paramFound { + return nil + } + } + + if len(resp.AppName) > 0 { + paramFound = false + for _, QueryAppName := range resp.AppName { + if bwInfo.AppName == QueryAppName { + paramFound = true + } + } + if !paramFound { + return nil + } + } + + if len(resp.SessionId) > 0 { + paramFound = false + for _, QueryAllocationId := range resp.SessionId { + if bwInfo.AllocationId == QueryAllocationId { + paramFound = true + } + } + if !paramFound { + return nil + } + } + + resp.SessionList = append(resp.SessionList, bwInfo) + return nil +} + +func errHandlerProblemDetails(w http.ResponseWriter, error string, code int) { + var pd ProblemDetails + pd.Detail = error + pd.Status = int32(code) + jsonResponse := convertProblemDetailsToJson(&pd) + w.WriteHeader(code) + fmt.Fprint(w, jsonResponse) +} + +/* +* setBwInfo sets/updates updated bandwidth allocation information with allocationId as a key to stored in the redis +* @param {BwInfo} bwInfo updated bandwidth allocation resource information +* @return {uint8} []byte encoded bandwidth allocation resource information in json string +* @return {error} error It returns error while encoding to json string throughs error + */ +func setBwInfo(bwInfo BwInfo) ([]byte, error) { + var jsonResponse []byte + bwallocIdStr := bwInfo.AllocationId + keyName := baseKey + "bw_alloc:" + bwallocIdStr + _ = rc.JSONSetEntry(keyName, ".", convertBandwidthInfoToJson(&bwInfo)) + jsonResponse, err := json.Marshal(bwInfo) + + return jsonResponse, err +} + +/* +* getAppInfo gets application information using its application Instance Id stored in redis +* @param {string} appId application Instance Id used to retrive its information from redis +* @return {map[string]string} appInfo application information +* @return {error} err It returns error if there is no information associated with this appId + */ +func getAppInfo(appId string) (map[string]string, error) { + + var appInfo map[string]string + // Get app instance from local MEP only + baseKeyAppEn := dkm.GetKeyRoot(sandboxName) + appEnablementKey + ":mep:" + mepName + ":" + key := baseKeyAppEn + "app:" + appId + ":info" + appInfo, err := rc.GetEntry(key) + if err != nil || len(appInfo) == 0 { + return nil, errors.New("appInsId not found") + } + return appInfo, nil +} + +/* +* validateAppInfo validates the status information of application to be in ready state +* @param {map[string]string} appInfo Information associated with application +* @return {int} int It returns the http status for validation +* @return {error} err It returns the details of the problem if any +* @return {error} err It returns the error message for error if any otherwise nil + */ +func validateAppInfo(appInfo map[string]string) (int, string, error) { + // Make sure App is in ready state + if appInfo[fieldState] != APP_STATE_READY { + var problemDetails ProblemDetails + problemDetails.Status = http.StatusForbidden + problemDetails.Detail = "App Instance not ready. Waiting for AppReadyConfirmation." + return http.StatusForbidden, convertProblemDetailsToJson(&problemDetails), errors.New("App Instance not ready") + } + return http.StatusOK, "", nil +} + +/* +* checkSrcIP validate source ip range passed in CIDR notation with existing UE ip +* @param {*BwInfo} bw request body of POST method +* @return {error} err It returns the status of UE present in the active model zone + */ +func checkSrcIP(bw *BwInfo) (err error) { + ueNameList := activeModel.GetNodeNames("UE") + // if the provided source IP range matches with the existing UE IP(s) + if len(ueNameList) > 0 { + for _, ip := range bw.SessionFilter { + ipFound := true + if ip.SourceIp != "" { + ipName := net.ParseIP(ip.SourceIp) + if ipName != nil { + for _, name := range ueNameList { + // Ignore disconnected UEs + if !isUeConnected(name) || !isInLocality(name) { + continue + } + if ipName.String() == name { + log.Info("Provided source IP range is valid against the existing UE IPs") + ipFound = true + break + } else { + ipFound = false + } + } + } + // Return error if IP not in ueNameList + if !ipFound { + log.Error("Provided source IP range is not valid against the existing UE IPs") + err = errors.New("Provided source IP range is not valid against the existing UE IPs in the request body") + return err + } + } + } + } + return nil +} + +/* +* checkDstIP validate destination ip range passed in CIDR notation with existing UE ip +* @param {*BwInfo} bw request body of POST method +* @return {error} err It returns the status of UE present in the active model zone + */ +func checkDstIP(bw *BwInfo) (err error) { + ueNameList := activeModel.GetNodeNames("UE") + // if the provided destination IP range matches with the existing UE IP(s) + if len(ueNameList) > 0 { + for _, ip := range bw.SessionFilter { + ipFound := true + if ip.DstAddress != "" { + ipName := net.ParseIP(ip.DstAddress) + if ipName != nil { + for _, name := range ueNameList { + // Ignore disconnected UEs + if !isUeConnected(name) || !isInLocality(name) { + continue + } + if ipName.String() == name { + log.Info("Provided destination IP range is valid against the existing UE IPs") + ipFound = true + break + } else { + ipFound = false + } + } + } + // Return error if IP not in ueNameList + if !ipFound { + log.Error("Provided destination IP range is not valid against the existing UE IPs") + err = errors.New("Provided destination IP range is not valid against the existing UE IPs in the request body") + return err + } + } + } + } + return nil +} + +/* +* isInLocality validate UE ip only when they are in locality of current active model +* @param {string} name name of a UE +* @return {bool} bool It returns the status of UE present in the active model zone + */ +func isInLocality(name string) bool { + if localityEnabled { + ctx := activeModel.GetNodeContext(name) + if ctx == nil { + log.Error("Error getting context for: " + name) + return false + } + if _, found := mapLocality[ctx.Parents[mod.Zone]]; !found { + return false + } + } + return true +} + +/* +* isUeConnected validate UE ip with connected UE(s) in the current active model +* @param {string} name name of a UE +* @return {bool} bool It returns the status of network connectivity of UE + */ +func isUeConnected(name string) bool { + node := activeModel.GetNode(name) + if node != nil { + pl := node.(*dataModel.PhysicalLocation) + return pl.Connected + } + return false +} + +/* +* getUplinkBuff fetches uplink buffer information stored in redis +* @return {map[string]string} bufferInfo Bandwidth buffer information (uplink/downlink) +* @return {uint64} valBuff Value of uplink buffer +* @return {String} error error message + */ +func getUplinkBuff() (bufferInfo map[string]string, valBuff uint64, err error) { + // fetch bandwidth buffer information from redis + key := baseKey + "linkbuf:" + bufferInfo, err = rc.GetEntry(key) + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + return nil, 0, err + } else { + log.Info("Allocation buffer is successfully fetched from redis") + var valBuff uint64 + // conversion of downlink buffer value from string to uint64 + valBuff, err = strconv.ParseUint(bufferInfo["up"], 10, 64) + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + return nil, 0, err + } else { + return bufferInfo, valBuff, nil + } + } +} + +/* +* getDownlinkBuff fetches downlink buffer information stored in redis +* @return {map[string]string} bufferInfo Bandwidth buffer information (uplink/downlink) +* @return {uint64} valBuff Value of downlink buffer +* @return {String} error error message + */ +func getDownlinkBuff() (bufferInfo map[string]string, valBuff uint64, err error) { + // fetch bandwidth buffer information from redis + key := baseKey + "linkbuf:" + bufferInfo, err = rc.GetEntry(key) + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + return nil, 0, err + } else { + log.Info("Allocation buffer is successfully fetched from redis") + var valBuff uint64 + // conversion of downlink buffer value from string to uint64 + valBuff, err = strconv.ParseUint(bufferInfo["down"], 10, 64) + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + return nil, 0, err + } else { + return bufferInfo, valBuff, nil + } + } +} + +/* +* validateUpdateRequestType validates the type (session/application specific) for allocation and in case of session specific makes check on UE range using sessionFilter array +* @param {*BwInfo} bwInfoInput bandwidth Allocation information to be updated +* @param{*BwInfo} bwInfoStored bandwidth Allocation information to be replaced +* @param {http.ResponseWriter} w writes HTTP reply + */ +func validateUpdateRequestType(bwInfoInput *BwInfo, bwInfoStored *BwInfo, w http.ResponseWriter) error { + + // if the RequestType attribute is the same for session specific allocation or changed to session specific allocation + // then SessionFilter should also provided in requested body and verified + if (*bwInfoInput.RequestType == 1 && bwInfoInput.RequestType == bwInfoStored.RequestType) || (*bwInfoInput.RequestType == 1 && bwInfoInput.RequestType != bwInfoStored.RequestType) { + if len(bwInfoInput.SessionFilter) <= 0 { + err := errors.New("sessions are not provided for filtering criteria") + errHandlerProblemDetails(w, "sessions are not provided for filtering criteria.", http.StatusBadRequest) + return err + // validate the requested changes within session specific allocation + } else { + log.Info("Request type is now change to session specific allocation") + + response := &SessionFilterResp{ + SessionMatch: false, + SessionFilterList: make([]BwInfoSessionFilter, len(bwInfoInput.SessionFilter)), + AllocationId: "", + AllocationIdMatch: false, + } + + response.SessionFilterList = bwInfoInput.SessionFilter + response.AllocationId = bwInfoInput.AllocationId + + // Get all Bandwidth Allocation Info from DB + keyMatchStr := baseKey + "bw_alloc:*" + err := rc.ForEachJSONEntry(keyMatchStr, populateSessionFilter, response) + if err != nil { + log.Error("Unable to fetch allocation resource from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation resource from redis", http.StatusInternalServerError) + return err + } + + if response.SessionMatch { + if response.AllocationIdMatch { + log.Info("Same sessionFilter requested to update") + return nil + } else { + err = errors.New("multiple sessions match sessionFilter") + //log.Error("multiple sessions match sessionFilter") + errHandlerProblemDetails(w, "multiple sessions match sessionFilter", http.StatusBadRequest) + return err + } + } + + switch bwInfoInput.AllocationDirection { + + //downlink + case "00": + + // if the provided destination IP range matches with the existing UE IP(s) + err := checkDstIP(bwInfoInput) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return err + } + + //uplink + case "01": + + // if the provided source IP range matches with the existing UE IP(s) + err := checkSrcIP(bwInfoInput) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return err + } + + //symmetrical + case "10": + // if the provided source IP range matches with the existing UE IP(s) + err := checkSrcIP(bwInfoInput) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return err + } + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(bwInfoInput) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return err + } + } + return nil + } + } else if *bwInfoInput.RequestType == 0 { + // The attribute for session filter should be removed if requested is application specific allocation + if *bwInfoInput.RequestType == 0 { + log.Info("Request Types is SessionFilter") + bwInfoInput.SessionFilter = nil + } + log.Info("Request type is now change to application specific allocation") + return nil + } + return nil +} + +/* +* UpdateAllocationDirection validates and update the resource allocation according to the direction of allocation (downlink, uplink and symmetrical) and fixedALloaction value +* @param {*BwInfo} bwInfoInput bandwidth Allocation information to be updated +* @param{*BwInfo} bwInfoStored bandwidth Allocation information to be replaced +* @param {http.ResponseWriter} w writes HTTP reply + */ +func UpdateAllocationDirection(bwInfoInput *BwInfo, bwInfoStored *BwInfo, w http.ResponseWriter) error { + if (bwInfoInput.AllocationDirection != bwInfoStored.AllocationDirection) || (bwInfoInput.FixedAllocation != bwInfoStored.FixedAllocation) { + + // Before updating resource allocation validate that value of FixedAllocation should be non-zero + var valFixedBuff uint64 + valFixedBuff, err := strconv.ParseUint(bwInfoInput.FixedAllocation, 10, 64) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else if valFixedBuff == 0 { + err = errors.New("Value of FixedAllocation should be non-zero") + log.Error(err.Error()) + errHandlerProblemDetails(w, "Value of FixedAllocation should be non-zero", http.StatusBadRequest) + return err + } + + // Release bandwidth resources in bandwidth buffer for previous allocation based on fixed allocation and allocation direction + err = freeBwBufferResource(bwInfoStored, w) + if err != nil { + return err + } + // update the newly requested bandwidth resources in bandwidth buffer based on fixed allocation and allocation direction + err = addBwBufferResource(bwInfoInput, w) + if err != nil { + return err + } + } + return nil +} + +/* +* freeBwBufferResource releases bandwidth buffer resources uplink/downlink based on Allocation direction (downlink, uplink and symmetrical) and fixedALloaction value +* @param{*BwInfo} bwInfoStored bandwidth Allocation information to be replaced +* @param {http.ResponseWriter} w writes HTTP reply + */ +func freeBwBufferResource(bwInfoStored *BwInfo, w http.ResponseWriter) error { + // adding/updating the Bandwidth Resource in Buffer + switch bwInfoStored.AllocationDirection { + + // downlink + case "00": + + bufferInfo, valBuff, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + var valFixedBuff uint64 + valFixedBuff, _ = strconv.ParseUint(bwInfoStored.FixedAllocation, 10, 64) + bufferInfo["down"] = strconv.FormatUint(valBuff+valFixedBuff, 10) + + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation downlink buffer is updated") + return nil + } + + // uplink + case "01": + + bufferInfo, valBuff, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + var valFixedBuff uint64 + valFixedBuff, _ = strconv.ParseUint(bwInfoStored.FixedAllocation, 10, 64) + bufferInfo["up"] = strconv.FormatUint(valBuff+valFixedBuff, 10) + + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation uplink buffer is updated") + return nil + } + + // symmetrical + case "10": + + _, valBuffup, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + bufferInfo, valBuffdown, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + var valFixedBuff uint64 + valFixedBuff, _ = strconv.ParseUint(bwInfoStored.FixedAllocation, 10, 64) + bufferInfo["down"] = strconv.FormatUint(valBuffdown+(valFixedBuff/2), 10) + bufferInfo["up"] = strconv.FormatUint(valBuffup+(valFixedBuff/2), 10) + + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation buffer is updated") + return nil + } + } + return nil +} + +/* +* addBwBufferResource allocate bandwidth buffer resources uplink/downlink based on new requested Allocation direction (downlink, uplink and symmetrical) and fixedALloaction value +* @param {*BwInfo} bwInfoInput bandwidth Allocation information to be updated +* @param {http.ResponseWriter} w writes HTTP reply + */ +func addBwBufferResource(bwInfoInput *BwInfo, w http.ResponseWriter) error { + switch bwInfoInput.AllocationDirection { + + // downlink case + case "00": + + // getting downlink buffer value from redis to update + bufferInfo, valBuff, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + // To start allocating resource, buffer value should be non-zero + if valBuff > 0 { + var valFixedBuff uint64 + valFixedBuff, err = strconv.ParseUint(bwInfoInput.FixedAllocation, 10, 64) + // The value of resource needed to be allocate should also be no-zero + if (valFixedBuff > 0) && (err == nil) { + bufferInfo["down"] = strconv.FormatUint(valBuff-valFixedBuff, 10) + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation downlink buffer is updated") + return nil + } + } + } else { + log.Debug("Resources are insufficient for this allocation") + return nil + } + + // uplink case + case "01": + + // getting uplink buffer value from redis to update + bufferInfo, valBuff, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + // To start allocating resource, buffer value should be non-zero + if valBuff > 0 { + var valFixedBuff uint64 + valFixedBuff, err = strconv.ParseUint(bwInfoInput.FixedAllocation, 10, 64) + // The value of resource needed to be allocate should also be no-zero + if (valFixedBuff > 0) && (err == nil) { + bufferInfo["up"] = strconv.FormatUint(valBuff-valFixedBuff, 10) + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation uplink buffer is updated") + return nil + } + } + } else { + + log.Debug("Resources are insufficient for this allocation") + return nil + } + // symmetrical case + case "10": + + // getting downlink/uplink buffer value from redis to update + _, valBuffup, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + bufferInfo, valBuffdown, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + // To start allocating resource, buffer values should be non-zero + if (valBuffup > 0) && (valBuffdown > 0) { + var valFixedBuff uint64 + valFixedBuff, err = strconv.ParseUint(bwInfoInput.FixedAllocation, 10, 64) + // The value of resource needed to be allocate should also be no-zero + if (valFixedBuff > 0) && (err == nil) { + bufferInfo["up"] = strconv.FormatUint(valBuffup-(valFixedBuff/2), 10) + bufferInfo["down"] = strconv.FormatUint(valBuffdown-(valFixedBuff/2), 10) + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation downlink buffer is updated") + return nil + } + } + } else { + + log.Debug("Resources are insufficient for this allocation") + return nil + } + + } + return nil +} + +/* +* sessionContains compares the slice of unique sessions with the passed single session of the requested allocation +* @param {[]BwInfoSessionFilter} sessionSlice slice contains the unique sessions +* @param {BwInfoSessionFilter} singleSessionFilter single session to be compared +* @return {[]BwInfoSessionFilter} returns the updated slice of sessionFilters +* @return {error} An error will be return if occurs + */ +func sessionContains(sessionSlice []BwInfoSessionFilter, singleSessionFilter BwInfoSessionFilter) ([]BwInfoSessionFilter, error) { + for _, sessionSlice1 := range sessionSlice { + if reflect.DeepEqual(singleSessionFilter, sessionSlice1) { + err := errors.New("SessionFilter contains same sessions") + return nil, err + } else { + sessionSlice = append(sessionSlice, singleSessionFilter) + } + } + return sessionSlice, nil +} + +/* + * validateQueryParams ensures that valid query parameters should be used to retrieve one of the + app_instance_id or app_name or allocation_id attributes from the user + * @return {error} error An error will be return if occurs +*/ +func validateQueryParams(params url.Values, validParams []string) error { + for param := range params { + found := false + for _, validParam := range validParams { + if param == validParam { + found = true + break + } + } + if !found { + err := errors.New("Invalid query param: " + param) + log.Error(err.Error()) + return err + } + } + return nil +} + +/* + * validateBwInfoQueryParams check that either app_instance_id or app_name or allocation_id or + none should be provided in the request + * @return {error} error An error will be return if occurs +*/ +func validateBwInfoQueryParams(appInstanceId []string, appName []string, sessionId []string) error { + count := 0 + if len(appInstanceId) != 0 { + count++ + } + if len(appName) != 0 { + count++ + } + if len(sessionId) != 0 { + count++ + } + if count > 1 { + err := errors.New("Either app_instance_id or app_name or allocation_id or none of them shall be present") + log.Error(err.Error()) + return err + } + return nil +} + +/* +* compareSessionFilters compares the requested allocation sessions with the existing unique sessions stored in redis of allocated resources +* @param {string} key Bandwidth allocation stored with this key +* @param {string} jsonInfo Bandwidth allocation information +* @param {*BwAllocInfoResp} sessionFilterList Bandwidth allocation information +* @return {String} error error message + */ +func compareSessionFilters(key string, jsonInfo string, sessionFilterList interface{}) error { + + // Get query params & bwInfo + data := sessionFilterList.(*sessionFilterListCheck) + if data == nil { + return errors.New("bwInfo list not found") + } + + // Retrieve bwInfo from DB + var sessionFilterInfo BwInfo + err := json.Unmarshal([]byte(jsonInfo), &sessionFilterInfo) + if err != nil { + return err + } + + for _, sessionFilterData := range data.SessionList { + for _, redisSessionFilterData := range sessionFilterInfo.SessionFilter { + if reflect.DeepEqual(sessionFilterData, redisSessionFilterData) { + data.sessionBool = true + return nil + } + } + } + return nil +} + +/* +* bandwidthResourceAllocation allocate bandwidth buffer resources uplink/downlink based on new requested Allocation direction (downlink, uplink and + symmetrical) and fixedALloaction value and also assigns a unique allocation id. This function is only for bandwidthAllocationPost method. +* @param {*BwInfo} bwInfoInput bandwidth Allocation information to be updated +* @param {http.ResponseWriter} w writes HTTP reply +* @return {error} error An error will be return if occurs +*/ +func bandwidthResourceAllocation(bwInfo *BwInfo, w http.ResponseWriter) error { + switch bwInfo.AllocationDirection { + case "00": + // getting downlink buffer value from redis to update + bufferInfo, valBuff, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + // To start allocating resource, buffer value should be non-zero + if valBuff > 0 { + var valFixedBuff uint64 + valFixedBuff, err = strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + // The value of resource needed to be allocate should also be no-zero + if (valFixedBuff > 0) && (err == nil) { + newAllocId := nextBwAllocIdAvailable + bwInfo.AllocationId = strconv.FormatUint(uint64(newAllocId), 10) + bufferInfo["down"] = strconv.FormatUint(valBuff-valFixedBuff, 10) + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation downlink buffer is updated") + } + nextBwAllocIdAvailable++ // increment allocation ID + } + } else { + log.Debug("Resources are insufficient for this allocation") + } + + case "01": + // getting uplink buffer value from redis to update + bufferInfo, valBuff, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + // To start allocating resource, buffer value should be non-zero + if valBuff > 0 { + var valFixedBuff uint64 + valFixedBuff, err = strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + // The value of resource needed to be allocate should also be no-zero + if (valFixedBuff > 0) && (err == nil) { + newAllocId := nextBwAllocIdAvailable + bwInfo.AllocationId = strconv.FormatUint(uint64(newAllocId), 10) + bufferInfo["up"] = strconv.FormatUint(valBuff-valFixedBuff, 10) + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation uplink buffer is updated") + } + nextBwAllocIdAvailable++ + } + } else { + log.Debug("Resources are insufficient for this allocation") + } + + case "10": + // getting downlink/uplink buffer value from redis to update + _, valBuffup, err := getUplinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + bufferInfo, valBuffdown, err := getDownlinkBuff() + if err != nil { + log.Error("Unable to fetch allocation buffer from redis") + errHandlerProblemDetails(w, "Unable to fetch allocation buffer from redis", http.StatusInternalServerError) + return err + } + + // To start allocating resource, buffer values should be non-zero + if (valBuffup > 0) && (valBuffdown > 0) { + var valFixedBuff uint64 + valFixedBuff, err = strconv.ParseUint(bwInfo.FixedAllocation, 10, 64) + // The value of resource needed to be allocate should also be no-zero + if (valFixedBuff > 0) && (err == nil) { + newAllocId := nextBwAllocIdAvailable + bwInfo.AllocationId = strconv.FormatUint(uint64(newAllocId), 10) + bufferInfo["up"] = strconv.FormatUint(valBuffup-(valFixedBuff/2), 10) + bufferInfo["down"] = strconv.FormatUint(valBuffdown-(valFixedBuff/2), 10) + // updateBuffer function takes updated buffer Information and store it in redis + // returns error if unable to store allocation buffer in redis + err = updateBuffer(bufferInfo) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return err + } else { + log.Info("Allocation downlink buffer is updated") + } + nextBwAllocIdAvailable++ + } + } else { + log.Debug("Resources are insufficient for this allocation") + } + } + return nil +} diff --git a/go-apps/meep-tm/server/bwm/convert.go b/go-apps/meep-tm/server/bwm/convert.go new file mode 100644 index 000000000..508320680 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/convert.go @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "encoding/json" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +func convertProblemDetailsToJson(obj *ProblemDetails) string { + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertBandwidthInfoToJson(obj *BwInfo) string { + + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + + return string(jsonInfo) +} diff --git a/go-apps/meep-tm/server/bwm/model_app_termination_notification.go b/go-apps/meep-tm/server/bwm/model_app_termination_notification.go new file mode 100644 index 000000000..b48e9ce8c --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_app_termination_notification.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// This type represents the information that the MEC platform notifies the subscribed application instance about the corresponding application instance termination/stop. +type AppTerminationNotification struct { + // Shall be set to AppTerminationNotification. + NotificationType string `json:"notificationType"` + + OperationAction *OperationActionType `json:"operationAction"` + // Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. + MaxGracefulTimeout int32 `json:"maxGracefulTimeout"` + + Links *AppTerminationNotificationLinks `json:"_links"` +} diff --git a/go-apps/meep-tm/server/bwm/model_app_termination_notification__links.go b/go-apps/meep-tm/server/bwm/model_app_termination_notification__links.go new file mode 100644 index 000000000..e29340118 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_app_termination_notification__links.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// Object containing hyperlinks related to the resource. +type AppTerminationNotificationLinks struct { + Subscription *LinkType `json:"subscription"` + + ConfirmTermination *LinkType `json:"confirmTermination,omitempty"` +} diff --git a/go-apps/meep-tm/server/bwm/model_bw_info.go b/go-apps/meep-tm/server/bwm/model_bw_info.go new file mode 100644 index 000000000..26e31d1db --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_bw_info.go @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type BwInfo struct { + // Bandwidth allocation instance identifier + AllocationId string `json:"allocationId,omitempty"` + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + AllocationDirection string `json:"allocationDirection"` + // Application instance identifier + AppInsId string `json:"appInsId"` + // Name of the application + AppName string `json:"appName,omitempty"` + // Size of requested fixed BW allocation in [bps] + FixedAllocation string `json:"fixedAllocation"` + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + FixedBWPriority string `json:"fixedBWPriority,omitempty"` + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + RequestType *int32 `json:"requestType"` + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + SessionFilter []BwInfoSessionFilter `json:"sessionFilter,omitempty"` + + TimeStamp *BwInfoTimeStamp `json:"timeStamp,omitempty"` +} diff --git a/go-apps/meep-tm/server/bwm/model_bw_info_deltas.go b/go-apps/meep-tm/server/bwm/model_bw_info_deltas.go new file mode 100644 index 000000000..f62ba8c10 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_bw_info_deltas.go @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type BwInfoDeltas struct { + // Bandwidth allocation instance identifier + AllocationId string `json:"allocationId,omitempty"` + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + AllocationDirection string `json:"allocationDirection,omitempty"` + // Application instance identifier + AppInsId string `json:"appInsId"` + // Size of requested fixed BW allocation in [bps] + FixedAllocation string `json:"fixedAllocation,omitempty"` + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + FixedBWPriority string `json:"fixedBWPriority,omitempty"` + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + RequestType *int32 `json:"requestType"` + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + SessionFilter []BwInfoDeltasSessionFilter `json:"sessionFilter,omitempty"` +} diff --git a/go-apps/meep-tm/server/bwm/model_bw_info_deltas_session_filter.go b/go-apps/meep-tm/server/bwm/model_bw_info_deltas_session_filter.go new file mode 100644 index 000000000..5a1e9ff09 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_bw_info_deltas_session_filter.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type BwInfoDeltasSessionFilter struct { + // Destination address identity of session. The string for a IPv4 address shall be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + DstAddress string `json:"dstAddress,omitempty"` + // Destination port identity of session + DstPort string `json:"dstPort,omitempty"` + // Protocol number + Protocol string `json:"protocol,omitempty"` + // Source address identity of session. The string for a IPv4 address shall be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + SourceIp string `json:"sourceIp,omitempty"` + // Source port identity of session + SourcePort string `json:"sourcePort,omitempty"` +} diff --git a/go-apps/meep-tm/server/bwm/model_bw_info_session_filter.go b/go-apps/meep-tm/server/bwm/model_bw_info_session_filter.go new file mode 100644 index 000000000..9e7ec1dd5 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_bw_info_session_filter.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type BwInfoSessionFilter struct { + // Destination address identity of session. The string for a IPv4 address shall be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + DstAddress string `json:"dstAddress,omitempty"` + // Destination port identity of session + DstPort string `json:"dstPort,omitempty"` + // Protocol number + Protocol string `json:"protocol,omitempty"` + // Source address identity of session. The string for a IPv4 address shall be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + SourceIp string `json:"sourceIp,omitempty"` + // Source port identity of session + SourcePort string `json:"sourcePort,omitempty"` +} diff --git a/go-apps/meep-tm/server/bwm/model_bw_info_time_stamp.go b/go-apps/meep-tm/server/bwm/model_bw_info_time_stamp.go new file mode 100644 index 000000000..ad3dd039f --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_bw_info_time_stamp.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// Time stamp to indicate when the corresponding information elements are sent +type BwInfoTimeStamp struct { + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + NanoSeconds int32 `json:"nanoSeconds"` + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + Seconds int32 `json:"seconds"` +} diff --git a/go-apps/meep-tm/server/bwm/model_link_type.go b/go-apps/meep-tm/server/bwm/model_link_type.go new file mode 100644 index 000000000..d7bed29f1 --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_link_type.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type LinkType struct { + // URI referring to a resource + Href string `json:"href"` +} diff --git a/go-apps/meep-tm/server/bwm/model_operation_action_type.go b/go-apps/meep-tm/server/bwm/model_operation_action_type.go new file mode 100644 index 000000000..f2072b5ff --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_operation_action_type.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// OperationActionType : Operation that is being performed on the MEC application instance. +type OperationActionType string + +// List of OperationActionType +const ( + STOPPING OperationActionType = "STOPPING" + TERMINATING OperationActionType = "TERMINATING" +) diff --git a/go-apps/meep-tm/server/bwm/model_problem_details.go b/go-apps/meep-tm/server/bwm/model_problem_details.go new file mode 100644 index 000000000..ffe99db3f --- /dev/null +++ b/go-apps/meep-tm/server/bwm/model_problem_details.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ProblemDetails struct { + // A human-readable explanation specific to this occurrence of the problem + Detail string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem + Instance string `json:"instance,omitempty"` + // The HTTP status code for this occurrence of the problem + Status int32 `json:"status,omitempty"` + // A short, human-readable summary of the problem type + Title string `json:"title,omitempty"` + // A URI reference according to IETF RFC 3986 that identifies the problem type + Type_ string `json:"type,omitempty"` +} diff --git a/go-apps/meep-tm/server/logger.go b/go-apps/meep-tm/server/logger.go new file mode 100644 index 000000000..3d6a62753 --- /dev/null +++ b/go-apps/meep-tm/server/logger.go @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package server + +import ( + "net/http" + "time" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +func Logger(inner http.Handler, name string) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() + + inner.ServeHTTP(w, r) + + log.Debug( + r.Method, " ", + r.RequestURI, " ", + name, " ", + time.Since(start), + ) + }) +} diff --git a/go-apps/meep-tm/server/mts/README.md b/go-apps/meep-tm/server/mts/README.md new file mode 100644 index 000000000..5d3aaa706 --- /dev/null +++ b/go-apps/meep-tm/server/mts/README.md @@ -0,0 +1,25 @@ +# Go API Server for swagger + +Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + +## Overview +This server was generated by the [swagger-codegen] +(https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) + +- API version: 2.2.1 +- Build date: 2022-11-23T14:56:31.655484300+05:00[Asia/Karachi] + + +### Running the server +To run the server, follow these simple steps: + +``` +go run main.go +``` + diff --git a/go-apps/meep-tm/server/mts/api_mts.go b/go-apps/meep-tm/server/mts/api_mts.go new file mode 100644 index 000000000..02f1db23f --- /dev/null +++ b/go-apps/meep-tm/server/mts/api_mts.go @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "net/http" +) + +func Mec011AppTerminationPOST(w http.ResponseWriter, r *http.Request) { + mec011AppTerminationPost(w, r) +} + +func MtsCapabilityInfoGET(w http.ResponseWriter, r *http.Request) { + mtsCapabilityInfoGet(w, r) +} + +func MtsSessionDELETE(w http.ResponseWriter, r *http.Request) { + mtsSessionDelete(w, r) +} + +func MtsSessionGET(w http.ResponseWriter, r *http.Request) { + mtsSessionGet(w, r) +} + +func MtsSessionPOST(w http.ResponseWriter, r *http.Request) { + mtsSessionPost(w, r) +} + +func MtsSessionPUT(w http.ResponseWriter, r *http.Request) { + mtsSessionPut(w, r) +} + +func MtsSessionsListGET(w http.ResponseWriter, r *http.Request) { + mtsSessionsListGet(w, r) +} diff --git a/go-apps/meep-tm/server/mts/convert.go b/go-apps/meep-tm/server/mts/convert.go new file mode 100644 index 000000000..94cecd8cd --- /dev/null +++ b/go-apps/meep-tm/server/mts/convert.go @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "encoding/json" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +func convertProblemDetailsToJson(obj *ProblemDetails) string { + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertMtsCapabilityInfoToJson(obj *MtsCapabilityInfo) string { + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertMtsSessionInfoToJson(obj *MtsSessionInfo) string { + + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + + return string(jsonInfo) +} diff --git a/go-apps/meep-tm/server/mts/model_app_termination_notification.go b/go-apps/meep-tm/server/mts/model_app_termination_notification.go new file mode 100644 index 000000000..9f41e7495 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_app_termination_notification.go @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// This type represents the information that the MEC platform notifies the subscribed application instance about the corresponding application instance termination/stop. +type AppTerminationNotification struct { + // Shall be set to AppTerminationNotification. + NotificationType string `json:"notificationType"` + + OperationAction *OperationActionType `json:"operationAction"` + // Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. + MaxGracefulTimeout int32 `json:"maxGracefulTimeout"` + + Links *AppTerminationNotificationLinks `json:"_links"` +} diff --git a/go-apps/meep-tm/server/mts/model_app_termination_notification__links.go b/go-apps/meep-tm/server/mts/model_app_termination_notification__links.go new file mode 100644 index 000000000..b2b6e34e5 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_app_termination_notification__links.go @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Object containing hyperlinks related to the resource. +type AppTerminationNotificationLinks struct { + Subscription *LinkType `json:"subscription"` + + ConfirmTermination *LinkType `json:"confirmTermination,omitempty"` +} diff --git a/go-apps/meep-tm/server/mts/model_link_type.go b/go-apps/meep-tm/server/mts/model_link_type.go new file mode 100644 index 000000000..802cdb464 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_link_type.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type LinkType struct { + // URI referring to a resource + Href string `json:"href"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_capability_info.go b/go-apps/meep-tm/server/mts/model_mts_capability_info.go new file mode 100644 index 000000000..84db818eb --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_capability_info.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type MtsCapabilityInfo struct { + // The information on access network connection as defined below + MtsAccessInfo []MtsCapabilityInfoMtsAccessInfo `json:"mtsAccessInfo"` + // Numeric value corresponding to a specific MTS operation supported by the TMS 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or/and multiple access network connection simultaneously if supported 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for highreliability and low-latency applications 4 = QoS, i.e. performing MTS based on the specific QoS requirements from the app + MtsMode []uint32 `json:"mtsMode"` + + TimeStamp *MtsCapabilityInfoTimeStamp `json:"timeStamp,omitempty"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_capability_info_mts_access_info.go b/go-apps/meep-tm/server/mts/model_mts_capability_info_mts_access_info.go new file mode 100644 index 000000000..ff9a8f05e --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_capability_info_mts_access_info.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type MtsCapabilityInfoMtsAccessInfo struct { + // Unique identifier for the access network connection + AccessId uint32 `json:"accessId"` + // Numeric value (0-255) corresponding to specific type of access network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11 a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11 b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33 = 3GPP NR (5G) + AccessType uint32 `json:"accessType"` + // Numeric value (0-255) corresponding to the following: 0: the connection is not metered (see note) 1: the connection is metered 2: unknown + Metered uint32 `json:"metered"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_capability_info_time_stamp.go b/go-apps/meep-tm/server/mts/model_mts_capability_info_time_stamp.go new file mode 100644 index 000000000..649071bd2 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_capability_info_time_stamp.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Time stamp to indicate when the corresponding information elements are sent +type MtsCapabilityInfoTimeStamp struct { + // Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00 UTC + NanoSeconds uint32 `json:"nanoSeconds"` + // Time in seconds in Unix-time since January 1, 1970, 00:00:00 UTC + Seconds uint32 `json:"seconds"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_session_info.go b/go-apps/meep-tm/server/mts/model_mts_session_info.go new file mode 100644 index 000000000..4bee64eb0 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_session_info.go @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type MtsSessionInfo struct { + // MTS session instance identifier + SessionId string `json:"sessionId,omitempty"` + // Application instance identifier + AppInsId string `json:"appInsId"` + // Name of the application + AppName string `json:"appName,omitempty"` + // Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering + FlowFilter []MtsSessionInfoFlowFilter `json:"flowFilter"` + // Numeric value (0 - 255) corresponding to a specific MTS mode of the MTS session: 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or multiple access network connection simultaneously 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for high-reliability and low-latency applications 4 = QoS, i.e. performing MTS based on the QoS requirement (qosD) + MtsMode *uint32 `json:"mtsMode"` + + QosD *MtsSessionInfoQosD `json:"qosD"` + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION + RequestType *uint32 `json:"requestType"` + + TimeStamp *MtsSessionInfoTimeStamp `json:"timeStamp,omitempty"` + // The direction of the requested MTS session: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical (see note) + TrafficDirection string `json:"trafficDirection"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_session_info_flow_filter.go b/go-apps/meep-tm/server/mts/model_mts_session_info_flow_filter.go new file mode 100644 index 000000000..0cfcb728c --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_session_info_flow_filter.go @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type MtsSessionInfoFlowFilter struct { + // DSCP in the IPv4 header or Traffic Class in the IPv6 header + Dscp *uint32 `json:"dscp,omitempty"` + // Destination address identity of session. The string for a IPv4 address shall be formatted in the + // "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be + // formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide + // the routing prefix. + DstIp string `json:"dstIp,omitempty"` + // Destination port identity of session + DstPort *uint32 `json:"dstPort,omitempty"` + // Flow Label in the IPv6 header, applicable only if the flow is IPv6 + Flowlabel *uint32 `json:"flowlabel,omitempty"` + // Protocol number + Protocol *uint32 `json:"protocol,omitempty"` + // Source address identity of session. The string for a IPv4 address shall be formatted in the + // "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be + // formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide + // the routing prefix. + SourceIp string `json:"sourceIp,omitempty"` + // Source port identity of session + SourcePort *uint32 `json:"sourcePort,omitempty"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_session_info_qos_d.go b/go-apps/meep-tm/server/mts/model_mts_session_info_qos_d.go new file mode 100644 index 000000000..ccc594484 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_session_info_qos_d.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// QoS requirement description of the MTS session, applicable only if mtsMode = 4 (QoS). If the qosD field is included, at least one of its subfields shall be included. Any qosD subfield that is not included shall be ignored in Multi-access Traffic Steering (MTS) +type MtsSessionInfoQosD struct { + // tolerable jitter in [10 nanoseconds] + MaxJitter uint32 `json:"maxJitter,omitempty"` + // tolerable (one-way) delay in [10 nanoseconds] + MaxLatency uint32 `json:"maxLatency,omitempty"` + // tolerable packet loss rate in [1/10^x] + MaxLoss uint32 `json:"maxLoss,omitempty"` + // minimal throughput in [kbps] + MinTpt uint32 `json:"minTpt,omitempty"` + // numeric value (0 - 255) corresponding to the traffic priority 0: low; 1: medium; 2: high; 3: critical + Priority uint32 `json:"priority,omitempty"` +} diff --git a/go-apps/meep-tm/server/mts/model_mts_session_info_time_stamp.go b/go-apps/meep-tm/server/mts/model_mts_session_info_time_stamp.go new file mode 100644 index 000000000..f6eddd1fe --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_mts_session_info_time_stamp.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Time stamp to indicate when the corresponding information elements are sent +type MtsSessionInfoTimeStamp struct { + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + NanoSeconds uint32 `json:"nanoSeconds"` + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + Seconds uint32 `json:"seconds"` +} diff --git a/go-apps/meep-tm/server/mts/model_operation_action_type.go b/go-apps/meep-tm/server/mts/model_operation_action_type.go new file mode 100644 index 000000000..ccc860a98 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_operation_action_type.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// OperationActionType : Operation that is being performed on the MEC application instance. +type OperationActionType string + +// List of OperationActionType +const ( + STOPPING OperationActionType = "STOPPING" + TERMINATING OperationActionType = "TERMINATING" +) diff --git a/go-apps/meep-tm/server/mts/model_problem_details.go b/go-apps/meep-tm/server/mts/model_problem_details.go new file mode 100644 index 000000000..ef7a56a55 --- /dev/null +++ b/go-apps/meep-tm/server/mts/model_problem_details.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type ProblemDetails struct { + // A human-readable explanation specific to this occurrence of the problem + Detail string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem + Instance string `json:"instance,omitempty"` + // The HTTP status code for this occurrence of the problem + Status uint32 `json:"status,omitempty"` + // A short, human-readable summary of the problem type + Title string `json:"title,omitempty"` + // A URI reference according to IETF RFC 3986 that identifies the problem type + Type_ string `json:"type,omitempty"` +} diff --git a/go-apps/meep-tm/server/mts/mts.go b/go-apps/meep-tm/server/mts/mts.go new file mode 100644 index 000000000..628e40fe0 --- /dev/null +++ b/go-apps/meep-tm/server/mts/mts.go @@ -0,0 +1,1415 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net" + "net/http" + "net/url" + "os" + "reflect" + "strconv" + "strings" + "time" + + asc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client" + dkm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr" + dataModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + mod "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model" + redis "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis" + scc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client" + smc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client" + sam "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr" + + "github.com/gorilla/mux" +) + +const moduleName = "meep-tm" +const mtsBasePath = "mts/v1/" + +// const tmKey = "traffic-mgmt" +const globalMepName = "global" + +const defaultMepName = "global" +const defaultScopeOfLocality = "MEC_SYSTEM" +const defaultConsumedLocalOnly = true +const appTerminationPath = "notifications/mec011/appTermination" + +const serviceCategory = "MTS" + +var sbxCtrlUrl string = "http://meep-sandbox-ctrl" +var Traffic_Mgmt_DB = 0 + +var instanceId string +var instanceName string + +var appEnablementUrl string +var appEnablementEnabled bool + +var activeModel *mod.Model +var apiMgr *sam.SwaggerApiMgr +var appSupportClient *asc.APIClient +var svcMgmtClient *smc.APIClient +var sbxCtrlClient *scc.APIClient +var appEnablementServiceId string +var appTermSubId string +var sendAppTerminationWhenDone bool = false +var serviceAppInstanceId string + +var globalMtsMode []uint32 + +var nextSessionIdAvailable int = 0 + +var localityEnabled bool +var mapLocality map[string]bool + +// App Ins ID fields +const fieldState = "state" +const APP_STATE_READY = "READY" +const appEnablementKey = "app-enablement" + +var registrationTicker *time.Ticker +var rc *redis.Connector +var hostUrl *url.URL +var sandboxName string +var mepName string = defaultMepName +var scopeOfLocality string = defaultScopeOfLocality +var consumedLocalOnly bool = defaultConsumedLocalOnly +var locality []string +var basePath string +var baseKey string + +// var appStore *apps.ApplicationStore +const serviceAppVersion = "2.2.1" + +type InitCfg struct { + SandboxName string + MepName string + InstanceId string + InstanceName string + BaseKey string + HostUrl *url.URL + RedisConn *redis.Connector + Model *mod.Model +} +type MtsSessInfoList struct { + SessionList []MtsSessionInfo + AppInstanceId []string + AppName []string + SessionId []string +} + +type flowFilterListCheck struct { + flowFilterBool bool + FilterList []MtsSessionInfoFlowFilter +} + +func mec011AppTerminationPost(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) +} + +func getAppInstanceId() (id string, err error) { + var appInfo scc.ApplicationInfo + appInfo.Id = instanceId + appInfo.Name = serviceCategory + appInfo.Type_ = "SYSTEM" + appInfo.NodeName = mepName + if mepName == defaultMepName { + appInfo.Persist = true + } else { + appInfo.Persist = false + } + response, _, err := sbxCtrlClient.ApplicationsApi.ApplicationsPOST(context.TODO(), appInfo) + if err != nil { + log.Error("Failed to get App Instance ID with error: ", err) + return "", err + } + return response.Id, nil +} + +func registerService(appInstanceId string) error { + // Build Service Info + state := smc.ACTIVE_ServiceState + serializer := smc.JSON_SerializerType + transportType := smc.REST_HTTP_TransportType + localityType := smc.LocalityType(scopeOfLocality) + srvInfo := smc.ServiceInfoPost{ + SerName: instanceName, + Version: serviceAppVersion, + State: &state, + Serializer: &serializer, + ScopeOfLocality: &localityType, + ConsumedLocalOnly: consumedLocalOnly, + TransportInfo: &smc.TransportInfo{ + Id: "sandboxTransport", + Name: "REST", + Type_: &transportType, + Protocol: "HTTP", + Version: "2.0", + Endpoint: &smc.OneOfTransportInfoEndpoint{}, + }, + SerCategory: &smc.CategoryRef{ + Href: "catalogueHref", + Id: "mtsId", + Name: serviceCategory, + Version: "v1", + }, + } + srvInfo.TransportInfo.Endpoint.Uris = append(srvInfo.TransportInfo.Endpoint.Uris, hostUrl.String()+basePath) + + appServicesPostResponse, _, err := svcMgmtClient.MecServiceMgmtApi.AppServicesPOST(context.TODO(), srvInfo, appInstanceId) + if err != nil { + log.Error("Failed to register the service to app enablement registry: ", err) + return err + } + log.Info("Application Enablement Service instance Id: ", appServicesPostResponse.SerInstanceId) + appEnablementServiceId = appServicesPostResponse.SerInstanceId + return nil +} + +func sendReadyConfirmation(appInstanceId string) error { + var appReady asc.AppReadyConfirmation + appReady.Indication = "READY" + _, err := appSupportClient.MecAppSupportApi.ApplicationsConfirmReadyPOST(context.TODO(), appReady, appInstanceId) + if err != nil { + log.Error("Failed to send a ready confirm acknowlegement: ", err) + return err + } + return nil +} + +func subscribeAppTermination(appInstanceId string) error { + var sub asc.AppTerminationNotificationSubscription + sub.SubscriptionType = "AppTerminationNotificationSubscription" + sub.AppInstanceId = appInstanceId + if mepName == defaultMepName { + sub.CallbackReference = "http://" + moduleName + "/" + mtsBasePath + appTerminationPath + } else { + sub.CallbackReference = "http://" + mepName + "-" + moduleName + "/" + mtsBasePath + appTerminationPath + } + subscription, _, err := appSupportClient.MecAppSupportApi.ApplicationsSubscriptionsPOST(context.TODO(), sub, appInstanceId) + if err != nil { + log.Error("Failed to register to App Support subscription: ", err) + return err + } + appTermSubLink := subscription.Links.Self.Href + appTermSubId = appTermSubLink[strings.LastIndex(appTermSubLink, "/")+1:] + return nil +} + +func Init(mtsCfg InitCfg) (err error) { + sandboxName = mtsCfg.SandboxName + hostUrl = mtsCfg.HostUrl + mepName = mtsCfg.MepName + instanceId = mtsCfg.InstanceId + instanceName = mtsCfg.InstanceName + baseKey = mtsCfg.BaseKey + rc = mtsCfg.RedisConn + activeModel = mtsCfg.Model + + // Get App Enablement URL + appEnablementEnabled = false + appEnablementEnv := strings.TrimSpace(os.Getenv("MEEP_APP_ENABLEMENT")) + if appEnablementEnv != "" { + appEnablementUrl = "http://" + appEnablementEnv + appEnablementEnabled = true + } + log.Info("MEEP_APP_ENABLEMENT: ", appEnablementUrl) + + // Get scope of locality + scopeOfLocalityEnv := strings.TrimSpace(os.Getenv("MEEP_SCOPE_OF_LOCALITY")) + if scopeOfLocalityEnv != "" { + scopeOfLocality = scopeOfLocalityEnv + } + log.Info("MEEP_SCOPE_OF_LOCALITY: ", scopeOfLocality) + + // Get local consumption + consumedLocalOnlyEnv := strings.TrimSpace(os.Getenv("MEEP_CONSUMED_LOCAL_ONLY")) + if consumedLocalOnlyEnv != "" { + value, err := strconv.ParseBool(consumedLocalOnlyEnv) + if err == nil { + consumedLocalOnly = value + } + } + log.Info("MEEP_CONSUMED_LOCAL_ONLY: ", consumedLocalOnly) + + // Get locality + localityEnv := strings.TrimSpace(os.Getenv("MEEP_LOCALITY")) + if localityEnv != "" { + locality = strings.Split(localityEnv, ":") + } + log.Info("MEEP_LOCALITY: ", locality) + + // Fill locality map + if len(locality) > 0 { + mapLocality = make(map[string]bool) + for _, locLocality := range locality { + mapLocality[locLocality] = true + } + localityEnabled = true + } else { + localityEnabled = false + } + + // Set base path + if mepName == globalMepName { + basePath = "/" + sandboxName + "/" + mtsBasePath + } else { + basePath = "/" + sandboxName + "/" + mepName + "/" + mtsBasePath + } + + // Create App Enablement REST clients + if appEnablementEnabled { + // Create Sandbox Controller client + sbxCtrlClientCfg := scc.NewConfiguration() + sbxCtrlClientCfg.BasePath = sbxCtrlUrl + "/sandbox-ctrl/v1" + sbxCtrlClient = scc.NewAPIClient(sbxCtrlClientCfg) + if sbxCtrlClient == nil { + return errors.New("Failed to create Sandbox Controller REST API client") + } + log.Info("Create Sandbox Controller REST API client") + + // Create App Support client + appSupportClientCfg := asc.NewConfiguration() + appSupportClientCfg.BasePath = appEnablementUrl + "/mec_app_support/v1" + appSupportClient = asc.NewAPIClient(appSupportClientCfg) + if appSupportClient == nil { + return errors.New("Failed to create App Enablement App Support REST API client") + } + log.Info("Create App Enablement App Support REST API client") + + // Create App Info client + srvMgmtClientCfg := smc.NewConfiguration() + srvMgmtClientCfg.BasePath = appEnablementUrl + "/mec_service_mgmt/v1" + svcMgmtClient = smc.NewAPIClient(srvMgmtClientCfg) + if svcMgmtClient == nil { + return errors.New("Failed to create App Enablement Service Management REST API client") + } + log.Info("Create App Enablement Service Management REST API client") + } + + // Store mtsCapabilityInfo key-value in Redis when MTS service is initialized + err = storeMtsCapabilityInfoKey() + if err != nil { + log.Error("Failed to store mtsCapabilityInfo in Redis: ", err.Error()) + return err + } + + log.Info("MTS successfully initialized") + + return nil +} + +// Run - Start MTS +func Run() (err error) { + // Start MEC Service registration ticker + if appEnablementEnabled { + startRegistrationTicker() + } + + return nil +} + +// Stop - Stop MTS +func Stop() (err error) { + // Stop MEC Service registration ticker + if appEnablementEnabled { + stopRegistrationTicker() + } + + if apiMgr != nil { + // Remove APIs + err = apiMgr.RemoveApis() + if err != nil { + log.Error("Failed to remove APIs with err: ", err.Error()) + return err + } + } + + return nil +} + +func startRegistrationTicker() { + // Make sure ticker is not running + if registrationTicker != nil { + log.Warn("Registration ticker already running") + return + } + + // Wait a few seconds to allow App Enablement Service to start. + // This is done to avoid the default 20 second TCP socket connect timeout + // if the App Enablement Service is not yet running. + log.Info("Waiting for App Enablement Service to start") + time.Sleep(5 * time.Second) + + // Start registration ticker + registrationTicker = time.NewTicker(5 * time.Second) + go func() { + mecAppReadySent := false + registrationSent := false + subscriptionSent := false + for range registrationTicker.C { + // Get Application instance ID + if serviceAppInstanceId == "" { + // If a sandbox service, request an app instance ID from Sandbox Controller + // Otherwise use the scenario-provisioned instance ID + if mepName == defaultMepName { + var err error + serviceAppInstanceId, err = getAppInstanceId() + if err != nil || serviceAppInstanceId == "" { + continue + } + } else { + serviceAppInstanceId = instanceId + } + } + + // Send App Ready message + if !mecAppReadySent { + err := sendReadyConfirmation(serviceAppInstanceId) + if err != nil { + log.Error("Failure when sending the MecAppReady message. Error: ", err) + continue + } + mecAppReadySent = true + } + + // Register service instance + if !registrationSent { + err := registerService(serviceAppInstanceId) + if err != nil { + log.Error("Failed to register to appEnablement DB, keep trying. Error: ", err) + continue + } + registrationSent = true + } + + // Register for graceful termination + if !subscriptionSent { + err := subscribeAppTermination(serviceAppInstanceId) + if err != nil { + log.Error("Failed to subscribe to graceful termination. Error: ", err) + continue + } + sendAppTerminationWhenDone = true + subscriptionSent = true + } + + if mecAppReadySent && registrationSent && subscriptionSent { + + // Registration complete + log.Info("Successfully registered with App Enablement Service") + stopRegistrationTicker() + return + } + } + }() +} + +func stopRegistrationTicker() { + if registrationTicker != nil { + log.Info("Stopping App Enablement registration ticker") + registrationTicker.Stop() + registrationTicker = nil + } +} + +/* +* storeMtsCapabilityInfoKey will create mtsCapabilityInfo body and save it in the redis DB in JSON format +* @return {error} err It returns error if error occurs in storing mtsCapabilityInfo in redis DB + */ +func storeMtsCapabilityInfoKey() (err error) { + var mtsCapabilityInfo MtsCapabilityInfo + //AccessType 1 refers to Any IEEE802.11-based WLAN technology + accessInfo1 := MtsCapabilityInfoMtsAccessInfo{ + AccessId: 2001, + AccessType: 1, + Metered: 2, + } + //AccessType 2 refers to Any 2 = Any 3GPP-based Cellular technology + accessInfo2 := MtsCapabilityInfoMtsAccessInfo{ + AccessId: 2002, + AccessType: 2, + Metered: 2, + } + + mtsCapabilityInfo.MtsAccessInfo = append(mtsCapabilityInfo.MtsAccessInfo, accessInfo1) + mtsCapabilityInfo.MtsAccessInfo = append(mtsCapabilityInfo.MtsAccessInfo, accessInfo2) + + mtsCapabilityInfo.MtsMode = []uint32{0, 1, 2, 3, 4} + globalMtsMode = mtsCapabilityInfo.MtsMode + + seconds := time.Now().Unix() + nanoseconds := time.Now().UnixNano() + + mtsCapabilityInfo.TimeStamp = &MtsCapabilityInfoTimeStamp{ + NanoSeconds: uint32(nanoseconds), + Seconds: uint32(seconds), + } + + // Make key for MTS Capability Info + mtsCapInfoKey := baseKey + "mtsCapabilityInfo" + + // Store mtsCapabilityInfo model in the redis DB + err = rc.JSONSetEntry(mtsCapInfoKey, ".", convertMtsCapabilityInfoToJson(&mtsCapabilityInfo)) + if err != nil { + return err + } + + return nil +} + +// mtsCapabilityInfoGet is to retrieve mtsCapabilityInfo at /mts_capability_info endpoint +func mtsCapabilityInfoGet(w http.ResponseWriter, r *http.Request) { + log.Info("mtsCapabilityInfoGet") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + keyName := baseKey + "mtsCapabilityInfo" + + // retrieve mtsCapabilityInfo from redis DB + mtsCapabilityInfoJson, _ := rc.JSONGetEntry(keyName, ".") + if mtsCapabilityInfoJson == "" { + return + } + + // Prepare & send mtsCapabilityInfo as a response + var mtsResp MtsCapabilityInfo + err := json.Unmarshal([]byte(mtsCapabilityInfoJson), &mtsResp) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + jsonResponse := convertMtsCapabilityInfoToJson(&mtsResp) + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, jsonResponse) +} + +// mtsSessionDelete is to delete a specific mtsSessionInfo at /mts_sessions/{sessionId} endpoint +func mtsSessionDelete(w http.ResponseWriter, r *http.Request) { + log.Info("Delete mtsSessionInfo by sessionId") + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + vars := mux.Vars(r) + sessionId := vars["sessionId"] + + keyName := baseKey + "mtsSessionInfo:" + sessionId + + // Find mtsSessionInfo entry in redis DB + _, err := rc.JSONGetEntry(keyName, ".") + if err != nil { + err = errors.New("mtsSessionInfo not found against the provided the sessionId") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Delete mtsSessionInfo entry from redis DB + err = rc.JSONDelEntry(keyName, ".") + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Send response on successful deletion of MTS session resource + w.WriteHeader(http.StatusNoContent) +} + +// mtsSessionGet is to retrieve a specific mtsSessionInfo at /mts_sessions/{sessionId} endpoint +func mtsSessionGet(w http.ResponseWriter, r *http.Request) { + log.Info("mtsSessionGet") + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + vars := mux.Vars(r) + sessionId := vars["sessionId"] + + keyName := baseKey + "mtsSessionInfo:" + sessionId + + // Find mtsSessionInfo entry in redis DB + mtsSessionJson, err := rc.JSONGetEntry(keyName, ".") + if err != nil { + err = errors.New("mtsSessionInfo not found against the provided the sessionId") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Prepare & send mtsSessionInfo as a response + var mtsSessionResp MtsSessionInfo + err = json.Unmarshal([]byte(mtsSessionJson), &mtsSessionResp) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + jsonResponse := convertMtsSessionInfoToJson(&mtsSessionResp) + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, jsonResponse) +} + +// mtsSessionPost is to create mtsSessionInfo at /mts_sessions endpoint +func mtsSessionPost(w http.ResponseWriter, r *http.Request) { + log.Info("mtsSessionPost") + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + var requestBody MtsSessionInfo + + // Read JSON input stream provided in the Request, and stores it in the buffer of a Decoder object + decoder := json.NewDecoder(r.Body) + // Decode function return strings containing the text provided in the request body + err := decoder.Decode(&requestBody) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Validating mandatory parameters provided in the request body + if requestBody.AppInsId == "" { + log.Error("Mandatory appInsId parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute appInsId is missing in the request body.", http.StatusBadRequest) + return + } + + if requestBody.RequestType == nil { + log.Error("Mandatory requestType parameter should be present") + errHandlerProblemDetails(w, "Mandatory requestType parameter is missing in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.RequestType > 1 { + log.Error("Valid requestType value should be present") + errHandlerProblemDetails(w, "Valid requestType value should be present in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.RequestType == 0 && requestBody.FlowFilter != nil { + log.Error("flowFilter shall not be present if requestType is 0") + errHandlerProblemDetails(w, "flowFilter shall not be present if requestType is 0 in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.RequestType == 1 && requestBody.FlowFilter == nil { + log.Error("flowFilter shall be present if requestType is 1") + errHandlerProblemDetails(w, "flowFilter shall be present if requestType is 1 in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.RequestType == 1 && len(requestBody.FlowFilter) == 0 { + log.Error("flowFilter shall be present if requestType is 1") + errHandlerProblemDetails(w, "flowFilter shall be present if requestType is 1 in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.RequestType == 1 && requestBody.FlowFilter != nil { + for _, flowFilterVal := range requestBody.FlowFilter { + if flowFilterVal.SourceIp == "" && *flowFilterVal.SourcePort == 0 && flowFilterVal.DstIp == "" && *flowFilterVal.DstPort == 0 && flowFilterVal.Protocol == nil && flowFilterVal.Dscp == nil && flowFilterVal.Flowlabel == nil { + log.Error("At least one of flowFilter subfields shall be included") + errHandlerProblemDetails(w, "At least one of flowFilter subfields shall be included in the request body.", http.StatusBadRequest) + return + } + } + } + + if *requestBody.RequestType == 1 && requestBody.FlowFilter != nil { + sessionSlice := make([]MtsSessionInfoFlowFilter, 0) + for index, singleFlowFilter := range requestBody.FlowFilter { + if index == 0 { + sessionSlice = append(sessionSlice, singleFlowFilter) + } else { + sessionSlice, err = sessionContains(sessionSlice, singleFlowFilter) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + } + + var mtsCheck bool = false + for _, x := range globalMtsMode { + if x == *requestBody.MtsMode { + mtsCheck = true + break + } + } + + if !mtsCheck { + log.Error("Valid mtsMode value should be present") + errHandlerProblemDetails(w, "Valid mtsMode value should be present in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.MtsMode == 4 && requestBody.QosD == nil { + log.Error("qosD shall be present if mtsMode is equals to 4") + errHandlerProblemDetails(w, "qosD shall be present if mtsMode is equals to 4 in the request body.", http.StatusBadRequest) + return + } + + if *requestBody.MtsMode != 4 && requestBody.QosD != nil { + log.Error("qosD shall not be present if mtsMode is not 4") + errHandlerProblemDetails(w, "qosD shall not be present if mtsMode is not 4 in the request body.", http.StatusBadRequest) + return + } + + if requestBody.TrafficDirection == "" { + log.Error("Mandatory trafficDirection parameter is missing") + errHandlerProblemDetails(w, "Mandatory attribute trafficDirection is missing in the request body.", http.StatusBadRequest) + return + } + + if requestBody.TrafficDirection != "00" && requestBody.TrafficDirection != "01" && requestBody.TrafficDirection != "10" { + log.Error("Valid trafficDirection value should be provided") + errHandlerProblemDetails(w, "Valid trafficDirection value should be provided in the request body.", http.StatusBadRequest) + return + } + + flowFilterList := &flowFilterListCheck{ + flowFilterBool: false, + FilterList: requestBody.FlowFilter, + } + + key := baseKey + "mtsSessionInfo:*" + + if *requestBody.RequestType == 1 { + // Retrieve MTS sessions from redis DB one by one and store in the mtsSessionInfoList array + err = rc.ForEachJSONEntry(key, compareFlowFilters, flowFilterList) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + //check bool here + if flowFilterList.flowFilterBool { + errHandlerProblemDetails(w, "Provide flowFilter matches an already existing session", http.StatusBadRequest) + return + } + } + + // timestamp to send in response + seconds := time.Now().Unix() + nanoseconds := time.Now().UnixNano() + + requestBody.TimeStamp = &MtsSessionInfoTimeStamp{ + NanoSeconds: uint32(nanoseconds), + Seconds: uint32(seconds), + } + + if *requestBody.RequestType == 1 { + switch requestBody.TrafficDirection { + case "00": + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(&requestBody) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + case "01": + // if the provided source IP range matches with the existing UE IP(s) + err = checkSrcIP(&requestBody) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + case "10": + // if the provided source IP range matches with the existing UE IP(s) + err = checkSrcIP(&requestBody) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(&requestBody) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + + // Validate appInsId from redis DB + appInfo, err := getAppInfo(requestBody.AppInsId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Validate state of the provided app ID + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error(err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + + // session id will be generated sequentially + nextSessionIdAvailable++ + newSessionId := nextSessionIdAvailable + sessionIdStr := strconv.Itoa(newSessionId) + + requestBody.SessionId = sessionIdStr + + // Store mtsSessionInfo key in redis + err = rc.JSONSetEntry(baseKey+"mtsSessionInfo:"+sessionIdStr, ".", convertMtsSessionInfoToJson(&requestBody)) + if err != nil { + log.Error("Failed to store MtsSessionInfo in the redis DB: ", err) + } + + // Prepare & send response + jsonResponse := convertMtsSessionInfoToJson(&requestBody) + + w.WriteHeader(http.StatusCreated) + fmt.Fprint(w, jsonResponse) +} + +/* +* compareFlowFilters compares the requested allocation flowFilters with the existing unique flowFilters stored in redis of allocated resources +* @param {string} key mts Session Informations stored with this key +* @param {string} jsonInfo mts Session Information +* @return {String} error error message + */ +func compareFlowFilters(key string, jsonInfo string, flowFilterList interface{}) error { + + // Get query params & mtsSessionInfo + data := flowFilterList.(*flowFilterListCheck) + if data == nil { + return errors.New("mtsSessionInfo list not found") + } + + // Retrieve mtsSessionInfo from DB + var filterInfo MtsSessionInfo + err := json.Unmarshal([]byte(jsonInfo), &filterInfo) + if err != nil { + return err + } + + for _, flowFilterData := range data.FilterList { + for _, redisFlowFilterData := range filterInfo.FlowFilter { + if reflect.DeepEqual(flowFilterData, redisFlowFilterData) { + data.flowFilterBool = true + return nil + } + } + } + + return nil +} + +/* +* checkSrcIP validate source ip range passed in CIDR notation with existing UE ip +* @param {*MtsSessionInfo} MTS session request body of POST method +* @return {error} err It returns err if the provided IP range is not valid against the existing UE IP (s) + */ +func checkSrcIP(requestBody *MtsSessionInfo) (err error) { + ueNameList := activeModel.GetNodeNames("UE") + // if the provided source IP range matches with the existing UE IP(s) + if len(ueNameList) > 0 { + for _, ip := range requestBody.FlowFilter { + ipFound := true + if ip.SourceIp != "" { + ipName := net.ParseIP(ip.SourceIp) + if ipName != nil { + for _, name := range ueNameList { + // Ignore disconnected UEs + if !isUeConnected(name) || !isInLocality(name) { + continue + } + if ipName.String() == name { + log.Info("Provided source IP range is valid against the existing UE IPs") + ipFound = true + break + } else { + ipFound = false + } + } + } + // Return error if IP not in ueNameList + if !ipFound { + log.Error("Provided source IP range is not valid against the existing UE IPs") + err = errors.New("Provided source IP range is not valid against the existing UE IPs in the request body.") + return err + } + } + } + } + return nil +} + +/* +* checkDstIP validate destination ip range passed in CIDR notation with existing UE IPs +* @param {*MtsSessionInfo} MTS session request body of POST method +* @return {error} err It returns err if the provided IP range is not valid against the existing UE IP (s) + */ +func checkDstIP(requestBody *MtsSessionInfo) (err error) { + ueNameList := activeModel.GetNodeNames("UE") + // if the provided destination IP range matches with the existing UE IP(s) + if len(ueNameList) > 0 { + for _, ip := range requestBody.FlowFilter { + ipFound := true + if ip.DstIp != "" { + ipName := net.ParseIP(ip.DstIp) + if ipName != nil { + for _, name := range ueNameList { + // Ignore disconnected UEs + if !isUeConnected(name) || !isInLocality(name) { + continue + } + if ipName.String() == name { + log.Info("Provided destination IP range is valid against the existing UE IPs") + ipFound = true + break + } else { + ipFound = false + } + } + } + // Return error if IP not in ueNameList + if !ipFound { + log.Error("Provided destination IP range is not valid against the existing UE IPs") + err = errors.New("Provided destination IP range is not valid against the existing UE IPs in the request body.") + return err + } + } + } + } + return nil +} + +/* +* isInLocality validate UE ip only when they are in locality of current active model +* @param {string} name name(IP) of a UE +* @return {bool} bool It returns the locality status of UE present in the active model zone + */ +func isInLocality(name string) bool { + if localityEnabled { + ctx := activeModel.GetNodeContext(name) + if ctx == nil { + log.Error("Error getting context for: " + name) + return false + } + if _, found := mapLocality[ctx.Parents[mod.Zone]]; !found { + return false + } + } + return true +} + +/* +* isUeConnected validate UE ip with connected UE(s) in the current active model +* @param {string} name name (IP) of a UE +* @return {bool} bool It returns the status of network connectivity of UE + */ +func isUeConnected(name string) bool { + node := activeModel.GetNode(name) + if node != nil { + pl := node.(*dataModel.PhysicalLocation) + return pl.Connected + } + return false +} + +/* +* getAppInfo gets application information using its application Instance Id stored in redis +* @param {string} appId application Instance Id used to retrive its information from redis DB +* @return {map[string]string} appInfo application information +* @return {error} err It returns error if there is no information associated with this appId + */ +func getAppInfo(appId string) (map[string]string, error) { + var appInfo map[string]string + + // Get app instance from local MEP only + baseKeyAppEn := dkm.GetKeyRoot(sandboxName) + appEnablementKey + ":mep:" + mepName + ":" + key := baseKeyAppEn + "app:" + appId + ":info" + appInfo, err := rc.GetEntry(key) + if err != nil || len(appInfo) == 0 { + return nil, errors.New("App Instance not found") + } + return appInfo, nil +} + +/* +* validateAppInfo validates the status information of application to be in ready state +* @param {map[string]string} appInfo Information associated with application +* @return {int} int It returns the http status for validation +* @return {string} string It returns the details of the problem if any +* @return {error} error It returns the error message for error if any otherwise nil + */ +func validateAppInfo(appInfo map[string]string) (int, string, error) { + // Make sure App is in ready state + if appInfo[fieldState] != APP_STATE_READY { + var problemDetails ProblemDetails + problemDetails.Status = http.StatusForbidden + problemDetails.Detail = "App Instance not ready. Waiting for AppReadyConfirmation." + return http.StatusForbidden, convertProblemDetailsToJson(&problemDetails), errors.New("App Instance not ready") + } + return http.StatusOK, "", nil +} + +// mtsSessionPut updates the information about a specific mtsSessionInfo at /mts_sessions/{sessionId} endpoint +func mtsSessionPut(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + log.Info("mtsSessionPut Intializing") + vars := mux.Vars(r) + sessionIdStr := vars["sessionId"] + + var requestBodyPut MtsSessionInfo + + // Read JSON input stream provided in the Request, and stores it in the buffer of a Decoder object + decoder := json.NewDecoder(r.Body) + // Decode function return strings containing the text provided in the request body + err := decoder.Decode(&requestBodyPut) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + jsonMtsSessionInfo, _ := rc.JSONGetEntry(baseKey+"mtsSessionInfo:"+sessionIdStr, ".") + + if jsonMtsSessionInfo == "" { + log.Error("mtsSession not found against the provided sessionId") + errHandlerProblemDetails(w, "mtsSession not found against the provided sessionId", http.StatusNotFound) + return + } + + if requestBodyPut.SessionId != "" { + if sessionIdStr != requestBodyPut.SessionId { + log.Error("sessionId provided in endpoint and in request body not matching") + errHandlerProblemDetails(w, "sessionId provided in endpoint and in request body not matching", http.StatusNotFound) + return + } + } + + var storedMtsSession MtsSessionInfo + err = json.Unmarshal([]byte(jsonMtsSessionInfo), &storedMtsSession) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // Validating mandatory parameters in request + if requestBodyPut.AppInsId != "" { + if requestBodyPut.AppInsId != storedMtsSession.AppInsId { + // Validate appInsId from redis DB + appInfo, err := getAppInfo(requestBodyPut.AppInsId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Validate state of the provided app ID + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error(err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + } + } else { + log.Error("Mandatory appInsId parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute appInsId is missing in the request body.", http.StatusBadRequest) + return + } + + if requestBodyPut.RequestType != nil { + if *requestBodyPut.RequestType > 1 { + log.Error("Valid requestType value should be present") + errHandlerProblemDetails(w, "Valid requestType value should be present in the request body.", http.StatusBadRequest) + return + } + + if *requestBodyPut.RequestType == 0 && requestBodyPut.FlowFilter != nil { + log.Error("flowFilter shall not be present if requestType is 0") + errHandlerProblemDetails(w, "flowFilter shall not be present if requestType is 0 in the request body.", http.StatusBadRequest) + return + } + + if *requestBodyPut.RequestType == 1 && requestBodyPut.FlowFilter == nil { + log.Error("flowFilter shall be present if requestType is 1") + errHandlerProblemDetails(w, "flowFilter shall be present if requestType is 1 in the request body.", http.StatusBadRequest) + return + } + + if *requestBodyPut.RequestType == 1 && len(requestBodyPut.FlowFilter) == 0 { + log.Error("flowFilter shall be present if requestType is 1") + errHandlerProblemDetails(w, "flowFilter shall be present if requestType is 1 in the request body.", http.StatusBadRequest) + return + } + + } else { + log.Error("Mandatory requestType parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute requestType is missing in the request body.", http.StatusBadRequest) + return + } + + if *requestBodyPut.RequestType == 1 && requestBodyPut.FlowFilter != nil { + for _, flowFilterVal := range requestBodyPut.FlowFilter { + if flowFilterVal.SourceIp == "" && *flowFilterVal.SourcePort == 0 && flowFilterVal.DstIp == "" && *flowFilterVal.DstPort == 0 && flowFilterVal.Protocol == nil && flowFilterVal.Dscp == nil && flowFilterVal.Flowlabel == nil { + log.Error("At least one of flowFilter subfields shall be included") + errHandlerProblemDetails(w, "At least one of flowFilter subfields shall be included in the request body.", http.StatusBadRequest) + return + } + } + } + + if *requestBodyPut.RequestType == 1 && requestBodyPut.FlowFilter != nil { + sessionSlice := make([]MtsSessionInfoFlowFilter, 0) + for index, singleSessionFilter := range requestBodyPut.FlowFilter { + if index == 0 { + sessionSlice = append(sessionSlice, singleSessionFilter) + } else { + sessionSlice, err = sessionContains(sessionSlice, singleSessionFilter) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + } + + if requestBodyPut.MtsMode != nil { + var mtsCheck bool = false + for _, x := range globalMtsMode { + if x == *requestBodyPut.MtsMode { + mtsCheck = true + break + } + } + + if !mtsCheck { + log.Error("Valid mtsMode value should be present") + errHandlerProblemDetails(w, "Valid mtsMode value should be present in the request body.", http.StatusBadRequest) + return + } + + if *requestBodyPut.MtsMode == 4 && requestBodyPut.QosD == nil { + log.Error("qosD shall be present if mtsMode is equals to 4") + errHandlerProblemDetails(w, "qosD shall be present if mtsMode is equals to 4 in the request body.", http.StatusBadRequest) + return + } + + if *requestBodyPut.MtsMode != 4 && requestBodyPut.QosD != nil { + log.Error("qosD shall not be present if mtsMode is not 4") + errHandlerProblemDetails(w, "qosD shall not be present if mtsMode is not 4 in the request body.", http.StatusBadRequest) + return + } + } else { + log.Error("Mandatory mtsMode parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute mtsMode is missing in the request body.", http.StatusBadRequest) + return + } + + if requestBodyPut.TrafficDirection != "" { + if requestBodyPut.TrafficDirection != "00" && requestBodyPut.TrafficDirection != "01" && requestBodyPut.TrafficDirection != "10" { + log.Error("Valid trafficDirection value should be provided") + errHandlerProblemDetails(w, "Valid trafficDirection value should be provided in the request body.", http.StatusBadRequest) + return + } + } else { + log.Error("Mandatory trafficDirection parameter should be present") + errHandlerProblemDetails(w, "Mandatory attribute trafficDirection is missing in the request body.", http.StatusBadRequest) + return + } + + // timestamp to send in response + seconds := time.Now().Unix() + nanoseconds := time.Now().UnixNano() + + requestBodyPut.TimeStamp = &MtsSessionInfoTimeStamp{ + NanoSeconds: uint32(nanoseconds), + Seconds: uint32(seconds), + } + + if *requestBodyPut.RequestType == 0 && *requestBodyPut.RequestType != *storedMtsSession.RequestType { + requestBodyPut.FlowFilter = nil + } else if *requestBodyPut.RequestType == 1 && *requestBodyPut.RequestType != *storedMtsSession.RequestType { + switch requestBodyPut.TrafficDirection { + case "00": + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(&requestBodyPut) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + case "01": + // if the provided source IP range matches with the existing UE IP(s) + err = checkSrcIP(&requestBodyPut) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + case "10": + // if the provided source IP range matches with the existing UE IP(s) + err = checkSrcIP(&requestBodyPut) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + // if the provided destination IP range matches with the existing UE IP(s) + err = checkDstIP(&requestBodyPut) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + } + } + + requestBodyPut.SessionId = sessionIdStr + + // Store mtsSessionInfo key in redis + err = rc.JSONSetEntry(baseKey+"mtsSessionInfo:"+sessionIdStr, ".", convertMtsSessionInfoToJson(&requestBodyPut)) + if err != nil { + log.Error("Failed to store MtsSessionInfo in the redis DB: ", err) + } + + // Prepare & send response + jsonResponse := convertMtsSessionInfoToJson(&requestBodyPut) + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, jsonResponse) +} + +// mtsSessionsListGet is to retrieve the information about all existing mtsSessionInfo at /mts_sessions endpoint +func mtsSessionsListGet(w http.ResponseWriter, r *http.Request) { + log.Info("mtsSessionsListGet") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Validate query parameters + u, _ := url.Parse(r.URL.String()) + q := u.Query() + + appInstanceId := q["app_instance_id"] + appName := q["app_name"] + sessionId := q["session_id"] + + validQueryParams := []string{"app_instance_id", "app_name", "session_id"} + err := validateQueryParams(q, validQueryParams) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // MtsSessInfoList struct is passed to mtsSessionInfoList as a pointer + // MtsSessInfoList is a struct which has four fields + // SessionList here is the array of the MtsSessionInfo struct. + mtsSessionInfoList := &MtsSessInfoList{ + AppInstanceId: appInstanceId, + AppName: appName, + SessionId: sessionId, + SessionList: make([]MtsSessionInfo, 0), + } + + // Make sure only 1 or none of the following are present: appInstanceId, appName, sessionId + err = validateMtsSesInfoQueryParams(appInstanceId, appName, sessionId) + if err != nil { + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + key := baseKey + "mtsSessionInfo:*" + + // Retrieve MTS sessions from redis DB one by one and store in the mtsSessionInfoList array + err = rc.ForEachJSONEntry(key, populateMtsSessInfoList, mtsSessionInfoList) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // Prepare & send response + jsonResponse, err := json.Marshal(mtsSessionInfoList.SessionList) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, string(jsonResponse)) +} + +/** +* Function that list down all the MTS session(s) based on query parameters +* @param {string} key MTS session stored with this key +* @param {string} jsonInfo MTS session information +* @param {*MtsSessInfoList} mtsSessionInfoList MTS session information +* @return {error} error An error will be return if occurs + */ +func populateMtsSessInfoList(key string, jsonInfo string, mtsSessionInfoList interface{}) error { + // Get query params & mtsSessionInfo + data := mtsSessionInfoList.(*MtsSessInfoList) + if data == nil { + return errors.New("mtsSessionInfo list not found") + } + + // Retrieve mtsSessionInfo from DB + var sessionInfo MtsSessionInfo + err := json.Unmarshal([]byte(jsonInfo), &sessionInfo) + if err != nil { + return err + } + + foundAMatch := false + // Filter using query params + if len(data.AppInstanceId) > 0 { + foundAMatch = false + for _, QueryAppInstanceId := range data.AppInstanceId { + if sessionInfo.AppInsId == QueryAppInstanceId { + foundAMatch = true + } + } + if !foundAMatch { + return nil + } + } + + if len(data.AppName) > 0 { + foundAMatch = false + for _, QueryAppName := range data.AppName { + if sessionInfo.AppName == QueryAppName { + foundAMatch = true + } + } + if !foundAMatch { + return nil + } + } + + if len(data.SessionId) > 0 { + foundAMatch = false + for _, QuerySessionId := range data.SessionId { + if sessionInfo.SessionId == QuerySessionId { + foundAMatch = true + } + } + if !foundAMatch { + return nil + } + } + + data.SessionList = append(data.SessionList, sessionInfo) + return nil +} + +/* + * validateQueryParams ensures that valid query parameters should be used to retrieve one of the + app_instance_id or app_name or session_id attributes from the user + * @return {error} error An error will be return if occurs +*/ +func validateQueryParams(params url.Values, validParams []string) error { + for param := range params { + found := false + for _, validParam := range validParams { + if param == validParam { + found = true + break + } + } + if !found { + err := errors.New("Invalid query param: " + param) + log.Error(err.Error()) + return err + } + } + return nil +} + +/* + * validateMtsSesInfoQueryParams check that either app_instance_id or app_name or session_id or + none should be provided in the request + * @return {error} error An error will be return if occurs +*/ +func validateMtsSesInfoQueryParams(appInstanceId []string, appName []string, sessionId []string) error { + count := 0 + if len(appInstanceId) != 0 { + count++ + } + if len(appName) != 0 { + count++ + } + if len(sessionId) != 0 { + count++ + } + if count > 1 { + err := errors.New("Either app_instance_id or app_name or session_id or none of them shall be present") + log.Error(err.Error()) + return err + } + return nil +} + +func errHandlerProblemDetails(w http.ResponseWriter, error string, code int) { + var pd ProblemDetails + pd.Detail = error + pd.Status = uint32(code) + + jsonResponse := convertProblemDetailsToJson(&pd) + + w.WriteHeader(code) + fmt.Fprint(w, jsonResponse) +} + +/* +* sessionContains compares the slice of unique sessions with the passed single session of the requested allocation +* @param {[]MtsSessionInfoFlowFilter} sessionSlice slice contains the unique FlowFilter +* @param {MtsSessionInfoFlowFilter} singleFlowFilter single FlowFilter to be compared +* @return {[]MtsSessionInfoFlowFilter} returns the updated slice of FlowFilter +* @return {error} An error will be return if occurs + */ +func sessionContains(sessionSlice []MtsSessionInfoFlowFilter, singleFlowFilter MtsSessionInfoFlowFilter) ([]MtsSessionInfoFlowFilter, error) { + for _, sessionSlice1 := range sessionSlice { + if reflect.DeepEqual(singleFlowFilter, sessionSlice1) { + err := errors.New("flowFilter contains duplicate sessions") + return nil, err + } else { + sessionSlice = append(sessionSlice, singleFlowFilter) + } + } + return sessionSlice, nil +} diff --git a/go-apps/meep-tm/server/routers.go b/go-apps/meep-tm/server/routers.go new file mode 100644 index 000000000..a1d84302f --- /dev/null +++ b/go-apps/meep-tm/server/routers.go @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package server + +import ( + "fmt" + "net/http" + "strings" + + bwm "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/bwm" + mts "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/mts" + httpLog "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger" + met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" + + "github.com/gorilla/mux" +) + +type Route struct { + Name string + Method string + Pattern string + HandlerFunc http.HandlerFunc +} + +type Routes []Route + +func NewRouter() *mux.Router { + var handler http.Handler + router := mux.NewRouter().StrictSlash(true) + for _, route := range routes { + handler = route.HandlerFunc + handler = Logger(handler, route.Name) + handler = met.MetricsHandler(handler, sandboxName, serviceName) + handler = httpLog.LogRx(handler) + router. + Methods(route.Method). + Path(route.Pattern). + Name(route.Name). + Handler(handler) + } + + // Path prefix router order is important + // Service Api files + handler = http.StripPrefix("/bwm/v1/api/", http.FileServer(http.Dir("./api/"))) + router. + PathPrefix("/bwm/v1/api/"). + Name("Api"). + Handler(handler) + // User supplied service API files + handler = http.StripPrefix("/bwm/v1/user-api/", http.FileServer(http.Dir("./user-api/"))) + router. + PathPrefix("/bwm/v1/user-api/"). + Name("UserApi"). + Handler(handler) + + return router +} + +func Index(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello World!") +} + +var routes = Routes{ + Route{ + "Index", + "GET", + "/bwm/v1/", + Index, + }, + + Route{ + "Mec011AppTerminationPOST", + strings.ToUpper("Post"), + "/bwm/v1/notifications/mec011/appTermination", + bwm.Mec011AppTerminationPOST, + }, + + Route{ + "BandwidthAllocationDELETE", + strings.ToUpper("Delete"), + "/bwm/v1/bw_allocations/{allocationId}", + bwm.BandwidthAllocationDELETE, + }, + + Route{ + "BandwidthAllocationGET", + strings.ToUpper("Get"), + "/bwm/v1/bw_allocations/{allocationId}", + bwm.BandwidthAllocationGET, + }, + + Route{ + "BandwidthAllocationListGET", + strings.ToUpper("Get"), + "/bwm/v1/bw_allocations", + bwm.BandwidthAllocationListGET, + }, + + Route{ + "BandwidthAllocationPATCH", + strings.ToUpper("Patch"), + "/bwm/v1/bw_allocations/{allocationId}", + bwm.BandwidthAllocationPATCH, + }, + + Route{ + "BandwidthAllocationPOST", + strings.ToUpper("Post"), + "/bwm/v1/bw_allocations", + bwm.BandwidthAllocationPOST, + }, + + Route{ + "BandwidthAllocationPUT", + strings.ToUpper("Put"), + "/bwm/v1/bw_allocations/{allocationId}", + bwm.BandwidthAllocationPUT, + }, + + Route{ + "Index", + "GET", + "/mts/v1/", + Index, + }, + + Route{ + "Mec011AppTerminationPOST", + strings.ToUpper("Post"), + "/mts/v1/notifications/mec011/appTermination", + mts.Mec011AppTerminationPOST, + }, + + Route{ + "MtsCapabilityInfoGET", + strings.ToUpper("Get"), + "/mts/v1/mts_capability_info", + mts.MtsCapabilityInfoGET, + }, + + Route{ + "MtsSessionDELETE", + strings.ToUpper("Delete"), + "/mts/v1/mts_sessions/{sessionId}", + mts.MtsSessionDELETE, + }, + + Route{ + "MtsSessionGET", + strings.ToUpper("Get"), + "/mts/v1/mts_sessions/{sessionId}", + mts.MtsSessionGET, + }, + + Route{ + "MtsSessionPOST", + strings.ToUpper("Post"), + "/mts/v1/mts_sessions", + mts.MtsSessionPOST, + }, + + Route{ + "MtsSessionPUT", + strings.ToUpper("Put"), + "/mts/v1/mts_sessions/{sessionId}", + mts.MtsSessionPUT, + }, + + Route{ + "MtsSessionsListGET", + strings.ToUpper("Get"), + "/mts/v1/mts_sessions", + mts.MtsSessionsListGET, + }, +} diff --git a/go-apps/meep-tm/server/traffic-mgmt.go b/go-apps/meep-tm/server/traffic-mgmt.go new file mode 100644 index 000000000..35f68cc13 --- /dev/null +++ b/go-apps/meep-tm/server/traffic-mgmt.go @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package server + +import ( + "errors" + "net/url" + "os" + "strings" + "sync" + + bwm "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/bwm" + mts "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/mts" + dkm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr" + httpLog "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" + mod "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model" + mq "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq" + redis "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis" + sam "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr" +) + +const serviceName = "Traffic Management Service" +const moduleName = "meep-tm" +const tmKey = "traffic_mgmt" +const defaultMepName = "global" + +var redisAddr string = "meep-redis-master.default.svc.cluster.local:6379" +var influxAddr string = "http://meep-influxdb.default.svc.cluster.local:8086" +var Traffic_Mgmt_DB = 0 + +var instanceId string +var instanceName string + +var metricStore *met.MetricStore +var mutex sync.Mutex +var rc *redis.Connector +var hostUrl *url.URL +var sandboxName string +var mepName string = defaultMepName +var handlerId int +var mqLocal *mq.MsgQueue +var apiMgr *sam.SwaggerApiMgr +var activeModel *mod.Model +var currentStoreName = "" +var currScenarioName = "" +var baseKey string + +// Init - TM Service initialization +func Init() (err error) { + + // Retrieve Instance ID from environment variable if present + instanceIdEnv := strings.TrimSpace(os.Getenv("MEEP_INSTANCE_ID")) + if instanceIdEnv != "" { + instanceId = instanceIdEnv + } + log.Info("MEEP_INSTANCE_ID: ", instanceId) + + // Retrieve Instance Name from environment variable + instanceName = moduleName + instanceNameEnv := strings.TrimSpace(os.Getenv("MEEP_POD_NAME")) + if instanceNameEnv != "" { + instanceName = instanceNameEnv + } + log.Info("MEEP_POD_NAME: ", instanceName) + + // Retrieve Sandbox name from environment variable + sandboxNameEnv := strings.TrimSpace(os.Getenv("MEEP_SANDBOX_NAME")) + if sandboxNameEnv != "" { + sandboxName = sandboxNameEnv + } + if sandboxName == "" { + err = errors.New("MEEP_SANDBOX_NAME env variable not set") + log.Error(err.Error()) + return err + } + log.Info("MEEP_SANDBOX_NAME: ", sandboxName) + + // Get MEP name + mepNameEnv := strings.TrimSpace(os.Getenv("MEEP_MEP_NAME")) + if mepNameEnv != "" { + mepName = mepNameEnv + } + log.Info("MEEP_MEP_NAME: ", mepName) + + // hostUrl is the url of the node serving the resourceURL + // Retrieve public url address where service is reachable, if not present, use Host URL environment variable + hostUrl, err = url.Parse(strings.TrimSpace(os.Getenv("MEEP_PUBLIC_URL"))) + if err != nil || hostUrl == nil || hostUrl.String() == "" { + hostUrl, err = url.Parse(strings.TrimSpace(os.Getenv("MEEP_HOST_URL"))) + if err != nil { + hostUrl = new(url.URL) + } + } + log.Info("MEEP_HOST_URL: ", hostUrl) + + // Create message queue + mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sandboxName), moduleName, sandboxName, redisAddr) + if err != nil { + log.Error("Failed to create Message Queue with error: ", err) + return err + } + log.Info("Message Queue created") + + // Create Swagger API Manager + mep := "" + if mepName != defaultMepName { + mep = mepName + } + apiMgr, err = sam.NewSwaggerApiMgr(moduleName, sandboxName, mep, mqLocal) + if err != nil { + log.Error("Failed to create Swagger API Manager. Error: ", err) + return err + } + log.Info("Swagger API Manager created") + + // Set base storage key + baseKey = dkm.GetKeyRoot(sandboxName) + tmKey + ":mep:" + mepName + ":" + + // Connect to Redis DB + rc, err = redis.NewConnector(redisAddr, Traffic_Mgmt_DB) + if err != nil { + log.Error("Failed connection to Redis DB. Error: ", err) + return err + } + log.Info("Connected to Redis DB") + + _ = rc.DBFlush(baseKey) + log.Info("Connected to Redis DB, TM service table") + + // Create new active scenario model + modelCfg := mod.ModelCfg{ + Name: "activeScenario", + Namespace: sandboxName, + Module: moduleName, + UpdateCb: nil, + DbAddr: redisAddr, + } + activeModel, err = mod.NewModel(modelCfg) + if err != nil { + log.Error("Failed to create model: ", err.Error()) + return err + } + + bwmInitCfg := bwm.InitCfg{ + SandboxName: sandboxName, + MepName: mepName, + InstanceId: instanceId, + InstanceName: instanceName, + BaseKey: baseKey, + HostUrl: hostUrl, + RedisConn: rc, + Model: activeModel, + } + + // Initialize BWM + err = bwm.Init(bwmInitCfg) + if err != nil { + return err + } + + mtsInitCfg := mts.InitCfg{ + SandboxName: sandboxName, + MepName: mepName, + InstanceId: instanceId, + InstanceName: instanceName, + BaseKey: baseKey, + HostUrl: hostUrl, + RedisConn: rc, + Model: activeModel, + } + + // Initialize MTS + err = mts.Init(mtsInitCfg) + if err != nil { + return err + } + + return nil +} + +// Run - Start Traffic Management +func Run() (err error) { + + err = bwm.Run() + if err != nil { + return err + } + + err = mts.Run() + if err != nil { + return err + } + + // Start Swagger API Manager (provider) + err = apiMgr.Start(true, false) + if err != nil { + log.Error("Failed to start Swagger API Manager with error: ", err.Error()) + return err + } + log.Info("Swagger API Manager started") + + // Add module Swagger APIs + err = apiMgr.AddApis() + if err != nil { + log.Error("Failed to add Swagger APIs with error: ", err.Error()) + return err + } + log.Info("Swagger APIs successfully added") + + // Register Message Queue handler + handler := mq.MsgHandler{Handler: msgHandler, UserData: nil} + handlerId, err = mqLocal.RegisterHandler(handler) + if err != nil { + log.Error("Failed to register local Msg Queue listener: ", err.Error()) + return err + } + log.Info("Registered local Msg Queue listener") + + // Initalize metric store + updateStoreName("") + + return nil +} + +// Stop - Stop Traffic Management +func Stop() (err error) { + if mqLocal != nil { + mqLocal.UnregisterHandler(handlerId) + } + + _ = bwm.Stop() + _ = mts.Stop() + + // Remove APIs + if apiMgr != nil { + err := apiMgr.RemoveApis() + if err != nil { + log.Error("Failed to remove APIs with err: ", err.Error()) + } + } + return nil +} + +// Message Queue handler +func msgHandler(msg *mq.Msg, userData interface{}) { + switch msg.Message { + case mq.MsgScenarioActivate: + log.Debug("RX MSG: ", mq.PrintMsg(msg)) + processActiveScenarioUpdate() + case mq.MsgScenarioUpdate: + log.Debug("RX MSG: ", mq.PrintMsg(msg)) + processActiveScenarioUpdate() + case mq.MsgScenarioTerminate: + log.Debug("RX MSG: ", mq.PrintMsg(msg)) + processActiveScenarioTerminate() + default: + log.Trace("Ignoring unsupported message: ", mq.PrintMsg(msg)) + } +} + +func processActiveScenarioTerminate() { + log.Debug("processActiveScenarioTerminate") + + // Sync with active scenario store + activeModel.UpdateScenario() + + cleanUp() +} + +func processActiveScenarioUpdate() { + + mutex.Lock() + defer mutex.Unlock() + + log.Debug("processActiveScenarioUpdate") + + activeModel.UpdateScenario() + + scenarioName := activeModel.GetScenarioName() + + // Connect to Metric Store + updateStoreName(scenarioName) + + var err error + + if scenarioName != currScenarioName { + currScenarioName = scenarioName + metricStore, err = met.NewMetricStore(scenarioName, sandboxName, influxAddr, redisAddr) + if err != nil { + log.Error("Failed connection to metric-store: ", err) + } + } +} + +func cleanUp() { + log.Info("Terminate all") + + // Flush all service data + _ = rc.DBFlush(baseKey) + + // Reset metrics store name + updateStoreName("") +} + +func updateStoreName(storeName string) { + if currentStoreName != storeName { + currentStoreName = storeName + + logComponent := moduleName + if mepName != defaultMepName { + logComponent = moduleName + "-" + mepName + } + err := httpLog.ReInit(logComponent, sandboxName, storeName, redisAddr, influxAddr) + if err != nil { + log.Error("Failed to initialise httpLog: ", err) + return + } + } +} diff --git a/go-apps/meep-tm/server/traffic-mgmt_test.go b/go-apps/meep-tm/server/traffic-mgmt_test.go new file mode 100644 index 000000000..3096b4654 --- /dev/null +++ b/go-apps/meep-tm/server/traffic-mgmt_test.go @@ -0,0 +1,1585 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on ance "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package server + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "testing" + "time" + + bwm "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/bwm" + mts "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tm/server/mts" + dkm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + mod "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model" + mq "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq" + "github.com/gorilla/mux" +) + +// const INITIAL = 0 +// const UPDATED = 1 + +const testScenario string = ` +{ + "version":"1.5.3", + "name":"test-scenario", + "deployment":{ + "netChar":{ + "latency":50, + "latencyVariation":5, + "throughputDl":1000, + "throughputUl":1000 + }, + "domains":[ + { + "id":"PUBLIC", + "name":"PUBLIC", + "type":"PUBLIC", + "netChar":{ + "latency":6, + "latencyVariation":2, + "throughputDl":1000000, + "throughputUl":1000000 + }, + "zones":[ + { + "id":"PUBLIC-COMMON", + "name":"PUBLIC-COMMON", + "type":"COMMON", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000000 + }, + "networkLocations":[ + { + "id":"PUBLIC-COMMON-DEFAULT", + "name":"PUBLIC-COMMON-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":50000, + "throughputUl":50000, + "packetLoss":1 + } + } + ] + } + ] + }, + { + "id":"4da82f2d-1f44-4945-8fe7-00c0431ef8c7", + "name":"operator-cell1", + "type":"OPERATOR-CELLULAR", + "netChar":{ + "latency":6, + "latencyVariation":2, + "throughputDl":1000, + "throughputUl":1000 + }, + "cellularDomainConfig":{ + "mnc":"456", + "mcc":"123", + "defaultCellId":"1234567" + }, + "zones":[ + { + "id":"operator-cell1-COMMON", + "name":"operator-cell1-COMMON", + "type":"COMMON", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000 + }, + "networkLocations":[ + { + "id":"operator-cell1-COMMON-DEFAULT", + "name":"operator-cell1-COMMON-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"0836975f-a7ea-41ec-b0e0-aff43178194d", + "name":"zone1", + "type":"ZONE", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000 + }, + "networkLocations":[ + { + "id":"zone1-DEFAULT", + "name":"zone1-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "physicalLocations":[ + { + "id":"97b80da7-a74a-4649-bb61-f7fa4fbb2d76", + "name":"zone1-edge1", + "type":"EDGE", + "connected":true, + "processes":[ + { + "id":"fcf1269c-a061-448e-aa80-6dd9c2d4c548", + "name":"zone1-edge1-iperf", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/iperf-server", + "commandArguments":"-c, export; iperf -s -p $IPERF_SERVICE_PORT", + "commandExe":"/bin/bash", + "serviceConfig":{ + "name":"zone1-edge1-iperf", + "meSvcName":"iperf", + "ports":[ + { + "protocol":"UDP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"35697e68-c627-4b8d-9cd7-ad8b8e226aee", + "name":"zone1-edge1-svc", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/demo-server", + "environment":"MGM_GROUP_NAME=svc, MGM_APP_ID=zone1-edge1-svc, MGM_APP_PORT=80", + "serviceConfig":{ + "name":"zone1-edge1-svc", + "meSvcName":"svc", + "ports":[ + { + "protocol":"TCP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"7a6f8077-b0b3-403d-b954-3351e21afeb7", + "name":"zone1-poa-cell1", + "type":"POA-4G", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "poa4GConfig":{ + "cellId":"2345678" + }, + "physicalLocations":[ + { + "id":"32a2ced4-a262-49a8-8503-8489a94386a2", + "name":"ue1", + "type":"UE", + "connected":true, + "wireless":true, + "processes":[ + { + "id":"9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + "name":"ue1-iperf", + "type":"UE-APP", + "image":"meep-docker-registry:30001/iperf-client", + "commandArguments":"-c, export; iperf -u -c $IPERF_SERVICE_HOST -p $IPERF_SERVICE_PORT\n-t 3600 -b 50M;", + "commandExe":"/bin/bash", + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"b1851da5-c9e1-4bd8-ad23-5925c82ee127", + "name":"zone1-fog1", + "type":"FOG", + "connected":true, + "processes":[ + { + "id":"c2f2fb5d-4053-4cee-a0ee-e62bbb7751b6", + "name":"zone1-fog1-iperf", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/iperf-server", + "commandArguments":"-c, export; iperf -s -p $IPERF_SERVICE_PORT;", + "commandExe":"/bin/bash", + "serviceConfig":{ + "name":"zone1-fog1-iperf", + "meSvcName":"iperf", + "ports":[ + { + "protocol":"UDP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"53b5806b-e213-4c5a-a181-f1c31c24287b", + "name":"zone1-fog1-svc", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/demo-server", + "environment":"MGM_GROUP_NAME=svc, MGM_APP_ID=zone1-fog1-svc, MGM_APP_PORT=80", + "serviceConfig":{ + "name":"zone1-fog1-svc", + "meSvcName":"svc", + "ports":[ + { + "protocol":"TCP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"7ff90180-2c1a-4c11-b59a-3608c5d8d874", + "name":"zone1-poa-cell2", + "type":"POA-4G", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "poa4GConfig":{ + "cellId":"3456789" + } + } + ] + }, + { + "id":"d1f06b00-4454-4d35-94a5-b573888e7ea9", + "name":"zone2", + "type":"ZONE", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000 + }, + "networkLocations":[ + { + "id":"zone2-DEFAULT", + "name":"zone2-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "physicalLocations":[ + { + "id":"fb130d18-fd81-43e0-900c-c584e7190302", + "name":"zone2-edge1", + "type":"EDGE", + "connected":true, + "processes":[ + { + "id":"5c8276ba-0b78-429d-a0bf-d96f35ba2c77", + "name":"zone2-edge1-iperf", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/iperf-server", + "commandArguments":"-c, export; iperf -s -p $IPERF_SERVICE_PORT;", + "commandExe":"/bin/bash", + "serviceConfig":{ + "name":"zone2-edge1-iperf", + "meSvcName":"iperf", + "ports":[ + { + "protocol":"UDP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"53fa28f0-80e2-414c-8841-86db9bd37d51", + "name":"zone2-edge1-svc", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/demo-server", + "environment":"MGM_GROUP_NAME=svc, MGM_APP_ID=zone2-edge1-svc, MGM_APP_PORT=80", + "serviceConfig":{ + "name":"zone2-edge1-svc", + "meSvcName":"svc", + "ports":[ + { + "protocol":"TCP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"c44b8937-58af-44b2-acdb-e4d1c4a1510b", + "name":"zone2-poa1", + "type":"POA", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":20, + "throughputUl":20 + } + } + ] + } + ] + }, + { + "id":"e29138fb-cf03-4372-8335-fd2665b77a11", + "name":"operator1", + "type":"OPERATOR", + "netChar":{ + "latency":6, + "latencyVariation":2, + "throughputDl":1000, + "throughputUl":1000 + }, + "zones":[ + { + "id":"operator1-COMMON", + "name":"operator1-COMMON", + "type":"COMMON", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "networkLocations":[ + { + "id":"operator1-COMMON-DEFAULT", + "name":"operator1-COMMON-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"7d8bee73-6d5c-4c5a-a3a0-49ebe3cd2c71", + "name":"zone3", + "type":"ZONE", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "networkLocations":[ + { + "id":"zone3-DEFAULT", + "name":"zone3-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"ecc2a41b-7381-4108-a037-52862c520733", + "name":"poa1", + "type":"POA", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + } + ] + } + ] + } +} +` + +const redisTestAddr = "localhost:30380" +const influxTestAddr = "http://localhost:30986" +const testScenarioName = "testScenario" + +var m *mod.Model + +/* + * MTS Test Cases + */ + +func testMtsSessionPost(t *testing.T) (string, string) { + + /****************************** + * expected response section + ******************************/ + + expectedRequestType := uint32(0) // Application specific MTS Session + expectedAppInsId := "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7" + expectedMtsMode := uint32(0) + expectedTrafficDirection := "00" + expectedMtsSessionInfo := mts.MtsSessionInfo{ + AppInsId: expectedAppInsId, + RequestType: &expectedRequestType, + MtsMode: &expectedMtsMode, + TrafficDirection: expectedTrafficDirection, + } + expectedResponseStr, err := json.Marshal(expectedMtsSessionInfo) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request body section + ******************************/ + + requestType := uint32(0) // Application specific MTS Session + mtsMode := uint32(0) + requestedMtsSessionInfo := mts.MtsSessionInfo{ + AppInsId: "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + RequestType: &requestType, + MtsMode: &mtsMode, + TrafficDirection: "00", + } + body, err := json.Marshal(requestedMtsSessionInfo) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("body: ", string(body)) + + /****************************** + * request execution section + ******************************/ + + rr, err := sendRequest(http.MethodPost, "/mts/v1/mts_sessions", bytes.NewBuffer(body), nil, nil, http.StatusCreated, mts.MtsSessionPOST) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("Request sent") + + var respBody mts.MtsSessionInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * Comparing responses + ******************************/ + + if expectedMtsSessionInfo.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedMtsSessionInfo.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if *expectedMtsSessionInfo.MtsMode != *respBody.MtsMode { + t.Fatalf("Failed to get expected response") + } + if expectedMtsSessionInfo.TrafficDirection != respBody.TrafficDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.SessionId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + + return respBody.SessionId, string(expectedResponseStr) +} + +func TestMtsSessionsListGet(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + // POST + sessionId1, _ := testMtsSessionPost(t) + sessionId2, _ := testMtsSessionPost(t) + + // GET list + testMtsSessionsListGet(t) + + // DELETE + testMtsSessionDelete(t, sessionId1, true) + testMtsSessionDelete(t, sessionId2, true) + + /****************************** + * back to initial state section + ******************************/ + + terminateScenario() +} + +func testMtsSessionsListGet(t *testing.T) { + + /****************************** + * expected response section + ******************************/ + nbExpectedMtsSessionInfo := 2 + + /****************************** + * request execution section + ******************************/ + + rr, err := sendRequest(http.MethodGet, "/mts/v1/mts_sessions", nil, nil, nil, http.StatusOK, mts.MtsSessionsListGET) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + var responseBody []mts.MtsSessionInfo + err = json.Unmarshal([]byte(rr), &responseBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if len(responseBody) != nbExpectedMtsSessionInfo { + t.Fatalf("Failed to get expected response, expected none") + } +} + +func testMtsSessionsGet(t *testing.T, sessionId string, expectedResponse string) { + + /****************************** + * expected response section + ******************************/ + //passed as a parameter since a POST had to be sent first + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["sessionId"] = sessionId + + /****************************** + * request execution section + ******************************/ + var err error + if expectedResponse == "" { + _, err = sendRequest(http.MethodGet, "/mts/v1/mts_sessions", nil, vars, nil, http.StatusNotFound, mts.MtsSessionGET) + if err != nil { + t.Fatalf("Failed to get expected response") + } + } else { + var expectedResp mts.MtsSessionInfo + err := json.Unmarshal([]byte(expectedResponse), &expectedResp) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + rr, err := sendRequest(http.MethodGet, "/mts/v1/mts_sessions", nil, vars, nil, http.StatusOK, mts.MtsSessionGET) + if err != nil { + t.Fatalf("Failed to get expected response") + } + var respBody mts.MtsSessionInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if expectedResp.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedResp.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if *expectedResp.MtsMode != *respBody.MtsMode { + t.Fatalf("Failed to get expected response") + } + if expectedResp.TrafficDirection != respBody.TrafficDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.SessionId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + } +} + +func testMtsSessionPut(t *testing.T, sessionId string, expectSuccess bool) string { + /****************************** + * expected response section + ******************************/ + + expectedRequestType := uint32(0) // Application specific MTS Session + expectedAppInsId := "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7" + expectedMtsMode := uint32(1) + expectedTrafficDirection := "00" + expectedMtsSessionInfo := mts.MtsSessionInfo{ + AppInsId: expectedAppInsId, + RequestType: &expectedRequestType, + MtsMode: &expectedMtsMode, + TrafficDirection: expectedTrafficDirection, + } + expectedResponseStr, err := json.Marshal(expectedMtsSessionInfo) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["sessionId"] = sessionId + + /****************************** + * request body section + ******************************/ + + requestType := uint32(0) // Application specific MTS Session + mtsMode := uint32(1) + requestedMtsSessionInfo := mts.MtsSessionInfo{ + AppInsId: "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + RequestType: &requestType, + MtsMode: &mtsMode, + TrafficDirection: "00", + } + body, err := json.Marshal(requestedMtsSessionInfo) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("body: ", string(body)) + + /****************************** + * request queries section + ******************************/ + + /****************************** + * request execution section + ******************************/ + + if expectSuccess { + rr, err := sendRequest(http.MethodPut, "/mts/v1/mts_sessions", bytes.NewBuffer(body), vars, nil, http.StatusOK, mts.MtsSessionPUT) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + var respBody mts.MtsSessionInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if expectedMtsSessionInfo.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedMtsSessionInfo.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if *expectedMtsSessionInfo.MtsMode != *respBody.MtsMode { + t.Fatalf("Failed to get expected response") + } + if expectedMtsSessionInfo.TrafficDirection != respBody.TrafficDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.SessionId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + + return string(expectedResponseStr) + } else { + _, err = sendRequest(http.MethodPost, "/mts/v1/mts_sessions", bytes.NewBuffer(body), vars, nil, http.StatusNotFound, mts.MtsSessionPUT) + if err != nil { + t.Fatalf("Failed to get expected response") + } + return "" + } +} + +func testMtsSessionDelete(t *testing.T, sessionId string, expectSuccess bool) { + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["sessionId"] = sessionId + + /****************************** + * request execution section + ******************************/ + + if expectSuccess { + _, err := sendRequest(http.MethodDelete, "/mts/v1/mts_sessions", nil, vars, nil, http.StatusNoContent, mts.MtsSessionDELETE) + if err != nil { + t.Fatalf("Failed to get expected response") + } + } else { + _, err := sendRequest(http.MethodDelete, "/mts/v1/mts_sessions", nil, vars, nil, http.StatusNotFound, mts.MtsSessionDELETE) + if err != nil { + t.Fatalf("Failed to get expected response") + } + } +} + +func TestSuccessMtsSession(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + // POST + sessionId, expectedGetResp := testMtsSessionPost(t) + // GET + testMtsSessionsGet(t, sessionId, expectedGetResp) + // PUT + expectedGetResp = testMtsSessionPut(t, sessionId, true) + // GET + testMtsSessionsGet(t, sessionId, expectedGetResp) + // DELETE + testMtsSessionDelete(t, sessionId, true) + + /****************************** + * back to initial state section + ******************************/ + + terminateScenario() +} + +func TestFailMtsSession(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + // GET + testMtsSessionsGet(t, "invalidSessionId", "") + + // PUT + _ = testMtsSessionPut(t, "invalidSessionId", false) + + // DELETE + testMtsSessionDelete(t, "invalidSessionId", false) + + /****************************** + * back to initial state section + ******************************/ + + terminateScenario() +} + +/* + * BWM Test Cases + */ + +func testBandwidthAllocationPost(t *testing.T) (string, string) { + + /****************************** + * expected response section + ******************************/ + + expectedRequestType := int32(0) // Application specific MTS Session + expectedAppInsId := "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7" + expectedFixedAllocation := "10737418240" // 10Gbps + expectedAllocationDirection := "00" + expectedBandwidthAlloc := bwm.BwInfo{ + AppInsId: expectedAppInsId, + RequestType: &expectedRequestType, + FixedAllocation: expectedFixedAllocation, + AllocationDirection: expectedAllocationDirection, + } + expectedResponseStr, err := json.Marshal(expectedBandwidthAlloc) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request body section + ******************************/ + + requestType := int32(0) // Application specific Bandwidth Allocation + fixedAllocation := "10737418240" // 10Gbps + requestedBandwidthAlloc := bwm.BwInfo{ + AppInsId: "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + RequestType: &requestType, + FixedAllocation: fixedAllocation, + AllocationDirection: "00", + } + body, err := json.Marshal(requestedBandwidthAlloc) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("body: ", string(body)) + + /****************************** + * request execution section + ******************************/ + + rr, err := sendRequest(http.MethodPost, "/bwm/v1/bw_allocations", bytes.NewBuffer(body), nil, nil, http.StatusCreated, bwm.BandwidthAllocationPOST) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("Request sent") + + var respBody bwm.BwInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * Comparing responses + ******************************/ + + if expectedBandwidthAlloc.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedBandwidthAlloc.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if expectedBandwidthAlloc.FixedAllocation != respBody.FixedAllocation { + t.Fatalf("Failed to get expected response") + } + if expectedBandwidthAlloc.AllocationDirection != respBody.AllocationDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.AllocationId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + + return respBody.AllocationId, string(expectedResponseStr) +} + +func TestBandwidthAllocationListGet(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + // POST + allocationId1, _ := testBandwidthAllocationPost(t) + allocationId2, _ := testBandwidthAllocationPost(t) + + // GET list + testBandwidthAllocationListGet(t) + + // DELETE + testBandwidthAllocationDelete(t, allocationId1, true) + testBandwidthAllocationDelete(t, allocationId2, true) + + /****************************** + * back to initial state section + ******************************/ + + terminateScenario() +} + +func testBandwidthAllocationListGet(t *testing.T) { + + /****************************** + * expected response section + ******************************/ + nbExpectedBandwidthAlloc := 2 + + /****************************** + * request execution section + ******************************/ + + rr, err := sendRequest(http.MethodGet, "/bwm/v1/bw_allocations", nil, nil, nil, http.StatusOK, bwm.BandwidthAllocationListGET) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + var responseBody []bwm.BwInfo + err = json.Unmarshal([]byte(rr), &responseBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if len(responseBody) != nbExpectedBandwidthAlloc { + t.Fatalf("Failed to get expected response, expected none") + } +} + +func testBandwidthAllocationGet(t *testing.T, allocationId string, expectedResponse string) { + + /****************************** + * expected response section + ******************************/ + //passed as a parameter since a POST had to be sent first + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["allocationId"] = allocationId + + /****************************** + * request execution section + ******************************/ + var err error + if expectedResponse == "" { + _, err = sendRequest(http.MethodGet, "/bwm/v1/bw_allocations", nil, vars, nil, http.StatusNotFound, bwm.BandwidthAllocationGET) + if err != nil { + t.Fatalf("Failed to get expected response") + } + } else { + var expectedResp bwm.BwInfo + err := json.Unmarshal([]byte(expectedResponse), &expectedResp) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + rr, err := sendRequest(http.MethodGet, "/bwm/v1/bw_allocations", nil, vars, nil, http.StatusOK, bwm.BandwidthAllocationGET) + if err != nil { + t.Fatalf("Failed to get expected response") + } + var respBody bwm.BwInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if expectedResp.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedResp.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if expectedResp.FixedAllocation != respBody.FixedAllocation { + t.Fatalf("Failed to get expected response") + } + if expectedResp.AllocationDirection != respBody.AllocationDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.AllocationId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + } +} + +func testBandwidthAllocationPut(t *testing.T, allocationId string, expectSuccess bool) string { + /****************************** + * expected response section + ******************************/ + + expectedRequestType := int32(0) // Application specific MTS Session + expectedAppInsId := "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7" + expectedFixedAllocation := "21474836480" // 20Gbps + expectedAllocationDirection := "00" + expectedBandwidthAlloc := bwm.BwInfo{ + AppInsId: expectedAppInsId, + RequestType: &expectedRequestType, + FixedAllocation: expectedFixedAllocation, + AllocationDirection: expectedAllocationDirection, + } + expectedResponseStr, err := json.Marshal(expectedBandwidthAlloc) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["allocationId"] = allocationId + + /****************************** + * request body section + ******************************/ + + requestType := int32(0) // Application specific Bandwidth Allocation + fixedAllocation := "21474836480" // 20Gbps + requestedBandwidthAlloc := bwm.BwInfo{ + AppInsId: "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + RequestType: &requestType, + FixedAllocation: fixedAllocation, + AllocationDirection: "00", + } + body, err := json.Marshal(requestedBandwidthAlloc) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("body: ", string(body)) + + /****************************** + * request queries section + ******************************/ + + /****************************** + * request execution section + ******************************/ + + if expectSuccess { + rr, err := sendRequest(http.MethodPut, "/bwm/v1/bw_allocations", bytes.NewBuffer(body), vars, nil, http.StatusOK, bwm.BandwidthAllocationPUT) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + var respBody bwm.BwInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if expectedBandwidthAlloc.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedBandwidthAlloc.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if expectedBandwidthAlloc.FixedAllocation != respBody.FixedAllocation { + t.Fatalf("Failed to get expected response") + } + if expectedBandwidthAlloc.AllocationDirection != respBody.AllocationDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.AllocationId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + + return string(expectedResponseStr) + } else { + _, err = sendRequest(http.MethodPut, "/bwm/v1/bw_allocations", bytes.NewBuffer(body), vars, nil, http.StatusNotFound, bwm.BandwidthAllocationPUT) + if err != nil { + t.Fatalf("Failed to get expected response") + } + return "" + } +} + +func testBandwidthAllocationPatch(t *testing.T, allocationId string, expectSuccess bool) string { + /****************************** + * expected response section + ******************************/ + + expectedRequestType := int32(0) // Application specific MTS Session + expectedAppInsId := "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7" + expectedFixedAllocation := "5368709120" // 5Gbps + expectedAllocationDirection := "00" + expectedBandwidthAlloc := bwm.BwInfo{ + AppInsId: expectedAppInsId, + RequestType: &expectedRequestType, + FixedAllocation: expectedFixedAllocation, + AllocationDirection: expectedAllocationDirection, + } + expectedResponseStr, err := json.Marshal(expectedBandwidthAlloc) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["allocationId"] = allocationId + + /****************************** + * request body section + ******************************/ + + requestType := int32(0) + fixedAllocation := "5368709120" // 5Gbps + requestedBandwidthAllocDeltas := bwm.BwInfoDeltas{ + AllocationId: allocationId, + AppInsId: "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + RequestType: &requestType, + FixedAllocation: fixedAllocation, + } + body, err := json.Marshal(requestedBandwidthAllocDeltas) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("body: ", string(body)) + + /****************************** + * request queries section + ******************************/ + + /****************************** + * request execution section + ******************************/ + + if expectSuccess { + rr, err := sendRequest(http.MethodPatch, "/bwm/v1/bw_allocations", bytes.NewBuffer(body), vars, nil, http.StatusOK, bwm.BandwidthAllocationPATCH) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + var respBody bwm.BwInfo + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf("Failed to get expected response") + } + + if expectedBandwidthAlloc.AppInsId != respBody.AppInsId { + t.Fatalf("Failed to get expected response") + } + if *expectedBandwidthAlloc.RequestType != *respBody.RequestType { + t.Fatalf("Failed to get expected response") + } + if expectedBandwidthAlloc.FixedAllocation != respBody.FixedAllocation { + t.Fatalf("Failed to get expected response") + } + if expectedBandwidthAlloc.AllocationDirection != respBody.AllocationDirection { + t.Fatalf("Failed to get expected response") + } + if respBody.AllocationId == "" { + t.Fatalf("Failed to get expected response") + } + if respBody.TimeStamp == nil { + t.Fatalf("Failed to get expected response") + } + + return string(expectedResponseStr) + } else { + _, err = sendRequest(http.MethodPatch, "/bwm/v1/bw_allocations", bytes.NewBuffer(body), vars, nil, http.StatusNotFound, bwm.BandwidthAllocationPATCH) + if err != nil { + t.Fatalf("Failed to get expected response") + } + return "" + } +} + +func testBandwidthAllocationDelete(t *testing.T, allocationId string, expectSuccess bool) { + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["allocationId"] = allocationId + + /****************************** + * request execution section + ******************************/ + + if expectSuccess { + _, err := sendRequest(http.MethodDelete, "/bwm/v1/bw_allocations", nil, vars, nil, http.StatusNoContent, bwm.BandwidthAllocationDELETE) + if err != nil { + t.Fatalf("Failed to get expected response") + } + } else { + _, err := sendRequest(http.MethodDelete, "/bwm/v1/bw_allocations", nil, vars, nil, http.StatusNotFound, bwm.BandwidthAllocationDELETE) + if err != nil { + t.Fatalf("Failed to get expected response") + } + } +} + +func TestSuccessBandwidthAllocation(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + // POST + allocationId, expectedGetResp := testBandwidthAllocationPost(t) + // GET + testBandwidthAllocationGet(t, allocationId, expectedGetResp) + // PUT + expectedGetResp = testBandwidthAllocationPut(t, allocationId, true) + // GET + testBandwidthAllocationGet(t, allocationId, expectedGetResp) + // PATCH + expectedGetResp = testBandwidthAllocationPatch(t, allocationId, true) + // GET + testBandwidthAllocationGet(t, allocationId, expectedGetResp) + // DELETE + testBandwidthAllocationDelete(t, allocationId, true) + + /****************************** + * back to initial state section + ******************************/ + + terminateScenario() +} + +func TestFailBandwidthAllocation(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + // GET + testBandwidthAllocationGet(t, "invalidAllocationId", "") + + // PUT + _ = testBandwidthAllocationPut(t, "invalidAllocationId", false) + + // PATCH + _ = testBandwidthAllocationPatch(t, "invalidAllocationId", false) + + // DELETE + testBandwidthAllocationDelete(t, "invalidAllocationId", false) + + /****************************** + * back to initial state section + ******************************/ + + terminateScenario() +} + +func terminateScenario() { + if mqLocal != nil { + _ = Stop() + msg := mqLocal.CreateMsg(mq.MsgScenarioTerminate, mq.TargetAll, testScenarioName) + err := mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + time.Sleep(100 * time.Millisecond) + } +} + +func updateScenario(testUpdate string) { + + switch testUpdate { + case "mobility1": + // mobility event of ue1 to zone2-poa1 + elemName := "ue1" + destName := "zone2-poa1" + + _, _, err := m.MoveNode(elemName, destName, nil) + if err != nil { + log.Error("Error sending mobility event") + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + case "mobility2": + // mobility event of ue1 to zone2-poa1 + elemName := "ue1" + destName := "zone1-poa-cell1" + + _, _, err := m.MoveNode(elemName, destName, nil) + if err != nil { + log.Error("Error sending mobility event") + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + case "mobility3": + // mobility event of ue1 to zone1-poa-cell2 + elemName := "ue1" + destName := "zone1-poa-cell2" + + _, _, err := m.MoveNode(elemName, destName, nil) + if err != nil { + log.Error("Error sending mobility event") + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + default: + } + time.Sleep(100 * time.Millisecond) +} + +func initializeVars() { + mod.DbAddress = redisTestAddr + redisAddr = redisTestAddr + influxAddr = influxTestAddr + sandboxName = testScenarioName +} + +func initialiseScenario(testScenario string) { + + //clear DB + cleanUp() + + cfg := mod.ModelCfg{ + Name: testScenarioName, + Namespace: sandboxName, + Module: "test-mod", + UpdateCb: nil, + DbAddr: redisAddr, + } + + var err error + m, err = mod.NewModel(cfg) + if err != nil { + log.Error("Failed to create model: ", err) + return + } + + // Create message queue + mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(testScenarioName), "test-mod", testScenarioName, redisAddr) + if err != nil { + log.Error("Failed to create Message Queue with error: ", err) + return + } + log.Info("Message Queue created") + + fmt.Println("Set Model") + err = m.SetScenario([]byte(testScenario)) + if err != nil { + log.Error("Failed to set model: ", err) + return + } + + err = m.Activate() + if err != nil { + log.Error("Failed to activate scenario with err: ", err.Error()) + return + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioActivate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + return + } + + time.Sleep(100 * time.Millisecond) + + // Load Redis with AppInstanceId + appEnablementKey := "app-enablement" + + appInfo := make(map[string]string) // same as in testScenario + appInfo["id"] = "9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7" + appInfo["name"] = "ue1-iperf" + appInfo["node"] = "" + appInfo["type"] = "UE-APP" + appInfo["persist"] = "false" + appInfo["state"] = "READY" + + entry := make(map[string]interface{}, len(appInfo)) + for k, v := range appInfo { + entry[k] = v + } + + baseKeyAppEn := dkm.GetKeyRoot(sandboxName) + appEnablementKey + ":mep:" + mepName + ":" + key := baseKeyAppEn + "app:" + appInfo["id"] + ":info" + err = rc.SetEntry(key, entry) + if err != nil { + log.Error("Failed to write appInstanceId to Redis DB") + return + } + + err = bwm.IntializeBwBuffer() + if err != nil { + log.Error("Failed to write BW Buffer to Redis DB") + return + } +} + +func sendRequest(method string, url string, body io.Reader, vars map[string]string, query map[string]string, code int, f http.HandlerFunc) (string, error) { + req, err := http.NewRequest(method, url, body) + if err != nil || req == nil { + return "", err + } + if vars != nil { + req = mux.SetURLVars(req, vars) + } + if query != nil { + q := req.URL.Query() + for k, v := range query { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + // We create a ResponseRecorder (which satisfies http.ResponseWriter) to record the response. + rr := httptest.NewRecorder() + handler := http.HandlerFunc(f) + + // Our handlers satisfy http.Handler, so we can call their ServeHTTP method + // directly and pass in our Request and ResponseRecorder. + handler.ServeHTTP(rr, req) + + time.Sleep(50 * time.Millisecond) + + // Check the status code is what we expect. + if status := rr.Code; status != code { + s := fmt.Sprintf("Wrong status code - got %v want %v", status, code) + return "", errors.New(s) + } + return string(rr.Body.String()), nil +} diff --git a/go-packages/meep-applications/application-store.go b/go-packages/meep-applications/application-store.go index e2ff041c6..d588ef54b 100644 --- a/go-packages/meep-applications/application-store.go +++ b/go-packages/meep-applications/application-store.go @@ -69,7 +69,7 @@ type ApplicationStore struct { mutex sync.Mutex } -var SysAppNames []string = []string{"meep-app-enablement", "meep-ams", "meep-loc-serv", "meep-rnis", "meep-wais", "meep-vis"} +var SysAppNames []string = []string{"meep-app-enablement", "meep-ams", "meep-loc-serv", "meep-rnis", "meep-wais", "meep-vis", "meep-dai", "meep-tm"} // NewApplicationStore - Creates and initialize an Application Store instance func NewApplicationStore(cfg *ApplicationStoreCfg) (as *ApplicationStore, err error) { diff --git a/go-packages/meep-bwm-client/.gitignore b/go-packages/meep-bwm-client/.gitignore new file mode 100644 index 000000000..daf913b1b --- /dev/null +++ b/go-packages/meep-bwm-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/go-packages/meep-bwm-client/.swagger-codegen-ignore b/go-packages/meep-bwm-client/.swagger-codegen-ignore new file mode 100644 index 000000000..c5fa491b4 --- /dev/null +++ b/go-packages/meep-bwm-client/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/go-packages/meep-bwm-client/.swagger-codegen/VERSION b/go-packages/meep-bwm-client/.swagger-codegen/VERSION new file mode 100644 index 000000000..0667b5ffc --- /dev/null +++ b/go-packages/meep-bwm-client/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.29 \ No newline at end of file diff --git a/go-packages/meep-bwm-client/.travis.yml b/go-packages/meep-bwm-client/.travis.yml new file mode 100644 index 000000000..f5cb2ce9a --- /dev/null +++ b/go-packages/meep-bwm-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/go-packages/meep-bwm-client/README.md b/go-packages/meep-bwm-client/README.md new file mode 100644 index 000000000..fcf42bce6 --- /dev/null +++ b/go-packages/meep-bwm-client/README.md @@ -0,0 +1,53 @@ +# Go API client for swagger + +Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 2.2.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./swagger" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/sandboxname/bwm/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BwmApi* | [**BandwidthAllocationDELETE**](docs/BwmApi.md#bandwidthallocationdelete) | **Delete** /bw_allocations/{allocationId} | Remove a specific bandwidthAllocation +*BwmApi* | [**BandwidthAllocationGET**](docs/BwmApi.md#bandwidthallocationget) | **Get** /bw_allocations/{allocationId} | Retrieve information about a specific bandwidthAllocation +*BwmApi* | [**BandwidthAllocationListGET**](docs/BwmApi.md#bandwidthallocationlistget) | **Get** /bw_allocations | Retrieve information about a list of bandwidthAllocation resources +*BwmApi* | [**BandwidthAllocationPATCH**](docs/BwmApi.md#bandwidthallocationpatch) | **Patch** /bw_allocations/{allocationId} | Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure +*BwmApi* | [**BandwidthAllocationPOST**](docs/BwmApi.md#bandwidthallocationpost) | **Post** /bw_allocations | Create a bandwidthAllocation resource +*BwmApi* | [**BandwidthAllocationPUT**](docs/BwmApi.md#bandwidthallocationput) | **Put** /bw_allocations/{allocationId} | Update the information about a specific bandwidthAllocation +*LocationApi* | [**Mec011AppTerminationPOST**](docs/LocationApi.md#mec011appterminationpost) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination + +## Documentation For Models + + - [AppTerminationNotification](docs/AppTerminationNotification.md) + - [AppTerminationNotificationLinks](docs/AppTerminationNotificationLinks.md) + - [BwInfo](docs/BwInfo.md) + - [BwInfoDeltas](docs/BwInfoDeltas.md) + - [BwInfoDeltasSessionFilter](docs/BwInfoDeltasSessionFilter.md) + - [BwInfoSessionFilter](docs/BwInfoSessionFilter.md) + - [BwInfoTimeStamp](docs/BwInfoTimeStamp.md) + - [LinkType](docs/LinkType.md) + - [OperationActionType](docs/OperationActionType.md) + - [ProblemDetails](docs/ProblemDetails.md) + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + +InterDigital Communications Inc +xFlow Research Inc. +FSCOM diff --git a/go-packages/meep-bwm-client/api/swagger.yaml b/go-packages/meep-bwm-client/api/swagger.yaml new file mode 100644 index 000000000..a3ae8cea3 --- /dev/null +++ b/go-packages/meep-bwm-client/api/swagger.yaml @@ -0,0 +1,803 @@ +openapi: 3.0.0 +info: + title: AdvantEDGE Bandwidth Management API + description: "Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI\ + \ MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)\ + \

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)\ + \

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)\ + \

**Type & Usage**
Edge Service used by edge applications that want to get\ + \ information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE\ + \ supports all Bandwidth Management API endpoints." + contact: + name: InterDigital AdvantEDGE Support + email: AdvantEDGE@InterDigital.com + license: + name: Apache 2.0 + url: https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE + version: 2.2.1 +externalDocs: + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf +servers: +- url: https://localhost/sandboxname/bwm/v1 +tags: +- name: bwm +paths: + /bw_allocations: + get: + tags: + - bwm + summary: Retrieve information about a list of bandwidthAllocation resources + description: Retrieves information about a list of bandwidthAllocation resources. + Typically used in 'Get configured bandwidth allocation from Bandwidth Management + Service' procedure as described in clause 6.2.5. + operationId: bandwidthAllocationListGET + parameters: + - name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids + as an input parameter to query the bandwidth allocation of a list of MEC + application instances. app_instance_id corresponds to appInsId defined in + table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the bandwidth allocation of a list of MEC application + instances. app_name corresponds to appName defined in table 7.2.2-1. See + note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the bandwidth allocation of a list of sessions. session_id corresponds + to allocationId defined in table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: "Upon success, a response body containing an array of the bandwidthAllocations\ + \ is returned." + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BwInfo' + x-content-type: application/json + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + post: + tags: + - bwm + summary: Create a bandwidthAllocation resource + description: Used to create a bandwidthAllocation resource. Typically used in + 'Register to Bandwidth Management Service' procedure as described in clause + 6.2.1. + operationId: bandwidthAllocationPOST + parameters: [] + requestBody: + description: Entity body in the request contains BwInfo to be created. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + required: true + responses: + "201": + description: "Upon success, the HTTP response shall include a 'Location'\ + \ HTTP header that contains the resource URI of the created resource." + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /bw_allocations/{allocationId}: + get: + tags: + - bwm + summary: Retrieve information about a specific bandwidthAllocation + description: Retrieves information about a bandwidthAllocation resource. Typically + used in 'Get configured bandwidth allocation from Bandwidth Management Service' + procedure as described in clause 6.2.5. + operationId: bandwidthAllocationGET + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + put: + tags: + - bwm + summary: Update the information about a specific bandwidthAllocation + description: "Updates the information about a bandwidthAllocation resource.\ + \ As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics." + operationId: bandwidthAllocationPUT + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: BwInfo with updated information is included as entity body of + the request. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + required: true + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts\ + \ when using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + delete: + tags: + - bwm + summary: Remove a specific bandwidthAllocation + description: Used in 'Unregister from Bandwidth Management Service' procedure + as described in clause 6.2.3. + operationId: bandwidthAllocationDELETE + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + patch: + tags: + - bwm + summary: Modify the information about a specific existing bandwidthAllocation + by sending updates on the data structure + description: "Updates the information about a bandwidthAllocation resource.\ + \ As specified in ETSI GS MEC 009 [6], the PATCH HTTP method updates a resource\ + \ on top of the existing resource state by just including the changes ('deltas')\ + \ in the request body." + operationId: bandwidthAllocationPATCH + parameters: + - name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: Description of the changes to instruct the server how to modify + the resource representation. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfoDeltas' + required: true + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/BwInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts\ + \ when using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /notifications/mec011/appTermination: + post: + tags: + - location + summary: MEC011 Application Termination notification for self termination + description: Terminates itself. + operationId: mec011AppTerminationPOST + requestBody: + description: Termination notification details + content: + application/json: + schema: + $ref: '#/components/schemas/AppTerminationNotification' + example: + notificationType: AppTerminationNotification + operationAction: TERMINATING + maxGracefulTimeout: 10 + links: + subscription: + href: http://mec011Server.example.com/mec_app_support/v1/applications/appId1234/subscriptions/sub123 + confirmTermination: + href: http://mec011Server.example.com/mec_app_support/v1/confirm_termination + required: true + responses: + "204": + description: No Content + x-swagger-router-controller: notifications +components: + schemas: + BwInfo: + required: + - allocationDirection + - appInsId + - fixedAllocation + - requestType + type: object + properties: + allocationId: + type: string + description: Bandwidth allocation instance identifier + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + allocationDirection: + type: string + description: "The direction of the requested BW allocation: 00 = Downlink\ + \ (towards the UE) 01 = Uplink (towards the application/session) 10 =\ + \ Symmetrical" + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appInsId: + type: string + description: Application instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appName: + type: string + description: Name of the application + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + fixedAllocation: + type: string + description: "Size of requested fixed BW allocation in [bps]" + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + fixedBWPriority: + type: string + description: Indicates the allocation priority when dealing with several + applications or sessions in parallel. Values are not defined in the present + document + enum: + - SEE_DESCRIPTION + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Enum + requestType: + type: integer + description: "Numeric value (0 - 255) corresponding to specific type of\ + \ consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION" + enum: + - 0 + - 1 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Enum_inlined + sessionFilter: + minItems: 0 + type: array + description: "Session filtering criteria, applicable when requestType is\ + \ set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall\ + \ define a single session only. In case multiple sessions match sessionFilter\ + \ the request shall be rejected" + items: + $ref: '#/components/schemas/BwInfo_sessionFilter' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: Structure (inlined) + timeStamp: + $ref: '#/components/schemas/BwInfo_timeStamp' + example: + timeStamp: + seconds: 1 + nanoSeconds: 6 + allocationDirection: allocationDirection + fixedBWPriority: SEE_DESCRIPTION + requestType: 0 + sessionFilter: + - protocol: protocol + sourcePort: sourcePort + dstPort: dstPort + sourceIp: sourceIp + dstAddress: dstAddress + - protocol: protocol + sourcePort: sourcePort + dstPort: dstPort + sourceIp: sourceIp + dstAddress: dstAddress + appName: appName + allocationId: allocationId + appInsId: appInsId + fixedAllocation: fixedAllocation + x-etsi-ref: 7.2.2 + BwInfoDeltas: + required: + - appInsId + - requestType + type: object + properties: + allocationId: + type: string + description: Bandwidth allocation instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + allocationDirection: + type: string + description: "The direction of the requested BW allocation: 00 = Downlink\ + \ (towards the UE) 01 = Uplink (towards the application/session) 10 =\ + \ Symmetrical" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appInsId: + type: string + description: Application instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + fixedAllocation: + type: string + description: "Size of requested fixed BW allocation in [bps]" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + fixedBWPriority: + type: string + description: Indicates the allocation priority when dealing with several + applications or sessions in parallel. Values are not defined in the present + document + enum: + - SEE DESCRIPTION + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Enum_inlined + requestType: + type: integer + description: "Numeric value (0 - 255) corresponding to specific type of\ + \ consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION" + enum: + - 0 + - 1 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Enum_inlined + sessionFilter: + minItems: 0 + type: array + description: "Session filtering criteria, applicable when requestType is\ + \ set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall\ + \ define a single session only. In case multiple sessions match sessionFilter\ + \ the request shall be rejected" + items: + $ref: '#/components/schemas/BwInfoDeltas_sessionFilter' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: Structure (inlined) + x-etsi-ref: 7.2.3 + ProblemDetails: + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + description: A URI reference that identifies the specific occurrence of + the problem + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + status: + type: integer + description: The HTTP status code for this occurrence of the problem + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + title: + type: string + description: "A short, human-readable summary of the problem type" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + type: + type: string + description: A URI reference according to IETF RFC 3986 that identifies + the problem type + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + AppTerminationNotification: + required: + - _links + - maxGracefulTimeout + - notificationType + - operationAction + type: object + properties: + notificationType: + type: string + description: Shall be set to AppTerminationNotification. + operationAction: + $ref: '#/components/schemas/OperationActionType' + maxGracefulTimeout: + type: integer + description: Maximum timeout value in seconds for graceful termination or + graceful stop of an application instance. + format: uint32 + _links: + $ref: '#/components/schemas/AppTerminationNotification__links' + description: This type represents the information that the MEC platform notifies + the subscribed application instance about the corresponding application instance + termination/stop. + OperationActionType: + type: string + description: Operation that is being performed on the MEC application instance. + enum: + - STOPPING + - TERMINATING + LinkType: + required: + - href + type: object + properties: + href: + type: string + description: URI referring to a resource + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uri + x-etsi-ref: 6.5.2 + BwInfo_sessionFilter: + type: object + properties: + dstAddress: + type: string + description: "Destination address identity of session. The string for a\ + \ IPv4 address shall be formatted in the \"dotted decimal\" notation as\ + \ defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be\ + \ formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR\ + \ notation [12] used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + dstPort: + type: string + description: Destination port identity of session + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + protocol: + type: string + description: Protocol number + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourceIp: + type: string + description: "Source address identity of session. The string for a IPv4\ + \ address shall be formatted in the \"dotted decimal\" notation as defined\ + \ in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted\ + \ according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12]\ + \ used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourcePort: + type: string + description: Source port identity of session + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + example: + protocol: protocol + sourcePort: sourcePort + dstPort: dstPort + sourceIp: sourceIp + dstAddress: dstAddress + BwInfo_timeStamp: + required: + - nanoSeconds + - seconds + type: object + properties: + nanoSeconds: + type: integer + description: "The nanoseconds part of the Time. Time is defined as Unix-time\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + seconds: + type: integer + description: "The seconds part of the Time. Time is defined as Unixtime\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + description: Time stamp to indicate when the corresponding information elements + are sent + example: + seconds: 1 + nanoSeconds: 6 + BwInfoDeltas_sessionFilter: + type: object + properties: + dstAddress: + type: string + description: "Destination address identity of session. The string for a\ + \ IPv4 address shall be formatted in the \"dotted decimal\" notation as\ + \ defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be\ + \ formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR\ + \ notation [12] used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + dstPort: + type: string + description: Destination port identity of session + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + protocol: + type: string + description: Protocol number + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourceIp: + type: string + description: "Source address identity of session. The string for a IPv4\ + \ address shall be formatted in the \"dotted decimal\" notation as defined\ + \ in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted\ + \ according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12]\ + \ used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourcePort: + type: string + description: 'Source port identity of session ' + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + AppTerminationNotification__links: + required: + - subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/LinkType' + confirmTermination: + $ref: '#/components/schemas/LinkType' + description: Object containing hyperlinks related to the resource. + responses: + "204": + description: "Upon success, a response 204 No Content without any response body\ + \ is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot be\ + \ mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts when\ + \ using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Path.allocationId: + name: allocationId + in: path + description: Represents a bandwidth allocation instance + required: true + style: simple + explode: false + schema: + type: string + Query.app_instance_id: + name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids as + an input parameter to query the bandwidth allocation of a list of MEC application + instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.app_name: + name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the bandwidth allocation of a list of MEC application instances. + app_name corresponds to appName defined in table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.session_id: + name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the bandwidth allocation of a list of sessions. session_id corresponds + to allocationId defined in table 7.2.2-1. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string diff --git a/go-packages/meep-bwm-client/api_bwm.go b/go-packages/meep-bwm-client/api_bwm.go new file mode 100644 index 000000000..6911736f6 --- /dev/null +++ b/go-packages/meep-bwm-client/api_bwm.go @@ -0,0 +1,816 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "context" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type BwmApiService service + +/* +BwmApiService Remove a specific bandwidthAllocation +Used in 'Unregister from Bandwidth Management Service' procedure as described in clause 6.2.3. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param allocationId Represents a bandwidth allocation instance + +*/ + +func (a *BwmApiService) Mec011AppTerminationPOST(ctx context.Context, body AppTerminationNotification) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/notifications/mec011/appTermination" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +func (a *BwmApiService) BandwidthAllocationDELETE(ctx context.Context, allocationId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bw_allocations/{allocationId}" + localVarPath = strings.Replace(localVarPath, "{"+"allocationId"+"}", fmt.Sprintf("%v", allocationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +BwmApiService Retrieve information about a specific bandwidthAllocation +Retrieves information about a bandwidthAllocation resource. Typically used in 'Get configured bandwidth allocation from Bandwidth Management Service' procedure as described in clause 6.2.5. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param allocationId Represents a bandwidth allocation instance +@return BwInfo +*/ +func (a *BwmApiService) BandwidthAllocationGET(ctx context.Context, allocationId string) (BwInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue BwInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bw_allocations/{allocationId}" + localVarPath = strings.Replace(localVarPath, "{"+"allocationId"+"}", fmt.Sprintf("%v", allocationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v BwInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BwmApiService Retrieve information about a list of bandwidthAllocation resources +Retrieves information about a list of bandwidthAllocation resources. Typically used in 'Get configured bandwidth allocation from Bandwidth Management Service' procedure as described in clause 6.2.5. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BwmApiBandwidthAllocationListGETOpts - Optional Parameters: + * @param "AppInstanceId" (optional.Interface of []string) - A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note. + * @param "AppName" (optional.Interface of []string) - A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note. + * @param "SessionId" (optional.Interface of []string) - A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note. +@return []BwInfo +*/ + +type BwmApiBandwidthAllocationListGETOpts struct { + AppInstanceId optional.Interface + AppName optional.Interface + SessionId optional.Interface +} + +func (a *BwmApiService) BandwidthAllocationListGET(ctx context.Context, localVarOptionals *BwmApiBandwidthAllocationListGETOpts) ([]BwInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []BwInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bw_allocations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AppInstanceId.IsSet() { + localVarQueryParams.Add("app_instance_id", parameterToString(localVarOptionals.AppInstanceId.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.AppName.IsSet() { + localVarQueryParams.Add("app_name", parameterToString(localVarOptionals.AppName.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.SessionId.IsSet() { + localVarQueryParams.Add("session_id", parameterToString(localVarOptionals.SessionId.Value(), "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []BwInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BwmApiService Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure +Updates the information about a bandwidthAllocation resource. As specified in ETSI GS MEC 009 [6], the PATCH HTTP method updates a resource on top of the existing resource state by just including the changes ('deltas') in the request body. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Description of the changes to instruct the server how to modify the resource representation. + * @param allocationId Represents a bandwidth allocation instance +@return BwInfo +*/ +func (a *BwmApiService) BandwidthAllocationPATCH(ctx context.Context, body BwInfoDeltas, allocationId string) (BwInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue BwInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bw_allocations/{allocationId}" + localVarPath = strings.Replace(localVarPath, "{"+"allocationId"+"}", fmt.Sprintf("%v", allocationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v BwInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 412 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BwmApiService Create a bandwidthAllocation resource +Used to create a bandwidthAllocation resource. Typically used in 'Register to Bandwidth Management Service' procedure as described in clause 6.2.1. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Entity body in the request contains BwInfo to be created. +@return BwInfo +*/ +func (a *BwmApiService) BandwidthAllocationPOST(ctx context.Context, body BwInfo) (BwInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue BwInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bw_allocations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v BwInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BwmApiService Update the information about a specific bandwidthAllocation +Updates the information about a bandwidthAllocation resource. As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body BwInfo with updated information is included as entity body of the request. + * @param allocationId Represents a bandwidth allocation instance +@return BwInfo +*/ +func (a *BwmApiService) BandwidthAllocationPUT(ctx context.Context, body BwInfo, allocationId string) (BwInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue BwInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bw_allocations/{allocationId}" + localVarPath = strings.Replace(localVarPath, "{"+"allocationId"+"}", fmt.Sprintf("%v", allocationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v BwInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 412 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/go-packages/meep-bwm-client/client.go b/go-packages/meep-bwm-client/client.go new file mode 100644 index 000000000..598f4e8d8 --- /dev/null +++ b/go-packages/meep-bwm-client/client.go @@ -0,0 +1,488 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the AdvantEDGE Bandwidth Management API API v2.2.1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + BwmApi *BwmApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.BwmApi = (*BwmApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/go-packages/meep-bwm-client/configuration.go b/go-packages/meep-bwm-client/configuration.go new file mode 100644 index 000000000..d3c6998b8 --- /dev/null +++ b/go-packages/meep-bwm-client/configuration.go @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://localhost/sandboxname/bwm/v2", + DefaultHeader: make(map[string]string), + UserAgent: "Swagger-Codegen/1.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/go-packages/meep-bwm-client/docs/AppTerminationNotification.md b/go-packages/meep-bwm-client/docs/AppTerminationNotification.md new file mode 100644 index 000000000..8156e455d --- /dev/null +++ b/go-packages/meep-bwm-client/docs/AppTerminationNotification.md @@ -0,0 +1,12 @@ +# AppTerminationNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationType** | **string** | Shall be set to AppTerminationNotification. | [default to null] +**OperationAction** | [***OperationActionType**](OperationActionType.md) | | [default to null] +**MaxGracefulTimeout** | **int32** | Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. | [default to null] +**Links** | [***AppTerminationNotificationLinks**](AppTerminationNotification__links.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/AppTerminationNotificationLinks.md b/go-packages/meep-bwm-client/docs/AppTerminationNotificationLinks.md new file mode 100644 index 000000000..67d7f0d90 --- /dev/null +++ b/go-packages/meep-bwm-client/docs/AppTerminationNotificationLinks.md @@ -0,0 +1,10 @@ +# AppTerminationNotificationLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | [***LinkType**](LinkType.md) | | [default to null] +**ConfirmTermination** | [***LinkType**](LinkType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/BwInfo.md b/go-packages/meep-bwm-client/docs/BwInfo.md new file mode 100644 index 000000000..e30234abf --- /dev/null +++ b/go-packages/meep-bwm-client/docs/BwInfo.md @@ -0,0 +1,17 @@ +# BwInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllocationId** | **string** | Bandwidth allocation instance identifier | [optional] [default to null] +**AllocationDirection** | **string** | The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical | [default to null] +**AppInsId** | **string** | Application instance identifier | [default to null] +**AppName** | **string** | Name of the application | [optional] [default to null] +**FixedAllocation** | **string** | Size of requested fixed BW allocation in [bps] | [default to null] +**FixedBWPriority** | **string** | Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document | [optional] [default to null] +**RequestType** | **int32** | Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION | [default to null] +**SessionFilter** | [**[]BwInfoSessionFilter**](BwInfo_sessionFilter.md) | Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected | [optional] [default to null] +**TimeStamp** | [***BwInfoTimeStamp**](BwInfo_timeStamp.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/BwInfoDeltas.md b/go-packages/meep-bwm-client/docs/BwInfoDeltas.md new file mode 100644 index 000000000..913fc95ed --- /dev/null +++ b/go-packages/meep-bwm-client/docs/BwInfoDeltas.md @@ -0,0 +1,15 @@ +# BwInfoDeltas + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllocationId** | **string** | Bandwidth allocation instance identifier | [optional] [default to null] +**AllocationDirection** | **string** | The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical | [optional] [default to null] +**AppInsId** | **string** | Application instance identifier | [default to null] +**FixedAllocation** | **string** | Size of requested fixed BW allocation in [bps] | [optional] [default to null] +**FixedBWPriority** | **string** | Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document | [optional] [default to null] +**RequestType** | **int32** | Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION | [default to null] +**SessionFilter** | [**[]BwInfoDeltasSessionFilter**](BwInfoDeltas_sessionFilter.md) | Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/BwInfoDeltasSessionFilter.md b/go-packages/meep-bwm-client/docs/BwInfoDeltasSessionFilter.md new file mode 100644 index 000000000..01e34e8ff --- /dev/null +++ b/go-packages/meep-bwm-client/docs/BwInfoDeltasSessionFilter.md @@ -0,0 +1,13 @@ +# BwInfoDeltasSessionFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DstAddress** | **string** | Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**DstPort** | **string** | Destination port identity of session | [optional] [default to null] +**Protocol** | **string** | Protocol number | [optional] [default to null] +**SourceIp** | **string** | Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**SourcePort** | **string** | Source port identity of session | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/BwInfoSessionFilter.md b/go-packages/meep-bwm-client/docs/BwInfoSessionFilter.md new file mode 100644 index 000000000..81498c3ac --- /dev/null +++ b/go-packages/meep-bwm-client/docs/BwInfoSessionFilter.md @@ -0,0 +1,13 @@ +# BwInfoSessionFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DstAddress** | **string** | Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**DstPort** | **string** | Destination port identity of session | [optional] [default to null] +**Protocol** | **string** | Protocol number | [optional] [default to null] +**SourceIp** | **string** | Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**SourcePort** | **string** | Source port identity of session | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/BwInfoTimeStamp.md b/go-packages/meep-bwm-client/docs/BwInfoTimeStamp.md new file mode 100644 index 000000000..6c5af850b --- /dev/null +++ b/go-packages/meep-bwm-client/docs/BwInfoTimeStamp.md @@ -0,0 +1,10 @@ +# BwInfoTimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NanoSeconds** | **int32** | The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] +**Seconds** | **int32** | The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/BwmApi.md b/go-packages/meep-bwm-client/docs/BwmApi.md new file mode 100644 index 000000000..73820c334 --- /dev/null +++ b/go-packages/meep-bwm-client/docs/BwmApi.md @@ -0,0 +1,191 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/bwm/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**BandwidthAllocationDELETE**](BwmApi.md#BandwidthAllocationDELETE) | **Delete** /bw_allocations/{allocationId} | Remove a specific bandwidthAllocation +[**BandwidthAllocationGET**](BwmApi.md#BandwidthAllocationGET) | **Get** /bw_allocations/{allocationId} | Retrieve information about a specific bandwidthAllocation +[**BandwidthAllocationListGET**](BwmApi.md#BandwidthAllocationListGET) | **Get** /bw_allocations | Retrieve information about a list of bandwidthAllocation resources +[**BandwidthAllocationPATCH**](BwmApi.md#BandwidthAllocationPATCH) | **Patch** /bw_allocations/{allocationId} | Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure +[**BandwidthAllocationPOST**](BwmApi.md#BandwidthAllocationPOST) | **Post** /bw_allocations | Create a bandwidthAllocation resource +[**BandwidthAllocationPUT**](BwmApi.md#BandwidthAllocationPUT) | **Put** /bw_allocations/{allocationId} | Update the information about a specific bandwidthAllocation + +# **BandwidthAllocationDELETE** +> BandwidthAllocationDELETE(ctx, allocationId) +Remove a specific bandwidthAllocation + +Used in 'Unregister from Bandwidth Management Service' procedure as described in clause 6.2.3. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationGET** +> BwInfo BandwidthAllocationGET(ctx, allocationId) +Retrieve information about a specific bandwidthAllocation + +Retrieves information about a bandwidthAllocation resource. Typically used in 'Get configured bandwidth allocation from Bandwidth Management Service' procedure as described in clause 6.2.5. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationListGET** +> []BwInfo BandwidthAllocationListGET(ctx, optional) +Retrieve information about a list of bandwidthAllocation resources + +Retrieves information about a list of bandwidthAllocation resources. Typically used in 'Get configured bandwidth allocation from Bandwidth Management Service' procedure as described in clause 6.2.5. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BwmApiBandwidthAllocationListGETOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BwmApiBandwidthAllocationListGETOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appInstanceId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note. | + **appName** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note. | + **sessionId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note. | + +### Return type + +[**[]BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationPATCH** +> BwInfo BandwidthAllocationPATCH(ctx, body, allocationId) +Modify the information about a specific existing bandwidthAllocation by sending updates on the data structure + +Updates the information about a bandwidthAllocation resource. As specified in ETSI GS MEC 009 [6], the PATCH HTTP method updates a resource on top of the existing resource state by just including the changes ('deltas') in the request body. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**BwInfoDeltas**](BwInfoDeltas.md)| Description of the changes to instruct the server how to modify the resource representation. | + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationPOST** +> BwInfo BandwidthAllocationPOST(ctx, body) +Create a bandwidthAllocation resource + +Used to create a bandwidthAllocation resource. Typically used in 'Register to Bandwidth Management Service' procedure as described in clause 6.2.1. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**BwInfo**](BwInfo.md)| Entity body in the request contains BwInfo to be created. | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BandwidthAllocationPUT** +> BwInfo BandwidthAllocationPUT(ctx, body, allocationId) +Update the information about a specific bandwidthAllocation + +Updates the information about a bandwidthAllocation resource. As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**BwInfo**](BwInfo.md)| BwInfo with updated information is included as entity body of the request. | + **allocationId** | **string**| Represents a bandwidth allocation instance | + +### Return type + +[**BwInfo**](BwInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/LinkType.md b/go-packages/meep-bwm-client/docs/LinkType.md new file mode 100644 index 000000000..a8945efcd --- /dev/null +++ b/go-packages/meep-bwm-client/docs/LinkType.md @@ -0,0 +1,9 @@ +# LinkType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | URI referring to a resource | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/LocationApi.md b/go-packages/meep-bwm-client/docs/LocationApi.md new file mode 100644 index 000000000..18eeda17b --- /dev/null +++ b/go-packages/meep-bwm-client/docs/LocationApi.md @@ -0,0 +1,36 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/bwm/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Mec011AppTerminationPOST**](LocationApi.md#Mec011AppTerminationPOST) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination + +# **Mec011AppTerminationPOST** +> Mec011AppTerminationPOST(ctx, body) +MEC011 Application Termination notification for self termination + +Terminates itself. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppTerminationNotification**](AppTerminationNotification.md)| Termination notification details | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/OperationActionType.md b/go-packages/meep-bwm-client/docs/OperationActionType.md new file mode 100644 index 000000000..4078c9e76 --- /dev/null +++ b/go-packages/meep-bwm-client/docs/OperationActionType.md @@ -0,0 +1,8 @@ +# OperationActionType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/docs/ProblemDetails.md b/go-packages/meep-bwm-client/docs/ProblemDetails.md new file mode 100644 index 000000000..d6f1dfeb6 --- /dev/null +++ b/go-packages/meep-bwm-client/docs/ProblemDetails.md @@ -0,0 +1,13 @@ +# ProblemDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | **string** | A human-readable explanation specific to this occurrence of the problem | [optional] [default to null] +**Instance** | **string** | A URI reference that identifies the specific occurrence of the problem | [optional] [default to null] +**Status** | **int32** | The HTTP status code for this occurrence of the problem | [optional] [default to null] +**Title** | **string** | A short, human-readable summary of the problem type | [optional] [default to null] +**Type_** | **string** | A URI reference according to IETF RFC 3986 that identifies the problem type | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-bwm-client/git_push.sh b/go-packages/meep-bwm-client/git_push.sh new file mode 100644 index 000000000..ae01b182a --- /dev/null +++ b/go-packages/meep-bwm-client/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/go-packages/meep-bwm-client/go.mod b/go-packages/meep-bwm-client/go.mod new file mode 100644 index 000000000..6c82ba8b2 --- /dev/null +++ b/go-packages/meep-bwm-client/go.mod @@ -0,0 +1,15 @@ +module github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-bwm-client + +go 1.17 + +require ( + github.com/antihax/optional v1.0.0 + golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c +) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect +) diff --git a/go-packages/meep-bwm-client/go.sum b/go-packages/meep-bwm-client/go.sum new file mode 100644 index 000000000..c6f9012ad --- /dev/null +++ b/go-packages/meep-bwm-client/go.sum @@ -0,0 +1,639 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c h1:q3gFqPqH7NVofKo3c3yETAP//pPI+G5mvB7qqj1Y5kY= +golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/go-packages/meep-bwm-client/model_app_termination_notification.go b/go-packages/meep-bwm-client/model_app_termination_notification.go new file mode 100644 index 000000000..540ad9951 --- /dev/null +++ b/go-packages/meep-bwm-client/model_app_termination_notification.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// This type represents the information that the MEC platform notifies the subscribed application instance about the corresponding application instance termination/stop. +type AppTerminationNotification struct { + // Shall be set to AppTerminationNotification. + NotificationType string `json:"notificationType"` + OperationAction *OperationActionType `json:"operationAction"` + // Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. + MaxGracefulTimeout int32 `json:"maxGracefulTimeout"` + Links *AppTerminationNotificationLinks `json:"_links"` +} diff --git a/go-packages/meep-bwm-client/model_app_termination_notification__links.go b/go-packages/meep-bwm-client/model_app_termination_notification__links.go new file mode 100644 index 000000000..90548a7d6 --- /dev/null +++ b/go-packages/meep-bwm-client/model_app_termination_notification__links.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Object containing hyperlinks related to the resource. +type AppTerminationNotificationLinks struct { + Subscription *LinkType `json:"subscription"` + ConfirmTermination *LinkType `json:"confirmTermination,omitempty"` +} diff --git a/go-packages/meep-bwm-client/model_bw_info.go b/go-packages/meep-bwm-client/model_bw_info.go new file mode 100644 index 000000000..cbda212c9 --- /dev/null +++ b/go-packages/meep-bwm-client/model_bw_info.go @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type BwInfo struct { + // Bandwidth allocation instance identifier + AllocationId string `json:"allocationId,omitempty"` + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + AllocationDirection string `json:"allocationDirection"` + // Application instance identifier + AppInsId string `json:"appInsId"` + // Name of the application + AppName string `json:"appName,omitempty"` + // Size of requested fixed BW allocation in [bps] + FixedAllocation string `json:"fixedAllocation"` + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + FixedBWPriority string `json:"fixedBWPriority,omitempty"` + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + RequestType int32 `json:"requestType"` + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + SessionFilter []BwInfoSessionFilter `json:"sessionFilter,omitempty"` + TimeStamp *BwInfoTimeStamp `json:"timeStamp,omitempty"` +} diff --git a/go-packages/meep-bwm-client/model_bw_info_deltas.go b/go-packages/meep-bwm-client/model_bw_info_deltas.go new file mode 100644 index 000000000..d14fac772 --- /dev/null +++ b/go-packages/meep-bwm-client/model_bw_info_deltas.go @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type BwInfoDeltas struct { + // Bandwidth allocation instance identifier + AllocationId string `json:"allocationId,omitempty"` + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + AllocationDirection string `json:"allocationDirection,omitempty"` + // Application instance identifier + AppInsId string `json:"appInsId"` + // Size of requested fixed BW allocation in [bps] + FixedAllocation string `json:"fixedAllocation,omitempty"` + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + FixedBWPriority string `json:"fixedBWPriority,omitempty"` + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + RequestType int32 `json:"requestType"` + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + SessionFilter []BwInfoDeltasSessionFilter `json:"sessionFilter,omitempty"` +} diff --git a/go-packages/meep-bwm-client/model_bw_info_deltas_session_filter.go b/go-packages/meep-bwm-client/model_bw_info_deltas_session_filter.go new file mode 100644 index 000000000..5344bd96b --- /dev/null +++ b/go-packages/meep-bwm-client/model_bw_info_deltas_session_filter.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type BwInfoDeltasSessionFilter struct { + // Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + DstAddress string `json:"dstAddress,omitempty"` + // Destination port identity of session + DstPort string `json:"dstPort,omitempty"` + // Protocol number + Protocol string `json:"protocol,omitempty"` + // Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + SourceIp string `json:"sourceIp,omitempty"` + // Source port identity of session + SourcePort string `json:"sourcePort,omitempty"` +} diff --git a/go-packages/meep-bwm-client/model_bw_info_session_filter.go b/go-packages/meep-bwm-client/model_bw_info_session_filter.go new file mode 100644 index 000000000..ad27a9906 --- /dev/null +++ b/go-packages/meep-bwm-client/model_bw_info_session_filter.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type BwInfoSessionFilter struct { + // Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + DstAddress string `json:"dstAddress,omitempty"` + // Destination port identity of session + DstPort string `json:"dstPort,omitempty"` + // Protocol number + Protocol string `json:"protocol,omitempty"` + // Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + SourceIp string `json:"sourceIp,omitempty"` + // Source port identity of session + SourcePort string `json:"sourcePort,omitempty"` +} diff --git a/go-packages/meep-bwm-client/model_bw_info_time_stamp.go b/go-packages/meep-bwm-client/model_bw_info_time_stamp.go new file mode 100644 index 000000000..84980bb63 --- /dev/null +++ b/go-packages/meep-bwm-client/model_bw_info_time_stamp.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Time stamp to indicate when the corresponding information elements are sent +type BwInfoTimeStamp struct { + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + NanoSeconds int32 `json:"nanoSeconds"` + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + Seconds int32 `json:"seconds"` +} diff --git a/go-packages/meep-bwm-client/model_link_type.go b/go-packages/meep-bwm-client/model_link_type.go new file mode 100644 index 000000000..1386eeaf0 --- /dev/null +++ b/go-packages/meep-bwm-client/model_link_type.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type LinkType struct { + // URI referring to a resource + Href string `json:"href"` +} diff --git a/go-packages/meep-bwm-client/model_operation_action_type.go b/go-packages/meep-bwm-client/model_operation_action_type.go new file mode 100644 index 000000000..efdd2d917 --- /dev/null +++ b/go-packages/meep-bwm-client/model_operation_action_type.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// OperationActionType : Operation that is being performed on the MEC application instance. +type OperationActionType string + +// List of OperationActionType +const ( + STOPPING_OperationActionType OperationActionType = "STOPPING" + TERMINATING_OperationActionType OperationActionType = "TERMINATING" +) diff --git a/go-packages/meep-bwm-client/model_problem_details.go b/go-packages/meep-bwm-client/model_problem_details.go new file mode 100644 index 000000000..8837a14ee --- /dev/null +++ b/go-packages/meep-bwm-client/model_problem_details.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ProblemDetails struct { + // A human-readable explanation specific to this occurrence of the problem + Detail string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem + Instance string `json:"instance,omitempty"` + // The HTTP status code for this occurrence of the problem + Status int32 `json:"status,omitempty"` + // A short, human-readable summary of the problem type + Title string `json:"title,omitempty"` + // A URI reference according to IETF RFC 3986 that identifies the problem type + Type_ string `json:"type,omitempty"` +} diff --git a/go-packages/meep-bwm-client/response.go b/go-packages/meep-bwm-client/response.go new file mode 100644 index 000000000..37e16e155 --- /dev/null +++ b/go-packages/meep-bwm-client/response.go @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Bandwidth Management API + * + * Bandwidth Management Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/bwm)

**Type & Usage**
Edge Service used by edge applications that want to get information about BWM Info and Session(s) in the network

**Note**
AdvantEDGE supports all Bandwidth Management API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/go-packages/meep-mts-client/.gitignore b/go-packages/meep-mts-client/.gitignore new file mode 100644 index 000000000..daf913b1b --- /dev/null +++ b/go-packages/meep-mts-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/go-packages/meep-mts-client/.swagger-codegen-ignore b/go-packages/meep-mts-client/.swagger-codegen-ignore new file mode 100644 index 000000000..c5fa491b4 --- /dev/null +++ b/go-packages/meep-mts-client/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/go-packages/meep-mts-client/.swagger-codegen/VERSION b/go-packages/meep-mts-client/.swagger-codegen/VERSION new file mode 100644 index 000000000..0667b5ffc --- /dev/null +++ b/go-packages/meep-mts-client/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.29 \ No newline at end of file diff --git a/go-packages/meep-mts-client/.travis.yml b/go-packages/meep-mts-client/.travis.yml new file mode 100644 index 000000000..f5cb2ce9a --- /dev/null +++ b/go-packages/meep-mts-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/go-packages/meep-mts-client/README.md b/go-packages/meep-mts-client/README.md new file mode 100644 index 000000000..dfeec044b --- /dev/null +++ b/go-packages/meep-mts-client/README.md @@ -0,0 +1,53 @@ +# Go API client for swagger + +Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 2.2.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./swagger" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/sandboxname/mts/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*MtsApi* | [**Mec011AppTerminationPOST**](docs/MtsApi.md#mec011appterminationpost) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination +*MtsApi* | [**MtsCapabilityInfoGET**](docs/MtsApi.md#mtscapabilityinfoget) | **Get** /mts_capability_info | Retrieve the MTS capability informations +*MtsApi* | [**MtsSessionDELETE**](docs/MtsApi.md#mtssessiondelete) | **Delete** /mts_sessions/{sessionId} | Remove specific MTS session +*MtsApi* | [**MtsSessionGET**](docs/MtsApi.md#mtssessionget) | **Get** /mts_sessions/{sessionId} | Retrieve information about specific MTS session +*MtsApi* | [**MtsSessionPOST**](docs/MtsApi.md#mtssessionpost) | **Post** /mts_sessions | Create a MTS session +*MtsApi* | [**MtsSessionPUT**](docs/MtsApi.md#mtssessionput) | **Put** /mts_sessions/{sessionId} | Update the information about specific MTS session +*MtsApi* | [**MtsSessionsListGET**](docs/MtsApi.md#mtssessionslistget) | **Get** /mts_sessions | Retrieve information about a list of MTS sessions + +## Documentation For Models + + - [AppTerminationNotification](docs/AppTerminationNotification.md) + - [AppTerminationNotificationLinks](docs/AppTerminationNotificationLinks.md) + - [LinkType](docs/LinkType.md) + - [MtsCapabilityInfo](docs/MtsCapabilityInfo.md) + - [MtsCapabilityInfoMtsAccessInfo](docs/MtsCapabilityInfoMtsAccessInfo.md) + - [MtsCapabilityInfoTimeStamp](docs/MtsCapabilityInfoTimeStamp.md) + - [MtsSessionInfo](docs/MtsSessionInfo.md) + - [MtsSessionInfoFlowFilter](docs/MtsSessionInfoFlowFilter.md) + - [MtsSessionInfoQosD](docs/MtsSessionInfoQosD.md) + - [MtsSessionInfoTimeStamp](docs/MtsSessionInfoTimeStamp.md) + - [OperationActionType](docs/OperationActionType.md) + - [ProblemDetails](docs/ProblemDetails.md) + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + +AdvantEDGE@InterDigital.com diff --git a/go-packages/meep-mts-client/api/swagger.yaml b/go-packages/meep-mts-client/api/swagger.yaml new file mode 100644 index 000000000..f4da7d460 --- /dev/null +++ b/go-packages/meep-mts-client/api/swagger.yaml @@ -0,0 +1,876 @@ +openapi: 3.0.0 +info: + title: AdvantEDGE Multi-access Traffic Steering API + description: "Multi-access Traffic Steering Sercice is AdvantEDGE's implementation\ + \ of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)\ + \

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)\ + \

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)\ + \

**Type & Usage**
Edge Service used by edge applications that want to get\ + \ information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE\ + \ supports all Multi-access Traffic Steering API endpoints." + contact: + name: InterDigital AdvantEDGE Support + email: AdvantEDGE@InterDigital.com + license: + name: Apache 2.0 + url: https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE + version: 2.2.1 +externalDocs: + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf +servers: +- url: https://localhost/sandboxname/mts/v1 +tags: +- name: mts +paths: + /mts_capability_info: + get: + tags: + - mts + summary: Retrieve the MTS capability informations + description: Used to query information about the MTS information. Typically + used in the 'Get MTS service Info from the MTS Service' procedure as described + in clause 6.2.6. + operationId: mtsCapabilityInfoGET + parameters: [] + responses: + "200": + description: "Upon success, a response body containing the MTS capability\ + \ information is returned." + content: + application/json: + schema: + $ref: '#/components/schemas/MtsCapabilityInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /mts_sessions: + get: + tags: + - mts + summary: Retrieve information about a list of MTS sessions + description: Retrieves information about a list of MTS sessions. Typically used + in the 'Get configured MTS Session Info from the MTS Service' procedure as + described in clause 6.2.10. + operationId: mtsSessionsListGET + parameters: + - name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids + as an input parameter to query the MTS session of a list of MEC application + instances. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the MTS session of a list of MEC application instances. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the information of a list of MTS sessions. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: "Upon success, a response body containing an array of the MTS\ + \ sessions is returned." + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MtsSessionInfo' + x-content-type: application/json + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + post: + tags: + - mts + summary: Create a MTS session + description: Used to create a MTS session. This method is typically used in + 'Register application to the MTS Service' procedure as described in clause + 6.2.7. + operationId: mtsSessionPOST + parameters: [] + requestBody: + description: Entity body in the request contains MtsSessionInfo to be created. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + required: true + responses: + "201": + description: "Upon success, the HTTP response shall include a 'Location'\ + \ HTTP header that contains the resource URI of the created resource." + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /mts_sessions/{sessionId}: + get: + tags: + - mts + summary: Retrieve information about specific MTS session + description: Retrieves information about an individual MTS session. Typically + used in the 'Get configured MTS Session Info from the MTS Service' procedure + as described in clause 6.2.10. + operationId: mtsSessionGET + parameters: + - name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + put: + tags: + - mts + summary: Update the information about specific MTS session + description: "Updates the information about an individual MTS session. As specified\ + \ in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. " + operationId: mtsSessionPUT + parameters: + - name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: MtsSessionInfo with updated information is included as entity + body of the request. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + required: true + responses: + "200": + description: Used to indicate nonspecific success. The response body contains + a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MtsSessionInfo' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts\ + \ when using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + delete: + tags: + - mts + summary: Remove specific MTS session + description: DELETE method is typically used in 'Unregister from the MTS Service' + procedure as described in clause 6.2.8. + operationId: mtsSessionDELETE + parameters: + - name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /notifications/mec011/appTermination: + post: + tags: + - mts + summary: MEC011 Application Termination notification for self termination + description: Terminates itself. + operationId: mec011AppTerminationPOST + requestBody: + description: Termination notification details + content: + application/json: + schema: + $ref: '#/components/schemas/AppTerminationNotification' + example: + notificationType: AppTerminationNotification + operationAction: TERMINATING + maxGracefulTimeout: 10 + links: + subscription: + href: http://mec011Server.example.com/mec_app_support/v1/applications/appId1234/subscriptions/sub123 + confirmTermination: + href: http://mec011Server.example.com/mec_app_support/v1/confirm_termination + required: true + responses: + "204": + description: No Content + x-swagger-router-controller: notifications +components: + schemas: + MtsCapabilityInfo: + required: + - mtsAccessInfo + - mtsMode + type: object + properties: + mtsAccessInfo: + minItems: 1 + required: + - accessId + - accessType + - metered + type: array + description: The information on access network connection as defined below + items: + $ref: '#/components/schemas/MtsCapabilityInfo_mtsAccessInfo' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: Structure (inlined) + mtsMode: + minItems: 1 + type: array + description: "Numeric value corresponding to a specific MTS operation supported\ + \ by the TMS 0 = low cost, i.e. using the unmetered access network connection\ + \ whenever it is available 1 = low latency, i.e. using the access network\ + \ connection with lower latency 2 = high throughput, i.e. using the access\ + \ network connection with higher throughput, or/and multiple access network\ + \ connection simultaneously if supported 3 = redundancy, i.e. sending\ + \ duplicated (redundancy) packets over multiple access network connections\ + \ for highreliability and low-latency applications 4 = QoS, i.e. performing\ + \ MTS based on the specific QoS requirements from the app" + items: + type: integer + format: uint32 + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: Uint32 + timeStamp: + $ref: '#/components/schemas/MtsCapabilityInfo_timeStamp' + example: + timeStamp: + seconds: 2 + nanoSeconds: 5 + mtsMode: + - 5 + - 5 + mtsAccessInfo: + - accessId: 0 + accessType: 6 + metered: 1 + - accessId: 0 + accessType: 6 + metered: 1 + x-etsi-notes: "NOTE:\tA metered connection is a network connection that has\ + \ a maximum data usage in a specific period, e.g. per hour/day/week/month.\ + \ The user may get billed extra charges if they go over the allotted amount." + x-etsi-ref: 7.2.4 + MtsSessionInfo: + required: + - appInsId + - flowFilter + - mtsMode + - qosD + - requestType + - trafficDirection + type: object + properties: + sessionId: + type: string + description: MTS session instance identifier + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appInsId: + type: string + description: Application instance identifier + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appName: + type: string + description: Name of the application + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + flowFilter: + minItems: 1 + type: array + description: "Traffic flow filtering criteria, applicable only if when requestType\ + \ is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define\ + \ a single session only. In case multiple sessions match flowFilter the\ + \ request shall be rejected. If the flowFilter field is included, at least\ + \ one of its subfields shall be included. Any flowFilter subfield that\ + \ is not included shall be ignored in traffic flow filtering" + items: + $ref: '#/components/schemas/MtsSessionInfo_flowFilter' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: Structure (inlined) + mtsMode: + type: integer + description: "Numeric value (0 - 255) corresponding to a specific MTS mode\ + \ of the MTS session: 0 = low cost, i.e. using the unmetered access network\ + \ connection whenever it is available 1 = low latency, i.e. using the\ + \ access network connection with lower latency 2 = high throughput, i.e.\ + \ using the access network connection with higher throughput, or multiple\ + \ access network connection simultaneously 3 = redundancy, i.e. sending\ + \ duplicated (redundancy) packets over multiple access network connections\ + \ for high-reliability and low-latency applications 4 = QoS, i.e. performing\ + \ MTS based on the QoS requirement (qosD)" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + qosD: + $ref: '#/components/schemas/MtsSessionInfo_qosD' + requestType: + type: integer + description: "Numeric value (0 - 255) corresponding to specific type of\ + \ consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION" + enum: + - 0 + - 1 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Enum_inlined + timeStamp: + $ref: '#/components/schemas/MtsSessionInfo_timeStamp' + trafficDirection: + type: string + description: "The direction of the requested MTS session: 00 = Downlink\ + \ (towards the UE) 01 = Uplink (towards the application/session) 10 =\ + \ Symmetrical (see note) " + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + timeStamp: + seconds: 1 + nanoSeconds: 1 + flowFilter: + - flowlabel: 1 + protocol: 5 + sourcePort: 5 + dscp: 0 + dstPort: 6 + sourceIp: sourceIp + dstIp: dstIp + - flowlabel: 1 + protocol: 5 + sourcePort: 5 + dscp: 0 + dstPort: 6 + sourceIp: sourceIp + dstIp: dstIp + requestType: 7 + appName: appName + qosD: + maxJitter: 7 + maxLatency: 9 + maxLoss: 3 + priority: 4 + minTpt: 2 + sessionId: sessionId + appInsId: appInsId + trafficDirection: trafficDirection + mtsMode: 2 + x-etsi-notes: "NOTE:\tFor the downlink direction of a symmetrical flow, \"sourceIp\"\ + \ and \"sourcePort\" in the \"flowFilter\" structure are used for source address\ + \ and port, respectively; \"dstIp\" and \"dstPort\" are used for destination\ + \ address and port, respectively. For the uplink direction of a symmetrical\ + \ flow, \"sourceIp\" and \"sourcePort\" are used for destination address and\ + \ port, respectively; \"dstIp\" and \"dstPort\" are used for source address\ + \ and port, respectively." + x-etsi-ref: 7.2.5 + ProblemDetails: + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + description: A URI reference that identifies the specific occurrence of + the problem + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + status: + type: integer + description: The HTTP status code for this occurrence of the problem + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + title: + type: string + description: "A short, human-readable summary of the problem type" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + type: + type: string + description: A URI reference according to IETF RFC 3986 that identifies + the problem type + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + AppTerminationNotification: + required: + - _links + - maxGracefulTimeout + - notificationType + - operationAction + type: object + properties: + notificationType: + type: string + description: Shall be set to AppTerminationNotification. + operationAction: + $ref: '#/components/schemas/OperationActionType' + maxGracefulTimeout: + type: integer + description: Maximum timeout value in seconds for graceful termination or + graceful stop of an application instance. + format: uint32 + _links: + $ref: '#/components/schemas/AppTerminationNotification__links' + description: This type represents the information that the MEC platform notifies + the subscribed application instance about the corresponding application instance + termination/stop. + OperationActionType: + type: string + description: Operation that is being performed on the MEC application instance. + enum: + - STOPPING + - TERMINATING + LinkType: + required: + - href + type: object + properties: + href: + type: string + description: URI referring to a resource + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uri + x-etsi-ref: 6.5.2 + MtsCapabilityInfo_mtsAccessInfo: + type: object + properties: + accessId: + type: integer + description: Unique identifier for the access network connection + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + accessType: + type: integer + description: "Numeric value (0-255) corresponding to specific type of access\ + \ network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology\ + \ 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11\ + \ a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac\ + \ WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11\ + \ b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33\ + \ = 3GPP NR (5G)" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + metered: + type: integer + description: "Numeric value (0-255) corresponding to the following: 0: the\ + \ connection is not metered (see note) 1: the connection is metered 2:\ + \ unknown " + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + example: + accessId: 0 + accessType: 6 + metered: 1 + MtsCapabilityInfo_timeStamp: + required: + - nanoSeconds + - seconds + type: object + properties: + nanoSeconds: + type: integer + description: "Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00\ + \ UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + seconds: + type: integer + description: "Time in seconds in Unix-time since January 1, 1970, 00:00:00\ + \ UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + description: Time stamp to indicate when the corresponding information elements + are sent + example: + seconds: 2 + nanoSeconds: 5 + MtsSessionInfo_flowFilter: + type: object + properties: + dscp: + type: integer + description: DSCP in the IPv4 header or Traffic Class in the IPv6 header + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + dstIp: + type: string + description: "Destination address identity of session. The string for a\ + \ IPv4 address shall be formatted in the \"dotted decimal\" notation as\ + \ defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be\ + \ formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR\ + \ notation [12] used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + dstPort: + type: integer + description: Destination port identity of session + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + flowlabel: + type: integer + description: "Flow Label in the IPv6 header, applicable only if the flow\ + \ is IPv6" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + protocol: + type: integer + description: Protocol number + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + sourceIp: + type: string + description: "Source address identity of session. The string for a IPv4\ + \ address shall be formatted in the \"dotted decimal\" notation as defined\ + \ in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted\ + \ according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12]\ + \ used to provide the routing prefix." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + sourcePort: + type: integer + description: Source port identity of session + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + example: + flowlabel: 1 + protocol: 5 + sourcePort: 5 + dscp: 0 + dstPort: 6 + sourceIp: sourceIp + dstIp: dstIp + MtsSessionInfo_qosD: + type: object + properties: + maxJitter: + type: integer + description: "tolerable jitter in [10 nanoseconds]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + maxLatency: + type: integer + description: "tolerable (one-way) delay in [10 nanoseconds]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + maxLoss: + type: integer + description: "tolerable packet loss rate in [1/10^x]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + minTpt: + type: integer + description: "minimal throughput in [kbps]" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + priority: + type: integer + description: "numeric value (0 - 255) corresponding to the traffic priority\ + \ 0: low; 1: medium; 2: high; 3: critical" + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + description: "QoS requirement description of the MTS session, applicable only\ + \ if mtsMode = 4 (QoS). If the qosD field is included, at least one of its\ + \ subfields shall be included. Any qosD subfield that is not included shall\ + \ be ignored in Multi-access Traffic Steering (MTS)" + example: + maxJitter: 7 + maxLatency: 9 + maxLoss: 3 + priority: 4 + minTpt: 2 + MtsSessionInfo_timeStamp: + required: + - nanoSeconds + - seconds + type: object + properties: + nanoSeconds: + type: integer + description: "The nanoseconds part of the Time. Time is defined as Unix-time\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + seconds: + type: integer + description: "The seconds part of the Time. Time is defined as Unixtime\ + \ since January 1, 1970, 00:00:00 UTC" + format: uint32 + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uint32 + description: 'Time stamp to indicate when the corresponding information elements + are sent ' + example: + seconds: 1 + nanoSeconds: 1 + AppTerminationNotification__links: + required: + - subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/LinkType' + confirmTermination: + $ref: '#/components/schemas/LinkType' + description: Object containing hyperlinks related to the resource. + responses: + "204": + description: "Upon success, a response 204 No Content without any response body\ + \ is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot be\ + \ mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "Precondition failed : used when a condition has failed during\ + \ conditional requests, e.g. when using ETags to avoid write conflicts when\ + \ using PUT" + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Path.sessionId: + name: sessionId + in: path + description: Represents a MTS session instance + required: true + style: simple + explode: false + schema: + type: string + Query.app_instance_id: + name: app_instance_id + in: query + description: A MEC application instance may use multiple app_instance_ids as + an input parameter to query the MTS session of a list of MEC application instances. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.app_name: + name: app_name + in: query + description: A MEC application instance may use multiple app_names as an input + parameter to query the MTS session of a list of MEC application instances. + See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + Query.session_id: + name: session_id + in: query + description: A MEC application instance may use session_id as an input parameter + to query the information of a list of MTS sessions. See note. + required: false + style: form + explode: true + schema: + type: array + items: + type: string diff --git a/go-packages/meep-mts-client/api_mts.go b/go-packages/meep-mts-client/api_mts.go new file mode 100644 index 000000000..b180d9f9c --- /dev/null +++ b/go-packages/meep-mts-client/api_mts.go @@ -0,0 +1,805 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "context" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type MtsApiService service + +/* +MtsApiService MEC011 Application Termination notification for self termination +Terminates itself. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Termination notification details + +*/ +func (a *MtsApiService) Mec011AppTerminationPOST(ctx context.Context, body AppTerminationNotification) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/notifications/mec011/appTermination" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MtsApiService Retrieve the MTS capability informations +Used to query information about the MTS information. Typically used in the 'Get MTS service Info from the MTS Service' procedure as described in clause 6.2.6. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return MtsCapabilityInfo +*/ +func (a *MtsApiService) MtsCapabilityInfoGET(ctx context.Context) (MtsCapabilityInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MtsCapabilityInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/mts_capability_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v MtsCapabilityInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MtsApiService Remove specific MTS session +DELETE method is typically used in 'Unregister from the MTS Service' procedure as described in clause 6.2.8. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param sessionId Represents a MTS session instance + +*/ +func (a *MtsApiService) MtsSessionDELETE(ctx context.Context, sessionId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/mts_sessions/{sessionId}" + localVarPath = strings.Replace(localVarPath, "{"+"sessionId"+"}", fmt.Sprintf("%v", sessionId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MtsApiService Retrieve information about specific MTS session +Retrieves information about an individual MTS session. Typically used in the 'Get configured MTS Session Info from the MTS Service' procedure as described in clause 6.2.10. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param sessionId Represents a MTS session instance +@return MtsSessionInfo +*/ +func (a *MtsApiService) MtsSessionGET(ctx context.Context, sessionId string) (MtsSessionInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MtsSessionInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/mts_sessions/{sessionId}" + localVarPath = strings.Replace(localVarPath, "{"+"sessionId"+"}", fmt.Sprintf("%v", sessionId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v MtsSessionInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MtsApiService Create a MTS session +Used to create a MTS session. This method is typically used in 'Register application to the MTS Service' procedure as described in clause 6.2.7. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Entity body in the request contains MtsSessionInfo to be created. +@return MtsSessionInfo +*/ +func (a *MtsApiService) MtsSessionPOST(ctx context.Context, body MtsSessionInfo) (MtsSessionInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MtsSessionInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/mts_sessions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v MtsSessionInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MtsApiService Update the information about specific MTS session +Updates the information about an individual MTS session. As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body MtsSessionInfo with updated information is included as entity body of the request. + * @param sessionId Represents a MTS session instance +@return MtsSessionInfo +*/ +func (a *MtsApiService) MtsSessionPUT(ctx context.Context, body MtsSessionInfo, sessionId string) (MtsSessionInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MtsSessionInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/mts_sessions/{sessionId}" + localVarPath = strings.Replace(localVarPath, "{"+"sessionId"+"}", fmt.Sprintf("%v", sessionId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v MtsSessionInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 412 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MtsApiService Retrieve information about a list of MTS sessions +Retrieves information about a list of MTS sessions. Typically used in the 'Get configured MTS Session Info from the MTS Service' procedure as described in clause 6.2.10. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *MtsApiMtsSessionsListGETOpts - Optional Parameters: + * @param "AppInstanceId" (optional.Interface of []string) - A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note. + * @param "AppName" (optional.Interface of []string) - A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note. + * @param "SessionId" (optional.Interface of []string) - A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note. +@return []MtsSessionInfo +*/ + +type MtsApiMtsSessionsListGETOpts struct { + AppInstanceId optional.Interface + AppName optional.Interface + SessionId optional.Interface +} + +func (a *MtsApiService) MtsSessionsListGET(ctx context.Context, localVarOptionals *MtsApiMtsSessionsListGETOpts) ([]MtsSessionInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []MtsSessionInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/mts_sessions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AppInstanceId.IsSet() { + localVarQueryParams.Add("app_instance_id", parameterToString(localVarOptionals.AppInstanceId.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.AppName.IsSet() { + localVarQueryParams.Add("app_name", parameterToString(localVarOptionals.AppName.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.SessionId.IsSet() { + localVarQueryParams.Add("session_id", parameterToString(localVarOptionals.SessionId.Value(), "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []MtsSessionInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/go-packages/meep-mts-client/client.go b/go-packages/meep-mts-client/client.go new file mode 100644 index 000000000..87bb2e152 --- /dev/null +++ b/go-packages/meep-mts-client/client.go @@ -0,0 +1,488 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the AdvantEDGE Multi-access Traffic Steering API API v2.2.1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + MtsApi *MtsApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.MtsApi = (*MtsApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/go-packages/meep-mts-client/configuration.go b/go-packages/meep-mts-client/configuration.go new file mode 100644 index 000000000..d9a11ce36 --- /dev/null +++ b/go-packages/meep-mts-client/configuration.go @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://localhost/sandboxname/mts/v2", + DefaultHeader: make(map[string]string), + UserAgent: "Swagger-Codegen/1.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/go-packages/meep-mts-client/docs/AppTerminationNotification.md b/go-packages/meep-mts-client/docs/AppTerminationNotification.md new file mode 100644 index 000000000..8156e455d --- /dev/null +++ b/go-packages/meep-mts-client/docs/AppTerminationNotification.md @@ -0,0 +1,12 @@ +# AppTerminationNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationType** | **string** | Shall be set to AppTerminationNotification. | [default to null] +**OperationAction** | [***OperationActionType**](OperationActionType.md) | | [default to null] +**MaxGracefulTimeout** | **int32** | Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. | [default to null] +**Links** | [***AppTerminationNotificationLinks**](AppTerminationNotification__links.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/AppTerminationNotificationLinks.md b/go-packages/meep-mts-client/docs/AppTerminationNotificationLinks.md new file mode 100644 index 000000000..67d7f0d90 --- /dev/null +++ b/go-packages/meep-mts-client/docs/AppTerminationNotificationLinks.md @@ -0,0 +1,10 @@ +# AppTerminationNotificationLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | [***LinkType**](LinkType.md) | | [default to null] +**ConfirmTermination** | [***LinkType**](LinkType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/LinkType.md b/go-packages/meep-mts-client/docs/LinkType.md new file mode 100644 index 000000000..a8945efcd --- /dev/null +++ b/go-packages/meep-mts-client/docs/LinkType.md @@ -0,0 +1,9 @@ +# LinkType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | URI referring to a resource | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsApi.md b/go-packages/meep-mts-client/docs/MtsApi.md new file mode 100644 index 000000000..aa7adf5bf --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsApi.md @@ -0,0 +1,215 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/mts/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Mec011AppTerminationPOST**](MtsApi.md#Mec011AppTerminationPOST) | **Post** /notifications/mec011/appTermination | MEC011 Application Termination notification for self termination +[**MtsCapabilityInfoGET**](MtsApi.md#MtsCapabilityInfoGET) | **Get** /mts_capability_info | Retrieve the MTS capability informations +[**MtsSessionDELETE**](MtsApi.md#MtsSessionDELETE) | **Delete** /mts_sessions/{sessionId} | Remove specific MTS session +[**MtsSessionGET**](MtsApi.md#MtsSessionGET) | **Get** /mts_sessions/{sessionId} | Retrieve information about specific MTS session +[**MtsSessionPOST**](MtsApi.md#MtsSessionPOST) | **Post** /mts_sessions | Create a MTS session +[**MtsSessionPUT**](MtsApi.md#MtsSessionPUT) | **Put** /mts_sessions/{sessionId} | Update the information about specific MTS session +[**MtsSessionsListGET**](MtsApi.md#MtsSessionsListGET) | **Get** /mts_sessions | Retrieve information about a list of MTS sessions + +# **Mec011AppTerminationPOST** +> Mec011AppTerminationPOST(ctx, body) +MEC011 Application Termination notification for self termination + +Terminates itself. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppTerminationNotification**](AppTerminationNotification.md)| Termination notification details | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsCapabilityInfoGET** +> MtsCapabilityInfo MtsCapabilityInfoGET(ctx, ) +Retrieve the MTS capability informations + +Used to query information about the MTS information. Typically used in the 'Get MTS service Info from the MTS Service' procedure as described in clause 6.2.6. + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**MtsCapabilityInfo**](MtsCapabilityInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionDELETE** +> MtsSessionDELETE(ctx, sessionId) +Remove specific MTS session + +DELETE method is typically used in 'Unregister from the MTS Service' procedure as described in clause 6.2.8. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sessionId** | **string**| Represents a MTS session instance | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionGET** +> MtsSessionInfo MtsSessionGET(ctx, sessionId) +Retrieve information about specific MTS session + +Retrieves information about an individual MTS session. Typically used in the 'Get configured MTS Session Info from the MTS Service' procedure as described in clause 6.2.10. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sessionId** | **string**| Represents a MTS session instance | + +### Return type + +[**MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionPOST** +> MtsSessionInfo MtsSessionPOST(ctx, body) +Create a MTS session + +Used to create a MTS session. This method is typically used in 'Register application to the MTS Service' procedure as described in clause 6.2.7. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**MtsSessionInfo**](MtsSessionInfo.md)| Entity body in the request contains MtsSessionInfo to be created. | + +### Return type + +[**MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionPUT** +> MtsSessionInfo MtsSessionPUT(ctx, body, sessionId) +Update the information about specific MTS session + +Updates the information about an individual MTS session. As specified in ETSI GS MEC 009 [6], the PUT HTTP method has 'replace' semantics. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**MtsSessionInfo**](MtsSessionInfo.md)| MtsSessionInfo with updated information is included as entity body of the request. | + **sessionId** | **string**| Represents a MTS session instance | + +### Return type + +[**MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtsSessionsListGET** +> []MtsSessionInfo MtsSessionsListGET(ctx, optional) +Retrieve information about a list of MTS sessions + +Retrieves information about a list of MTS sessions. Typically used in the 'Get configured MTS Session Info from the MTS Service' procedure as described in clause 6.2.10. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***MtsApiMtsSessionsListGETOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a MtsApiMtsSessionsListGETOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appInstanceId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note. | + **appName** | [**optional.Interface of []string**](string.md)| A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note. | + **sessionId** | [**optional.Interface of []string**](string.md)| A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note. | + +### Return type + +[**[]MtsSessionInfo**](MtsSessionInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsCapabilityInfo.md b/go-packages/meep-mts-client/docs/MtsCapabilityInfo.md new file mode 100644 index 000000000..9fb7c9eaf --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsCapabilityInfo.md @@ -0,0 +1,11 @@ +# MtsCapabilityInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MtsAccessInfo** | [**[]MtsCapabilityInfoMtsAccessInfo**](MtsCapabilityInfo_mtsAccessInfo.md) | The information on access network connection as defined below | [default to null] +**MtsMode** | **[]int32** | Numeric value corresponding to a specific MTS operation supported by the TMS 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or/and multiple access network connection simultaneously if supported 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for highreliability and low-latency applications 4 = QoS, i.e. performing MTS based on the specific QoS requirements from the app | [default to null] +**TimeStamp** | [***MtsCapabilityInfoTimeStamp**](MtsCapabilityInfo_timeStamp.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsCapabilityInfoMtsAccessInfo.md b/go-packages/meep-mts-client/docs/MtsCapabilityInfoMtsAccessInfo.md new file mode 100644 index 000000000..9ac351ca9 --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsCapabilityInfoMtsAccessInfo.md @@ -0,0 +1,11 @@ +# MtsCapabilityInfoMtsAccessInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessId** | **int32** | Unique identifier for the access network connection | [optional] [default to null] +**AccessType** | **int32** | Numeric value (0-255) corresponding to specific type of access network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11 a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11 b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33 = 3GPP NR (5G) | [optional] [default to null] +**Metered** | **int32** | Numeric value (0-255) corresponding to the following: 0: the connection is not metered (see note) 1: the connection is metered 2: unknown | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsCapabilityInfoTimeStamp.md b/go-packages/meep-mts-client/docs/MtsCapabilityInfoTimeStamp.md new file mode 100644 index 000000000..0c9f3c7d3 --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsCapabilityInfoTimeStamp.md @@ -0,0 +1,10 @@ +# MtsCapabilityInfoTimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NanoSeconds** | **int32** | Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] +**Seconds** | **int32** | Time in seconds in Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsSessionInfo.md b/go-packages/meep-mts-client/docs/MtsSessionInfo.md new file mode 100644 index 000000000..41db6be4c --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsSessionInfo.md @@ -0,0 +1,17 @@ +# MtsSessionInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SessionId** | **string** | MTS session instance identifier | [optional] [default to null] +**AppInsId** | **string** | Application instance identifier | [default to null] +**AppName** | **string** | Name of the application | [optional] [default to null] +**FlowFilter** | [**[]MtsSessionInfoFlowFilter**](MtsSessionInfo_flowFilter.md) | Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering | [default to null] +**MtsMode** | **int32** | Numeric value (0 - 255) corresponding to a specific MTS mode of the MTS session: 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or multiple access network connection simultaneously 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for high-reliability and low-latency applications 4 = QoS, i.e. performing MTS based on the QoS requirement (qosD) | [default to null] +**QosD** | [***MtsSessionInfoQosD**](MtsSessionInfo_qosD.md) | | [default to null] +**RequestType** | **int32** | Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION | [default to null] +**TimeStamp** | [***MtsSessionInfoTimeStamp**](MtsSessionInfo_timeStamp.md) | | [optional] [default to null] +**TrafficDirection** | **string** | The direction of the requested MTS session: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical (see note) | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsSessionInfoFlowFilter.md b/go-packages/meep-mts-client/docs/MtsSessionInfoFlowFilter.md new file mode 100644 index 000000000..27822e66e --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsSessionInfoFlowFilter.md @@ -0,0 +1,15 @@ +# MtsSessionInfoFlowFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dscp** | **int32** | DSCP in the IPv4 header or Traffic Class in the IPv6 header | [optional] [default to null] +**DstIp** | **string** | Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**DstPort** | **int32** | Destination port identity of session | [optional] [default to null] +**Flowlabel** | **int32** | Flow Label in the IPv6 header, applicable only if the flow is IPv6 | [optional] [default to null] +**Protocol** | **int32** | Protocol number | [optional] [default to null] +**SourceIp** | **string** | Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. | [optional] [default to null] +**SourcePort** | **int32** | Source port identity of session | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsSessionInfoQosD.md b/go-packages/meep-mts-client/docs/MtsSessionInfoQosD.md new file mode 100644 index 000000000..b45f5c648 --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsSessionInfoQosD.md @@ -0,0 +1,13 @@ +# MtsSessionInfoQosD + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MaxJitter** | **int32** | tolerable jitter in [10 nanoseconds] | [optional] [default to null] +**MaxLatency** | **int32** | tolerable (one-way) delay in [10 nanoseconds] | [optional] [default to null] +**MaxLoss** | **int32** | tolerable packet loss rate in [1/10^x] | [optional] [default to null] +**MinTpt** | **int32** | minimal throughput in [kbps] | [optional] [default to null] +**Priority** | **int32** | numeric value (0 - 255) corresponding to the traffic priority 0: low; 1: medium; 2: high; 3: critical | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/MtsSessionInfoTimeStamp.md b/go-packages/meep-mts-client/docs/MtsSessionInfoTimeStamp.md new file mode 100644 index 000000000..3c9552dac --- /dev/null +++ b/go-packages/meep-mts-client/docs/MtsSessionInfoTimeStamp.md @@ -0,0 +1,10 @@ +# MtsSessionInfoTimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NanoSeconds** | **int32** | The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC | [default to null] +**Seconds** | **int32** | The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/OperationActionType.md b/go-packages/meep-mts-client/docs/OperationActionType.md new file mode 100644 index 000000000..4078c9e76 --- /dev/null +++ b/go-packages/meep-mts-client/docs/OperationActionType.md @@ -0,0 +1,8 @@ +# OperationActionType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/docs/ProblemDetails.md b/go-packages/meep-mts-client/docs/ProblemDetails.md new file mode 100644 index 000000000..d6f1dfeb6 --- /dev/null +++ b/go-packages/meep-mts-client/docs/ProblemDetails.md @@ -0,0 +1,13 @@ +# ProblemDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | **string** | A human-readable explanation specific to this occurrence of the problem | [optional] [default to null] +**Instance** | **string** | A URI reference that identifies the specific occurrence of the problem | [optional] [default to null] +**Status** | **int32** | The HTTP status code for this occurrence of the problem | [optional] [default to null] +**Title** | **string** | A short, human-readable summary of the problem type | [optional] [default to null] +**Type_** | **string** | A URI reference according to IETF RFC 3986 that identifies the problem type | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-mts-client/git_push.sh b/go-packages/meep-mts-client/git_push.sh new file mode 100644 index 000000000..ae01b182a --- /dev/null +++ b/go-packages/meep-mts-client/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/go-packages/meep-mts-client/go.mod b/go-packages/meep-mts-client/go.mod new file mode 100644 index 000000000..62cda62ec --- /dev/null +++ b/go-packages/meep-mts-client/go.mod @@ -0,0 +1,12 @@ +module github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-mts-client + +go 1.17 + +require ( + golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c + + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect +) diff --git a/go-packages/meep-mts-client/go.sum b/go-packages/meep-mts-client/go.sum new file mode 100644 index 000000000..5833d8936 --- /dev/null +++ b/go-packages/meep-mts-client/go.sum @@ -0,0 +1,638 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c h1:q3gFqPqH7NVofKo3c3yETAP//pPI+G5mvB7qqj1Y5kY= +golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/go-packages/meep-mts-client/model_app_termination_notification.go b/go-packages/meep-mts-client/model_app_termination_notification.go new file mode 100644 index 000000000..05433595b --- /dev/null +++ b/go-packages/meep-mts-client/model_app_termination_notification.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// This type represents the information that the MEC platform notifies the subscribed application instance about the corresponding application instance termination/stop. +type AppTerminationNotification struct { + // Shall be set to AppTerminationNotification. + NotificationType string `json:"notificationType"` + OperationAction *OperationActionType `json:"operationAction"` + // Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. + MaxGracefulTimeout int32 `json:"maxGracefulTimeout"` + Links *AppTerminationNotificationLinks `json:"_links"` +} diff --git a/go-packages/meep-mts-client/model_app_termination_notification__links.go b/go-packages/meep-mts-client/model_app_termination_notification__links.go new file mode 100644 index 000000000..f5f69ba27 --- /dev/null +++ b/go-packages/meep-mts-client/model_app_termination_notification__links.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Object containing hyperlinks related to the resource.// Object containing hyperlinks related to the resource. +type AppTerminationNotificationLinks struct { + Subscription *LinkType `json:"subscription"` + ConfirmTermination *LinkType `json:"confirmTermination,omitempty"` +} diff --git a/go-packages/meep-mts-client/model_link_type.go b/go-packages/meep-mts-client/model_link_type.go new file mode 100644 index 000000000..c13c09d11 --- /dev/null +++ b/go-packages/meep-mts-client/model_link_type.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type LinkType struct { + // URI referring to a resource + Href string `json:"href"` +} diff --git a/go-packages/meep-mts-client/model_mts_capability_info.go b/go-packages/meep-mts-client/model_mts_capability_info.go new file mode 100644 index 000000000..ff61787e6 --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_capability_info.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type MtsCapabilityInfo struct { + // The information on access network connection as defined below + MtsAccessInfo []MtsCapabilityInfoMtsAccessInfo `json:"mtsAccessInfo"` + // Numeric value corresponding to a specific MTS operation supported by the TMS 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or/and multiple access network connection simultaneously if supported 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for highreliability and low-latency applications 4 = QoS, i.e. performing MTS based on the specific QoS requirements from the app + MtsMode []int32 `json:"mtsMode"` + TimeStamp *MtsCapabilityInfoTimeStamp `json:"timeStamp,omitempty"` +} diff --git a/go-packages/meep-mts-client/model_mts_capability_info_mts_access_info.go b/go-packages/meep-mts-client/model_mts_capability_info_mts_access_info.go new file mode 100644 index 000000000..22767a58a --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_capability_info_mts_access_info.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type MtsCapabilityInfoMtsAccessInfo struct { + // Unique identifier for the access network connection + AccessId int32 `json:"accessId,omitempty"` + // Numeric value (0-255) corresponding to specific type of access network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11 a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11 b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33 = 3GPP NR (5G) + AccessType int32 `json:"accessType,omitempty"` + // Numeric value (0-255) corresponding to the following: 0: the connection is not metered (see note) 1: the connection is metered 2: unknown + Metered int32 `json:"metered,omitempty"` +} diff --git a/go-packages/meep-mts-client/model_mts_capability_info_time_stamp.go b/go-packages/meep-mts-client/model_mts_capability_info_time_stamp.go new file mode 100644 index 000000000..8cb891114 --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_capability_info_time_stamp.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Time stamp to indicate when the corresponding information elements are sent +type MtsCapabilityInfoTimeStamp struct { + // Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00 UTC + NanoSeconds int32 `json:"nanoSeconds"` + // Time in seconds in Unix-time since January 1, 1970, 00:00:00 UTC + Seconds int32 `json:"seconds"` +} diff --git a/go-packages/meep-mts-client/model_mts_session_info.go b/go-packages/meep-mts-client/model_mts_session_info.go new file mode 100644 index 000000000..4a487d006 --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_session_info.go @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type MtsSessionInfo struct { + // MTS session instance identifier + SessionId string `json:"sessionId,omitempty"` + // Application instance identifier + AppInsId string `json:"appInsId"` + // Name of the application + AppName string `json:"appName,omitempty"` + // Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering + FlowFilter []MtsSessionInfoFlowFilter `json:"flowFilter"` + // Numeric value (0 - 255) corresponding to a specific MTS mode of the MTS session: 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or multiple access network connection simultaneously 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for high-reliability and low-latency applications 4 = QoS, i.e. performing MTS based on the QoS requirement (qosD) + MtsMode int32 `json:"mtsMode"` + QosD *MtsSessionInfoQosD `json:"qosD"` + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION + RequestType int32 `json:"requestType"` + TimeStamp *MtsSessionInfoTimeStamp `json:"timeStamp,omitempty"` + // The direction of the requested MTS session: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical (see note) + TrafficDirection string `json:"trafficDirection"` +} diff --git a/go-packages/meep-mts-client/model_mts_session_info_flow_filter.go b/go-packages/meep-mts-client/model_mts_session_info_flow_filter.go new file mode 100644 index 000000000..3b116e2c0 --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_session_info_flow_filter.go @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type MtsSessionInfoFlowFilter struct { + // DSCP in the IPv4 header or Traffic Class in the IPv6 header + Dscp int32 `json:"dscp,omitempty"` + // Destination address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + DstIp string `json:"dstIp,omitempty"` + // Destination port identity of session + DstPort int32 `json:"dstPort,omitempty"` + // Flow Label in the IPv6 header, applicable only if the flow is IPv6 + Flowlabel int32 `json:"flowlabel,omitempty"` + // Protocol number + Protocol int32 `json:"protocol,omitempty"` + // Source address identity of session. The string for a IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for a IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix. + SourceIp string `json:"sourceIp,omitempty"` + // Source port identity of session + SourcePort int32 `json:"sourcePort,omitempty"` +} diff --git a/go-packages/meep-mts-client/model_mts_session_info_qos_d.go b/go-packages/meep-mts-client/model_mts_session_info_qos_d.go new file mode 100644 index 000000000..6848ebf55 --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_session_info_qos_d.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// QoS requirement description of the MTS session, applicable only if mtsMode = 4 (QoS). If the qosD field is included, at least one of its subfields shall be included. Any qosD subfield that is not included shall be ignored in Multi-access Traffic Steering (MTS) +type MtsSessionInfoQosD struct { + // tolerable jitter in [10 nanoseconds] + MaxJitter int32 `json:"maxJitter,omitempty"` + // tolerable (one-way) delay in [10 nanoseconds] + MaxLatency int32 `json:"maxLatency,omitempty"` + // tolerable packet loss rate in [1/10^x] + MaxLoss int32 `json:"maxLoss,omitempty"` + // minimal throughput in [kbps] + MinTpt int32 `json:"minTpt,omitempty"` + // numeric value (0 - 255) corresponding to the traffic priority 0: low; 1: medium; 2: high; 3: critical + Priority int32 `json:"priority,omitempty"` +} diff --git a/go-packages/meep-mts-client/model_mts_session_info_time_stamp.go b/go-packages/meep-mts-client/model_mts_session_info_time_stamp.go new file mode 100644 index 000000000..97b99bffb --- /dev/null +++ b/go-packages/meep-mts-client/model_mts_session_info_time_stamp.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Time stamp to indicate when the corresponding information elements are sent +type MtsSessionInfoTimeStamp struct { + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + NanoSeconds int32 `json:"nanoSeconds"` + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + Seconds int32 `json:"seconds"` +} diff --git a/go-packages/meep-mts-client/model_operation_action_type.go b/go-packages/meep-mts-client/model_operation_action_type.go new file mode 100644 index 000000000..403f5ffd1 --- /dev/null +++ b/go-packages/meep-mts-client/model_operation_action_type.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// OperationActionType : Operation that is being performed on the MEC application instance. +type OperationActionType string + +// List of OperationActionType +const ( + STOPPING_OperationActionType OperationActionType = "STOPPING" + TERMINATING_OperationActionType OperationActionType = "TERMINATING" +) diff --git a/go-packages/meep-mts-client/model_problem_details.go b/go-packages/meep-mts-client/model_problem_details.go new file mode 100644 index 000000000..5321cfdb0 --- /dev/null +++ b/go-packages/meep-mts-client/model_problem_details.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ProblemDetails struct { + // A human-readable explanation specific to this occurrence of the problem + Detail string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem + Instance string `json:"instance,omitempty"` + // The HTTP status code for this occurrence of the problem + Status int32 `json:"status,omitempty"` + // A short, human-readable summary of the problem type + Title string `json:"title,omitempty"` + // A URI reference according to IETF RFC 3986 that identifies the problem type + Type_ string `json:"type,omitempty"` +} diff --git a/go-packages/meep-mts-client/response.go b/go-packages/meep-mts-client/response.go new file mode 100644 index 000000000..6216d0c25 --- /dev/null +++ b/go-packages/meep-mts-client/response.go @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 InterDigital Communications, Inc + * + * Licensed under the Apache License, Version 2.0 (the \"License\"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an \"AS IS\" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Multi-access Traffic Steering API + * + * Multi-access Traffic Steering Sercice is AdvantEDGE's implementation of [ETSI MEC ISG MEC015 Traffic Management APIs](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-tm](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-tm/server/mts)

**Type & Usage**
Edge Service used by edge applications that want to get information about MTS Info and Session(s) in the network

**Note**
AdvantEDGE supports all Multi-access Traffic Steering API endpoints. + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} From 39a402072ed2b4951a1437f72ff727f911248737 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Fri, 23 Dec 2022 18:34:30 +0500 Subject: [PATCH 2/3] update VIS description in swagger.yaml file of meep-vis --- go-apps/meep-vis/api/swagger.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/go-apps/meep-vis/api/swagger.yaml b/go-apps/meep-vis/api/swagger.yaml index 9ec5e2f8d..33e963b79 100644 --- a/go-apps/meep-vis/api/swagger.yaml +++ b/go-apps/meep-vis/api/swagger.yaml @@ -7,8 +7,7 @@ info:

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-vis](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-vis)

**Type & Usage**
Edge Service used by edge applications that want to get - information about radio conditions in the network

**Note**
AdvantEDGE supports - a selected subset of RNI API endpoints (see below) and a subset of subscription + information about predicted QoS information for a vehicular UE with potential routes

**Note**
AdvantEDGE supports a selected subset of VIS API endpoints (see below) and a subset of subscription types. contact: name: InterDigital AdvantEDGE Support From 7373d7e56ab8b20163d55b71e49fe8c0afb80791 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Fri, 23 Dec 2022 18:35:40 +0500 Subject: [PATCH 3/3] implement MEC016 device application interface --- charts/meep-dai/.helmignore | 21 + charts/meep-dai/Chart.yaml | 5 + charts/meep-dai/templates/_helpers.tpl | 32 + .../templates/clusterrolebinding.yaml | 13 + charts/meep-dai/templates/codecov-pv.yaml | 35 + charts/meep-dai/templates/deployment.yaml | 80 + charts/meep-dai/templates/ingress.yaml | 38 + charts/meep-dai/templates/monitor.yaml | 33 + .../meep-dai/templates/onboardedapp-pv.yaml | 33 + charts/meep-dai/templates/service.yaml | 41 + charts/meep-dai/templates/serviceaccount.yaml | 4 + charts/meep-dai/values-template.yaml | 123 ++ docs/api-dai/.openapi-generator-ignore | 23 + docs/api-dai/.openapi-generator/FILES | 31 + docs/api-dai/.openapi-generator/VERSION | 1 + docs/api-dai/Apis/AppTermApi.md | 37 + docs/api-dai/Apis/DevAppApi.md | 163 ++ docs/api-dai/Apis/UnsupportedApi.md | 36 + .../Models/AddressChangeNotification.md | 12 + docs/api-dai/Models/AppContext.md | 14 + docs/api-dai/Models/AppContextAppInfo.md | 16 + .../AppContextAppInfoUserAppInstanceInfo.md | 11 + .../Models/AppTerminationNotification.md | 12 + .../Models/AppTerminationNotificationLinks.md | 10 + .../ApplicationContextDeleteNotification.md | 10 + .../ApplicationContextUpdateNotification.md | 11 + ...xtUpdateNotificationUserAppInstanceInfo.md | 11 + docs/api-dai/Models/ApplicationList.md | 9 + docs/api-dai/Models/ApplicationListAppInfo.md | 16 + .../Models/ApplicationListAppInfoAppCharcs.md | 13 + docs/api-dai/Models/ApplicationListAppList.md | 10 + .../ApplicationListVendorSpecificExt.md | 9 + .../Models/ApplicationLocationAvailability.md | 10 + .../ApplicationLocationAvailabilityAppInfo.md | 15 + ...onAvailabilityAppInfoAvailableLocations.md | 9 + ...icationLocationAvailabilityNotification.md | 11 + docs/api-dai/Models/InlineNotification.md | 8 + docs/api-dai/Models/LinkType.md | 9 + docs/api-dai/Models/Links.md | 9 + docs/api-dai/Models/LocationConstraints.md | 11 + .../LocationConstraintsCivicAddressElement.md | 10 + .../api-dai/Models/OneOfInlineNotification.md | 8 + docs/api-dai/Models/OperationActionType.md | 8 + docs/api-dai/Models/Polygon.md | 9 + docs/api-dai/Models/ProblemDetails.md | 13 + docs/api-dai/README.md | 53 + go-apps/meep-dai/Dockerfile | 32 + go-apps/meep-dai/api/swagger.yaml | 1663 +++++++++++++++++ go-apps/meep-dai/entrypoint.sh | 50 + go-apps/meep-dai/go.mod | 47 + go-apps/meep-dai/go.sum | 485 +++++ go-apps/meep-dai/main.go | 97 + go-apps/meep-dai/main_test.go | 58 + go-apps/meep-dai/sbi/dai-sbi.go | 640 +++++++ go-apps/meep-dai/server/README.md | 26 + go-apps/meep-dai/server/api_dai.go | 53 + go-apps/meep-dai/server/api_unsupported.go | 32 + go-apps/meep-dai/server/convert.go | 92 + go-apps/meep-dai/server/dai.go | 1002 ++++++++++ go-apps/meep-dai/server/dai_test.go | 1463 +++++++++++++++ go-apps/meep-dai/server/logger.go | 46 + .../model_address_change_notification.go | 36 + go-apps/meep-dai/server/model_app_context.go | 40 + .../server/model_app_context_app_info.go | 44 + ...context_app_info_user_app_instance_info.go | 34 + .../model_app_termination_notification.go | 37 + ...del_app_termination_notification__links.go | 32 + ...application_context_delete_notification.go | 32 + ...application_context_update_notification.go | 34 + ...ate_notification_user_app_instance_info.go | 34 + .../meep-dai/server/model_application_list.go | 30 + .../server/model_application_list_app_info.go | 43 + ...el_application_list_app_info_app_charcs.go | 39 + .../server/model_application_list_app_list.go | 31 + ...el_application_list_vendor_specific_ext.go | 31 + ...model_application_location_availability.go | 31 + ...lication_location_availability_app_info.go | 42 + ...ailability_app_info_available_locations.go | 29 + ...tion_location_availability_notification.go | 34 + .../server/model_inline_notification.go | 28 + go-apps/meep-dai/server/model_link_type.go | 30 + go-apps/meep-dai/server/model_links.go | 30 + .../server/model_location_constraints.go | 33 + ...ation_constraints_civic_address_element.go | 32 + .../model_one_of_inline_notification.go | 33 + .../server/model_operation_action_type.go | 34 + go-apps/meep-dai/server/model_polygon.go | 28 + .../meep-dai/server/model_problem_details.go | 38 + go-apps/meep-dai/server/routers.go | 139 ++ go-packages/meep-dai-client/.gitignore | 24 + .../meep-dai-client/.swagger-codegen-ignore | 23 + .../meep-dai-client/.swagger-codegen/VERSION | 1 + go-packages/meep-dai-client/.travis.yml | 8 + go-packages/meep-dai-client/README.md | 69 + go-packages/meep-dai-client/api/swagger.yaml | 1663 +++++++++++++++++ go-packages/meep-dai-client/api_dai.go | 666 +++++++ go-packages/meep-dai-client/client.go | 488 +++++ go-packages/meep-dai-client/configuration.go | 86 + .../docs/AddressChangeNotification.md | 12 + .../meep-dai-client/docs/AppContext.md | 14 + .../meep-dai-client/docs/AppContextAppInfo.md | 16 + .../AppContextAppInfoUserAppInstanceInfo.md | 11 + .../docs/AppTerminationNotification.md | 12 + .../docs/AppTerminationNotificationLinks.md | 10 + .../ApplicationContextDeleteNotification.md | 10 + .../ApplicationContextUpdateNotification.md | 11 + ...xtUpdateNotificationUserAppInstanceInfo.md | 11 + .../meep-dai-client/docs/ApplicationList.md | 9 + .../docs/ApplicationListAppInfo.md | 16 + .../docs/ApplicationListAppInfoAppCharcs.md | 13 + .../docs/ApplicationListAppList.md | 10 + .../docs/ApplicationListVendorSpecificExt.md | 9 + .../docs/ApplicationLocationAvailability.md | 10 + .../ApplicationLocationAvailabilityAppInfo.md | 15 + ...onAvailabilityAppInfoAvailableLocations.md | 9 + ...icationLocationAvailabilityNotification.md | 11 + .../docs/InlineNotification.md | 8 + go-packages/meep-dai-client/docs/LinkType.md | 9 + go-packages/meep-dai-client/docs/Links.md | 9 + .../docs/LocationConstraints.md | 11 + .../LocationConstraintsCivicAddressElement.md | 10 + .../docs/OneOfInlineNotification.md | 8 + .../docs/OperationActionType.md | 8 + go-packages/meep-dai-client/docs/Polygon.md | 9 + .../meep-dai-client/docs/ProblemDetails.md | 13 + go-packages/meep-dai-client/git_push.sh | 52 + go-packages/meep-dai-client/go.mod | 9 + go-packages/meep-dai-client/go.sum | 15 + .../model_address_change_notification.go | 35 + .../meep-dai-client/model_app_context.go | 38 + .../model_app_context_app_info.go | 43 + ...context_app_info_user_app_instance_info.go | 32 + .../model_app_termination_notification.go | 34 + ...del_app_termination_notification__links.go | 30 + ...application_context_delete_notification.go | 31 + ...application_context_update_notification.go | 33 + ...ate_notification_user_app_instance_info.go | 32 + .../meep-dai-client/model_application_list.go | 29 + .../model_application_list_app_info.go | 42 + ...el_application_list_app_info_app_charcs.go | 38 + .../model_application_list_app_list.go | 29 + ...el_application_list_vendor_specific_ext.go | 15 + ...model_application_location_availability.go | 30 + ...lication_location_availability_app_info.go | 41 + ...ailability_app_info_available_locations.go | 28 + ...tion_location_availability_notification.go | 33 + .../model_inline_notification.go | 27 + .../meep-dai-client/model_link_type.go | 29 + go-packages/meep-dai-client/model_links.go | 29 + .../model_location_constraints.go | 32 + ...ation_constraints_civic_address_element.go | 31 + .../model_one_of_inline_notification.go | 32 + .../model_operation_action_type.go | 33 + go-packages/meep-dai-client/model_polygon.go | 28 + .../meep-dai-client/model_problem_details.go | 37 + go-packages/meep-dai-client/response.go | 57 + go-packages/meep-dai-mgr/convert.go | 127 ++ go-packages/meep-dai-mgr/docker.go | 107 ++ go-packages/meep-dai-mgr/exec.go | 194 ++ go-packages/meep-dai-mgr/format.go | 35 + go-packages/meep-dai-mgr/go.mod | 14 + go-packages/meep-dai-mgr/go.sum | 25 + go-packages/meep-dai-mgr/meep-dai-mgr.go | 1479 +++++++++++++++ go-packages/meep-dai-mgr/meep-dai-mgr_test.go | 1285 +++++++++++++ 164 files changed, 15532 insertions(+) create mode 100644 charts/meep-dai/.helmignore create mode 100644 charts/meep-dai/Chart.yaml create mode 100644 charts/meep-dai/templates/_helpers.tpl create mode 100644 charts/meep-dai/templates/clusterrolebinding.yaml create mode 100644 charts/meep-dai/templates/codecov-pv.yaml create mode 100644 charts/meep-dai/templates/deployment.yaml create mode 100644 charts/meep-dai/templates/ingress.yaml create mode 100644 charts/meep-dai/templates/monitor.yaml create mode 100644 charts/meep-dai/templates/onboardedapp-pv.yaml create mode 100644 charts/meep-dai/templates/service.yaml create mode 100644 charts/meep-dai/templates/serviceaccount.yaml create mode 100644 charts/meep-dai/values-template.yaml create mode 100644 docs/api-dai/.openapi-generator-ignore create mode 100644 docs/api-dai/.openapi-generator/FILES create mode 100644 docs/api-dai/.openapi-generator/VERSION create mode 100644 docs/api-dai/Apis/AppTermApi.md create mode 100644 docs/api-dai/Apis/DevAppApi.md create mode 100644 docs/api-dai/Apis/UnsupportedApi.md create mode 100644 docs/api-dai/Models/AddressChangeNotification.md create mode 100644 docs/api-dai/Models/AppContext.md create mode 100644 docs/api-dai/Models/AppContextAppInfo.md create mode 100644 docs/api-dai/Models/AppContextAppInfoUserAppInstanceInfo.md create mode 100644 docs/api-dai/Models/AppTerminationNotification.md create mode 100644 docs/api-dai/Models/AppTerminationNotificationLinks.md create mode 100644 docs/api-dai/Models/ApplicationContextDeleteNotification.md create mode 100644 docs/api-dai/Models/ApplicationContextUpdateNotification.md create mode 100644 docs/api-dai/Models/ApplicationContextUpdateNotificationUserAppInstanceInfo.md create mode 100644 docs/api-dai/Models/ApplicationList.md create mode 100644 docs/api-dai/Models/ApplicationListAppInfo.md create mode 100644 docs/api-dai/Models/ApplicationListAppInfoAppCharcs.md create mode 100644 docs/api-dai/Models/ApplicationListAppList.md create mode 100644 docs/api-dai/Models/ApplicationListVendorSpecificExt.md create mode 100644 docs/api-dai/Models/ApplicationLocationAvailability.md create mode 100644 docs/api-dai/Models/ApplicationLocationAvailabilityAppInfo.md create mode 100644 docs/api-dai/Models/ApplicationLocationAvailabilityAppInfoAvailableLocations.md create mode 100644 docs/api-dai/Models/ApplicationLocationAvailabilityNotification.md create mode 100644 docs/api-dai/Models/InlineNotification.md create mode 100644 docs/api-dai/Models/LinkType.md create mode 100644 docs/api-dai/Models/Links.md create mode 100644 docs/api-dai/Models/LocationConstraints.md create mode 100644 docs/api-dai/Models/LocationConstraintsCivicAddressElement.md create mode 100644 docs/api-dai/Models/OneOfInlineNotification.md create mode 100644 docs/api-dai/Models/OperationActionType.md create mode 100644 docs/api-dai/Models/Polygon.md create mode 100644 docs/api-dai/Models/ProblemDetails.md create mode 100644 docs/api-dai/README.md create mode 100644 go-apps/meep-dai/Dockerfile create mode 100644 go-apps/meep-dai/api/swagger.yaml create mode 100644 go-apps/meep-dai/entrypoint.sh create mode 100644 go-apps/meep-dai/go.mod create mode 100644 go-apps/meep-dai/go.sum create mode 100644 go-apps/meep-dai/main.go create mode 100644 go-apps/meep-dai/main_test.go create mode 100644 go-apps/meep-dai/sbi/dai-sbi.go create mode 100644 go-apps/meep-dai/server/README.md create mode 100644 go-apps/meep-dai/server/api_dai.go create mode 100644 go-apps/meep-dai/server/api_unsupported.go create mode 100644 go-apps/meep-dai/server/convert.go create mode 100644 go-apps/meep-dai/server/dai.go create mode 100644 go-apps/meep-dai/server/dai_test.go create mode 100644 go-apps/meep-dai/server/logger.go create mode 100644 go-apps/meep-dai/server/model_address_change_notification.go create mode 100644 go-apps/meep-dai/server/model_app_context.go create mode 100644 go-apps/meep-dai/server/model_app_context_app_info.go create mode 100644 go-apps/meep-dai/server/model_app_context_app_info_user_app_instance_info.go create mode 100644 go-apps/meep-dai/server/model_app_termination_notification.go create mode 100644 go-apps/meep-dai/server/model_app_termination_notification__links.go create mode 100644 go-apps/meep-dai/server/model_application_context_delete_notification.go create mode 100644 go-apps/meep-dai/server/model_application_context_update_notification.go create mode 100644 go-apps/meep-dai/server/model_application_context_update_notification_user_app_instance_info.go create mode 100644 go-apps/meep-dai/server/model_application_list.go create mode 100644 go-apps/meep-dai/server/model_application_list_app_info.go create mode 100644 go-apps/meep-dai/server/model_application_list_app_info_app_charcs.go create mode 100644 go-apps/meep-dai/server/model_application_list_app_list.go create mode 100644 go-apps/meep-dai/server/model_application_list_vendor_specific_ext.go create mode 100644 go-apps/meep-dai/server/model_application_location_availability.go create mode 100644 go-apps/meep-dai/server/model_application_location_availability_app_info.go create mode 100644 go-apps/meep-dai/server/model_application_location_availability_app_info_available_locations.go create mode 100644 go-apps/meep-dai/server/model_application_location_availability_notification.go create mode 100644 go-apps/meep-dai/server/model_inline_notification.go create mode 100644 go-apps/meep-dai/server/model_link_type.go create mode 100644 go-apps/meep-dai/server/model_links.go create mode 100644 go-apps/meep-dai/server/model_location_constraints.go create mode 100644 go-apps/meep-dai/server/model_location_constraints_civic_address_element.go create mode 100644 go-apps/meep-dai/server/model_one_of_inline_notification.go create mode 100644 go-apps/meep-dai/server/model_operation_action_type.go create mode 100644 go-apps/meep-dai/server/model_polygon.go create mode 100644 go-apps/meep-dai/server/model_problem_details.go create mode 100644 go-apps/meep-dai/server/routers.go create mode 100644 go-packages/meep-dai-client/.gitignore create mode 100644 go-packages/meep-dai-client/.swagger-codegen-ignore create mode 100644 go-packages/meep-dai-client/.swagger-codegen/VERSION create mode 100644 go-packages/meep-dai-client/.travis.yml create mode 100644 go-packages/meep-dai-client/README.md create mode 100644 go-packages/meep-dai-client/api/swagger.yaml create mode 100644 go-packages/meep-dai-client/api_dai.go create mode 100644 go-packages/meep-dai-client/client.go create mode 100644 go-packages/meep-dai-client/configuration.go create mode 100644 go-packages/meep-dai-client/docs/AddressChangeNotification.md create mode 100644 go-packages/meep-dai-client/docs/AppContext.md create mode 100644 go-packages/meep-dai-client/docs/AppContextAppInfo.md create mode 100644 go-packages/meep-dai-client/docs/AppContextAppInfoUserAppInstanceInfo.md create mode 100644 go-packages/meep-dai-client/docs/AppTerminationNotification.md create mode 100644 go-packages/meep-dai-client/docs/AppTerminationNotificationLinks.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationContextDeleteNotification.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationContextUpdateNotification.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationContextUpdateNotificationUserAppInstanceInfo.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationList.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationListAppInfo.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationListAppInfoAppCharcs.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationListAppList.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationListVendorSpecificExt.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationLocationAvailability.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfo.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfoAvailableLocations.md create mode 100644 go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityNotification.md create mode 100644 go-packages/meep-dai-client/docs/InlineNotification.md create mode 100644 go-packages/meep-dai-client/docs/LinkType.md create mode 100644 go-packages/meep-dai-client/docs/Links.md create mode 100644 go-packages/meep-dai-client/docs/LocationConstraints.md create mode 100644 go-packages/meep-dai-client/docs/LocationConstraintsCivicAddressElement.md create mode 100644 go-packages/meep-dai-client/docs/OneOfInlineNotification.md create mode 100644 go-packages/meep-dai-client/docs/OperationActionType.md create mode 100644 go-packages/meep-dai-client/docs/Polygon.md create mode 100644 go-packages/meep-dai-client/docs/ProblemDetails.md create mode 100644 go-packages/meep-dai-client/git_push.sh create mode 100644 go-packages/meep-dai-client/go.mod create mode 100644 go-packages/meep-dai-client/go.sum create mode 100644 go-packages/meep-dai-client/model_address_change_notification.go create mode 100644 go-packages/meep-dai-client/model_app_context.go create mode 100644 go-packages/meep-dai-client/model_app_context_app_info.go create mode 100644 go-packages/meep-dai-client/model_app_context_app_info_user_app_instance_info.go create mode 100644 go-packages/meep-dai-client/model_app_termination_notification.go create mode 100644 go-packages/meep-dai-client/model_app_termination_notification__links.go create mode 100644 go-packages/meep-dai-client/model_application_context_delete_notification.go create mode 100644 go-packages/meep-dai-client/model_application_context_update_notification.go create mode 100644 go-packages/meep-dai-client/model_application_context_update_notification_user_app_instance_info.go create mode 100644 go-packages/meep-dai-client/model_application_list.go create mode 100644 go-packages/meep-dai-client/model_application_list_app_info.go create mode 100644 go-packages/meep-dai-client/model_application_list_app_info_app_charcs.go create mode 100644 go-packages/meep-dai-client/model_application_list_app_list.go create mode 100644 go-packages/meep-dai-client/model_application_list_vendor_specific_ext.go create mode 100644 go-packages/meep-dai-client/model_application_location_availability.go create mode 100644 go-packages/meep-dai-client/model_application_location_availability_app_info.go create mode 100644 go-packages/meep-dai-client/model_application_location_availability_app_info_available_locations.go create mode 100644 go-packages/meep-dai-client/model_application_location_availability_notification.go create mode 100644 go-packages/meep-dai-client/model_inline_notification.go create mode 100644 go-packages/meep-dai-client/model_link_type.go create mode 100644 go-packages/meep-dai-client/model_links.go create mode 100644 go-packages/meep-dai-client/model_location_constraints.go create mode 100644 go-packages/meep-dai-client/model_location_constraints_civic_address_element.go create mode 100644 go-packages/meep-dai-client/model_one_of_inline_notification.go create mode 100644 go-packages/meep-dai-client/model_operation_action_type.go create mode 100644 go-packages/meep-dai-client/model_polygon.go create mode 100644 go-packages/meep-dai-client/model_problem_details.go create mode 100644 go-packages/meep-dai-client/response.go create mode 100644 go-packages/meep-dai-mgr/convert.go create mode 100644 go-packages/meep-dai-mgr/docker.go create mode 100644 go-packages/meep-dai-mgr/exec.go create mode 100644 go-packages/meep-dai-mgr/format.go create mode 100644 go-packages/meep-dai-mgr/go.mod create mode 100644 go-packages/meep-dai-mgr/go.sum create mode 100644 go-packages/meep-dai-mgr/meep-dai-mgr.go create mode 100644 go-packages/meep-dai-mgr/meep-dai-mgr_test.go diff --git a/charts/meep-dai/.helmignore b/charts/meep-dai/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/charts/meep-dai/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/charts/meep-dai/Chart.yaml b/charts/meep-dai/Chart.yaml new file mode 100644 index 000000000..32539bf19 --- /dev/null +++ b/charts/meep-dai/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0.0" +description: MEEP Device Application Interface Service Helm chart for Kubernetes +name: meep-dai +version: 1.0.0 diff --git a/charts/meep-dai/templates/_helpers.tpl b/charts/meep-dai/templates/_helpers.tpl new file mode 100644 index 000000000..727f78b8b --- /dev/null +++ b/charts/meep-dai/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meep-dai.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "meep-dai.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "meep-dai.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/charts/meep-dai/templates/clusterrolebinding.yaml b/charts/meep-dai/templates/clusterrolebinding.yaml new file mode 100644 index 000000000..0c62196a1 --- /dev/null +++ b/charts/meep-dai/templates/clusterrolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: "{{ .Release.Namespace }}:{{ template "meep-dai.fullname" . }}" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: +- kind: ServiceAccount + name: {{ template "meep-dai.fullname" . }} + namespace: {{ .Release.Namespace }} + \ No newline at end of file diff --git a/charts/meep-dai/templates/codecov-pv.yaml b/charts/meep-dai/templates/codecov-pv.yaml new file mode 100644 index 000000000..7496223d7 --- /dev/null +++ b/charts/meep-dai/templates/codecov-pv.yaml @@ -0,0 +1,35 @@ +{{- if .Values.codecov.enabled}} +kind: PersistentVolume +apiVersion: v1 +metadata: + name: meep-dai-codecov-pv +spec: + storageClassName: meep-dai-codecov-sc + capacity: + storage: 100Mi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: {{ .Values.codecov.location }} + +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: meep-dai-codecov-sc +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: meep-dai-codecov-pvc +spec: + storageClassName: meep-dai-codecov-sc + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +{{- end}} diff --git a/charts/meep-dai/templates/deployment.yaml b/charts/meep-dai/templates/deployment.yaml new file mode 100644 index 000000000..2b23fc5a4 --- /dev/null +++ b/charts/meep-dai/templates/deployment.yaml @@ -0,0 +1,80 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "meep-dai.fullname" . }} + labels: + app: {{ template "meep-dai.name" . }} + chart: {{ template "meep-dai.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + meepOrigin: {{ .Values.meepOrigin }} +spec: + replicas: {{ .Values.deployment.replicas }} + selector: + matchLabels: + app: {{ template "meep-dai.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "meep-dai.name" . }} + release: {{ .Release.Name }} + meepOrigin: {{ .Values.meepOrigin }} + spec: + serviceAccountName: {{ .Values.serviceAccount }} + volumes: + - name: onboardedapp-storage + persistentVolumeClaim: + claimName: meep-dai-onboardedapp-pvc + {{- if .Values.codecov.enabled}} + - name: codecov-storage + persistentVolumeClaim: + claimName: meep-dai-codecov-pvc + {{- end}} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- if .Values.codecov.enabled}} + command: [ "/meep-dai" ] + args: [ "-test.coverprofile=/codecov/codecov-meep-dai.out", "__DEVEL--code-cov" ] + {{- end}} + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.deployment.port }} + protocol: {{ .Values.deployment.protocol }} + - containerPort: 31120 + protocol: TCP + - containerPort: 31121 + protocol: TCP + - containerPort: 31122 + protocol: TCP + - containerPort: 31123 + protocol: TCP + - containerPort: 31124 + protocol: TCP + env: + {{- range $key, $value := .Values.image.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + volumeMounts: + - name: onboardedapp-storage + mountPath: /onboardedapp-vol + {{- if .Values.codecov.enabled}} + - name: codecov-storage + mountPath: /codecov + {{- end}} + terminationGracePeriodSeconds: 5 + initContainers: + {{- range $value := .Values.deployment.dependencies.system }} + - name: init-system-{{ $value }} + image: busybox:1.28 + imagePullPolicy: IfNotPresent + command: ['sh', '-c', 'until nslookup {{ $value }}.kube-system ; do echo waiting for {{ $value }}; sleep 0.25; done;'] + {{- end}} + {{- range $value := .Values.deployment.dependencies.namespace }} + - name: init-{{ $value }} + image: busybox:1.28 + imagePullPolicy: IfNotPresent + command: ['sh', '-c', 'until nslookup {{ $value }} ; do echo waiting for {{ $value }}; sleep 0.25; done;'] + {{- end}} diff --git a/charts/meep-dai/templates/ingress.yaml b/charts/meep-dai/templates/ingress.yaml new file mode 100644 index 000000000..36a9d1c3f --- /dev/null +++ b/charts/meep-dai/templates/ingress.yaml @@ -0,0 +1,38 @@ +{{- if .Values.ingress.enabled -}} +{{- $serviceName := .Values.service.name -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $serviceName }} + labels: + app: {{ template "meep-dai.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.ingress.labels }} +{{ toYaml .Values.ingress.labels | indent 4 }} +{{- end }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + rules: + {{- range .Values.ingress.hosts }} + - http: + paths: + {{- range $path := .paths }} + - path: {{ $path.path }} + backend: + serviceName: {{ $serviceName }} + servicePort: {{ $path.port }} + {{- end -}} + {{- if .name }} + host: {{ .name }} + {{- end }} + {{- end -}} + {{- if .Values.ingress.tls }} + tls: +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end -}} +{{- end -}} diff --git a/charts/meep-dai/templates/monitor.yaml b/charts/meep-dai/templates/monitor.yaml new file mode 100644 index 000000000..2781bf58e --- /dev/null +++ b/charts/meep-dai/templates/monitor.yaml @@ -0,0 +1,33 @@ +{{- if .Values.prometheus.monitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "meep-dai.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "meep-dai.name" . }} + chart: {{ template "meep-dai.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + meepOrigin: {{ .Values.meepOrigin }} + {{- if .Values.prometheus.monitor.additionalLabels }} +{{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }} + {{- end }} +spec: + selector: + matchLabels: + app: {{ template "meep-dai.name" . }} + release: {{ .Release.Name }} + endpoints: + - port: metrics + {{- if .Values.prometheus.monitor.interval }} + interval: {{ .Values.prometheus.monitor.interval }} + {{- end }} + {{- if .Values.prometheus.monitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }} + {{- end }} +{{- if .Values.prometheus.monitor.relabelings }} + relabelings: +{{ toYaml .Values.prometheus.monitor.relabelings | indent 6 }} +{{- end }} +{{- end }} diff --git a/charts/meep-dai/templates/onboardedapp-pv.yaml b/charts/meep-dai/templates/onboardedapp-pv.yaml new file mode 100644 index 000000000..6f3cadfa7 --- /dev/null +++ b/charts/meep-dai/templates/onboardedapp-pv.yaml @@ -0,0 +1,33 @@ +kind: PersistentVolume +apiVersion: v1 +metadata: + name: meep-dai-onboardedapp-pv +spec: + storageClassName: meep-dai-onboardedapp-sc + capacity: + storage: 100Mi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: {{ .Values.onboardedapp.location }} + +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: meep-dai-onboardedapp-sc +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: meep-dai-onboardedapp-pvc +spec: + storageClassName: meep-dai-onboardedapp-sc + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/charts/meep-dai/templates/service.yaml b/charts/meep-dai/templates/service.yaml new file mode 100644 index 000000000..d4a7e020e --- /dev/null +++ b/charts/meep-dai/templates/service.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.service.name }} + labels: + app: {{ template "meep-dai.name" . }} + chart: {{ template "meep-dai.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + meepOrigin: {{ .Values.meepOrigin }} +spec: + type: {{ .Values.service.type }} + selector: + app: {{ template "meep-dai.name" . }} + release: {{ .Release.Name }} + ports: + - name: dai + port: {{ .Values.service.port }} + targetPort: {{ .Values.deployment.port }} + {{- if .Values.service.nodePort }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + - name: onboarded-demo0 + port: 31120 + targetPort: 31120 + - name: onboarded-demo1 + port: 31121 + targetPort: 31122 + - name: onboarded-demo2 + port: 31123 + targetPort: 31123 + - name: onboarded-demo4 + port: 31124 + targetPort: 31124 + {{- if .Values.prometheus.monitor.enabled}} + - name: metrics + port: {{ .Values.prometheus.monitor.port }} + targetPort: {{ .Values.prometheus.monitor.port }} + protocol: TCP + {{- end}} + diff --git a/charts/meep-dai/templates/serviceaccount.yaml b/charts/meep-dai/templates/serviceaccount.yaml new file mode 100644 index 000000000..200057379 --- /dev/null +++ b/charts/meep-dai/templates/serviceaccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "meep-dai.fullname" . }} diff --git a/charts/meep-dai/values-template.yaml b/charts/meep-dai/values-template.yaml new file mode 100644 index 000000000..d81d93bdb --- /dev/null +++ b/charts/meep-dai/values-template.yaml @@ -0,0 +1,123 @@ +# Default values for meep-dai. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +deployment: + replicas: 1 + port: 80 + protocol: TCP + dependencies: + system: + {{- if not .IsMepService }} + - kube-dns + {{- end }} + namespace: + +image: + repository: meep-docker-registry:30001/meep-dai + tag: latest + pullPolicy: Always + env: + MEEP_INSTANCE_ID: {{.InstanceId}} + MEEP_SANDBOX_NAME: {{.SandboxName}} + MEEP_SVC_PATH: /dev_app/v1 + MEEP_HOST_URL: {{.HostUrl}} + {{- if .IsMepService }} + MEEP_MEP_NAME: {{.MepName}} + {{- end }} + {{- if eq .AppEnablement "local" }} + MEEP_APP_ENABLEMENT: {{.MepName}}-meep-app-enablement + {{- else if eq .AppEnablement "global" }} + MEEP_APP_ENABLEMENT: meep-app-enablement + {{- end }} + {{- range .Env}} + {{.}} + {{- end}} + +service: + {{- if .IsMepService }} + name: {{.MepName}}-meep-dai + {{- else }} + name: meep-dai + {{- end }} + type: ClusterIP + port: 80 + +ingress: + enabled: true + hosts: + - name: '' + paths: + {{- if .IsMepService }} + - path: /{{.SandboxName}}/{{.MepName}}/dev_app + port: 80 + - path: /{{.SandboxName}}/{{.MepName}}/onboarded-demo0 + port: 31120 + - path: /{{.SandboxName}}/{{.MepName}}/onboarded-demo1 + port: 31121 + - path: /{{.SandboxName}}/{{.MepName}}/onboarded-demo2 + port: 31122 + - path: /{{.SandboxName}}/{{.MepName}}/onboarded-demo3 + port: 31123 + - path: /{{.SandboxName}}/{{.MepName}}/onboarded-demo4 + port: 31124 + {{- else }} + - path: /{{.SandboxName}}/dev_app + port: 80 + - path: /{{.SandboxName}}/onboarded-demo0 + port: 31120 + - path: /{{.SandboxName}}/onboarded-demo1 + port: 31121 + - path: /{{.SandboxName}}/onboarded-demo2 + port: 31122 + - path: /{{.SandboxName}}/onboarded-demo3 + port: 31123 + - path: /{{.SandboxName}}/onboarded-demo4 + port: 31124 + {{- end }} + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + nginx.ingress.kubernetes.io/force-ssl-redirect: {{ .HttpsOnly }} + {{- if .IsMepService }} + nginx.ingress.kubernetes.io/configuration-snippet: | + rewrite ^/{{.SandboxName}}/{{.MepName}}/dev_app(/|$)(.*)$ /dev_app/$2 break; + rewrite ^/{{.SandboxName}}/{{.MepName}}/onboarded-demo0(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/{{.MepName}}/onboarded-demo1(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/{{.MepName}}/onboarded-demo2(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/{{.MepName}}/onboarded-demo3(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/{{.MepName}}/onboarded-demo4(/|$)(.*)$ /$2 break; + {{- else }} + nginx.ingress.kubernetes.io/configuration-snippet: | + rewrite ^/{{.SandboxName}}/dev_app(/|$)(.*)$ /dev_app/$2 break; + rewrite ^/{{.SandboxName}}/onboarded-demo0(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/onboarded-demo1(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/onboarded-demo2(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/onboarded-demo3(/|$)(.*)$ /$2 break; + rewrite ^/{{.SandboxName}}/onboarded-demo4(/|$)(.*)$ /$2 break; + {{- end }} + {{- if .AuthEnabled }} + nginx.ingress.kubernetes.io/auth-url: https://$http_host/auth/v1/authenticate?svc=meep-dai&sbox={{.SandboxName}}&mep={{.MepName}} + {{- end }} + labels: {} + tls: + +prometheus: + monitor: + enabled: true + port: 9000 + interval: 10s + additionalLabels: {} + relabelings: [] + scrapeTimeout: 5s + +codecov: + enabled: false + location: "/codecov/meep-dai" + +onboardedapp: + enabled: true + location: "/onboardedapp" + +meepOrigin: core diff --git a/docs/api-dai/.openapi-generator-ignore b/docs/api-dai/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/docs/api-dai/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/docs/api-dai/.openapi-generator/FILES b/docs/api-dai/.openapi-generator/FILES new file mode 100644 index 000000000..5cc105ed4 --- /dev/null +++ b/docs/api-dai/.openapi-generator/FILES @@ -0,0 +1,31 @@ +.openapi-generator-ignore +Apis/AppTermApi.md +Apis/DevAppApi.md +Apis/UnsupportedApi.md +Models/AddressChangeNotification.md +Models/AppContext.md +Models/AppContextAppInfo.md +Models/AppContextAppInfoUserAppInstanceInfo.md +Models/AppTerminationNotification.md +Models/AppTerminationNotificationLinks.md +Models/ApplicationContextDeleteNotification.md +Models/ApplicationContextUpdateNotification.md +Models/ApplicationContextUpdateNotificationUserAppInstanceInfo.md +Models/ApplicationList.md +Models/ApplicationListAppInfo.md +Models/ApplicationListAppInfoAppCharcs.md +Models/ApplicationListAppList.md +Models/ApplicationListVendorSpecificExt.md +Models/ApplicationLocationAvailability.md +Models/ApplicationLocationAvailabilityAppInfo.md +Models/ApplicationLocationAvailabilityAppInfoAvailableLocations.md +Models/ApplicationLocationAvailabilityNotification.md +Models/InlineNotification.md +Models/LinkType.md +Models/Links.md +Models/LocationConstraints.md +Models/LocationConstraintsCivicAddressElement.md +Models/OperationActionType.md +Models/Polygon.md +Models/ProblemDetails.md +README.md diff --git a/docs/api-dai/.openapi-generator/VERSION b/docs/api-dai/.openapi-generator/VERSION new file mode 100644 index 000000000..1a487e1a2 --- /dev/null +++ b/docs/api-dai/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-beta2 \ No newline at end of file diff --git a/docs/api-dai/Apis/AppTermApi.md b/docs/api-dai/Apis/AppTermApi.md new file mode 100644 index 000000000..7c368492a --- /dev/null +++ b/docs/api-dai/Apis/AppTermApi.md @@ -0,0 +1,37 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/dev_app/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Mec011AppTerminationPOST**](AppTermApi.md#Mec011AppTerminationPOST) | **Post** /subscriptions/{subscriptionId} | MEC011 Application Termination notification for self termination + +# **Mec011AppTerminationPOST** +> Mec011AppTerminationPOST(ctx, body, subscriptionId) +MEC011 Application Termination notification for self termination + +Terminates itself. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppTerminationNotification**](AppTerminationNotification.md)| Termination notification details | + **subscriptionId** | **string**| Refers to created subscription, where the VIS API allocates a unique resource name for this subscription | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Apis/DevAppApi.md b/docs/api-dai/Apis/DevAppApi.md new file mode 100644 index 000000000..971c6c6de --- /dev/null +++ b/docs/api-dai/Apis/DevAppApi.md @@ -0,0 +1,163 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/dev_app/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AppLocationAvailabilityPOST**](DevAppApi.md#AppLocationAvailabilityPOST) | **Post** /obtain_app_loc_availability | Obtain the location constraints for a new application context. +[**DevAppContextDELETE**](DevAppApi.md#DevAppContextDELETE) | **Delete** /app_contexts/{contextId} | Deletion of an existing application context. +[**DevAppContextPUT**](DevAppApi.md#DevAppContextPUT) | **Put** /app_contexts/{contextId} | Updating the callbackReference and/or appLocation of an existing application context. +[**DevAppContextsPOST**](DevAppApi.md#DevAppContextsPOST) | **Post** /app_contexts | Creation of a new application context. +[**MeAppListGET**](DevAppApi.md#MeAppListGET) | **Get** /app_list | Get available application information. + +# **AppLocationAvailabilityPOST** +> ApplicationLocationAvailability AppLocationAvailabilityPOST(ctx, body) +Obtain the location constraints for a new application context. + +Used to obtain the locations available for instantiation of a specific user application in the MEC system. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**ApplicationLocationAvailability**](ApplicationLocationAvailability.md)| Entity body in the request contains the user application information for the MEC system to evaluate the locations available for instantiation of that application. | + +### Return type + +[**ApplicationLocationAvailability**](ApplicationLocationAvailability.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DevAppContextDELETE** +> DevAppContextDELETE(ctx, contextId) +Deletion of an existing application context. + +Used to delete the resource that represents the existing application context. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **contextId** | **string**| Uniquely identifies the application context in the MEC system. It is assigned by the MEC system. | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DevAppContextPUT** +> DevAppContextPUT(ctx, body, contextId) +Updating the callbackReference and/or appLocation of an existing application context. + +Used to update the callback reference and/or application location constraints of an existing application context. Upon successful operation, the target resource is updated with the new application context information. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppContext**](AppContext.md)| Only the callbackReference and/or appLocation attribute values are allowed to be updated. Other attributes and their values shall remain untouched. | + **contextId** | **string**| Uniquely identifies the application context in the MEC system. It is assigned by the MEC system. | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DevAppContextsPOST** +> AppContext DevAppContextsPOST(ctx, body) +Creation of a new application context. + +Used to create a new application context. Upon success, the response contains entity body describing the created application context. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**AppContext**](AppContext.md)| Entity body in the request contains the Application Context as requested by the device application. | + +### Return type + +[**AppContext**](AppContext.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MeAppListGET** +> ApplicationList MeAppListGET(ctx, optional) +Get available application information. + +Used to query information about the available MEC applications. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***DevAppApiMeAppListGETOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DevAppApiMeAppListGETOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appName** | [**optional.Interface of []string**](string.md)| Name to identify the MEC application. | + **appProvider** | [**optional.Interface of []string**](string.md)| Provider of the MEC application. | + **appSoftVersion** | [**optional.Interface of []string**](string.md)| Software version of the MEC application. | + **vendorId** | [**optional.Interface of []string**](string.md)| Vendor identifier | + **serviceCont** | **optional.Int32**| Required service continuity mode for this application. Permitted values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED. | + +### Return type + +[**ApplicationList**](ApplicationList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Apis/UnsupportedApi.md b/docs/api-dai/Apis/UnsupportedApi.md new file mode 100644 index 000000000..3800e77ad --- /dev/null +++ b/docs/api-dai/Apis/UnsupportedApi.md @@ -0,0 +1,36 @@ +# {{classname}} + +All URIs are relative to *https://localhost/sandboxname/dev_app/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**IndividualSubscriptionDELETE**](UnsupportedApi.md#IndividualSubscriptionDELETE) | **Delete** /subscriptions/{subscriptionId} | Used to cancel the existing subscription. + +# **IndividualSubscriptionDELETE** +> IndividualSubscriptionDELETE(ctx, subscriptionId) +Used to cancel the existing subscription. + +Used to cancel the existing subscription. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **subscriptionId** | **string**| Refers to created subscription, where the VIS API allocates a unique resource name for this subscription | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/AddressChangeNotification.md b/docs/api-dai/Models/AddressChangeNotification.md new file mode 100644 index 000000000..2ffbd0ec0 --- /dev/null +++ b/docs/api-dai/Models/AddressChangeNotification.md @@ -0,0 +1,12 @@ +# AddressChangeNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInstanceId** | **string** | Identifier of the user application instance. | [default to null] +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. | [default to null] +**NotificationType** | **string** | Shall be set to \"AddressChangeNotification\". | [default to null] +**ReferenceURI** | **string** | Address of the user application. Used as the reference URI for the application. Assigned by the MEC system. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/AppContext.md b/docs/api-dai/Models/AppContext.md new file mode 100644 index 000000000..df07f8052 --- /dev/null +++ b/docs/api-dai/Models/AppContext.md @@ -0,0 +1,14 @@ +# AppContext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppAutoInstantiation** | **bool** | Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request. | [optional] [default to null] +**AppInfo** | [***AppContextAppInfo**](AppContext_appInfo.md) | | [default to null] +**AppLocationUpdates** | **bool** | Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation. | [optional] [default to null] +**AssociateDevAppId** | **string** | Uniquely identifies the device application. The length of the value shall not exceed 32 characters. | [default to null] +**CallbackReference** | **string** | URI assigned by the device application to receive application lifecycle related notifications. Inclusion in the request implies the client supports the pub/sub mechanism and is capable of receiving notifications. This endpoint shall be maintained for the lifetime of the application context. | [optional] [default to null] +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. Assigned by the MEC system and shall be present other than in a create request. The length of the value shall not exceed 32 characters. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/AppContextAppInfo.md b/docs/api-dai/Models/AppContextAppInfo.md new file mode 100644 index 000000000..1039a8008 --- /dev/null +++ b/docs/api-dai/Models/AppContextAppInfo.md @@ -0,0 +1,16 @@ +# AppContextAppInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppDId** | **string** | Identifier of this MEC application descriptor. This attribute shall be globally unique. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application is one in the ApplicationList. | [optional] [default to null] +**AppDVersion** | **string** | Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [default to null] +**AppDescription** | **string** | Human readable description of the MEC application. The length of the value shall not exceed 128 characters. | [optional] [default to null] +**AppName** | **string** | Name of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppProvider** | **string** | Provider of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppSoftVersion** | **string** | Software version of the MEC application. The length of the value shall not exceed 32 characters. | [optional] [default to null] +**AppPackageSource** | **string** | URI of the application package. Included in the request if the application is not one in the ApplicationList. appPackageSource enables on-boarding of the application package into the MEC system. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [optional] [default to null] +**UserAppInstanceInfo** | [**[]AppContextAppInfoUserAppInstanceInfo**](AppContext_appInfo_userAppInstanceInfo.md) | List of user application instance information. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/AppContextAppInfoUserAppInstanceInfo.md b/docs/api-dai/Models/AppContextAppInfoUserAppInstanceInfo.md new file mode 100644 index 000000000..9c860343a --- /dev/null +++ b/docs/api-dai/Models/AppContextAppInfoUserAppInstanceInfo.md @@ -0,0 +1,11 @@ +# AppContextAppInfoUserAppInstanceInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInstanceId** | **string** | Identifier of the user application instance. It shall only be included in the response. | [optional] [default to null] +**AppLocation** | [***LocationConstraints**](LocationConstraints.md) | | [optional] [default to null] +**ReferenceURI** | **string** | Address of the user application instance. It shall only be included in the response. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/AppTerminationNotification.md b/docs/api-dai/Models/AppTerminationNotification.md new file mode 100644 index 000000000..8156e455d --- /dev/null +++ b/docs/api-dai/Models/AppTerminationNotification.md @@ -0,0 +1,12 @@ +# AppTerminationNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationType** | **string** | Shall be set to AppTerminationNotification. | [default to null] +**OperationAction** | [***OperationActionType**](OperationActionType.md) | | [default to null] +**MaxGracefulTimeout** | **int32** | Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. | [default to null] +**Links** | [***AppTerminationNotificationLinks**](AppTerminationNotification__links.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/AppTerminationNotificationLinks.md b/docs/api-dai/Models/AppTerminationNotificationLinks.md new file mode 100644 index 000000000..67d7f0d90 --- /dev/null +++ b/docs/api-dai/Models/AppTerminationNotificationLinks.md @@ -0,0 +1,10 @@ +# AppTerminationNotificationLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | [***LinkType**](LinkType.md) | | [default to null] +**ConfirmTermination** | [***LinkType**](LinkType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationContextDeleteNotification.md b/docs/api-dai/Models/ApplicationContextDeleteNotification.md new file mode 100644 index 000000000..1b1bdce5b --- /dev/null +++ b/docs/api-dai/Models/ApplicationContextDeleteNotification.md @@ -0,0 +1,10 @@ +# ApplicationContextDeleteNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContextId** | **string** | Uniquely identifies the application context that has been deleted from the MEC system. | [default to null] +**NotificationType** | **string** | Shall be set to \"ApplicationContextDeleteNotification\". | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationContextUpdateNotification.md b/docs/api-dai/Models/ApplicationContextUpdateNotification.md new file mode 100644 index 000000000..3fadb94b0 --- /dev/null +++ b/docs/api-dai/Models/ApplicationContextUpdateNotification.md @@ -0,0 +1,11 @@ +# ApplicationContextUpdateNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. | [default to null] +**NotificationType** | **string** | Shall be set to \"ApplicationContextUpdateNotification\". | [default to null] +**UserAppInstanceInfo** | [**[]ApplicationContextUpdateNotificationUserAppInstanceInfo**](ApplicationContextUpdateNotification_userAppInstanceInfo.md) | List of user application instance information. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationContextUpdateNotificationUserAppInstanceInfo.md b/docs/api-dai/Models/ApplicationContextUpdateNotificationUserAppInstanceInfo.md new file mode 100644 index 000000000..d754d83ca --- /dev/null +++ b/docs/api-dai/Models/ApplicationContextUpdateNotificationUserAppInstanceInfo.md @@ -0,0 +1,11 @@ +# ApplicationContextUpdateNotificationUserAppInstanceInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInstanceId** | **string** | Identifier of the user application instance. | [optional] [default to null] +**AppLocation** | [***LocationConstraints**](LocationConstraints.md) | | [optional] [default to null] +**ReferenceURI** | **string** | Address of the user application instance. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationList.md b/docs/api-dai/Models/ApplicationList.md new file mode 100644 index 000000000..113b273da --- /dev/null +++ b/docs/api-dai/Models/ApplicationList.md @@ -0,0 +1,9 @@ +# ApplicationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppList** | [**[]ApplicationListAppList**](ApplicationList_appList.md) | List of user applications available to the device application. As defined below. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationListAppInfo.md b/docs/api-dai/Models/ApplicationListAppInfo.md new file mode 100644 index 000000000..7bc421b1b --- /dev/null +++ b/docs/api-dai/Models/ApplicationListAppInfo.md @@ -0,0 +1,16 @@ +# ApplicationListAppInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppCharcs** | [***ApplicationListAppInfoAppCharcs**](ApplicationList_appInfo_appCharcs.md) | | [optional] [default to null] +**AppDId** | **string** | Identifier of this MEC application descriptor. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. This attribute shall be globally unique. | [default to null] +**AppDVersion** | **string** | Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [default to null] +**AppDescription** | **string** | Human readable description of the MEC application (see note 2). | [default to null] +**AppLocation** | [**[]LocationConstraints**](LocationConstraints.md) | Identifies the locations of the MEC application. | [optional] [default to null] +**AppName** | **string** | Name of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppProvider** | **string** | Provider of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppSoftVersion** | **string** | Software version of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationListAppInfoAppCharcs.md b/docs/api-dai/Models/ApplicationListAppInfoAppCharcs.md new file mode 100644 index 000000000..59e4ed4fa --- /dev/null +++ b/docs/api-dai/Models/ApplicationListAppInfoAppCharcs.md @@ -0,0 +1,13 @@ +# ApplicationListAppInfoAppCharcs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bandwidth** | **int32** | The required connection bandwidth in kbit/s for the use of the MEC application instance. | [optional] [default to null] +**Latency** | **int32** | The target round trip time in milliseconds supported by the MEC system for the MEC application instance. | [optional] [default to null] +**Memory** | **int32** | The maximum size in Mbytes of the memory resource expected to be used by the MEC application instance in the MEC system. | [optional] [default to null] +**ServiceCont** | **int32** | Required service continuity mode for this application. Permitted values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED. | [optional] [default to null] +**Storage** | **int32** | The maximum size in Mbytes of the storage resource expected to be used by the MEC application instance in the MEC system. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationListAppList.md b/docs/api-dai/Models/ApplicationListAppList.md new file mode 100644 index 000000000..b167df336 --- /dev/null +++ b/docs/api-dai/Models/ApplicationListAppList.md @@ -0,0 +1,10 @@ +# ApplicationListAppList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInfo** | [***ApplicationListAppInfo**](ApplicationList_appInfo.md) | | [optional] [default to null] +**VendorSpecificExt** | [***ApplicationListVendorSpecificExt**](ApplicationList_vendorSpecificExt.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationListVendorSpecificExt.md b/docs/api-dai/Models/ApplicationListVendorSpecificExt.md new file mode 100644 index 000000000..961a995c7 --- /dev/null +++ b/docs/api-dai/Models/ApplicationListVendorSpecificExt.md @@ -0,0 +1,9 @@ +# ApplicationListVendorSpecificExt + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VendorId** | **string** | Vendor identifier. The length of the value shall not exceed 32 characters. The rest of the structure of vendor specific extension is not defined. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationLocationAvailability.md b/docs/api-dai/Models/ApplicationLocationAvailability.md new file mode 100644 index 000000000..a22113959 --- /dev/null +++ b/docs/api-dai/Models/ApplicationLocationAvailability.md @@ -0,0 +1,10 @@ +# ApplicationLocationAvailability + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInfo** | [***ApplicationLocationAvailabilityAppInfo**](ApplicationLocationAvailability_appInfo.md) | | [default to null] +**AssociateDevAppId** | **string** | Uniquely identifies the device application. The length of the value shall not exceed 32 characters. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationLocationAvailabilityAppInfo.md b/docs/api-dai/Models/ApplicationLocationAvailabilityAppInfo.md new file mode 100644 index 000000000..25afd4bee --- /dev/null +++ b/docs/api-dai/Models/ApplicationLocationAvailabilityAppInfo.md @@ -0,0 +1,15 @@ +# ApplicationLocationAvailabilityAppInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppDVersion** | **string** | Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [default to null] +**AppDescription** | **string** | Human readable description of the MEC application. The length of the value shall not exceed 128 characters. | [optional] [default to null] +**AppName** | **string** | Name of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppPackageSource** | **string** | URI of the application package. Shall be included in the request. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [optional] [default to null] +**AppProvider** | **string** | Provider of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppSoftVersion** | **string** | Software version of the MEC application. The length of the value shall not exceed 32 characters. | [optional] [default to null] +**AvailableLocations** | [**[]ApplicationLocationAvailabilityAppInfoAvailableLocations**](ApplicationLocationAvailability_appInfo_availableLocations.md) | MEC application location constraints. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationLocationAvailabilityAppInfoAvailableLocations.md b/docs/api-dai/Models/ApplicationLocationAvailabilityAppInfoAvailableLocations.md new file mode 100644 index 000000000..6e48bd031 --- /dev/null +++ b/docs/api-dai/Models/ApplicationLocationAvailabilityAppInfoAvailableLocations.md @@ -0,0 +1,9 @@ +# ApplicationLocationAvailabilityAppInfoAvailableLocations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppLocation** | [***LocationConstraints**](LocationConstraints.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ApplicationLocationAvailabilityNotification.md b/docs/api-dai/Models/ApplicationLocationAvailabilityNotification.md new file mode 100644 index 000000000..3850feb48 --- /dev/null +++ b/docs/api-dai/Models/ApplicationLocationAvailabilityNotification.md @@ -0,0 +1,11 @@ +# ApplicationLocationAvailabilityNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvailableLocations** | [**[]ApplicationLocationAvailabilityAppInfoAvailableLocations**](ApplicationLocationAvailability_appInfo_availableLocations.md) | Locations available to the MEC application. | [default to null] +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. | [optional] [default to null] +**NotificationType** | **string** | Shall be set to \"ApplicationLocationAvailabilityNotification\". | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/InlineNotification.md b/docs/api-dai/Models/InlineNotification.md new file mode 100644 index 000000000..f268cd077 --- /dev/null +++ b/docs/api-dai/Models/InlineNotification.md @@ -0,0 +1,8 @@ +# InlineNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/LinkType.md b/docs/api-dai/Models/LinkType.md new file mode 100644 index 000000000..a8945efcd --- /dev/null +++ b/docs/api-dai/Models/LinkType.md @@ -0,0 +1,9 @@ +# LinkType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | URI referring to a resource | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/Links.md b/docs/api-dai/Models/Links.md new file mode 100644 index 000000000..dc27914ca --- /dev/null +++ b/docs/api-dai/Models/Links.md @@ -0,0 +1,9 @@ +# Links + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | [***LinkType**](LinkType.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/LocationConstraints.md b/docs/api-dai/Models/LocationConstraints.md new file mode 100644 index 000000000..c7d4e73f9 --- /dev/null +++ b/docs/api-dai/Models/LocationConstraints.md @@ -0,0 +1,11 @@ +# LocationConstraints + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Area** | [***Polygon**](Polygon.md) | | [optional] [default to null] +**CivicAddressElement** | [**[]LocationConstraintsCivicAddressElement**](LocationConstraints_civicAddressElement.md) | Zero or more elements comprising the civic address. Shall be absent if the \"area\" attribute is present. | [optional] [default to null] +**CountryCode** | **string** | The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the \"area\" attribute is absent. May be absent if the \"area\" attribute is present (see note). | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/LocationConstraintsCivicAddressElement.md b/docs/api-dai/Models/LocationConstraintsCivicAddressElement.md new file mode 100644 index 000000000..70e2d83be --- /dev/null +++ b/docs/api-dai/Models/LocationConstraintsCivicAddressElement.md @@ -0,0 +1,10 @@ +# LocationConstraintsCivicAddressElement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CaType** | **int32** | Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776 [6]. | [optional] [default to null] +**CaValue** | **string** | Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776 [6]. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/OneOfInlineNotification.md b/docs/api-dai/Models/OneOfInlineNotification.md new file mode 100644 index 000000000..442884e24 --- /dev/null +++ b/docs/api-dai/Models/OneOfInlineNotification.md @@ -0,0 +1,8 @@ +# OneOfInlineNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/OperationActionType.md b/docs/api-dai/Models/OperationActionType.md new file mode 100644 index 000000000..4078c9e76 --- /dev/null +++ b/docs/api-dai/Models/OperationActionType.md @@ -0,0 +1,8 @@ +# OperationActionType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/Polygon.md b/docs/api-dai/Models/Polygon.md new file mode 100644 index 000000000..f4cb2c96a --- /dev/null +++ b/docs/api-dai/Models/Polygon.md @@ -0,0 +1,9 @@ +# Polygon + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Coordinates** | [**[][][]float32**](array.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/Models/ProblemDetails.md b/docs/api-dai/Models/ProblemDetails.md new file mode 100644 index 000000000..d6f1dfeb6 --- /dev/null +++ b/docs/api-dai/Models/ProblemDetails.md @@ -0,0 +1,13 @@ +# ProblemDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | **string** | A human-readable explanation specific to this occurrence of the problem | [optional] [default to null] +**Instance** | **string** | A URI reference that identifies the specific occurrence of the problem | [optional] [default to null] +**Status** | **int32** | The HTTP status code for this occurrence of the problem | [optional] [default to null] +**Title** | **string** | A short, human-readable summary of the problem type | [optional] [default to null] +**Type_** | **string** | A URI reference according to IETF RFC 3986 that identifies the problem type | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/api-dai/README.md b/docs/api-dai/README.md new file mode 100644 index 000000000..398bbf915 --- /dev/null +++ b/docs/api-dai/README.md @@ -0,0 +1,53 @@ +# Documentation for ETSI GS MEC 016 Device application interface + + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/sandboxname/dev_app/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AppTermApi* | [**mec011AppTerminationPOST**](Apis/AppTermApi.md#mec011appterminationpost) | **POST** /subscriptions/{subscriptionId} | MEC011 Application Termination notification for self termination +*DevAppApi* | [**appLocationAvailabilityPOST**](Apis/DevAppApi.md#applocationavailabilitypost) | **POST** /obtain_app_loc_availability | Obtain the location constraints for a new application context. +*DevAppApi* | [**devAppContextDELETE**](Apis/DevAppApi.md#devappcontextdelete) | **DELETE** /app_contexts/{contextId} | Deletion of an existing application context. +*DevAppApi* | [**devAppContextPUT**](Apis/DevAppApi.md#devappcontextput) | **PUT** /app_contexts/{contextId} | Updating the callbackReference and/or appLocation of an existing application context. +*DevAppApi* | [**devAppContextsPOST**](Apis/DevAppApi.md#devappcontextspost) | **POST** /app_contexts | Creation of a new application context. +*DevAppApi* | [**meAppListGET**](Apis/DevAppApi.md#meapplistget) | **GET** /app_list | Get available application information. +*UnsupportedApi* | [**individualSubscriptionDELETE**](Apis/UnsupportedApi.md#individualsubscriptiondelete) | **DELETE** /subscriptions/{subscriptionId} | Used to cancel the existing subscription. + + + +## Documentation for Models + + - [AddressChangeNotification](./Models/AddressChangeNotification.md) + - [AppContext](./Models/AppContext.md) + - [AppContextAppInfo](./Models/AppContextAppInfo.md) + - [AppContextAppInfoUserAppInstanceInfo](./Models/AppContextAppInfoUserAppInstanceInfo.md) + - [AppTerminationNotification](./Models/AppTerminationNotification.md) + - [AppTerminationNotificationLinks](./Models/AppTerminationNotificationLinks.md) + - [ApplicationContextDeleteNotification](./Models/ApplicationContextDeleteNotification.md) + - [ApplicationContextUpdateNotification](./Models/ApplicationContextUpdateNotification.md) + - [ApplicationContextUpdateNotificationUserAppInstanceInfo](./Models/ApplicationContextUpdateNotificationUserAppInstanceInfo.md) + - [ApplicationList](./Models/ApplicationList.md) + - [ApplicationListAppInfo](./Models/ApplicationListAppInfo.md) + - [ApplicationListAppInfoAppCharcs](./Models/ApplicationListAppInfoAppCharcs.md) + - [ApplicationListAppList](./Models/ApplicationListAppList.md) + - [ApplicationListVendorSpecificExt](./Models/ApplicationListVendorSpecificExt.md) + - [ApplicationLocationAvailability](./Models/ApplicationLocationAvailability.md) + - [ApplicationLocationAvailabilityAppInfo](./Models/ApplicationLocationAvailabilityAppInfo.md) + - [ApplicationLocationAvailabilityAppInfoAvailableLocations](./Models/ApplicationLocationAvailabilityAppInfoAvailableLocations.md) + - [ApplicationLocationAvailabilityNotification](./Models/ApplicationLocationAvailabilityNotification.md) + - [InlineNotification](./Models/InlineNotification.md) + - [LinkType](./Models/LinkType.md) + - [Links](./Models/Links.md) + - [LocationConstraints](./Models/LocationConstraints.md) + - [LocationConstraintsCivicAddressElement](./Models/LocationConstraintsCivicAddressElement.md) + - [OperationActionType](./Models/OperationActionType.md) + - [Polygon](./Models/Polygon.md) + - [ProblemDetails](./Models/ProblemDetails.md) + + + +## Documentation for Authorization + +All endpoints do not require authorization. diff --git a/go-apps/meep-dai/Dockerfile b/go-apps/meep-dai/Dockerfile new file mode 100644 index 000000000..e0860b021 --- /dev/null +++ b/go-apps/meep-dai/Dockerfile @@ -0,0 +1,32 @@ +# Copyright (c) 2022 The AdvantEDGE Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +FROM debian:9.6-slim + +COPY ./meep-dai /meep-dai +COPY ./api /api +COPY ./user-api /user-api +COPY ./data / +#COPY ./onboardedapp/ /onboardedapp + +VOLUME /onboardedapp-vol + +RUN chmod +x /entrypoint.sh + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends procps + +EXPOSE 31120-31129/tcp + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/go-apps/meep-dai/api/swagger.yaml b/go-apps/meep-dai/api/swagger.yaml new file mode 100644 index 000000000..59c0d8d5a --- /dev/null +++ b/go-apps/meep-dai/api/swagger.yaml @@ -0,0 +1,1663 @@ +openapi: 3.0.0 +info: + title: AdvantEDGE Device Application Interface + description: + Device Application Interface is AdvantEDGE's implementation of [ETSI MEC + ISG MEC016 Device Application Interface API](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/016/02.02.01_60/gs_MEC016v020201p.pdf) +

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) +

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai) +

**Type & Usage**
Edge Service used by edge applications that want to get + information about application information in the network

**Note**
AdvantEDGE supports + a selected subset Device application interface endpoints. + contact: + name: InterDigital AdvantEDGE Support + email: AdvantEDGE@InterDigital.com + license: + name: Apache 2.0 + url: https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE + version: 2.2.1 +externalDocs: + description: ETSI GS MEC016 V2.2.1 Device application interface + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/016/02.02.01_60/gs_MEC016v020201p.pdf +servers: + - url: https://localhost/sandboxname/dev_app/v1 +tags: + - name: dev_app + +paths: + /app_list: + get: + tags: + - dev_app + summary: Get available application information. + description: Used to query information about the available MEC applications. + operationId: meAppListGET + parameters: + - name: appName + in: query + description: Name to identify the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: appProvider + in: query + description: Provider of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: appSoftVersion + in: query + description: Software version of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: vendorId + in: query + description: Vendor identifier + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: serviceCont + in: query + description: "Required service continuity mode for this application. Permitted\ + \ values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED." + required: false + style: form + explode: true + schema: + type: integer + enum: + - 0 + - 1 + responses: + "200": + description: The response body contains an array of the user applications + available to the querying device application. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationList' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /app_contexts: + post: + tags: + - dev_app + summary: Creation of a new application context. + description: "Used to create a new application context. Upon success, the response\ + \ contains entity body describing the created application context." + operationId: devAppContextsPOST + parameters: [] + requestBody: + description: Entity body in the request contains the Application Context as + requested by the device application. + content: + application/json: + schema: + $ref: '#/components/schemas/AppContext' + required: true + responses: + "201": + description: "The response body contains the Application Context as it was\ + \ created by the MEC system, which includes the reference URI(s) of the\ + \ associated user application instance(s). The URI of the resource created\ + \ within the MEC system associated with the request, with its specific\ + \ application context ID, shall be included in the 'Location' HTTP header\ + \ of the response." + content: + application/json: + schema: + $ref: '#/components/schemas/AppContext' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + callbacks: + notification: + '{$request.body#/appContext.callbackReference}': + post: + summary: Callback POST used to send a notification + description: Notification with content based on subscription type + operationId: notificationPOST + requestBody: + description: Subscription notification + content: + application/json: + schema: + $ref: '#/components/schemas/InlineNotification' + example: + notificationType: ApplicationContextDeleteNotification + contextId: contextId123 + required: true + responses: + "204": + description: "Upon success, a response 204 No Content without any\ + \ response body is returned." + /app_contexts/{contextId}: + put: + tags: + - dev_app + summary: Updating the callbackReference and/or appLocation of an existing application + context. + description: "Used to update the callback reference and/or application location\ + \ constraints of an existing application context. Upon successful operation,\ + \ the target resource is updated with the new application context information." + operationId: devAppContextPUT + parameters: + - name: contextId + in: path + description: Uniquely identifies the application context in the MEC system. + It is assigned by the MEC system. + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: Only the callbackReference and/or appLocation attribute values + are allowed to be updated. Other attributes and their values shall remain + untouched. + content: + application/json: + schema: + $ref: '#/components/schemas/AppContext' + required: true + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + delete: + tags: + - dev_app + summary: Deletion of an existing application context. + description: Used to delete the resource that represents the existing application + context. + operationId: devAppContextDELETE + parameters: + - name: contextId + in: path + description: Uniquely identifies the application context in the MEC system. + It is assigned by the MEC system. + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /obtain_app_loc_availability: + post: + tags: + - dev_app + summary: Obtain the location constraints for a new application context. + description: Used to obtain the locations available for instantiation of a specific + user application in the MEC system. + operationId: appLocationAvailabilityPOST + parameters: [] + requestBody: + description: Entity body in the request contains the user application information + for the MEC system to evaluate the locations available for instantiation + of that application. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationLocationAvailability' + required: true + responses: + "200": + description: The response body contains the locations available for instantiation + of the requested user application in the MEC system. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationLocationAvailability' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /subscriptions/{subscriptionId}: + post: + tags: + - app_term + summary: MEC011 Application Termination notification for self termination + description: Terminates itself. + operationId: mec011AppTerminationPOST + parameters: + - name: subscriptionId + in: path + description: "Refers to created subscription, where the VIS API allocates\ + \ a unique resource name for this subscription" + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: Termination notification details + content: + application/json: + schema: + $ref: '#/components/schemas/AppTerminationNotification' + example: + notificationType: AppTerminationNotification + operationAction: TERMINATING + maxGracefulTimeout: 10 + _links: + subscription: + href: http://mec011Server.example.com/mec_app_support/v1/applications/appId1234/subscriptions/sub123 + confirmTermination: + href: http://mec011Server.example.com/mec_app_support/v1/confirm_termination + required: true + responses: + "204": + description: No Content + x-swagger-router-controller: notifications + delete: + tags: + - unsupported + summary: Used to cancel the existing subscription. + description: Used to cancel the existing subscription. + operationId: individualSubscriptionDELETE + parameters: + - name: subscriptionId + in: path + description: "Refers to created subscription, where the VIS API allocates\ + \ a unique resource name for this subscription" + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "429": + description: "Too Many Requests : used when a rate limiter has triggered." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' +components: + schemas: + AddressChangeNotification: + required: + - appInstanceId + - contextId + - notificationType + - referenceURI + type: object + properties: + appInstanceId: + type: string + description: Identifier of the user application instance. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + contextId: + type: string + description: Uniquely identifies the application context in the MEC system. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "AddressChangeNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + referenceURI: + type: string + description: Address of the user application. Used as the reference URI + for the application. Assigned by the MEC system. + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: URI + x-etsi-ref: 6.4.2 + AppContext: + required: + - appInfo + - associateDevAppId + type: object + properties: + appAutoInstantiation: + type: boolean + description: Provides indication to the MEC system that instantiation of + the requested application is desired should a requested appLocation become + available that was not at the time of the request. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Boolean + appInfo: + $ref: '#/components/schemas/AppContext_appInfo' + appLocationUpdates: + type: boolean + description: Used by the device application to request to receive notifications + at the callbackReference URI relating to location availability for user + application instantiation. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Boolean + associateDevAppId: + maxLength: 32 + type: string + description: Uniquely identifies the device application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + callbackReference: + type: string + description: URI assigned by the device application to receive application + lifecycle related notifications. Inclusion in the request implies the + client supports the pub/sub mechanism and is capable of receiving notifications. + This endpoint shall be maintained for the lifetime of the application + context. + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + contextId: + maxLength: 32 + type: string + description: Uniquely identifies the application context in the MEC system. + Assigned by the MEC system and shall be present other than in a create + request. The length of the value shall not exceed 32 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + example: + callbackReference: http://example.com/aeiou + appInfo: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + userAppInstanceInfo: + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + appDId: appDId + appProvider: appProvider + associateDevAppId: associateDevAppId + contextId: contextId + appLocationUpdates: true + appAutoInstantiation: true + x-etsi-notes: "NOTE 1:\tIf a value of the attribute is included in the request,\ + \ the same value shall be included in the response.\nNOTE 2:\tThe design of\ + \ the current operation with callback reference assumes no web proxy between\ + \ the entity that originates the notification and the entity that receives\ + \ it.\nNOTE 3:\tThe language support for the application description may be\ + \ limited.\nNOTE 4:\tAttribute appLocationUpdates and appAutoInstantiation\ + \ shall not both be set to TRUE." + x-etsi-ref: 6.2.3 + ApplicationContextDeleteNotification: + required: + - contextId + - notificationType + type: object + properties: + contextId: + type: string + description: Uniquely identifies the application context that has been deleted + from the MEC system. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "ApplicationContextDeleteNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + x-etsi-ref: 6.4.3 + ApplicationContextUpdateNotification: + required: + - contextId + - notificationType + - userAppInstanceInfo + type: object + properties: + contextId: + type: string + description: Uniquely identifies the application context in the MEC system. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "ApplicationContextUpdateNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + userAppInstanceInfo: + minItems: 1 + required: + - appInstanceId + - referenceURI + type: array + description: List of user application instance information. + items: + $ref: '#/components/schemas/ApplicationContextUpdateNotification_userAppInstanceInfo' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: array (Structure inlined) + x-etsi-ref: 6.4.4 + ApplicationList: + type: object + properties: + appList: + minItems: 0 + required: + - appInfo + type: array + description: List of user applications available to the device application. + As defined below. + items: + $ref: '#/components/schemas/ApplicationList_appList' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: Array (Structure (inlined)) + example: + appList: + - appInfo: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + vendorSpecificExt: + vendorId: vendorId + - appInfo: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + vendorSpecificExt: + vendorId: vendorId + x-etsi-notes: "NOTE 1:\tThe vendor specific extension allows submitting information\ + \ on the application lists that have been made available to the device application\ + \ of the corresponding vendor.\nNOTE 2:\tThe language support may be limited.\ + \ The length of the value shall not exceed 128 characters." + x-etsi-ref: 6.2.2 + ApplicationLocationAvailability: + required: + - appInfo + - associateDevAppId + type: object + properties: + appInfo: + $ref: '#/components/schemas/ApplicationLocationAvailability_appInfo' + associateDevAppId: + maxLength: 32 + type: string + description: Uniquely identifies the device application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + appInfo: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + appProvider: appProvider + availableLocations: + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + associateDevAppId: associateDevAppId + x-etsi-ref: 6.2.4 + ApplicationLocationAvailabilityNotification: + required: + - availableLocations + - notificationType + type: object + properties: + availableLocations: + minItems: 1 + required: + - appLocation + type: array + description: Locations available to the MEC application. + items: + $ref: '#/components/schemas/ApplicationLocationAvailability_appInfo_availableLocations' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: array (Structure (inline)) + contextId: + type: string + description: Uniquely identifies the application context in the MEC system. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "ApplicationLocationAvailabilityNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + x-etsi-ref: 6.4.5 + InlineNotification: + discriminator: + propertyName: NotificationType + oneOf: + - $ref: '#/components/schemas/AddressChangeNotification' + - $ref: '#/components/schemas/ApplicationContextDeleteNotification' + - $ref: '#/components/schemas/ApplicationContextUpdateNotification' + - $ref: '#/components/schemas/ApplicationLocationAvailabilityNotification' + LocationConstraints: + type: object + properties: + area: + $ref: '#/components/schemas/Polygon' + civicAddressElement: + minItems: 0 + required: + - caType + - caValue + type: array + description: Zero or more elements comprising the civic address. Shall be + absent if the "area" attribute is present. + items: + $ref: '#/components/schemas/LocationConstraints_civicAddressElement' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: array (Structure inlined) + countryCode: + maxLength: 2 + type: string + description: "The two-letter ISO 3166 [7] country code in capital letters.\ + \ Shall be present in case the \"area\" attribute is absent. May be absent\ + \ if the \"area\" attribute is present (see note)." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + example: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + x-etsi-notes: "NOTE:\tIf both \"countryCode\" and \"area\" are present, no conflicts\ + \ should exist between the values of these two attributes. In case of conflicts,\ + \ the API producer (e.g. MEO, MEAO) shall disregard parts of the geographic\ + \ area signalled by \"area\" that are outside the boundaries of the country\ + \ signalled by \"countryCode\". If \"countryCode\" is absent, it is solely\ + \ the \"area\" attribute that defines the location constraint." + x-etsi-ref: 6.5.2 + Polygon: + type: object + properties: + coordinates: + minItems: 1 + type: array + items: + type: array + items: + type: array + items: + type: number + format: float + x-etsi-mec-cardinality: 1 + x-etsi-mec-origin-type: array + example: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + ProblemDetails: + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + description: A URI reference that identifies the specific occurrence of + the problem + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + status: + type: integer + description: The HTTP status code for this occurrence of the problem + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + title: + type: string + description: "A short, human-readable summary of the problem type" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + type: + type: string + description: A URI reference according to IETF RFC 3986 that identifies + the problem type + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + Links: + required: + - self + type: object + properties: + self: + $ref: '#/components/schemas/LinkType' + description: Hyperlink related to the resource. This shall be only included + in the HTTP responses and in HTTP PUT requests. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Structure (inlined) + LinkType: + required: + - href + type: object + properties: + href: + type: string + description: URI referring to a resource + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uri + example: + href: http://example.com/aeiou + x-etsi-ref: 6.5.13 + AppTerminationNotification: + required: + - _links + - maxGracefulTimeout + - notificationType + - operationAction + type: object + properties: + notificationType: + type: string + description: Shall be set to AppTerminationNotification. + operationAction: + $ref: '#/components/schemas/OperationActionType' + maxGracefulTimeout: + type: integer + description: Maximum timeout value in seconds for graceful termination or + graceful stop of an application instance. + format: uint32 + _links: + $ref: '#/components/schemas/AppTerminationNotification__links' + description: This type represents the information that the MEC platform notifies + the subscribed application instance about the corresponding application instance + termination/stop. + OperationActionType: + type: string + description: Operation that is being performed on the MEC application instance. + enum: + - STOPPING + - TERMINATING + AppTerminationNotification__links: + required: + - subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/LinkType' + confirmTermination: + $ref: '#/components/schemas/LinkType' + description: Object containing hyperlinks related to the resource. + AppContext_appInfo_userAppInstanceInfo: + type: object + properties: + appInstanceId: + type: string + description: Identifier of the user application instance. It shall only + be included in the response. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appLocation: + $ref: '#/components/schemas/LocationConstraints' + referenceURI: + type: string + description: Address of the user application instance. It shall only be + included in the response. + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + example: + appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + AppContext_appInfo: + required: + - appDVersion + - appName + - appProvider + - userAppInstanceInfo + type: object + properties: + appDId: + type: string + description: "Identifier of this MEC application descriptor. This attribute\ + \ shall be globally unique. It is equivalent to the appDId defined in\ + \ clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application\ + \ is one in the ApplicationList." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appDVersion: + type: string + description: "Identifies the version of the application descriptor. It is\ + \ equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC\ + \ 0102 [1]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDescription: + maxLength: 128 + type: string + description: Human readable description of the MEC application. The length + of the value shall not exceed 128 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appName: + maxLength: 32 + type: string + description: Name of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appProvider: + maxLength: 32 + type: string + description: |- + Provider of the MEC application. + The length of the value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appSoftVersion: + maxLength: 32 + type: string + description: Software version of the MEC application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appPackageSource: + type: string + description: "URI of the application package.\nIncluded in the request if\ + \ the application is not one in the ApplicationList. appPackageSource\ + \ enables on-boarding of the application package into the MEC system.\ + \ The application package shall comply with the definitions in clause\ + \ 6.2.1.2 of ETSI GS MEC 0102 [1]." + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + userAppInstanceInfo: + minItems: 1 + type: array + description: List of user application instance information. + items: + $ref: '#/components/schemas/AppContext_appInfo_userAppInstanceInfo' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: array (Structure inlined) + example: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + userAppInstanceInfo: + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + appDId: appDId + appProvider: appProvider + ApplicationContextUpdateNotification_userAppInstanceInfo: + type: object + properties: + appInstanceId: + type: string + description: Identifier of the user application instance. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appLocation: + $ref: '#/components/schemas/LocationConstraints' + referenceURI: + type: string + description: Address of the user application instance. + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: URI + ApplicationList_appInfo_appCharcs: + type: object + properties: + bandwidth: + type: integer + description: 'The required connection bandwidth in kbit/s for the use of + the MEC application instance. ' + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + latency: + type: integer + description: The target round trip time in milliseconds supported by the + MEC system for the MEC application instance. + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + memory: + type: integer + description: The maximum size in Mbytes of the memory resource expected + to be used by the MEC application instance in the MEC system. + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + serviceCont: + type: integer + description: "Required service continuity mode for this application. Permitted\ + \ values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED." + enum: + - 0 + - 1 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Enum + storage: + type: integer + description: The maximum size in Mbytes of the storage resource expected + to be used by the MEC application instance in the MEC system. + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + description: Characteristics of the application. As defined below. The application + characteristics relate to the system resources consumed by the application. + A device application can use this information e.g. for estimating the cost + of use of the application or for the expected user experience. + example: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + ApplicationList_appInfo: + required: + - appDId + - appDVersion + - appDescription + - appName + - appProvider + - appSoftVersion + type: object + properties: + appCharcs: + $ref: '#/components/schemas/ApplicationList_appInfo_appCharcs' + appDId: + type: string + description: "Identifier of this MEC application descriptor. It is equivalent\ + \ to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. This\ + \ attribute shall be globally unique." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDVersion: + type: string + description: "Identifies the version of the application descriptor. It is\ + \ equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC\ + \ 0102 [1]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDescription: + maxLength: 128 + type: string + description: Human readable description of the MEC application (see note + 2). + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appLocation: + minItems: 0 + type: array + description: Identifies the locations of the MEC application. + items: + $ref: '#/components/schemas/LocationConstraints' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: LocationConstraints + appName: + maxLength: 32 + type: string + description: Name of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appProvider: + maxLength: 32 + type: string + description: Provider of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appSoftVersion: + maxLength: 32 + type: string + description: Software version of the MEC application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + ApplicationList_vendorSpecificExt: + required: + - vendorId + type: object + properties: + vendorId: + maxLength: 32 + type: string + description: Vendor identifier. The length of the value shall not exceed + 32 characters. The rest of the structure of vendor specific extension + is not defined. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + description: Extension for vendor specific information (see note 1). + example: + vendorId: vendorId + ApplicationList_appList: + type: object + properties: + appInfo: + $ref: '#/components/schemas/ApplicationList_appInfo' + vendorSpecificExt: + $ref: '#/components/schemas/ApplicationList_vendorSpecificExt' + example: + appInfo: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + vendorSpecificExt: + vendorId: vendorId + ApplicationLocationAvailability_appInfo_availableLocations: + type: object + properties: + appLocation: + $ref: '#/components/schemas/LocationConstraints' + example: + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + ApplicationLocationAvailability_appInfo: + required: + - appDVersion + - appName + - appProvider + type: object + properties: + appDVersion: + type: string + description: "Identifies the version of the application descriptor. It is\ + \ equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC\ + \ 0102 [1]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDescription: + maxLength: 128 + type: string + description: Human readable description of the MEC application. The length + of the value shall not exceed 128 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appName: + maxLength: 32 + type: string + description: Name of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appPackageSource: + type: string + description: "URI of the application package. Shall be included in the request.\ + \ The application package shall comply with the definitions in clause\ + \ 6.2.1.2 of ETSI GS MEC 0102 [1]." + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + appProvider: + maxLength: 32 + type: string + description: Provider of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appSoftVersion: + maxLength: 32 + type: string + description: Software version of the MEC application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + availableLocations: + minItems: 0 + type: array + description: 'MEC application location constraints. ' + items: + $ref: '#/components/schemas/ApplicationLocationAvailability_appInfo_availableLocations' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: array (Structure (inline)) + example: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + appProvider: appProvider + availableLocations: + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + LocationConstraints_civicAddressElement: + type: object + properties: + caType: + type: integer + description: "Describe the content type of caValue. The value of caType\ + \ shall comply with section 3.4 of IETF RFC 4776 [6]. " + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Integer + caValue: + type: string + description: "Content of civic address element corresponding to the caType.\ + \ The format caValue shall comply with section 3.4 of IETF RFC 4776 [6]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + caType: 7 + caValue: caValue + responses: + "204": + description: "Upon success, a response 204 No Content without any response body\ + \ is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot be\ + \ mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Query.appName: + name: appName + in: query + description: Name to identify the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.appProvider: + name: appProvider + in: query + description: Provider of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.appSoftVersion: + name: appSoftVersion + in: query + description: Software version of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.vendorId: + name: vendorId + in: query + description: Vendor identifier + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.serviceCont: + name: serviceCont + in: query + description: "Required service continuity mode for this application. Permitted\ + \ values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED." + required: false + style: form + explode: true + schema: + type: integer + enum: + - 0 + - 1 + Path.contextId: + name: contextId + in: path + description: Uniquely identifies the application context in the MEC system. + It is assigned by the MEC system. + required: true + style: simple + explode: false + schema: + type: string diff --git a/go-apps/meep-dai/entrypoint.sh b/go-apps/meep-dai/entrypoint.sh new file mode 100644 index 000000000..f003b9551 --- /dev/null +++ b/go-apps/meep-dai/entrypoint.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e + +echo "MEEP_HOST_URL: ${MEEP_HOST_URL}" +echo "MEEP_SANDBOX_NAME: ${MEEP_SANDBOX_NAME}" +echo "MEEP_MEP_NAME: ${MEEP_MEP_NAME}" +echo "MEEP_CODECOV: ${MEEP_CODECOV}" + +if [[ ! -z "${MEEP_MEP_NAME}" ]]; then + svcPath="${MEEP_SANDBOX_NAME}/${MEEP_MEP_NAME}" +else + svcPath="${MEEP_SANDBOX_NAME}" +fi + +# Update API yaml basepaths to enable "Try-it-out" feature +# OAS2: Set relative path to sandbox name + endpoint path (origin will be derived from browser URL) +# OAS3: Set full path to provided Host URL + sandbox name + endpoint path +setBasepath() { + # OAS3 + hostName=$(echo "${MEEP_HOST_URL}" | sed -E 's/^\s*.*:\/\///g') + echo "Replacing [localhost] with ${hostName} to url in: '$1'" + sed -i "s,localhost,${hostName},g" "$1"; + + # OAS2 and OAS3 + echo "Replacing [sandboxname] with ${svcPath} to basepath or url in: '$1'" + sed -i "s,sandboxname,${svcPath},g" "$1"; +} + +# Set basepath for API files +for file in /api/*; do + if [[ ! -e "$file" ]]; then continue; fi + setBasepath "$file" +done + +# Set basepath for user-supplied API files +for file in /user-api/*; do + if [[ ! -e "$file" ]]; then continue; fi + setBasepath "$file" +done + +# Start service +currenttime=`date "+%Y%m%d-%H%M%S"` +filepath="/codecov/codecov-meep-dai-" +filename=$filepath$currenttime".out" +if [ "$MEEP_CODECOV" = 'true' ]; then + exec /meep-dai -test.coverprofile=$filename __DEVEL--code-cov +else + exec /meep-dai +fi + diff --git a/go-apps/meep-dai/go.mod b/go-apps/meep-dai/go.mod new file mode 100644 index 000000000..8999a817c --- /dev/null +++ b/go-apps/meep-dai/go.mod @@ -0,0 +1,47 @@ +module github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-dai + +go 1.12 + +require ( + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-client v0.0.0 // indirect + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-mgr v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model v0.0.0 // indirect + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client v0.0.0-20211214133749-f203f7ab4f1c + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions v0.0.0 + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr v0.0.0 + github.com/antihax/optional v1.0.0 // indirect + github.com/gorilla/handlers v1.5.1 + github.com/gorilla/mux v1.8.0 + github.com/prometheus/client_golang v1.9.0 +) + +replace ( + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client => ../../go-packages/meep-app-support-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-client => ../../go-packages/meep-dai-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-mgr => ../../go-packages/meep-dai-mgr + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr => ../../go-packages/meep-data-key-mgr + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model => ../../go-packages/meep-data-model + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache => ../../go-packages/meep-gis-cache + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger => ../../go-packages/meep-http-logger + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger => ../../go-packages/meep-logger + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics => ../../go-packages/meep-metrics + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model => ../../go-packages/meep-model + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq => ../../go-packages/meep-mq + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis => ../../go-packages/meep-redis + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client => ../../go-packages/meep-sandbox-ctrl-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client => ../../go-packages/meep-service-mgmt-client + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions => ../../go-packages/meep-subscriptions + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr => ../../go-packages/meep-swagger-api-mgr + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-websocket => ../../go-packages/meep-websocket +) diff --git a/go-apps/meep-dai/go.sum b/go-apps/meep-dai/go.sum new file mode 100644 index 000000000..74489b615 --- /dev/null +++ b/go-apps/meep-dai/go.sum @@ -0,0 +1,485 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/InterDigitalInc/AdvantEDGE v1.8.1 h1:2jZJ/Hu6IDweJifEpbOD8PP9pX03AQlZGNnrhv1Die8= +github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client v0.0.0-20211214133749-f203f7ab4f1c h1:DkNlaUmblsbg4nJ00GCqiLW4gf/fxE0uzCqJAv26drU= +github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client v0.0.0-20211214133749-f203f7ab4f1c/go.mod h1:sqsU5VHHOwW4xIgSYeA0p58bzkbD8PnghN1/uhYNE94= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/RyanCarrier/dijkstra v0.0.0-20190726134004-b51cadb5ae52 h1:trnwuu/Q8T59kgRjXcSDBODnyZP9wes+bnLn0lx4PgM= +github.com/RyanCarrier/dijkstra v0.0.0-20190726134004-b51cadb5ae52/go.mod h1:DdR6ymcLl8+sN/XOVNjnYO1NDYfgHskGjreZUDuQCTY= +github.com/RyanCarrier/dijkstra-1 v0.0.0-20170512020943-0e5801a26345/go.mod h1:OK4EvWJ441LQqGzed5NGB6vKBAE34n3z7iayPcEwr30= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/albertorestifo/dijkstra v0.0.0-20160910063646-aba76f725f72/go.mod h1:o+JdB7VetTHjLhU0N57x18B9voDBQe0paApdEAEoEfw= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4= +github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA= +github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= +github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattomatic/dijkstra v0.0.0-20130617153013-6f6d134eb237/go.mod h1:UOnLAUmVG5paym8pD3C4B9BQylUDC2vXFJJpT7JrlEA= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/go-apps/meep-dai/main.go b/go-apps/meep-dai/main.go new file mode 100644 index 000000000..e1492035a --- /dev/null +++ b/go-apps/meep-dai/main.go @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021 ETSI STF 625 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "net/http" + "os" + "os/signal" + "syscall" + "time" + + server "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-dai/server" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + "github.com/prometheus/client_golang/prometheus/promhttp" + + "github.com/gorilla/handlers" +) + +func init() { + // Log as JSON instead of the default ASCII formatter. + log.MeepJSONLogInit("meep-dai") +} + +func main() { + log.Info(os.Args) + + log.Info("Starting DAI Service") + + run := true + go func() { + sigchan := make(chan os.Signal, 10) + signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM) + <-sigchan + log.Info("Program killed !") + // do last actions and wait for all write operations to end + run = false + }() + + go func() { + // Initialize DAI + err := server.Init() + if err != nil { + log.Error("Failed to initialize DAI Service") + run = false + return + } + + // Start DAI Event Handler thread + err = server.Run() + if err != nil { + log.Error("Failed to start DAI Service") + run = false + return + } + + // Start DAI REST API Server + router := server.NewRouter() + methods := handlers.AllowedMethods([]string{"OPTIONS", "DELETE", "GET", "HEAD", "POST", "PUT"}) + header := handlers.AllowedHeaders([]string{"content-type"}) + log.Info("main: Starting listener") + log.Fatal(http.ListenAndServe(":80", handlers.CORS(methods, header)(router))) + run = false + }() + + go func() { + // Initialize Metrics Endpoint + http.Handle("/metrics", promhttp.Handler()) + log.Fatal(http.ListenAndServe(":9000", nil)) + run = false + }() + + count := 0 + for { + if !run { + _ = server.Stop() + log.Info("Ran for ", count, " seconds") + break + } + time.Sleep(time.Second) + count++ + } + +} diff --git a/go-apps/meep-dai/main_test.go b/go-apps/meep-dai/main_test.go new file mode 100644 index 000000000..f12275209 --- /dev/null +++ b/go-apps/meep-dai/main_test.go @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 ETSI STF 625 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "os" + "strings" + "testing" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +// Build: +// $ go test -covermode=count -coverpkg=./... -c -o +// Run: +// $ ./ -test.coverprofile=cover.out __DEVEL--code-cov + +// TestMain is a hack that allows us to figure out what the coverage is during +// integration tests. I would not recommend that you use a binary built using +// this hack outside of a test suite. +func TestMain(t *testing.T) { + var ( + args []string + run bool + ) + + log.Info(os.Args) + for _, arg := range os.Args { + switch { + case arg == "__DEVEL--code-cov": + run = true + case strings.HasPrefix(arg, "-test"): + case strings.HasPrefix(arg, "__DEVEL"): + default: + args = append(args, arg) + } + } + os.Args = args + log.Info(os.Args) + + if run { + main() + } +} diff --git a/go-apps/meep-dai/sbi/dai-sbi.go b/go-apps/meep-dai/sbi/dai-sbi.go new file mode 100644 index 000000000..68bc59f6d --- /dev/null +++ b/go-apps/meep-dai/sbi/dai-sbi.go @@ -0,0 +1,640 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package sbi + +import ( + "errors" + "strconv" + "sync" + + //"time" + + //dataModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model" + tm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-mgr" + gc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" + mod "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model" + mq "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq" + sam "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr" +) + +const moduleName string = "meep-dai-sbi" + +var metricStore *met.MetricStore +var redisAddr string = "meep-redis-master.default.svc.cluster.local:6379" +var influxAddr string = "http://meep-influxdb.default.svc.cluster.local:8086" + +const postgresUser = "postgres" +const postgresPwd = "pwd" + +var notifyAppContextDeletion func(string, string) + +type SbiCfg struct { + ModuleName string + SandboxName string + HostUrl string + MepName string + RedisAddr string + InfluxAddr string + PostgisHost string + PostgisPort string + OnboardedMecApplicationsFolder string + Locality []string + ScenarioNameCb func(string) + AppInfoList func(tm.AppInfoList) + NotifyAppContextDeletion func(string, string) + CleanUpCb func() +} + +type DaiSbi struct { + moduleName string + sandboxName string + hostUrl string + mepName string + scenarioName string + localityEnabled bool + locality map[string]bool + mqLocal *mq.MsgQueue + handlerId int + apiMgr *sam.SwaggerApiMgr + activeModel *mod.Model + gisCache *gc.GisCache + daiMgr *tm.DaiMgr + //refreshTicker *time.Ticker + updateAppInfoCB func(tm.AppInfoList) + updateScenarioNameCB func(string) + cleanUpCB func() + mutex sync.Mutex +} + +var sbi *DaiSbi = nil + +// Init - DAI Service SBI initialization +func Init(cfg SbiCfg) (err error) { + // Create new SBI instance + if sbi != nil { + sbi = nil + } + sbi = new(DaiSbi) + sbi.moduleName = cfg.ModuleName + sbi.sandboxName = cfg.SandboxName + sbi.hostUrl = cfg.HostUrl + sbi.mepName = cfg.MepName + sbi.scenarioName = "" + sbi.updateAppInfoCB = cfg.AppInfoList + sbi.updateScenarioNameCB = cfg.ScenarioNameCb + sbi.cleanUpCB = cfg.CleanUpCb + redisAddr = cfg.RedisAddr + influxAddr = cfg.InfluxAddr + notifyAppContextDeletion = cfg.NotifyAppContextDeletion + + // Fill locality map + if len(cfg.Locality) > 0 { + sbi.locality = make(map[string]bool) + for _, locality := range cfg.Locality { + sbi.locality[locality] = true + } + sbi.localityEnabled = true + } else { + sbi.localityEnabled = false + } + + // Create message queue + sbi.mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sbi.sandboxName), sbi.moduleName, sbi.sandboxName, cfg.RedisAddr) + if err != nil { + log.Error("Failed to create Message Queue with error: ", err) + return err + } + log.Info("Message Queue created") + + // Create Swagger API Manager + log.Info("am.NewSwaggerApiMgr: ", sbi.moduleName, " - ", sbi.sandboxName, " - ", sbi.mepName) + sbi.apiMgr, err = sam.NewSwaggerApiMgr(sbi.moduleName, sbi.sandboxName, sbi.mepName, sbi.mqLocal) + if err != nil { + log.Error("Failed to create Swagger API Manager. Error: ", err) + return err + } + log.Info("Swagger API Manager created") + + // Create new active scenario model + modelCfg := mod.ModelCfg{ + Name: "activeScenario", + Namespace: sbi.sandboxName, + Module: moduleName, + UpdateCb: nil, + DbAddr: cfg.RedisAddr, + } + sbi.activeModel, err = mod.NewModel(modelCfg) + if err != nil { + log.Error("Failed to create model: ", err.Error()) + return err + } + + // Connect to GIS cache + sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) + if err != nil { + log.Error("Failed to GIS Cache: ", err.Error()) + return err + } + log.Info("Connected to GIS Cache") + + // Connect to DAI Manager + cfgDai := tm.DaiCfg{ + Name: sbi.moduleName, + Namespace: sbi.sandboxName, + User: postgresUser, + Pwd: postgresPwd, + Host: cfg.PostgisHost, + Port: cfg.PostgisPort, + NotifyAppContextDeletion: notifyAppContextDeletionSbi, + } + sbi.daiMgr, err = tm.NewDaiMgr(cfgDai) + if err != nil { + log.Error("Failed connection to VIS Traffic Manager: ", err) + return err + } + log.Info("Connected to DAI Manager") + + // Delete any old tables + _ = sbi.daiMgr.DeleteTables() + + // Create new tables + err = sbi.daiMgr.CreateTables() + if err != nil { + log.Error("Failed to create tables: ", err) + return err + } + log.Info("Created new DAI DB tables") + + err = sbi.daiMgr.LoadOnboardedMecApplications(cfg.OnboardedMecApplicationsFolder) + if err != nil { + log.Error("Failed to load simulating data: ", err) + return err + } + log.Info("Created existing application") + + // Initialize service + processActiveScenarioUpdate() + + return nil +} + +// Run - MEEP DAI execution +func Run() (err error) { + + // Start Swagger API Manager (provider) + err = sbi.apiMgr.Start(true, false) + if err != nil { + log.Error("Failed to start Swagger API Manager with error: ", err.Error()) + return err + } + log.Info("Swagger API Manager started") + + // Add module Swagger APIs + err = sbi.apiMgr.AddApis() + if err != nil { + log.Error("Failed to add Swagger APIs with error: ", err.Error()) + return err + } + log.Info("Swagger APIs successfully added") + + // Register Message Queue handler + handler := mq.MsgHandler{Handler: msgHandler, UserData: nil} + sbi.handlerId, err = sbi.mqLocal.RegisterHandler(handler) + if err != nil { + log.Error("Failed to register message queue handler: ", err.Error()) + return err + } + + // Start refresh loop + //startRefreshTicker() + + return nil +} + +func Stop() (err error) { + if sbi == nil { + return + } + + // Stop refresh loop + //stopRefreshTicker() + + if sbi.mqLocal != nil { + sbi.mqLocal.UnregisterHandler(sbi.handlerId) + } + + if sbi.apiMgr != nil { + // Remove APIs + err = sbi.apiMgr.RemoveApis() + if err != nil { + log.Error("Failed to remove APIs with err: ", err.Error()) + return err + } + } + + // Flush all DAI tables + _ = sbi.daiMgr.DeleteTables() + + // Delete DAI instance + if sbi.daiMgr != nil { + err = sbi.daiMgr.DeleteDaiMgr() + if err != nil { + log.Error(err.Error()) + return err + } + } + + return nil +} + +// Message Queue handler +func msgHandler(msg *mq.Msg, userData interface{}) { + switch msg.Message { + case mq.MsgScenarioActivate: + log.Debug("RX MSG: ", mq.PrintMsg(msg)) + processActiveScenarioUpdate() + case mq.MsgScenarioUpdate: + log.Debug("RX MSG: ", mq.PrintMsg(msg)) + processActiveScenarioUpdate() + case mq.MsgScenarioTerminate: + log.Debug("RX MSG: ", mq.PrintMsg(msg)) + processActiveScenarioTerminate() + default: + log.Trace("Ignoring unsupported message: ", mq.PrintMsg(msg)) + } +} + +func processActiveScenarioTerminate() { + log.Debug("processActiveScenarioTerminate") + + // Sync with active scenario store + sbi.activeModel.UpdateScenario() + + sbi.cleanUpCB() +} + +func processActiveScenarioUpdate() { + + sbi.mutex.Lock() + defer sbi.mutex.Unlock() + + log.Debug("processActiveScenarioUpdate") + + // Sync with active scenario store + sbi.activeModel.UpdateScenario() + + scenarioName := sbi.activeModel.GetScenarioName() + + // Connect to Metric Store + sbi.updateScenarioNameCB(scenarioName) + + if scenarioName != sbi.scenarioName { + sbi.scenarioName = scenarioName + var err error + + metricStore, err = met.NewMetricStore(scenarioName, sbi.sandboxName, influxAddr, redisAddr) + if err != nil { + log.Error("Failed connection to metric-store: ", err) + } + } +} + +// ETSI GS MEC 016 V2.2.1 (2020-04) Clause 7.3.3.1 GET +func GetApplicationListAppList(appNames []string, appProviders []string, appSoftVersions []string, vendorIds []string, serviceConts []string) (appListSbi *map[string]*tm.AppInfoList, err error) { + log.Debug("GetApplicationListAppList: ", appNames) + + appListSbi, err = GetAllListAppList() + if err != nil { + log.Error(err.Error()) + return nil, err + } + + // Apply criteria + if len(appNames) != 0 { + filteredAppListSbi := filterAppNames(appNames, appListSbi) + log.Debug("GetApplicationListAppList: After appName, filteredAppListSbi: ", filteredAppListSbi) + if len(appProviders) != 0 && len(filteredAppListSbi) != 0 { + filterExcludeAppProviders(appProviders, &filteredAppListSbi) + log.Debug("GetApplicationListAppList: After appProvider, filteredAppListSbi: ", filteredAppListSbi) + } + if len(appSoftVersions) != 0 && len(filteredAppListSbi) != 0 { + filterExcludeAppSoftVersion(appSoftVersions, &filteredAppListSbi) + log.Debug("GetApplicationListAppList: After appSoftVersion, filteredAppListSbi: ", filteredAppListSbi) + } + // FIXME if len(vendorIds) != 0 && len(filteredAppListSbi) != 0 { + if len(serviceConts) != 0 && len(filteredAppListSbi) != 0 { + filterExcludeServiceConts(serviceConts, &filteredAppListSbi) + log.Debug("GetApplicationListAppList: After appSoftVersion, filteredAppListSbi: ", filteredAppListSbi) + } + + return &filteredAppListSbi, nil + } else if len(appProviders) != 0 { + filteredAppListSbi := filterAppProviders(appProviders, appListSbi) + log.Debug("GetApplicationListAppList: After appProvider, filteredAppListSbi: ", filteredAppListSbi) + if len(appSoftVersions) != 0 && len(filteredAppListSbi) != 0 { + filterExcludeAppSoftVersion(appSoftVersions, &filteredAppListSbi) + log.Debug("GetApplicationListAppList: After appSoftVersion, filteredAppListSbi: ", filteredAppListSbi) + } + // FIXME if len(vendorIds) != 0 && len(filteredAppListSbi) != 0 { + if len(serviceConts) != 0 && len(filteredAppListSbi) != 0 { + filterExcludeServiceConts(serviceConts, &filteredAppListSbi) + log.Debug("GetApplicationListAppList: After appSoftVersion, filteredAppListSbi: ", filteredAppListSbi) + } + + return &filteredAppListSbi, nil + } else if len(appSoftVersions) != 0 { + filteredAppListSbi := filterAppSoftVersions(appSoftVersions, appListSbi) + // FIXME if len(vendorIds) != 0 && len(filteredAppListSbi) != 0 { + if len(serviceConts) != 0 && len(filteredAppListSbi) != 0 { + filterExcludeServiceConts(serviceConts, &filteredAppListSbi) + log.Debug("GetApplicationListAppList: After appSoftVersion, filteredAppListSbi: ", filteredAppListSbi) + } + + return &filteredAppListSbi, nil + // FIXME } else if len(vendorIds) != 0 { + } else if len(serviceConts) != 0 { + filteredAppListSbi := filterServiceConts(serviceConts, appListSbi) + + return &filteredAppListSbi, nil + } + + return appListSbi, nil +} + +func filterAppNames(appNames []string, appListSbi *map[string]*tm.AppInfoList) map[string]*tm.AppInfoList { + filteredAppListSbi := make(map[string]*tm.AppInfoList) + for _, appName := range appNames { + log.Debug("filterAppNames: Processing appName: ", appName) + // Remove quotes + if appName != "" { + appName = appName[1 : len(appName)-1] // Remove quotes + } + log.Debug("filterAppNames: After removing quotes: appName: ", appName) + // Search for the entry + for _, item := range *appListSbi { + if item.AppName == appName { + filteredAppListSbi[appName] = item + } + } // End of 'for' statement + } // End of 'for' statement + + return filteredAppListSbi +} + +func filterAppProviders(appProviders []string, appListSbi *map[string]*tm.AppInfoList) map[string]*tm.AppInfoList { + filteredAppListSbi := make(map[string]*tm.AppInfoList) + for _, appProvider := range appProviders { + log.Debug("filterAppProviders: Processing appProvider: ", appProvider) + // Remove quotes + if appProvider != "" { + appProvider = appProvider[1 : len(appProvider)-1] // Remove quotes + } + log.Debug("filterAppProviders: After removing quotes: appSoftVersion: ", appProvider) + // Search for the entry + for _, item := range *appListSbi { + if item.AppProvider == appProvider { + filteredAppListSbi[item.AppName] = item + } + } // End of 'for' statement + } // End of 'for' statement + + return filteredAppListSbi +} + +func filterAppSoftVersions(appSoftVersions []string, appListSbi *map[string]*tm.AppInfoList) map[string]*tm.AppInfoList { + filteredAppListSbi := make(map[string]*tm.AppInfoList) + for _, appSoftVersion := range appSoftVersions { + log.Debug("filterAppSoftVersions: Processing appSoftVersion: ", appSoftVersion) + // Remove quotes + if appSoftVersion != "" { + appSoftVersion = appSoftVersion[1 : len(appSoftVersion)-1] // Remove quotes + } + log.Debug("filterAppSoftVersions: After removing quotes: appSoftVersion: ", appSoftVersion) + // Search for the entry + for _, item := range *appListSbi { + if item.AppSoftVersion == appSoftVersion { + filteredAppListSbi[item.AppName] = item + } + } // End of 'for' statement + } // End of 'for' statement + + return filteredAppListSbi +} + +func filterServiceConts(serviceConts []string, appListSbi *map[string]*tm.AppInfoList) map[string]*tm.AppInfoList { + filteredAppListSbi := make(map[string]*tm.AppInfoList) + for _, serviceCount := range serviceConts { + log.Debug("filterServiceConts: Processing serviceCount: ", serviceCount) + // Remove quotes + if serviceCount != "" { + serviceCount = serviceCount[1 : len(serviceCount)-1] // Remove quotes + } + log.Debug("filterServiceConts: After removing quotes: appSoftVersion: ", serviceCount) + svcCount, _ := strconv.ParseUint(serviceCount, 10, 32) + svcCount32 := uint32(svcCount) + // Search for the entry + for _, item := range *appListSbi { + if len(item.AppCharcs) != 0 { + for _, sc := range item.AppCharcs { + if sc.ServiceCont != nil && *sc.ServiceCont == svcCount32 { + filteredAppListSbi[item.AppName] = item + break + } + } // End of 'for' statement + } + } // End of 'for' statement + } // End of 'for' statement + + return filteredAppListSbi +} + +func filterExcludeAppProviders(appProviders []string, filteredAppListSbi *map[string]*tm.AppInfoList) { + for _, appProvider := range appProviders { + log.Debug("filterExcludeAppProviders: Processing appProvider: ", appProvider) + // Remove quotes + if appProvider != "" { + appProvider = appProvider[1 : len(appProvider)-1] // Remove quotes + } + log.Debug("filterExcludeAppProviders: After removing quotes: appProvider: ", appProvider) + // Search for the entry + for _, item := range *filteredAppListSbi { + if item.AppProvider != appProvider { + log.Debug("filterExcludeAppProviders: Removing entry: ", item.AppName) + delete(*filteredAppListSbi, item.AppName) + } + } // End of 'for' statement + } // End of 'for' statement +} + +func filterExcludeAppSoftVersion(appSoftVersions []string, filteredAppListSbi *map[string]*tm.AppInfoList) { + for _, appSoftVersion := range appSoftVersions { + log.Debug("GetApplicationListAppList: Processing appProvider: ", appSoftVersion) + // Remove quotes + if appSoftVersion != "" { + appSoftVersion = appSoftVersion[1 : len(appSoftVersion)-1] // Remove quotes + } + log.Debug("GetApplicationListAppList: After removing quotes: appSoftVersion: ", appSoftVersion) + // Search for the entry + for _, item := range *filteredAppListSbi { + if item.AppSoftVersion != appSoftVersion { + log.Debug("GetApplicationListAppList: Removing entry: ", appSoftVersion) + delete(*filteredAppListSbi, item.AppName) + } + } // End of 'for' statement + } // End of 'for' statement +} + +func filterExcludeServiceConts(serviceConts []string, filteredAppListSbi *map[string]*tm.AppInfoList) { + for _, serviceCount := range serviceConts { + log.Debug("filterExcludeServiceConts: Processing serviceCount: ", serviceCount) + // Remove quotes + if serviceCount != "" { + serviceCount = serviceCount[1 : len(serviceCount)-1] // Remove quotes + } + log.Debug("filterExcludeServiceConts: After removing quotes: serviceCount: ", serviceCount) + svcCount, _ := strconv.ParseUint(serviceCount, 10, 32) + svcCount32 := uint32(svcCount) + // Search for the entry + for _, item := range *filteredAppListSbi { + if len(item.AppCharcs) != 0 { + for _, sc := range item.AppCharcs { + if sc.ServiceCont != nil && *sc.ServiceCont != svcCount32 { + log.Debug("filterExcludeServiceConts: Removing entry: ", item.AppName) + delete(*filteredAppListSbi, item.AppName) + break + } + } // End of 'for' statement + } + } // End of 'for' statement + } // End of 'for' statement +} + +func GetAllListAppList() (appListSbi *map[string]*tm.AppInfoList, err error) { + + // Get list of application + appInfoList, err := sbi.daiMgr.GetAllAppInfoListEntry() + if err != nil { + log.Error(err.Error()) + return nil, err + } + appListSbi = &appInfoList + + //sbi.updateAppInfoCB(appListSbi) + return appListSbi, nil +} + +func CreateAppContext(appContextSbi *tm.AppContext) (appContextSbi_ *tm.AppContext, err error) { + + appContextSbi_, err = sbi.daiMgr.CreateAppContext(appContextSbi, sbi.hostUrl, sbi.sandboxName) + if err != nil { + log.Error(err.Error()) + return nil, err + } + + return appContextSbi_, nil +} + +func DeleteAppContext(contextId string) (err error) { + + err = sbi.daiMgr.DeleteAppContext(contextId) + if err != nil { + log.Error(err.Error()) + return err + } + + return nil +} + +func PutAppContext(appContextSbi tm.AppContext) (err error) { + + err = sbi.daiMgr.PutAppContext(appContextSbi) + if err != nil { + log.Error(err.Error()) + return err + } + + return nil +} + +func PosApplicationLocationAvailability(applicationLocationAvailabilitySbi *tm.ApplicationLocationAvailability) (applicationLocationAvailability_ *tm.ApplicationLocationAvailability, err error) { + + // Retrieve the AppInfo data for the specified application + var appNames = []string{strconv.Quote(applicationLocationAvailabilitySbi.AppInfo.AppName)} + var appProviders = []string{strconv.Quote(applicationLocationAvailabilitySbi.AppInfo.AppProvider)} + var appSoftVersions []string + if applicationLocationAvailabilitySbi.AppInfo.AppSoftVersion != nil { + appSoftVersions = []string{strconv.Quote(*applicationLocationAvailabilitySbi.AppInfo.AppSoftVersion)} + } + var vendorIds []string // FIXME To be done + var serviceConts []string // FIXME To be done + appListSbi, err := GetApplicationListAppList(appNames, appProviders, appSoftVersions, vendorIds, serviceConts) + if err != nil { + log.Error(err.Error()) + return nil, err + } + + if len(*appListSbi) == 0 { + err = errors.New("No application found for " + applicationLocationAvailabilitySbi.AppInfo.AppName) + log.Error(err.Error()) + return nil, err + } + + applicationLocationAvailability_ = applicationLocationAvailabilitySbi + for _, item := range *appListSbi { + if item.AppName != applicationLocationAvailabilitySbi.AppInfo.AppName { + err = errors.New("Wrong application found for " + applicationLocationAvailabilitySbi.AppInfo.AppName + "- " + item.AppName) + log.Error(err.Error()) + return nil, err + } + applicationLocationAvailability_.AppInfo.AvailableLocations = make(tm.AvailableLocations, 1) + applicationLocationAvailability_.AppInfo.AvailableLocations[0].AppLocation = new(tm.LocationConstraints) + *applicationLocationAvailability_.AppInfo.AvailableLocations[0].AppLocation = item.AppLocation + break + } // End of 'for' statement + + return applicationLocationAvailability_, nil +} + +func notifyAppContextDeletionSbi(notifyUrl string, appContextId string) { + log.Debug(">>> notifyAppContextDeletionSbi: ", appContextId) + + notifyAppContextDeletion(notifyUrl, appContextId) +} + +/*func isAppConnected(app string) bool { + parentNode := sbi.activeModel.GetNodeParent(app) + if parentNode != nil { + pl := parentNode.(*dataModel.PhysicalLocation) + return pl.Connected + } + return false +} + +func isInLocality(name string) bool { + if sbi.localityEnabled { + ctx := sbi.activeModel.GetNodeContext(name) + if ctx == nil { + log.Error("Error getting context for: " + name) + return false + } + if _, found := sbi.locality[ctx.Parents[mod.Zone]]; !found { + return false + } + } + return true +}*/ diff --git a/go-apps/meep-dai/server/README.md b/go-apps/meep-dai/server/README.md new file mode 100644 index 000000000..a93411a43 --- /dev/null +++ b/go-apps/meep-dai/server/README.md @@ -0,0 +1,26 @@ +# Go API Server for swagger + +The ETSI MEC ISG Device application interface API described using OpenAPI. + +## Overview +This server was generated by the [swagger-codegen] +(https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) + +- API version: 2.2.1 +- Build date: 2022-11-18T08:39:01.863Z[Etc/UTC] +For more information, please visit [https://forge.etsi.org/rep/mec/gs016-dev-app-api](https://forge.etsi.org/rep/mec/gs016-dev-app-api) + + +### Running the server +To run the server, follow these simple steps: + +``` +go run main.go +``` + diff --git a/go-apps/meep-dai/server/api_dai.go b/go-apps/meep-dai/server/api_dai.go new file mode 100644 index 000000000..dadf2f985 --- /dev/null +++ b/go-apps/meep-dai/server/api_dai.go @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "net/http" +) + +func AppLocationAvailabilityPOST(w http.ResponseWriter, r *http.Request) { + appLocationAvailabilityPOST(w, r) +} + +func DevAppContextDELETE(w http.ResponseWriter, r *http.Request) { + devAppContextDELETE(w, r) +} + +func DevAppContextPUT(w http.ResponseWriter, r *http.Request) { + devAppContextPUT(w, r) +} + +func DevAppContextsPOST(w http.ResponseWriter, r *http.Request) { + devAppContextsPOST(w, r) + +} + +func MeAppListGET(w http.ResponseWriter, r *http.Request) { + meAppListGET(w, r) +} + +func Mec011AppTerminationPOST(w http.ResponseWriter, r *http.Request) { + mec011AppTerminationPOST(w, r) +} diff --git a/go-apps/meep-dai/server/api_unsupported.go b/go-apps/meep-dai/server/api_unsupported.go new file mode 100644 index 000000000..235564f2c --- /dev/null +++ b/go-apps/meep-dai/server/api_unsupported.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "net/http" +) + +func IndividualSubscriptionDELETE(w http.ResponseWriter, r *http.Request) { + notImplemented(w, r) +} diff --git a/go-apps/meep-dai/server/convert.go b/go-apps/meep-dai/server/convert.go new file mode 100644 index 000000000..e779b92ea --- /dev/null +++ b/go-apps/meep-dai/server/convert.go @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "encoding/json" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +func convertJsonToAppContext(jsonInfo string) *AppContext { + + var obj AppContext + err := json.Unmarshal([]byte(jsonInfo), &obj) + if err != nil { + log.Error(err.Error()) + return nil + } + return &obj +} + +func convertAppContextToJson(obj *AppContext) string { + + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + + return string(jsonInfo) +} + +func convertJsonToApplicationList(jsonInfo string) *ApplicationList { + + var obj ApplicationList + err := json.Unmarshal([]byte(jsonInfo), &obj) + if err != nil { + log.Error(err.Error()) + return nil + } + return &obj +} + +func convertApplicationListToJson(obj *ApplicationList) string { + + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + + return string(jsonInfo) +} + +func convertApplicationLocationAvailabilityToJson(applicationLocationAvailability *ApplicationLocationAvailability) string { + jsonInfo, err := json.Marshal(*applicationLocationAvailability) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertProblemDetailstoJson(probdetails *ProblemDetails) string { + jsonInfo, err := json.Marshal(*probdetails) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} diff --git a/go-apps/meep-dai/server/dai.go b/go-apps/meep-dai/server/dai.go new file mode 100644 index 000000000..0981d793d --- /dev/null +++ b/go-apps/meep-dai/server/dai.go @@ -0,0 +1,1002 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "os" + "strconv" + "strings" + + //"sync" + "time" + + sbi "github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-dai/sbi" + meepdaimgr "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-mgr" + + asc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-app-support-client" + dkm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr" + gisClient "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client" + httpLog "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger" + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" + redis "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis" + scc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client" + smc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client" + sm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions" + + "github.com/gorilla/mux" +) + +const moduleName = "meep-dai" +const daiBasePath = "dev_app/v1/" +const daiKey = "dai" + +const serviceName = "DAI Service" +const serviceCategory = "DAI" +const defaultMepName = "global" +const defaultScopeOfLocality = "MEC_SYSTEM" +const defaultConsumedLocalOnly = true +const appTerminationPath = "notifications/mec011/appTermination" + +var redisAddr = "meep-redis-master.default.svc.cluster.local:6379" +var influxAddr = "http://meep-influxdb.default.svc.cluster.local:8086" +var sbxCtrlUrl = "http://meep-sandbox-ctrl" + +var currentStoreName = "" + +var DAI_DB = 0 + +var rc *redis.Connector +var hostUrl *url.URL +var instanceId string +var instanceName string +var sandboxName string +var mepName string = defaultMepName +var scopeOfLocality string = defaultScopeOfLocality +var consumedLocalOnly bool = defaultConsumedLocalOnly +var locality []string +var basePath string +var baseKey string + +//var mutex sync.Mutex + +const serviceAppVersion = "2.2.1" + +var serviceAppInstanceId string + +var appEnablementUrl string +var appEnablementEnabled bool +var sendAppTerminationWhenDone bool = false +var appTermSubId string +var appEnablementServiceId string +var appSupportClient *asc.APIClient +var svcMgmtClient *smc.APIClient +var sbxCtrlClient *scc.APIClient + +var processCheckTicker *time.Ticker +var subMgr *sm.SubscriptionMgr = nil + +var gisAppClient *gisClient.APIClient +var gisAppClientUrl string = "http://meep-gis-engine" +var postgresHost string = "" +var postgresPort string = "" + +var onboardedMecApplicationsFolder string = "/onboardedapp-vol/" + +// Notifications +const ( + applicationContextDeleteNotification = "ApplicationContextDeleteNotification" + //applicationContextUpdateNotification = "ApplicationContextUpdateNotification" +) + +// No Subscriptions + +func notImplemented(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusNotImplemented) +} + +func getAppInstanceId() (id string, err error) { + var appInfo scc.ApplicationInfo + appInfo.Id = instanceId + appInfo.Name = serviceCategory + appInfo.Type_ = "SYSTEM" + appInfo.NodeName = mepName + if mepName == defaultMepName { + appInfo.Persist = true + } else { + appInfo.Persist = false + } + response, _, err := sbxCtrlClient.ApplicationsApi.ApplicationsPOST(context.TODO(), appInfo) + if err != nil { + log.Error("Failed to get App Instance ID with error: ", err) + return "", err + } + return response.Id, nil +} + +func deregisterService(appInstanceId string, serviceId string) error { + _, err := svcMgmtClient.MecServiceMgmtApi.AppServicesServiceIdDELETE(context.TODO(), appInstanceId, serviceId) + if err != nil { + log.Error("Failed to unregister the service to app enablement registry: ", err) + return err + } + return nil +} + +func registerService(appInstanceId string) error { + // Build Service Info + state := smc.ACTIVE_ServiceState + serializer := smc.JSON_SerializerType + transportType := smc.REST_HTTP_TransportType + localityType := smc.LocalityType(scopeOfLocality) + srvInfo := smc.ServiceInfoPost{ + SerName: instanceName, + Version: serviceAppVersion, + State: &state, + Serializer: &serializer, + ScopeOfLocality: &localityType, + ConsumedLocalOnly: consumedLocalOnly, + TransportInfo: &smc.TransportInfo{ + Id: "sandboxTransport", + Name: "REST", + Type_: &transportType, + Protocol: "HTTP", + Version: "2.0", + Endpoint: &smc.OneOfTransportInfoEndpoint{}, + }, + SerCategory: &smc.CategoryRef{ + Href: "catalogueHref", + Id: "daiId", + Name: serviceCategory, + Version: "v1", + }, + } + srvInfo.TransportInfo.Endpoint.Uris = append(srvInfo.TransportInfo.Endpoint.Uris, hostUrl.String()+basePath) + + appServicesPostResponse, _, err := svcMgmtClient.MecServiceMgmtApi.AppServicesPOST(context.TODO(), srvInfo, appInstanceId) + if err != nil { + log.Error("Failed to register the service to app enablement registry: ", err) + return err + } + log.Info("Application Enablement Service instance Id: ", appServicesPostResponse.SerInstanceId) + appEnablementServiceId = appServicesPostResponse.SerInstanceId + return nil +} + +func sendReadyConfirmation(appInstanceId string) error { + var appReady asc.AppReadyConfirmation + appReady.Indication = "READY" + _, err := appSupportClient.MecAppSupportApi.ApplicationsConfirmReadyPOST(context.TODO(), appReady, appInstanceId) + if err != nil { + log.Error("Failed to send a ready confirm acknowlegement: ", err) + return err + } + return nil +} + +func sendTerminationConfirmation(appInstanceId string) error { + var appTermination asc.AppTerminationConfirmation + operationAction := asc.TERMINATING_OperationActionType + appTermination.OperationAction = &operationAction + _, err := appSupportClient.MecAppSupportApi.ApplicationsConfirmTerminationPOST(context.TODO(), appTermination, appInstanceId) + if err != nil { + log.Error("Failed to send a confirm termination acknowlegement: ", err) + return err + } + return nil +} + +func subscribeAppTermination(appInstanceId string) error { + var sub asc.AppTerminationNotificationSubscription + sub.SubscriptionType = "AppTerminationNotificationSubscription" + sub.AppInstanceId = appInstanceId + if mepName == defaultMepName { + sub.CallbackReference = "http://" + moduleName + "/" + daiBasePath + appTerminationPath + } else { + sub.CallbackReference = "http://" + mepName + "-" + moduleName + "/" + daiBasePath + appTerminationPath + } + subscription, _, err := appSupportClient.MecAppSupportApi.ApplicationsSubscriptionsPOST(context.TODO(), sub, appInstanceId) + if err != nil { + log.Error("Failed to register to App Support subscription: ", err) + return err + } + appTermSubLink := subscription.Links.Self.Href + appTermSubId = appTermSubLink[strings.LastIndex(appTermSubLink, "/")+1:] + return nil +} + +func unsubscribeAppTermination(appInstanceId string, subId string) error { + //only subscribe to one subscription, so we force number to be one, couldn't be anything else + _, err := appSupportClient.MecAppSupportApi.ApplicationsSubscriptionDELETE(context.TODO(), appInstanceId, subId) + if err != nil { + log.Error("Failed to unregister to App Support subscription: ", err) + return err + } + return nil +} + +func mec011AppTerminationPOST(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + var notification AppTerminationNotification + decoder := json.NewDecoder(r.Body) + err := decoder.Decode(¬ification) + if err != nil { + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + if !appEnablementEnabled { + //just ignore the message + w.WriteHeader(http.StatusNoContent) + return + } + + go func() { + // Wait to allow app termination response to be sent + time.Sleep(20 * time.Millisecond) + + // Deregister service + _ = deregisterService(serviceAppInstanceId, appEnablementServiceId) + + // Delete subscriptions + _ = unsubscribeAppTermination(serviceAppInstanceId, appTermSubId) + + // Confirm App termination if necessary + if sendAppTerminationWhenDone { + _ = sendTerminationConfirmation(serviceAppInstanceId) + } + }() + + w.WriteHeader(http.StatusNoContent) +} + +// Init - DAI Service initialization +func Init() (err error) { + + // Retrieve Instance ID from environment variable if present + instanceIdEnv := strings.TrimSpace(os.Getenv("MEEP_INSTANCE_ID")) + if instanceIdEnv != "" { + instanceId = instanceIdEnv + } + log.Info("MEEP_INSTANCE_ID: ", instanceId) + + // Retrieve Instance Name from environment variable + instanceName = moduleName + instanceNameEnv := strings.TrimSpace(os.Getenv("MEEP_POD_NAME")) + if instanceNameEnv != "" { + instanceName = instanceNameEnv + } + log.Info("MEEP_POD_NAME: ", instanceName) + + // Retrieve Sandbox name from environment variable + sandboxNameEnv := strings.TrimSpace(os.Getenv("MEEP_SANDBOX_NAME")) + if sandboxNameEnv != "" { + sandboxName = sandboxNameEnv + } + if sandboxName == "" { + err = errors.New("MEEP_SANDBOX_NAME env variable not set") + log.Error(err.Error()) + return err + } + log.Info("MEEP_SANDBOX_NAME: ", sandboxName) + + // hostUrl is the url of the node serving the resourceURL + // Retrieve public url address where service is reachable, if not present, use Host URL environment variable + hostUrl, err = url.Parse(strings.TrimSpace(os.Getenv("MEEP_PUBLIC_URL"))) + if err != nil || hostUrl == nil || hostUrl.String() == "" { + hostUrl, err = url.Parse(strings.TrimSpace(os.Getenv("MEEP_HOST_URL"))) + if err != nil { + hostUrl = new(url.URL) + } + } + log.Info("MEEP_HOST_URL: ", hostUrl) + + // Get MEP name + mepNameEnv := strings.TrimSpace(os.Getenv("MEEP_MEP_NAME")) + if mepNameEnv != "" { + mepName = mepNameEnv + } + log.Info("MEEP_MEP_NAME: ", mepName) + + // Get App Enablement URL + appEnablementEnabled = false + appEnablementEnv := strings.TrimSpace(os.Getenv("MEEP_APP_ENABLEMENT")) + if appEnablementEnv != "" { + appEnablementUrl = "http://" + appEnablementEnv + appEnablementEnabled = true + } + log.Info("MEEP_APP_ENABLEMENT: ", appEnablementUrl) + + // Get scope of locality + scopeOfLocalityEnv := strings.TrimSpace(os.Getenv("MEEP_SCOPE_OF_LOCALITY")) + if scopeOfLocalityEnv != "" { + scopeOfLocality = scopeOfLocalityEnv + } + log.Info("MEEP_SCOPE_OF_LOCALITY: ", scopeOfLocality) + + // Get local consumption + consumedLocalOnlyEnv := strings.TrimSpace(os.Getenv("MEEP_CONSUMED_LOCAL_ONLY")) + if consumedLocalOnlyEnv != "" { + value, err := strconv.ParseBool(consumedLocalOnlyEnv) + if err == nil { + consumedLocalOnly = value + } + } + log.Info("MEEP_CONSUMED_LOCAL_ONLY: ", consumedLocalOnly) + + // Get locality + localityEnv := strings.TrimSpace(os.Getenv("MEEP_LOCALITY")) + if localityEnv != "" { + locality = strings.Split(localityEnv, ":") + } + log.Info("MEEP_LOCALITY: ", locality) + + // Set base path + if mepName == defaultMepName { + basePath = "/" + sandboxName + "/" + daiBasePath + } else { + basePath = "/" + sandboxName + "/" + mepName + "/" + daiBasePath + } + + // Set base storage key + baseKey = dkm.GetKeyRoot(sandboxName) + daiKey + ":mep:" + mepName + ":" + + // Connect to Redis DB + rc, err = redis.NewConnector(redisAddr, DAI_DB) + if err != nil { + log.Error("Failed connection to Redis DB (DAI_DB). Error: ", err) + return err + } + _ = rc.DBFlush(baseKey) + log.Info("Connected to Redis DB, DAI service table") + + gisAppClientCfg := gisClient.NewConfiguration() + gisAppClientCfg.BasePath = gisAppClientUrl + "/gis/v1" + + gisAppClient = gisClient.NewAPIClient(gisAppClientCfg) + if gisAppClient == nil { + log.Error("Failed to create GIS App REST API client: ", gisAppClientCfg.BasePath) + err := errors.New("Failed to create GIS App REST API client") + return err + } + + // Initialize SBI + sbiCfg := sbi.SbiCfg{ + ModuleName: moduleName, + SandboxName: sandboxName, + HostUrl: hostUrl.String(), + RedisAddr: redisAddr, + PostgisHost: postgresHost, + PostgisPort: postgresPort, + OnboardedMecApplicationsFolder: onboardedMecApplicationsFolder, + Locality: locality, + ScenarioNameCb: updateStoreName, + AppInfoList: updateAppInfoList, + NotifyAppContextDeletion: notifyAppContextDeletion, + CleanUpCb: cleanUp, + } + if mepName != defaultMepName { + sbiCfg.MepName = mepName + } + err = sbi.Init(sbiCfg) + if err != nil { + log.Fatal("Failed initialize SBI. Error: ", err) + return err + } + log.Info("SBI Initialized") + + // Create App Enablement REST clients + if appEnablementEnabled { + // Create Sandbox Controller client + sbxCtrlClientCfg := scc.NewConfiguration() + sbxCtrlClientCfg.BasePath = sbxCtrlUrl + "/sandbox-ctrl/v1" + sbxCtrlClient = scc.NewAPIClient(sbxCtrlClientCfg) + if sbxCtrlClient == nil { + return errors.New("Failed to create Sandbox Controller REST API client") + } + log.Info("Create Sandbox Controller REST API client") + + // Create App Support client + appSupportClientCfg := asc.NewConfiguration() + appSupportClientCfg.BasePath = appEnablementUrl + "/mec_app_support/v1" + appSupportClient = asc.NewAPIClient(appSupportClientCfg) + if appSupportClient == nil { + return errors.New("Failed to create App Enablement App Support REST API client") + } + log.Info("Create App Enablement App Support REST API client") + + // Create App Info client + srvMgmtClientCfg := smc.NewConfiguration() + srvMgmtClientCfg.BasePath = appEnablementUrl + "/mec_service_mgmt/v1" + svcMgmtClient = smc.NewAPIClient(srvMgmtClientCfg) + if svcMgmtClient == nil { + return errors.New("Failed to create App Enablement Service Management REST API client") + } + log.Info("Create App Enablement Service Management REST API client") + } + + log.Info("DAI successfully initialized") + return nil +} + +// Run - Start DAI +func Run() (err error) { + + // Start MEC Service registration ticker + if appEnablementEnabled { + startprocessCheckTicker() + } + + return sbi.Run() +} + +// Stop - Stop DAI +func Stop() (err error) { + // Stop MEC Service registration ticker + if appEnablementEnabled { + stopprocessCheckTicker() + } + return sbi.Stop() +} + +func startprocessCheckTicker() { + // Make sure ticker is not running + if processCheckTicker != nil { + log.Warn("Registration ticker already running") + return + } + + // Wait a few seconds to allow App Enablement Service to start. + // This is done to avoid the default 20 second TCP socket connect timeout + // if the App Enablement Service is not yet running. + log.Info("Waiting for App Enablement Service to start") + time.Sleep(5 * time.Second) + + // Start registration ticker + processCheckTicker = time.NewTicker(5 * time.Second) + go func() { + mecAppReadySent := false + registrationSent := false + subscriptionSent := false + for range processCheckTicker.C { + // Get Application instance ID + if serviceAppInstanceId == "" { + // If a sandbox service, request an app instance ID from Sandbox Controller + // Otherwise use the scenario-provisioned instance ID + if mepName == defaultMepName { + var err error + serviceAppInstanceId, err = getAppInstanceId() + if err != nil || serviceAppInstanceId == "" { + continue + } + } else { + serviceAppInstanceId = instanceId + } + } + + // Send App Ready message + if !mecAppReadySent { + err := sendReadyConfirmation(serviceAppInstanceId) + if err != nil { + log.Error("Failure when sending the MecAppReady message. Error: ", err) + continue + } + mecAppReadySent = true + } + + // Register service instance + if !registrationSent { + err := registerService(serviceAppInstanceId) + if err != nil { + log.Error("Failed to register to appEnablement DB, keep trying. Error: ", err) + continue + } + registrationSent = true + } + + // Register for graceful termination + if !subscriptionSent { + err := subscribeAppTermination(serviceAppInstanceId) + if err != nil { + log.Error("Failed to subscribe to graceful termination. Error: ", err) + continue + } + sendAppTerminationWhenDone = true + subscriptionSent = true + } + + if mecAppReadySent && registrationSent && subscriptionSent { + + // Registration complete + log.Info("Successfully registered with App Enablement Service") + stopprocessCheckTicker() + return + } + } + }() +} + +func stopprocessCheckTicker() { + if processCheckTicker != nil { + log.Info("Stopping App Enablement registration ticker") + processCheckTicker.Stop() + processCheckTicker = nil + } +} + +func cleanUp() { + log.Info("Terminate all") + + // Flush subscriptions + if subMgr != nil { + _ = subMgr.DeleteAllSubscriptions() + } + + // Flush all service data + rc.DBFlush(baseKey) + + // Reset metrics store name + updateStoreName("") +} + +func updateStoreName(storeName string) { + if currentStoreName != storeName { + currentStoreName = storeName + + logComponent := moduleName + if mepName != defaultMepName { + logComponent = moduleName + "-" + mepName + } + err := httpLog.ReInit(logComponent, sandboxName, storeName, redisAddr, influxAddr) + if err != nil { + log.Error("Failed to initialise httpLog: ", err) + return + } + + } +} + +func updateAppInfoList(obj meepdaimgr.AppInfoList) { + log.Debug(">>> updateAppInfoList: ", obj) + + // TODO Add logic +} + +func meAppListGET(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Extract query parameters + // FIXME Add support of cardinality > 1 + u, _ := url.Parse(r.URL.String()) + log.Info("url: ", u) + q := u.Query() + appName := q["appName"] + appProvider := q["appProvider"] + appSoftVersion := q["appSoftVersion"] + vendorId := q["vendorId"] + serviceCont := q["serviceCont"] + + // log.Debug("meAppListGET: appName: ", appName) + // log.Debug("meAppListGET: appProvider: ", appProvider) + // log.Debug("meAppListGET: appSoftVersion: ", appSoftVersion) + // log.Debug("meAppListGET: vendorId: ", vendorId) + // log.Debug("meAppListGET: serviceCont: ", serviceCont) + + // Get the ApplicationList + appInfoList, err := sbi.GetApplicationListAppList(appName, appProvider, appSoftVersion, vendorId, serviceCont) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + log.Debug("meAppListGET: appInfoList: ", appInfoList) + log.Debug("meAppListGET: len(appInfoList): ", len(*appInfoList)) + + // Build the response + var appList ApplicationList + appList.AppList = make([]ApplicationListAppList, len(*appInfoList)) + //log.Debug("meAppListGET: len(appList.AppList): ", len(appList.AppList)) + var i int32 = 0 + for _, item := range *appInfoList { + appList.AppList[i].AppInfo = new(ApplicationListAppInfo) + appList.AppList[i].AppInfo.AppDId = item.AppDId + appList.AppList[i].AppInfo.AppName = item.AppName + appList.AppList[i].AppInfo.AppProvider = item.AppProvider + appList.AppList[i].AppInfo.AppSoftVersion = item.AppSoftVersion + appList.AppList[i].AppInfo.AppDVersion = item.AppDVersion + appList.AppList[i].AppInfo.AppDescription = item.AppDescription + //log.Debug("meAppListGET: appList.AppList[i].AppInfo: ", appList.AppList[i].AppInfo) + + appList.AppList[i].AppInfo.AppLocation = make([]LocationConstraints, len(item.AppLocation)) + for j, item1 := range item.AppLocation { + if item1.Area != nil { + appList.AppList[i].AppInfo.AppLocation[j].Area = new(Polygon) + appList.AppList[i].AppInfo.AppLocation[j].Area.Coordinates = item1.Area.Coordinates + } else { + appList.AppList[i].AppInfo.AppLocation[j].Area = nil + } + + if item1.CivicAddressElement != nil { + appList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement = make([]LocationConstraintsCivicAddressElement, len(*item1.CivicAddressElement)) + for k, cv := range *item1.CivicAddressElement { + appList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement[k].CaType = cv.CaType + appList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement[k].CaValue = cv.CaValue + } // End of 'for' statement + } else { + appList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement = make([]LocationConstraintsCivicAddressElement, 0) + } + if item1.CountryCode != nil { + appList.AppList[i].AppInfo.AppLocation[j].CountryCode = *item1.CountryCode + } + } // End of 'for' statement + + if len(item.AppCharcs) == 1 { + appList.AppList[i].AppInfo.AppCharcs = new(ApplicationListAppInfoAppCharcs) + if item.AppCharcs[0].Memory != nil { + appList.AppList[i].AppInfo.AppCharcs.Memory = int32(*item.AppCharcs[0].Memory) + } + if item.AppCharcs[0].Storage != nil { + appList.AppList[i].AppInfo.AppCharcs.Storage = int32(*item.AppCharcs[0].Storage) + } + if item.AppCharcs[0].Latency != nil { + appList.AppList[i].AppInfo.AppCharcs.Latency = int32(*item.AppCharcs[0].Latency) + } + if item.AppCharcs[0].Bandwidth != nil { + appList.AppList[i].AppInfo.AppCharcs.Bandwidth = int32(*item.AppCharcs[0].Bandwidth) + } + if item.AppCharcs[0].ServiceCont != nil { + appList.AppList[i].AppInfo.AppCharcs.ServiceCont = int32(*item.AppCharcs[0].ServiceCont) + } + } else { + appList.AppList[i].AppInfo.AppCharcs = nil + } + + appList.AppList[i].VendorSpecificExt = nil // FIXME Not supported yet + + i = i + 1 + } // End of 'for' statement + log.Info("ApplicationList: ", appList) + + // Convert into JSON + var jsonResponse string = convertApplicationListToJson(&appList) + log.Info("json response: ", jsonResponse) + w.WriteHeader(http.StatusOK) + fmt.Fprintf(w, string(jsonResponse)) +} + +func devAppContextsPOST(w http.ResponseWriter, r *http.Request) { + // Retrieve the AppContext message body + var appContext AppContext + bodyBytes, _ := ioutil.ReadAll(r.Body) + err := json.Unmarshal(bodyBytes, &appContext) + if err != nil { + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + log.Info("devAppContextsPOST: ", appContext) + + // Create the AppContext + var appContextSbi meepdaimgr.AppContext + appContextSbi.AppAutoInstantiation = appContext.AppAutoInstantiation + if appContext.AppInfo == nil { + err = errors.New("AppInfo shall be present") + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + appContextSbi.AppInfo.AppDId = new(string) + *appContextSbi.AppInfo.AppDId = appContext.AppInfo.AppDId + appContextSbi.AppInfo.AppDVersion = appContext.AppInfo.AppDVersion + appContextSbi.AppInfo.AppDescription = appContext.AppInfo.AppDescription + appContextSbi.AppInfo.AppName = appContext.AppInfo.AppName + appContextSbi.AppInfo.AppProvider = appContext.AppInfo.AppProvider + appContextSbi.AppInfo.AppSoftVersion = new(string) + *appContextSbi.AppInfo.AppSoftVersion = appContext.AppInfo.AppSoftVersion + appContextSbi.AppInfo.UserAppInstanceInfo = make(meepdaimgr.UserAppInstanceInfo, len(appContext.AppInfo.UserAppInstanceInfo)) + for i, item := range appContext.AppInfo.UserAppInstanceInfo { + if item.AppLocation != nil { + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation = make(meepdaimgr.LocationConstraints, 1) + if item.AppLocation.Area != nil { + area := meepdaimgr.Polygon(*item.AppLocation.Area) + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].Area = &area + } + if len(item.AppLocation.CivicAddressElement) != 0 { + c := make(meepdaimgr.CivicAddressElement, len(item.AppLocation.CivicAddressElement)) + for j, item1 := range item.AppLocation.CivicAddressElement { + c[j].CaType = item1.CaType + c[j].CaValue = item1.CaValue + } // End of 'for' statement + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].CivicAddressElement = &c + } + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].CountryCode = new(string) + *appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].CountryCode = item.AppLocation.CountryCode + } + } // End of 'for' statement + appContextSbi.AppLocationUpdates = appContext.AppLocationUpdates + appContextSbi.AssociateDevAppId = appContext.AssociateDevAppId + appContextSbi.CallbackReference = meepdaimgr.Uri(appContext.CallbackReference) + appContextSbi.ContextId = nil + log.Debug("devAppContextsPOST: Before appContextSbi: ", appContextSbi) + appContextSbi_, err := sbi.CreateAppContext(&appContextSbi) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + log.Debug("devAppContextsPOST: After appContextSbi_: ", appContextSbi_) + log.Debug("devAppContextsPOST: *appContextSbi_.ContextId: ", *appContextSbi_.ContextId) + log.Debug("devAppContextsPOST: appContextSbi_.AppInfo: ", appContextSbi_.AppInfo) + log.Debug("devAppContextsPOST: appContextSbi_.AppInfo.UserAppInstanceInfo: ", appContextSbi_.AppInfo.UserAppInstanceInfo) + + // Update AppContext + appContext.ContextId = *appContextSbi_.ContextId + for i, item := range appContextSbi_.AppInfo.UserAppInstanceInfo { + if item.AppInstanceId != nil { + appContext.AppInfo.UserAppInstanceInfo[i].AppInstanceId = *item.AppInstanceId + } + if item.ReferenceURI != nil { + appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI = string(*item.ReferenceURI) + } + } // End of 'for' statement + + log.Debug("devAppContextsPOST: appContext: ", appContext) + + // Build the response + var jsonResponse string = convertAppContextToJson(&appContext) + log.Info("json response: ", jsonResponse) + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusCreated) + fmt.Fprintf(w, string(jsonResponse)) +} + +func devAppContextDELETE(w http.ResponseWriter, r *http.Request) { + vars := mux.Vars(r) + contextId := vars["contextId"] + log.Debug("devAppContextDELETE: contextId: ", contextId) + err := sbi.DeleteAppContext(contextId) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusNoContent) +} + +func devAppContextPUT(w http.ResponseWriter, r *http.Request) { + vars := mux.Vars(r) + contextId := vars["contextId"] + log.Debug("devAppContextPUT: contextId: ", contextId) + + // Retrive the AppContext message body + var appContext AppContext + bodyBytes, _ := ioutil.ReadAll(r.Body) + err := json.Unmarshal(bodyBytes, &appContext) + if err != nil { + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + log.Info("devAppContextPUT: ", appContext) + + // Sanity checks + if appContext.ContextId != contextId { + err = errors.New("ContextId mismatch") + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // Create the AppContext + var appContextSbi meepdaimgr.AppContext + appContextSbi.AppAutoInstantiation = appContext.AppAutoInstantiation + if appContext.AppInfo == nil { + err = errors.New("AppInfo shall be present") + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + appContextSbi.AppInfo.AppDId = new(string) + *appContextSbi.AppInfo.AppDId = appContext.AppInfo.AppDId + appContextSbi.AppInfo.AppDVersion = appContext.AppInfo.AppDVersion + appContextSbi.AppInfo.AppDescription = appContext.AppInfo.AppDescription + appContextSbi.AppInfo.AppName = appContext.AppInfo.AppName + appContextSbi.AppInfo.AppProvider = appContext.AppInfo.AppProvider + appContextSbi.AppInfo.AppSoftVersion = new(string) + *appContextSbi.AppInfo.AppSoftVersion = appContext.AppInfo.AppSoftVersion + appContextSbi.AppInfo.UserAppInstanceInfo = make(meepdaimgr.UserAppInstanceInfo, len(appContext.AppInfo.UserAppInstanceInfo)) + for i, item := range appContext.AppInfo.UserAppInstanceInfo { + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppInstanceId = new(string) + *appContextSbi.AppInfo.UserAppInstanceInfo[i].AppInstanceId = item.AppInstanceId + appContextSbi.AppInfo.UserAppInstanceInfo[i].ReferenceURI = new(meepdaimgr.Uri) + *appContextSbi.AppInfo.UserAppInstanceInfo[i].ReferenceURI = meepdaimgr.Uri(item.ReferenceURI) + if item.AppLocation != nil { + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation = make(meepdaimgr.LocationConstraints, 1) + if item.AppLocation.Area != nil { + area := meepdaimgr.Polygon(*item.AppLocation.Area) + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].Area = &area + } + if len(item.AppLocation.CivicAddressElement) != 0 { + c := make(meepdaimgr.CivicAddressElement, len(item.AppLocation.CivicAddressElement)) + for j, item1 := range item.AppLocation.CivicAddressElement { + c[j].CaType = item1.CaType + c[j].CaValue = item1.CaValue + } // End of 'for' statement + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].CivicAddressElement = &c + } + appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].CountryCode = new(string) + *appContextSbi.AppInfo.UserAppInstanceInfo[i].AppLocation[0].CountryCode = item.AppLocation.CountryCode + } + } // End of 'for' statement + appContextSbi.AppLocationUpdates = appContext.AppLocationUpdates + appContextSbi.AssociateDevAppId = appContext.AssociateDevAppId + appContextSbi.CallbackReference = meepdaimgr.Uri(appContext.CallbackReference) + appContextSbi.ContextId = new(string) + *appContextSbi.ContextId = appContext.ContextId + log.Debug("devAppContextPUT: appContextSbi: ", appContextSbi) + err = sbi.PutAppContext(appContextSbi) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusNoContent) +} + +func appLocationAvailabilityPOST(w http.ResponseWriter, r *http.Request) { + // Retrive the AppContext message body + var applicationLocationAvailability ApplicationLocationAvailability + bodyBytes, _ := ioutil.ReadAll(r.Body) + err := json.Unmarshal(bodyBytes, &applicationLocationAvailability) + if err != nil { + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + log.Info("appLocationAvailabilityPOST: ", applicationLocationAvailability) + + // Sanity checks + if applicationLocationAvailability.AppInfo == nil { + err = errors.New("AppInfo mismatch") + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + if applicationLocationAvailability.AppInfo.AppPackageSource == "" { // Check presence of the filed AppPackageSource in te request + err = errors.New("AppPackageSource mismatch") + log.Error(err.Error()) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + var applicationLocationAvailabilitySbi meepdaimgr.ApplicationLocationAvailability + applicationLocationAvailabilitySbi.AppInfo = new(meepdaimgr.ApplicationLocationAvailabilityAppInfo) + applicationLocationAvailabilitySbi.AppInfo.AppName = applicationLocationAvailability.AppInfo.AppName + applicationLocationAvailabilitySbi.AppInfo.AppProvider = applicationLocationAvailability.AppInfo.AppProvider + applicationLocationAvailabilitySbi.AppInfo.AppSoftVersion = new(string) + *applicationLocationAvailabilitySbi.AppInfo.AppSoftVersion = applicationLocationAvailability.AppInfo.AppSoftVersion + applicationLocationAvailabilitySbi.AppInfo.AppDVersion = applicationLocationAvailability.AppInfo.AppDVersion + applicationLocationAvailabilitySbi.AppInfo.AppDescription = applicationLocationAvailability.AppInfo.AppDescription + applicationLocationAvailabilitySbi.AppInfo.AppPackageSource = new(meepdaimgr.Uri) + *applicationLocationAvailabilitySbi.AppInfo.AppPackageSource = meepdaimgr.Uri(applicationLocationAvailability.AppInfo.AppPackageSource) + // FIXME Should AvailableLocations field bet set ? + applicationLocationAvailabilitySbi.AssociateDevAppId = applicationLocationAvailability.AssociateDevAppId + applicationLocationAvailabilitySbi_, err := sbi.PosApplicationLocationAvailability(&applicationLocationAvailabilitySbi) + if err != nil { + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) + return + } + + // Build response: only update AvailableLocations field + log.Debug("devAppContextsPOST: applicationLocationAvailabilitySbi_.AppInfo.AvailableLocations: ", applicationLocationAvailabilitySbi_.AppInfo.AvailableLocations) + log.Debug("devAppContextsPOST: len(applicationLocationAvailabilitySbi_.AppInfo.AvailableLocations): ", len(applicationLocationAvailabilitySbi_.AppInfo.AvailableLocations)) + applicationLocationAvailability.AppInfo.AvailableLocations = make([]ApplicationLocationAvailabilityAppInfoAvailableLocations, len(applicationLocationAvailabilitySbi_.AppInfo.AvailableLocations)) + if len(applicationLocationAvailability.AppInfo.AvailableLocations) != 0 { + for i, item := range applicationLocationAvailabilitySbi_.AppInfo.AvailableLocations { + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation = new(LocationConstraints) + + if (*item.AppLocation)[0].Area != nil { + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation.Area = new(Polygon) + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation.Area.Coordinates = (*item.AppLocation)[0].Area.Coordinates + } + + if (*item.AppLocation)[0].CivicAddressElement != nil { + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation.CivicAddressElement = make([]LocationConstraintsCivicAddressElement, len(*(*item.AppLocation)[0].CivicAddressElement)) + for j, cv := range *(*item.AppLocation)[0].CivicAddressElement { + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation.CivicAddressElement[j].CaType = cv.CaType + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation.CivicAddressElement[j].CaValue = cv.CaValue + } // End of 'for' statement + } + + if (*item.AppLocation)[0].CountryCode != nil { + log.Debug("devAppContextsPOST: *(*item.AppLocation)[0].CountryCode: ", *(*item.AppLocation)[0].CountryCode) + applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation.CountryCode = *(*item.AppLocation)[0].CountryCode + } + log.Debug("devAppContextsPOST: applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation: ", applicationLocationAvailability.AppInfo.AvailableLocations[i].AppLocation) + } // End of 'for' statement + } + log.Debug("devAppContextsPOST: applicationLocationAvailability.AppInfo.AvailableLocations: ", applicationLocationAvailability.AppInfo.AvailableLocations) + + // Build the response + var jsonResponse string = convertApplicationLocationAvailabilityToJson(&applicationLocationAvailability) + log.Info("json response: ", jsonResponse) + + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusCreated) + fmt.Fprintf(w, string(jsonResponse)) + + w.WriteHeader(http.StatusOK) +} + +func notifyAppContextDeletion(notifyUrl string, contextId string) { + + url := notifyUrl + "/dai/callback/ApplicationContextDeleteNotification" + startTime := time.Now() + var appContextDeleteNotification = ApplicationContextDeleteNotification{contextId, applicationContextDeleteNotification} + jsonNotif, err := json.Marshal(appContextDeleteNotification) + if err != nil { + log.Error(err.Error()) + } + log.Info("notifyAppContextDeletion: Request body: ", jsonNotif) + + resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonNotif)) + duration := float64(time.Since(startTime).Microseconds()) / 1000.0 + _ = httpLog.LogNotification(url, "POST", "", "", string(jsonNotif), resp, startTime) + if err != nil { + log.Error(err) + met.ObserveNotification(sandboxName, serviceName, applicationContextDeleteNotification, url, nil, duration) + return + } + log.Info("notifyAppContextDeletion: Successfully sent notification: ", resp.Status) + met.ObserveNotification(sandboxName, serviceName, applicationContextDeleteNotification, url, resp, duration) + defer resp.Body.Close() +} + +func errHandlerProblemDetails(w http.ResponseWriter, error string, code int) { + var pd ProblemDetails + pd.Detail = error + pd.Status = int32(code) + + jsonResponse := convertProblemDetailstoJson(&pd) + + w.WriteHeader(code) + fmt.Fprint(w, jsonResponse) +} diff --git a/go-apps/meep-dai/server/dai_test.go b/go-apps/meep-dai/server/dai_test.go new file mode 100644 index 000000000..944e36231 --- /dev/null +++ b/go-apps/meep-dai/server/dai_test.go @@ -0,0 +1,1463 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "os" + "strconv" + "testing" + "time" + + meepdaimgr "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-mgr" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + // met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" + mod "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model" + mq "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq" + + "github.com/gorilla/mux" +) + +//const INITIAL = 0 +//const UPDATED = 1 + +//json format using spacing to facilitate reading +const testScenario string = ` +{ + "version":"1.5.3", + "name":"test-scenario", + "deployment":{ + "netChar":{ + "latency":50, + "latencyVariation":5, + "throughputDl":1000, + "throughputUl":1000 + }, + "domains":[ + { + "id":"PUBLIC", + "name":"PUBLIC", + "type":"PUBLIC", + "netChar":{ + "latency":6, + "latencyVariation":2, + "throughputDl":1000000, + "throughputUl":1000000 + }, + "zones":[ + { + "id":"PUBLIC-COMMON", + "name":"PUBLIC-COMMON", + "type":"COMMON", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000000 + }, + "networkLocations":[ + { + "id":"PUBLIC-COMMON-DEFAULT", + "name":"PUBLIC-COMMON-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":50000, + "throughputUl":50000, + "packetLoss":1 + } + } + ] + } + ] + }, + { + "id":"4da82f2d-1f44-4945-8fe7-00c0431ef8c7", + "name":"operator-cell1", + "type":"OPERATOR-CELLULAR", + "netChar":{ + "latency":6, + "latencyVariation":2, + "throughputDl":1000, + "throughputUl":1000 + }, + "cellularDomainConfig":{ + "mnc":"456", + "mcc":"123", + "defaultCellId":"1234567" + }, + "zones":[ + { + "id":"operator-cell1-COMMON", + "name":"operator-cell1-COMMON", + "type":"COMMON", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000 + }, + "networkLocations":[ + { + "id":"operator-cell1-COMMON-DEFAULT", + "name":"operator-cell1-COMMON-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"0836975f-a7ea-41ec-b0e0-aff43178194d", + "name":"zone1", + "type":"ZONE", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000 + }, + "networkLocations":[ + { + "id":"zone1-DEFAULT", + "name":"zone1-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "physicalLocations":[ + { + "id":"97b80da7-a74a-4649-bb61-f7fa4fbb2d76", + "name":"zone1-edge1", + "type":"EDGE", + "connected":true, + "processes":[ + { + "id":"fcf1269c-a061-448e-aa80-6dd9c2d4c548", + "name":"zone1-edge1-iperf", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/iperf-server", + "commandArguments":"-c, export; iperf -s -p $IPERF_SERVICE_PORT", + "commandExe":"/bin/bash", + "serviceConfig":{ + "name":"zone1-edge1-iperf", + "meSvcName":"iperf", + "ports":[ + { + "protocol":"UDP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"35697e68-c627-4b8d-9cd7-ad8b8e226aee", + "name":"zone1-edge1-svc", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/demo-server", + "environment":"MGM_GROUP_NAME=svc, MGM_APP_ID=zone1-edge1-svc, MGM_APP_PORT=80", + "serviceConfig":{ + "name":"zone1-edge1-svc", + "meSvcName":"svc", + "ports":[ + { + "protocol":"TCP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"7a6f8077-b0b3-403d-b954-3351e21afeb7", + "name":"zone1-poa-cell1", + "type":"POA-4G", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "poa4GConfig":{ + "cellId":"2345678" + }, + "physicalLocations":[ + { + "id":"32a2ced4-a262-49a8-8503-8489a94386a2", + "name":"ue1", + "type":"UE", + "connected":true, + "wireless":true, + "processes":[ + { + "id":"9bdd6acd-f6e4-44f6-a26c-8fd9abd338a7", + "name":"ue1-iperf", + "type":"UE-APP", + "image":"meep-docker-registry:30001/iperf-client", + "commandArguments":"-c, export; iperf -u -c $IPERF_SERVICE_HOST -p $IPERF_SERVICE_PORT\n-t 3600 -b 50M;", + "commandExe":"/bin/bash", + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"b1851da5-c9e1-4bd8-ad23-5925c82ee127", + "name":"zone1-fog1", + "type":"FOG", + "connected":true, + "processes":[ + { + "id":"c2f2fb5d-4053-4cee-a0ee-e62bbb7751b6", + "name":"zone1-fog1-iperf", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/iperf-server", + "commandArguments":"-c, export; iperf -s -p $IPERF_SERVICE_PORT;", + "commandExe":"/bin/bash", + "serviceConfig":{ + "name":"zone1-fog1-iperf", + "meSvcName":"iperf", + "ports":[ + { + "protocol":"UDP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"53b5806b-e213-4c5a-a181-f1c31c24287b", + "name":"zone1-fog1-svc", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/demo-server", + "environment":"MGM_GROUP_NAME=svc, MGM_APP_ID=zone1-fog1-svc, MGM_APP_PORT=80", + "serviceConfig":{ + "name":"zone1-fog1-svc", + "meSvcName":"svc", + "ports":[ + { + "protocol":"TCP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"7ff90180-2c1a-4c11-b59a-3608c5d8d874", + "name":"zone1-poa-cell2", + "type":"POA-4G", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "poa4GConfig":{ + "cellId":"3456789" + } + } + ] + }, + { + "id":"d1f06b00-4454-4d35-94a5-b573888e7ea9", + "name":"zone2", + "type":"ZONE", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughput":1000 + }, + "networkLocations":[ + { + "id":"zone2-DEFAULT", + "name":"zone2-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "physicalLocations":[ + { + "id":"fb130d18-fd81-43e0-900c-c584e7190302", + "name":"zone2-edge1", + "type":"EDGE", + "connected":true, + "processes":[ + { + "id":"5c8276ba-0b78-429d-a0bf-d96f35ba2c77", + "name":"zone2-edge1-iperf", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/iperf-server", + "commandArguments":"-c, export; iperf -s -p $IPERF_SERVICE_PORT;", + "commandExe":"/bin/bash", + "serviceConfig":{ + "name":"zone2-edge1-iperf", + "meSvcName":"iperf", + "ports":[ + { + "protocol":"UDP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"53fa28f0-80e2-414c-8841-86db9bd37d51", + "name":"zone2-edge1-svc", + "type":"EDGE-APP", + "image":"meep-docker-registry:30001/demo-server", + "environment":"MGM_GROUP_NAME=svc, MGM_APP_ID=zone2-edge1-svc, MGM_APP_PORT=80", + "serviceConfig":{ + "name":"zone2-edge1-svc", + "meSvcName":"svc", + "ports":[ + { + "protocol":"TCP", + "port":80 + } + ] + }, + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ], + "netChar":{ + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"c44b8937-58af-44b2-acdb-e4d1c4a1510b", + "name":"zone2-poa1", + "type":"POA", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":20, + "throughputUl":20 + } + } + ] + } + ] + }, + { + "id":"e29138fb-cf03-4372-8335-fd2665b77a11", + "name":"operator1", + "type":"OPERATOR", + "netChar":{ + "latency":6, + "latencyVariation":2, + "throughputDl":1000, + "throughputUl":1000 + }, + "zones":[ + { + "id":"operator1-COMMON", + "name":"operator1-COMMON", + "type":"COMMON", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "networkLocations":[ + { + "id":"operator1-COMMON-DEFAULT", + "name":"operator1-COMMON-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + }, + { + "id":"7d8bee73-6d5c-4c5a-a3a0-49ebe3cd2c71", + "name":"zone3", + "type":"ZONE", + "netChar":{ + "latency":5, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + }, + "networkLocations":[ + { + "id":"zone3-DEFAULT", + "name":"zone3-DEFAULT", + "type":"DEFAULT", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + }, + { + "id":"ecc2a41b-7381-4108-a037-52862c520733", + "name":"poa1", + "type":"POA", + "netChar":{ + "latency":1, + "latencyVariation":1, + "throughputDl":1000, + "throughputUl":1000 + } + } + ] + } + ] + } + ] + } +}` + +const redisTestAddr = "localhost:30380" +const influxTestAddr = "http://localhost:30986" +const testScenarioName = "testScenario" + +var m *mod.Model +var mqLocal *mq.MsgQueue + +const ( + postgresTestHost = "localhost" + postgresTestPort = "30432" +) + +const ( + associateDevAppId1 = "associateDevAppId1" + callbackReference1 = "callbackReference1" + appName1 = "appName1" + appProvider1 = "appProvider1" + appDVersion1 = "appDVersion1" + appDescription1 = "appDescription1" + + callbackReference2 = "callbackReference2" +) + +var ( // Need to take address + contextId1 string = "contextId1" + appDId1 string = "appDId1" + appSoftVersion1 string = "appSoftVersion1" + appPackageSource1 string = "appPackageSource1" + referenceURI1_1 meepdaimgr.Uri = "referenceURI1-1" + area1 = Polygon{[][][]float32{{{7.43166, 43.736156}, {7.431723, 43.736115}, {7.431162, 43.735607}, {7.430685, 43.73518}}}} + civicAddressElement1 = []LocationConstraintsCivicAddressElement{{2, "Value2"}, {20, "Value20"}} + countryCode1 string = "countryCode1" + memory1 int32 = 1024 * 2 + storage1 int32 = 1024 * 2 + latency1 int32 = 1024 * 2 + bandwidth1 int32 = 1024 * 2 + serviceCont1 int32 = 1 +) + +func TestNotImplemented(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + _, err := sendRequest(http.MethodDelete, "/subscriptions/1", nil, nil, nil, http.StatusNotImplemented, IndividualSubscriptionDELETE) + if err != nil { + t.Fatalf("Failed to get expected response") + } + +} + +func TestAppListGET(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + /****************************** + * expected response section + ******************************/ + // Fill LocationConstraints + appLocationConstraints := make([]LocationConstraints, 2) + appLocationConstraints[0] = LocationConstraints{&area1, make([]LocationConstraintsCivicAddressElement, 0), countryCode1} + appLocationConstraints[1] = LocationConstraints{nil, make([]LocationConstraintsCivicAddressElement, 1), ""} + appLocationConstraints[1].CivicAddressElement = civicAddressElement1 + // Fill ApplicationListAppInfo + var appInfo ApplicationListAppInfo + appInfo.AppDId = appDId1 + appInfo.AppDVersion = appDVersion1 + appInfo.AppDescription = appDescription1 + appInfo.AppLocation = appLocationConstraints + appInfo.AppName = appName1 + appInfo.AppProvider = appProvider1 + appInfo.AppSoftVersion = appSoftVersion1 + // Fill ApplicationListAppList + var applicationListAppList ApplicationListAppList + applicationListAppList.AppInfo = &appInfo + applicationListAppList.VendorSpecificExt = nil + appInfo.AppCharcs = new(ApplicationListAppInfoAppCharcs) + appInfo.AppCharcs.Memory = memory1 + appInfo.AppCharcs.Storage = storage1 + appInfo.AppCharcs.Latency = latency1 + appInfo.AppCharcs.Bandwidth = bandwidth1 + appInfo.AppCharcs.ServiceCont = serviceCont1 + + var appList ApplicationList + appList.AppList = make([]ApplicationListAppList, 1) + appList.AppList[0] = applicationListAppList + log.Info("ApplicationList: ", appList) + // Convert into JSON + var expected_json_response string = convertApplicationListToJson(&appList) + log.Info("json response: ", expected_json_response) + + // Get all onboarded MEC application + fmt.Println("Get all onboarded MEC application") + rr, err := sendRequest(http.MethodGet, "/app_list", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + var respBody ApplicationList + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList := convertJsonToApplicationList(rr) + if len(receivedAppList.AppList) != 2 { + t.Errorf("handler returned unexpected body.") + } + // if !validateApplicationList(&receivedAppList, fullAppList) { + // t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + // } + log.Info("Received expected response") + + // Get onboarded MEC application using appName filter + fmt.Println("Get onboarded MEC application using appName filter") + rr, err = sendRequest(http.MethodGet, "/app_list?appName=\""+appName1+"\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, appList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + // Unknown appName + rr, err = sendRequest(http.MethodGet, "/app_list?appName=\"unknownApp\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + var emptyApplicationList ApplicationList + if !validateApplicationList(receivedAppList, emptyApplicationList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + + // Get onboarded MEC application using appProvider filter + fmt.Println("Get onboarded MEC application using appProvider filter") + rr, err = sendRequest(http.MethodGet, "/app_list?appProvider=\""+appProvider1+"\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, appList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + // Unknown appProvider + rr, err = sendRequest(http.MethodGet, "/app_list?appProvider=\"unknownAppProvider\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, emptyApplicationList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + + // Get onboarded MEC application using appSoftVersion filter + fmt.Println("Get onboarded MEC application using appSoftVersion filter") + rr, err = sendRequest(http.MethodGet, "/app_list?appSoftVersion=\""+appSoftVersion1+"\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, appList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + // Unknown appSoftVersion + rr, err = sendRequest(http.MethodGet, "/app_list?appSoftVersion=\"unknownAppSoftVersion\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, emptyApplicationList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + + // TODO Get onboarded MEC application using appVendorId filter + fmt.Println("Get onboarded MEC application using appVendorId filter") + + // TODO Get onboarded MEC application using serviceCont filter + fmt.Println("Get onboarded MEC application using serviceCont filter") + rr, err = sendRequest(http.MethodGet, "/app_list?serviceCont=\""+strconv.Itoa(int(serviceCont1))+"\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, appList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + + // Get onboarded MEC application using appName + appProvider filter + fmt.Println("Get onboarded MEC application using appName + appProvider filter") + rr, err = sendRequest(http.MethodGet, "/app_list?appName=\""+appName1+"\"&appProvider=\""+appProvider1+"\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, appList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + // Known appName and unknown appProvider + rr, err = sendRequest(http.MethodGet, "/app_list?appName=\""+appName1+"\"&appProvider=\"unknownAppProvider\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, emptyApplicationList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + + // Get onboarded MEC application using appName + appSoftVersion filter + fmt.Println("Get onboarded MEC application using appName + appSoftVersion filter") + rr, err = sendRequest(http.MethodGet, "/app_list?appName=\""+appName1+"\"&appSoftVersion=\""+appSoftVersion1+"\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, appList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + // Known appName and unknown appSoftVersion + rr, err = sendRequest(http.MethodGet, "/app_list?appName=\""+appName1+"\"&appSoftVersion=\"unknownAppSoftVersion\"", nil, nil, nil, http.StatusOK, MeAppListGET) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppList = convertJsonToApplicationList(rr) + if !validateApplicationList(receivedAppList, emptyApplicationList) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + log.Info("Received expected response") + + // TODO Get onboarded MEC application using appName + appProvider + appSoftVersion filter + fmt.Println("Get onboarded MEC application using appName + appProvider + appSoftVersion filter") + + terminateScenario() +} + +func TestDevAppContextsPOST(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + testDevAppContextsPOST(t) + + log.Info("Received expected response") + + /****************************** + * back to initial state section + ******************************/ + terminateScenario() +} + +func TestDevAppContextDELETE(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + appContext := testDevAppContextsPOST(t) + log.Info("Received expected response") + + /****************************** + * expected response section + ******************************/ + + /****************************** + * request execution section + ******************************/ + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["contextId"] = appContext.ContextId + + _, err = sendRequest(http.MethodDelete, "/app_contexts", nil, vars, nil, http.StatusNoContent, DevAppContextDELETE) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + /****************************** + * back to initial state section + ******************************/ + terminateScenario() +} + +func TestDevAppContextPUT(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + initializeVars() + + err := Init() + if err != nil { + t.Fatalf("Error initializing test basic procedure") + } + err = Run() + if err != nil { + t.Fatalf("Error running test basic procedure") + } + + fmt.Println("Set a scenario") + initialiseScenario(testScenario) + + time.Sleep(1000 * time.Millisecond) + updateScenario("mobility1") + + appContext := testDevAppContextsPOST(t) + log.Info("Received expected response") + + /****************************** + * expected response section + ******************************/ + + /****************************** + * request execution section + ******************************/ + + /****************************** + * request vars section + ******************************/ + vars := make(map[string]string) + vars["contextId"] = appContext.ContextId + + // Update appContext.CallbackReference + appContext.CallbackReference = callbackReference2 + log.Info("New appContext: ", appContext) + // Convert into JSON + body, err := json.Marshal(appContext) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request execution section + ******************************/ + _, err = sendRequest(http.MethodPut, "/app_contexts", bytes.NewBuffer(body), vars, nil, http.StatusNoContent, DevAppContextPUT) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + /****************************** + * back to initial state section + ******************************/ + terminateScenario() +} + +func testDevAppContextsPOST(t *testing.T) *AppContext { + + /****************************** + * expected response section + ******************************/ + // Fill LocationConstraints + var expected_appLocationConstraints = LocationConstraints{&area1, make([]LocationConstraintsCivicAddressElement, 1), countryCode1} + expected_appLocationConstraints.CivicAddressElement = civicAddressElement1 + // Fill UserAppInstanceInfo + expected_appContextAppInfoUserAppInstanceInfo := make([]AppContextAppInfoUserAppInstanceInfo, 1) + expected_appContextAppInfoUserAppInstanceInfo[0].AppLocation = &expected_appLocationConstraints + expected_appContextAppInfoUserAppInstanceInfo[0].ReferenceURI = string(referenceURI1_1) + // Fill AppContextAppInfo + var expected_appContextAppInfo AppContextAppInfo + expected_appContextAppInfo.AppDId = appDId1 + expected_appContextAppInfo.AppDVersion = appDVersion1 + expected_appContextAppInfo.AppDescription = appDescription1 + expected_appContextAppInfo.AppName = appName1 + expected_appContextAppInfo.AppProvider = appProvider1 + expected_appContextAppInfo.AppSoftVersion = appSoftVersion1 + expected_appContextAppInfo.AppPackageSource = appPackageSource1 + expected_appContextAppInfo.UserAppInstanceInfo = expected_appContextAppInfoUserAppInstanceInfo + // Fill AppContext + var expected_appContext AppContext + expected_appContext.AppAutoInstantiation = false + expected_appContext.AppInfo = &expected_appContextAppInfo + expected_appContext.AppLocationUpdates = true + expected_appContext.AssociateDevAppId = associateDevAppId1 + expected_appContext.CallbackReference = callbackReference1 + expected_appContext.ContextId = contextId1 + log.Info("expected_appContext: ", expected_appContext) + // Convert into JSON + var expected_json_response string = convertAppContextToJson(&expected_appContext) + log.Info("json response: ", expected_json_response) + + /****************************** + * request body section + ******************************/ + // Fill LocationConstraints + var appLocationConstraints = LocationConstraints{&area1, make([]LocationConstraintsCivicAddressElement, 1), countryCode1} + expected_appLocationConstraints.CivicAddressElement = civicAddressElement1 + // Fill UserAppInstanceInfo + appContextAppInfoUserAppInstanceInfo := make([]AppContextAppInfoUserAppInstanceInfo, 1) + appContextAppInfoUserAppInstanceInfo[0].AppLocation = &appLocationConstraints + appContextAppInfoUserAppInstanceInfo[0].ReferenceURI = string(referenceURI1_1) + // Fill AppContextAppInfo + var appContextAppInfo AppContextAppInfo + appContextAppInfo.AppDId = appDId1 + appContextAppInfo.AppDVersion = appDVersion1 + appContextAppInfo.AppDescription = appDescription1 + appContextAppInfo.AppName = appName1 + appContextAppInfo.AppProvider = appProvider1 + appContextAppInfo.AppSoftVersion = appSoftVersion1 + appContextAppInfo.AppPackageSource = appPackageSource1 + appContextAppInfo.UserAppInstanceInfo = appContextAppInfoUserAppInstanceInfo + // Fill AppContext + var appContext AppContext + appContext.AppAutoInstantiation = false + appContext.AppInfo = &appContextAppInfo + appContext.AppLocationUpdates = true + appContext.AssociateDevAppId = associateDevAppId1 + appContext.CallbackReference = callbackReference1 + log.Info("appContext: ", appContext) + // Convert into JSON + body, err := json.Marshal(appContext) + if err != nil { + t.Fatalf(err.Error()) + } + + /****************************** + * request execution section + ******************************/ + rr, err := sendRequest(http.MethodPost, "/app_contexts", bytes.NewBuffer(body), nil, nil, http.StatusCreated, DevAppContextsPOST) + if err != nil { + t.Fatalf(err.Error()) + } + log.Info("sendRequest done") + + var respBody AppContext + err = json.Unmarshal([]byte(rr), &respBody) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("respBody: ", respBody) + receivedAppContext := convertJsonToAppContext(rr) + if !validateAppContext(receivedAppContext, appContext) { + t.Errorf("handler returned unexpected body: got %v want %v", rr, expected_json_response) + } + + return receivedAppContext +} + +func initializeVars() { + mod.DbAddress = redisTestAddr + redisAddr = redisTestAddr + influxAddr = influxTestAddr + sandboxName = testScenarioName + os.Setenv("MEEP_SANDBOX_NAME", testScenarioName) + postgresHost = postgresTestHost + postgresPort = postgresTestPort + onboardedMecApplicationsFolder = "../../../examples/demo4-ue/src/onboarded-demo/" +} + +func initialiseScenario(testScenario string) { + + //clear DB + cleanUp() + + cfg := mod.ModelCfg{ + Name: testScenarioName, + Namespace: sandboxName, + Module: "test-mod", + UpdateCb: nil, + DbAddr: redisAddr, + } + + var err error + m, err = mod.NewModel(cfg) + if err != nil { + log.Error("Failed to create model: ", err) + return + } + log.Info("initialiseScenario: model created") + + // Create message queue + mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(testScenarioName), "test-mod", testScenarioName, redisAddr) + if err != nil { + log.Error("Failed to create Message Queue with error: ", err) + return + } + log.Info("Message Queue created") + + fmt.Println("Set Model") + err = m.SetScenario([]byte(testScenario)) + if err != nil { + log.Error("Failed to set model: ", err) + return + } + + err = m.Activate() + if err != nil { + log.Error("Failed to activate scenario with err: ", err.Error()) + return + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioActivate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + return + } + + time.Sleep(100 * time.Millisecond) + +} + +func updateScenario(testUpdate string) { + + switch testUpdate { + case "mobility1": + // mobility event of ue1 to zone2-poa1 + elemName := "ue1" + destName := "zone2-poa1" + + _, _, err := m.MoveNode(elemName, destName, nil) + if err != nil { + log.Error("Error sending mobility event") + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + case "mobility2": + // mobility event of ue1 to zone2-poa1 + elemName := "ue1" + destName := "zone1-poa-cell1" + + _, _, err := m.MoveNode(elemName, destName, nil) + if err != nil { + log.Error("Error sending mobility event") + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + case "mobility3": + // mobility event of ue1 to zone1-poa-cell2 + elemName := "ue1" + destName := "zone1-poa-cell2" + + _, _, err := m.MoveNode(elemName, destName, nil) + if err != nil { + log.Error("Error sending mobility event") + } + + msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) + err = mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + default: + } + time.Sleep(100 * time.Millisecond) +} + +func terminateScenario() { + if mqLocal != nil { + _ = Stop() + msg := mqLocal.CreateMsg(mq.MsgScenarioTerminate, mq.TargetAll, testScenarioName) + err := mqLocal.SendMsg(msg) + if err != nil { + log.Error("Failed to send message: ", err) + } + time.Sleep(100 * time.Millisecond) + } +} + +func sendRequest(method string, url string, body io.Reader, vars map[string]string, query map[string]string, code int, f http.HandlerFunc) (string, error) { + req, err := http.NewRequest(method, url, body) + if err != nil || req == nil { + return "", err + } + if vars != nil { + req = mux.SetURLVars(req, vars) + } + if query != nil { + q := req.URL.Query() + for k, v := range query { + q.Add(k, v) + } + req.URL.RawQuery = q.Encode() + } + + // We create a ResponseRecorder (which satisfies http.ResponseWriter) to record the response. + rr := httptest.NewRecorder() + handler := http.HandlerFunc(f) + + // Our handlers satisfy http.Handler, so we can call their ServeHTTP method + // directly and pass in our Request and ResponseRecorder. + handler.ServeHTTP(rr, req) + + time.Sleep(50 * time.Millisecond) + + // Check the status code is what we expect. + if status := rr.Code; status != code { + s := fmt.Sprintf("Wrong status code - got %v want %v", status, code) + return "", errors.New(s) + } + return string(rr.Body.String()), nil +} + +func validateApplicationList(appInfoListEntry *ApplicationList, appInfoList ApplicationList) bool { + + if appInfoListEntry == nil { + fmt.Println("appInfoListEntry == nil") + return false + } + + if len(appInfoListEntry.AppList) != len(appInfoList.AppList) { + fmt.Println("len(appInfoListEntry.AppList) != len(appInfoList.AppList)") + return false + } + + for i, appList := range appInfoListEntry.AppList { + + if appList.VendorSpecificExt != appInfoList.AppList[i].VendorSpecificExt { + fmt.Println("appList.VendorSpecificExt != appInfoList.AppList.VendorSpecificExt") + return false + } + + if appList.AppInfo != nil && appInfoList.AppList[i].AppInfo != nil { + if appList.AppInfo.AppDId != appInfoList.AppList[i].AppInfo.AppDId { + fmt.Println("appList.AppInfo.AppDId != appInfoList.AppDId") + return false + } + if appList.AppInfo.AppName != appInfoList.AppList[i].AppInfo.AppName { + fmt.Println("appList.AppInfo.AppName != appInfoList.AppName") + return false + } + if appList.AppInfo.AppProvider != appInfoList.AppList[i].AppInfo.AppProvider { + fmt.Println("appList.AppInfo.AppProvider != appInfoList.AppProvider") + return false + } + if appList.AppInfo.AppSoftVersion != appInfoList.AppList[i].AppInfo.AppSoftVersion { + fmt.Println("appList.AppInfo.AppSoftVersion != appInfoList.AppSoftVersion") + return false + } + if appList.AppInfo.AppDVersion != appInfoList.AppList[i].AppInfo.AppDVersion { + fmt.Println("appList.AppInfo.AppDVersion != appInfoList.AppDVersion") + return false + } + if appList.AppInfo.AppDescription != appInfoList.AppList[i].AppInfo.AppDescription { + fmt.Println("appList.AppInfo.AppDescription != appInfoList.AppDescription") + return false + } + if appList.AppInfo.AppCharcs != nil && appInfoList.AppList[i].AppInfo.AppCharcs != nil { + if appList.AppInfo.AppCharcs.Memory != appInfoList.AppList[i].AppInfo.AppCharcs.Memory { + fmt.Println("len(appList.AppInfo.AppCharcs.Memory) != len(appInfoList.AppCharcs.Memory)") + return false + } + if appList.AppInfo.AppCharcs.Storage != appInfoList.AppList[i].AppInfo.AppCharcs.Storage { + fmt.Println("len(appList.AppInfo.AppCharcs.Storage) != len(appInfoList.AppCharcs.Storage)") + return false + } + if appList.AppInfo.AppCharcs.Latency != appInfoList.AppList[i].AppInfo.AppCharcs.Latency { + fmt.Println("len(appList.AppInfo.AppCharcs.Latency) != len(appInfoList.AppCharcs.Latency)") + return false + } + if appList.AppInfo.AppCharcs.Bandwidth != appInfoList.AppList[i].AppInfo.AppCharcs.Bandwidth { + fmt.Println("len(appList.AppInfo.AppCharcs.Bandwidth) != len(appInfoList.AppCharcs.Bandwidth)") + return false + } + if appList.AppInfo.AppCharcs.ServiceCont != appInfoList.AppList[i].AppInfo.AppCharcs.ServiceCont { + fmt.Println("len(appList.AppInfo.AppCharcs.ServiceCont) != len(appInfoList.AppCharcs.ServiceCont)") + return false + } + } else if (appList.AppInfo.AppCharcs == nil) != (appInfoList.AppList[i].AppInfo.AppCharcs == nil) { + fmt.Println("appList.AppInfo.AppCharcs != appInfoList.AppList.AppInfo.AppCharcs") + return false + } + //fmt.Println("===> len(appList.AppInfo.AppLocation): ", len(appList.AppInfo.AppLocation)) + //fmt.Println("===> len(appInfoList.AppList[i].AppInfo.AppLocation): ", len(appInfoList.AppList[i].AppInfo.AppLocation)) + if len(appList.AppInfo.AppLocation) != len(appInfoList.AppList[i].AppInfo.AppLocation) { + fmt.Println("len(appList.AppInfo.AppLocation) != len(appInfoList.AppList[i].AppInfo.AppLocation)") + return false + } + //fmt.Println("validateApplicationList: appList.AppInfo.AppLocation: ", appList.AppInfo.AppLocation) + //fmt.Println("validateApplicationList: appInfoList.AppList[i].AppInfo.AppLocation: ", appInfoList.AppList[i].AppInfo.AppLocation) + for j, appLocation := range appList.AppInfo.AppLocation { + if appLocation.Area != nil && appInfoList.AppList[i].AppInfo.AppLocation[j].Area != nil { + if len(appLocation.Area.Coordinates) != len(appInfoList.AppList[i].AppInfo.AppLocation[j].Area.Coordinates) { + fmt.Println("len(appLocation.Area.Coordinates) != len(appInfoList.AppList.AppInfo.AppLocation.Area.Coordinates)") + return false + } + // TODO Compare content + } else if (appLocation.Area == nil) != (appInfoList.AppList[i].AppInfo.AppLocation[j].Area == nil) { + fmt.Println("appLocation.Area != appInfoList.AppList.AppInfo.AppLocation.Area") + return false + } + + if len(appLocation.CivicAddressElement) != len(appInfoList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement) { + fmt.Println("len(appLocation.CivicAddressElement) != len(appInfoList.AppList.AppInfo.AppLocation.CivicAddressElement") + return false + } + for k, cv := range appLocation.CivicAddressElement { + if cv.CaType != appInfoList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement[k].CaType || cv.CaValue != appInfoList.AppList[i].AppInfo.AppLocation[j].CivicAddressElement[k].CaValue { + fmt.Println("cv.CivicAddressElement != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement") + return false + } + } // End of 'for' statement + + if appLocation.CountryCode != appInfoList.AppList[i].AppInfo.AppLocation[j].CountryCode { + fmt.Println("appLocation.CountryCode != appInfoList.AppList.AppInfo.AppLocation.CountryCode") + return false + } + } // End of 'for' statement + } else if (appList.AppInfo == nil) != (appInfoList.AppList[i].AppInfo == nil) { + fmt.Println("appList.AppInfo != appInfoList.AppList.AppInfo.AppInfo") + return false + } + + } // End of 'for' statement + + return true +} + +func validateAppContext(appContextEntry *AppContext, appContext AppContext) bool { + + if appContextEntry == nil { + fmt.Println("appContextEntry == nil") + return false + } + if appContextEntry.ContextId == "" || appContextEntry.ContextId == appContext.ContextId { + fmt.Println("appContextEntry.ContextId != ContextId") + return false + } + if appContextEntry.AssociateDevAppId != appContext.AssociateDevAppId { + fmt.Println("appContextEntry.AssociateDevAppId != AssociateDevAppId") + return false + } + if appContextEntry.CallbackReference != appContext.CallbackReference { + fmt.Println("appContextEntry.CallbackReference != CallbackReference") + return false + } + if appContextEntry.AppLocationUpdates != appContext.AppLocationUpdates { + fmt.Println("appContextEntry.AppLocationUpdates != AppLocationUpdates") + return false + } + if appContextEntry.AppAutoInstantiation != appContext.AppAutoInstantiation { + fmt.Println("appContextEntry.AppAutoInstantiation != AppAutoInstantiation") + return false + } + + if appContextEntry.AppInfo.AppDId != appContext.AppInfo.AppDId { + fmt.Println("appContextEntry.AppInfo.AppDId != AppInfo.AppDId") + return false + } + if appContextEntry.AppInfo.AppName != appContext.AppInfo.AppName { + fmt.Println("appContextEntry.AppInfo.AppName != AppInfo.AppName") + return false + } + if appContextEntry.AppInfo.AppProvider != appContext.AppInfo.AppProvider { + fmt.Println("appContextEntry.AppInfo.AppProvider != AppInfo.AppProvider") + return false + } + if appContextEntry.AppInfo.AppSoftVersion != appContext.AppInfo.AppSoftVersion { + fmt.Println("appContextEntry.AppInfo.AppSoftVersion != AppInfo.AppSoftVersion") + return false + } + if appContextEntry.AppInfo.AppDVersion != appContext.AppInfo.AppDVersion { + fmt.Println("appContextEntry.AppInfo.AppDVersion != AppInfo.AppDVersion") + return false + } + if appContextEntry.AppInfo.AppDescription != appContext.AppInfo.AppDescription { + fmt.Println("appContextEntry.AppInfo.AppDescription != AppInfo.AppDescription") + return false + } + if appContextEntry.AppInfo.AppPackageSource != appContext.AppInfo.AppPackageSource { + fmt.Println("appContextEntry.AppInfo.AppPackageSource != AppInfo.AppPackageSource") + return false + } + if appContextEntry.AppInfo.UserAppInstanceInfo == nil || appContext.AppInfo.UserAppInstanceInfo == nil { + fmt.Println("appContextEntry.AppInfo.UserAppInstanceInfo != AppInfo.UserAppInstanceInfo") + return false + } + if len(appContextEntry.AppInfo.UserAppInstanceInfo) == 0 || len(appContext.AppInfo.UserAppInstanceInfo) == 0 { + fmt.Println("appContextEntry.AppInfo.UserAppInstanceInfo len shall be at leat one") + return false + } else if len(appContextEntry.AppInfo.UserAppInstanceInfo) != len(appContext.AppInfo.UserAppInstanceInfo) { + fmt.Println("len(appContextEntry.AppInfo.UserAppInstanceInfo) != len(AppInfo.UserAppInstanceInfo)") + return false + } + for i, item := range appContextEntry.AppInfo.UserAppInstanceInfo { + if item.AppInstanceId == "" { + fmt.Println("item.AppInstanceId empty") + return false + } + if item.ReferenceURI == "" { + fmt.Println("item.ReferenceURI empty") + return false + } + if item.AppLocation != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppLocation != nil { + if item.AppLocation.Area != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.Area != nil { + if len(item.AppLocation.Area.Coordinates) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.Area.Coordinates) { + fmt.Println("len(item.AppLocation.Area.Coordinates) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.Area.Coordinates)") + return false + } + // TODO Compare content + } else if (item.AppLocation.Area == nil) != (appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.Area == nil) { + fmt.Println("item.AppLocation.Area != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.Area") + return false + } + + if len(item.AppLocation.CivicAddressElement) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.CivicAddressElement) { + fmt.Println("len(item.AppLocation.CivicAddressElement) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.CivicAddressElement") + return false + } + appContextCivicAddressElements := appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.CivicAddressElement + for k, cv := range item.AppLocation.CivicAddressElement { + fmt.Println("validateAppContexts: Process item k#", k) + fmt.Println("validateAppContexts: cv: ", cv) + fmt.Println("validateAppContexts: civicAddressElements[k]: ", appContextCivicAddressElements) + if cv != appContextCivicAddressElements[k] { + fmt.Println("cv.CivicAddressElement != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.CivicAddressElement") + return false + } + } // End of 'for' statement + + if item.AppLocation.CountryCode != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.CountryCode { + fmt.Println("item.AppLocation.CountryCode != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation.CountryCode") + return false + } + } + + } // End of 'for' statement + + return true +} diff --git a/go-apps/meep-dai/server/logger.go b/go-apps/meep-dai/server/logger.go new file mode 100644 index 000000000..f7856db64 --- /dev/null +++ b/go-apps/meep-dai/server/logger.go @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "log" + "net/http" + "time" +) + +func Logger(inner http.Handler, name string) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() + + inner.ServeHTTP(w, r) + + log.Printf( + "%s %s %s %s", + r.Method, + r.RequestURI, + name, + time.Since(start), + ) + }) +} diff --git a/go-apps/meep-dai/server/model_address_change_notification.go b/go-apps/meep-dai/server/model_address_change_notification.go new file mode 100644 index 000000000..f7af7b208 --- /dev/null +++ b/go-apps/meep-dai/server/model_address_change_notification.go @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type AddressChangeNotification struct { + // Identifier of the user application instance. + AppInstanceId string `json:"appInstanceId"` + // Uniquely identifies the application context in the MEC system. + ContextId string `json:"contextId"` + // Shall be set to \"AddressChangeNotification\". + NotificationType string `json:"notificationType"` + // Address of the user application. Used as the reference URI for the application. Assigned by the MEC system. + ReferenceURI string `json:"referenceURI"` +} diff --git a/go-apps/meep-dai/server/model_app_context.go b/go-apps/meep-dai/server/model_app_context.go new file mode 100644 index 000000000..3f855e3b4 --- /dev/null +++ b/go-apps/meep-dai/server/model_app_context.go @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type AppContext struct { + // Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request. + AppAutoInstantiation bool `json:"appAutoInstantiation,omitempty"` + + AppInfo *AppContextAppInfo `json:"appInfo"` + // Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation. + AppLocationUpdates bool `json:"appLocationUpdates,omitempty"` + // Uniquely identifies the device application. The length of the value shall not exceed 32 characters. + AssociateDevAppId string `json:"associateDevAppId"` + // URI assigned by the device application to receive application lifecycle related notifications. Inclusion in the request implies the client supports the pub/sub mechanism and is capable of receiving notifications. This endpoint shall be maintained for the lifetime of the application context. + CallbackReference string `json:"callbackReference,omitempty"` + // Uniquely identifies the application context in the MEC system. Assigned by the MEC system and shall be present other than in a create request. The length of the value shall not exceed 32 characters. + ContextId string `json:"contextId,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_app_context_app_info.go b/go-apps/meep-dai/server/model_app_context_app_info.go new file mode 100644 index 000000000..760aca8d3 --- /dev/null +++ b/go-apps/meep-dai/server/model_app_context_app_info.go @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type AppContextAppInfo struct { + // Identifier of this MEC application descriptor. This attribute shall be globally unique. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application is one in the ApplicationList. + AppDId string `json:"appDId,omitempty"` + // Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppDVersion string `json:"appDVersion"` + // Human readable description of the MEC application. The length of the value shall not exceed 128 characters. + AppDescription string `json:"appDescription,omitempty"` + // Name of the MEC application. The length of the value shall not exceed 32 characters. + AppName string `json:"appName"` + // Provider of the MEC application. The length of the value shall not exceed 32 characters. + AppProvider string `json:"appProvider"` + // Software version of the MEC application. The length of the value shall not exceed 32 characters. + AppSoftVersion string `json:"appSoftVersion,omitempty"` + // URI of the application package. Included in the request if the application is not one in the ApplicationList. appPackageSource enables on-boarding of the application package into the MEC system. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppPackageSource string `json:"appPackageSource,omitempty"` + // List of user application instance information. + UserAppInstanceInfo []AppContextAppInfoUserAppInstanceInfo `json:"userAppInstanceInfo"` +} diff --git a/go-apps/meep-dai/server/model_app_context_app_info_user_app_instance_info.go b/go-apps/meep-dai/server/model_app_context_app_info_user_app_instance_info.go new file mode 100644 index 000000000..f2899dd6d --- /dev/null +++ b/go-apps/meep-dai/server/model_app_context_app_info_user_app_instance_info.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type AppContextAppInfoUserAppInstanceInfo struct { + // Identifier of the user application instance. It shall only be included in the response. + AppInstanceId string `json:"appInstanceId,omitempty"` + + AppLocation *LocationConstraints `json:"appLocation,omitempty"` + // Address of the user application instance. It shall only be included in the response. + ReferenceURI string `json:"referenceURI,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_app_termination_notification.go b/go-apps/meep-dai/server/model_app_termination_notification.go new file mode 100644 index 000000000..aedc87c97 --- /dev/null +++ b/go-apps/meep-dai/server/model_app_termination_notification.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// This type represents the information that the MEC platform notifies the subscribed application instance about the corresponding application instance termination/stop. +type AppTerminationNotification struct { + // Shall be set to AppTerminationNotification. + NotificationType string `json:"notificationType"` + + OperationAction *OperationActionType `json:"operationAction"` + // Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. + MaxGracefulTimeout int32 `json:"maxGracefulTimeout"` + + Links *AppTerminationNotificationLinks `json:"_links"` +} diff --git a/go-apps/meep-dai/server/model_app_termination_notification__links.go b/go-apps/meep-dai/server/model_app_termination_notification__links.go new file mode 100644 index 000000000..ac7067801 --- /dev/null +++ b/go-apps/meep-dai/server/model_app_termination_notification__links.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// Object containing hyperlinks related to the resource. +type AppTerminationNotificationLinks struct { + Subscription *LinkType `json:"subscription"` + + ConfirmTermination *LinkType `json:"confirmTermination,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_context_delete_notification.go b/go-apps/meep-dai/server/model_application_context_delete_notification.go new file mode 100644 index 000000000..cae583772 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_context_delete_notification.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationContextDeleteNotification struct { + // Uniquely identifies the application context that has been deleted from the MEC system. + ContextId string `json:"contextId"` + // Shall be set to \"ApplicationContextDeleteNotification\". + NotificationType string `json:"notificationType"` +} diff --git a/go-apps/meep-dai/server/model_application_context_update_notification.go b/go-apps/meep-dai/server/model_application_context_update_notification.go new file mode 100644 index 000000000..15ec2d323 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_context_update_notification.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationContextUpdateNotification struct { + // Uniquely identifies the application context in the MEC system. + ContextId string `json:"contextId"` + // Shall be set to \"ApplicationContextUpdateNotification\". + NotificationType string `json:"notificationType"` + // List of user application instance information. + UserAppInstanceInfo []ApplicationContextUpdateNotificationUserAppInstanceInfo `json:"userAppInstanceInfo"` +} diff --git a/go-apps/meep-dai/server/model_application_context_update_notification_user_app_instance_info.go b/go-apps/meep-dai/server/model_application_context_update_notification_user_app_instance_info.go new file mode 100644 index 000000000..48e673af2 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_context_update_notification_user_app_instance_info.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationContextUpdateNotificationUserAppInstanceInfo struct { + // Identifier of the user application instance. + AppInstanceId string `json:"appInstanceId,omitempty"` + + AppLocation *LocationConstraints `json:"appLocation,omitempty"` + // Address of the user application instance. + ReferenceURI string `json:"referenceURI,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_list.go b/go-apps/meep-dai/server/model_application_list.go new file mode 100644 index 000000000..14671ee5d --- /dev/null +++ b/go-apps/meep-dai/server/model_application_list.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationList struct { + // List of user applications available to the device application. As defined below. + AppList []ApplicationListAppList `json:"appList,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_list_app_info.go b/go-apps/meep-dai/server/model_application_list_app_info.go new file mode 100644 index 000000000..55d2effd7 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_list_app_info.go @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationListAppInfo struct { + AppCharcs *ApplicationListAppInfoAppCharcs `json:"appCharcs,omitempty"` + // Identifier of this MEC application descriptor. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. This attribute shall be globally unique. + AppDId string `json:"appDId"` + // Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppDVersion string `json:"appDVersion"` + // Human readable description of the MEC application (see note 2). + AppDescription string `json:"appDescription"` + // Identifies the locations of the MEC application. + AppLocation []LocationConstraints `json:"appLocation,omitempty"` + // Name of the MEC application. The length of the value shall not exceed 32 characters. + AppName string `json:"appName"` + // Provider of the MEC application. The length of the value shall not exceed 32 characters. + AppProvider string `json:"appProvider"` + // Software version of the MEC application. The length of the value shall not exceed 32 characters. + AppSoftVersion string `json:"appSoftVersion"` +} diff --git a/go-apps/meep-dai/server/model_application_list_app_info_app_charcs.go b/go-apps/meep-dai/server/model_application_list_app_info_app_charcs.go new file mode 100644 index 000000000..037c14279 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_list_app_info_app_charcs.go @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// Characteristics of the application. As defined below. The application characteristics relate to the system resources consumed by the application. A device application can use this information e.g. for estimating the cost of use of the application or for the expected user experience. +type ApplicationListAppInfoAppCharcs struct { + // The required connection bandwidth in kbit/s for the use of the MEC application instance. + Bandwidth int32 `json:"bandwidth,omitempty"` + // The target round trip time in milliseconds supported by the MEC system for the MEC application instance. + Latency int32 `json:"latency,omitempty"` + // The maximum size in Mbytes of the memory resource expected to be used by the MEC application instance in the MEC system. + Memory int32 `json:"memory,omitempty"` + // Required service continuity mode for this application. Permitted values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED. + ServiceCont int32 `json:"serviceCont,omitempty"` + // The maximum size in Mbytes of the storage resource expected to be used by the MEC application instance in the MEC system. + Storage int32 `json:"storage,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_list_app_list.go b/go-apps/meep-dai/server/model_application_list_app_list.go new file mode 100644 index 000000000..3bc25e65c --- /dev/null +++ b/go-apps/meep-dai/server/model_application_list_app_list.go @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationListAppList struct { + AppInfo *ApplicationListAppInfo `json:"appInfo,omitempty"` + + VendorSpecificExt *ApplicationListVendorSpecificExt `json:"vendorSpecificExt,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_list_vendor_specific_ext.go b/go-apps/meep-dai/server/model_application_list_vendor_specific_ext.go new file mode 100644 index 000000000..9a9652f63 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_list_vendor_specific_ext.go @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// Extension for vendor specific information (see note 1). +type ApplicationListVendorSpecificExt struct { + // Vendor identifier. The length of the value shall not exceed 32 characters. The rest of the structure of vendor specific extension is not defined. + VendorId string `json:"vendorId"` +} diff --git a/go-apps/meep-dai/server/model_application_location_availability.go b/go-apps/meep-dai/server/model_application_location_availability.go new file mode 100644 index 000000000..3b0f7e56b --- /dev/null +++ b/go-apps/meep-dai/server/model_application_location_availability.go @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationLocationAvailability struct { + AppInfo *ApplicationLocationAvailabilityAppInfo `json:"appInfo"` + // Uniquely identifies the device application. The length of the value shall not exceed 32 characters. + AssociateDevAppId string `json:"associateDevAppId"` +} diff --git a/go-apps/meep-dai/server/model_application_location_availability_app_info.go b/go-apps/meep-dai/server/model_application_location_availability_app_info.go new file mode 100644 index 000000000..b69bafb82 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_location_availability_app_info.go @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationLocationAvailabilityAppInfo struct { + // Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppDVersion string `json:"appDVersion"` + // Human readable description of the MEC application. The length of the value shall not exceed 128 characters. + AppDescription string `json:"appDescription,omitempty"` + // Name of the MEC application. The length of the value shall not exceed 32 characters. + AppName string `json:"appName"` + // URI of the application package. Shall be included in the request. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppPackageSource string `json:"appPackageSource,omitempty"` + // Provider of the MEC application. The length of the value shall not exceed 32 characters. + AppProvider string `json:"appProvider"` + // Software version of the MEC application. The length of the value shall not exceed 32 characters. + AppSoftVersion string `json:"appSoftVersion,omitempty"` + // MEC application location constraints. + AvailableLocations []ApplicationLocationAvailabilityAppInfoAvailableLocations `json:"availableLocations,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_location_availability_app_info_available_locations.go b/go-apps/meep-dai/server/model_application_location_availability_app_info_available_locations.go new file mode 100644 index 000000000..43991ef8c --- /dev/null +++ b/go-apps/meep-dai/server/model_application_location_availability_app_info_available_locations.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationLocationAvailabilityAppInfoAvailableLocations struct { + AppLocation *LocationConstraints `json:"appLocation,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_application_location_availability_notification.go b/go-apps/meep-dai/server/model_application_location_availability_notification.go new file mode 100644 index 000000000..00bffd532 --- /dev/null +++ b/go-apps/meep-dai/server/model_application_location_availability_notification.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ApplicationLocationAvailabilityNotification struct { + // Locations available to the MEC application. + AvailableLocations []ApplicationLocationAvailabilityAppInfoAvailableLocations `json:"availableLocations"` + // Uniquely identifies the application context in the MEC system. + ContextId string `json:"contextId,omitempty"` + // Shall be set to \"ApplicationLocationAvailabilityNotification\". + NotificationType string `json:"notificationType"` +} diff --git a/go-apps/meep-dai/server/model_inline_notification.go b/go-apps/meep-dai/server/model_inline_notification.go new file mode 100644 index 000000000..ac95ce3b0 --- /dev/null +++ b/go-apps/meep-dai/server/model_inline_notification.go @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type InlineNotification struct { +} diff --git a/go-apps/meep-dai/server/model_link_type.go b/go-apps/meep-dai/server/model_link_type.go new file mode 100644 index 000000000..07bcd3706 --- /dev/null +++ b/go-apps/meep-dai/server/model_link_type.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type LinkType struct { + // URI referring to a resource + Href string `json:"href"` +} diff --git a/go-apps/meep-dai/server/model_links.go b/go-apps/meep-dai/server/model_links.go new file mode 100644 index 000000000..664718abd --- /dev/null +++ b/go-apps/meep-dai/server/model_links.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests. +type Links struct { + Self *LinkType `json:"self"` +} diff --git a/go-apps/meep-dai/server/model_location_constraints.go b/go-apps/meep-dai/server/model_location_constraints.go new file mode 100644 index 000000000..610e9a7ae --- /dev/null +++ b/go-apps/meep-dai/server/model_location_constraints.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type LocationConstraints struct { + Area *Polygon `json:"area,omitempty"` + // Zero or more elements comprising the civic address. Shall be absent if the \"area\" attribute is present. + CivicAddressElement []LocationConstraintsCivicAddressElement `json:"civicAddressElement,omitempty"` + // The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the \"area\" attribute is absent. May be absent if the \"area\" attribute is present (see note). + CountryCode string `json:"countryCode,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_location_constraints_civic_address_element.go b/go-apps/meep-dai/server/model_location_constraints_civic_address_element.go new file mode 100644 index 000000000..f77ca2b81 --- /dev/null +++ b/go-apps/meep-dai/server/model_location_constraints_civic_address_element.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type LocationConstraintsCivicAddressElement struct { + // Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776 [6]. + CaType int32 `json:"caType,omitempty"` + // Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776 [6]. + CaValue string `json:"caValue,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_one_of_inline_notification.go b/go-apps/meep-dai/server/model_one_of_inline_notification.go new file mode 100644 index 000000000..d03a0b28e --- /dev/null +++ b/go-apps/meep-dai/server/model_one_of_inline_notification.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type OneOfInlineNotification struct { + NotificationType string `json:"notificationType"` + /*AddressChangeNotification + ApplicationContextDeleteNotification + ApplicationContextUpdateNotification + ApplicationLocationAvailabilityNotification*/ +} diff --git a/go-apps/meep-dai/server/model_operation_action_type.go b/go-apps/meep-dai/server/model_operation_action_type.go new file mode 100644 index 000000000..0d189a3b8 --- /dev/null +++ b/go-apps/meep-dai/server/model_operation_action_type.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +// OperationActionType : Operation that is being performed on the MEC application instance. +type OperationActionType string + +// List of OperationActionType +const ( + STOPPING OperationActionType = "STOPPING" + TERMINATING OperationActionType = "TERMINATING" +) diff --git a/go-apps/meep-dai/server/model_polygon.go b/go-apps/meep-dai/server/model_polygon.go new file mode 100644 index 000000000..62f88b527 --- /dev/null +++ b/go-apps/meep-dai/server/model_polygon.go @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type Polygon struct { + Coordinates [][][]float32 `json:"coordinates,omitempty"` +} diff --git a/go-apps/meep-dai/server/model_problem_details.go b/go-apps/meep-dai/server/model_problem_details.go new file mode 100644 index 000000000..d5a872bd7 --- /dev/null +++ b/go-apps/meep-dai/server/model_problem_details.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +type ProblemDetails struct { + // A human-readable explanation specific to this occurrence of the problem + Detail string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem + Instance string `json:"instance,omitempty"` + // The HTTP status code for this occurrence of the problem + Status int32 `json:"status,omitempty"` + // A short, human-readable summary of the problem type + Title string `json:"title,omitempty"` + // A URI reference according to IETF RFC 3986 that identifies the problem type + Type_ string `json:"type,omitempty"` +} diff --git a/go-apps/meep-dai/server/routers.go b/go-apps/meep-dai/server/routers.go new file mode 100644 index 000000000..4d938f8c3 --- /dev/null +++ b/go-apps/meep-dai/server/routers.go @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Device Application Interface + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package server + +import ( + "fmt" + "net/http" + "strings" + + httpLog "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger" + met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" + + "github.com/gorilla/mux" +) + +type Route struct { + Name string + Method string + Pattern string + HandlerFunc http.HandlerFunc +} + +type Routes []Route + +func NewRouter() *mux.Router { + router := mux.NewRouter().StrictSlash(true) + var handler http.Handler + for _, route := range routes { + handler = route.HandlerFunc + handler = Logger(handler, route.Name) + handler = met.MetricsHandler(handler, sandboxName, serviceName) + handler = httpLog.LogRx(handler) + router. + Methods(route.Method). + Path(route.Pattern). + Name(route.Name). + Handler(handler) + } + + // Path prefix router order is important + // Service Api files + handler = http.StripPrefix("/dev_app/v1/api/", http.FileServer(http.Dir("./api/"))) + router. + PathPrefix("/dev_app/v1/api/"). + Name("Api"). + Handler(handler) + // User supplied service API files + handler = http.StripPrefix("/dev_app/v1/user-api/", http.FileServer(http.Dir("./user-api/"))) + router. + PathPrefix("/dev_app/v1/user-api/"). + Name("UserApi"). + Handler(handler) + + return router +} + +func Index(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello World!") +} + +var routes = Routes{ + Route{ + "Index", + "GET", + "/dev_app/v1/", + Index, + }, + + Route{ + "Mec011AppTerminationPOST", + strings.ToUpper("Post"), + "/dev_app/v1/notifications/mec011/appTermination", + Mec011AppTerminationPOST, + }, + + Route{ + "AppLocationAvailabilityPOST", + strings.ToUpper("Post"), + "/dev_app/v1/obtain_app_loc_availability", + AppLocationAvailabilityPOST, + }, + + Route{ + "DevAppContextDELETE", + strings.ToUpper("Delete"), + "/dev_app/v1/app_contexts/{contextId}", + DevAppContextDELETE, + }, + + Route{ + "DevAppContextPUT", + strings.ToUpper("Put"), + "/dev_app/v1/app_contexts/{contextId}", + DevAppContextPUT, + }, + + Route{ + "DevAppContextsPOST", + strings.ToUpper("Post"), + "/dev_app/v1/app_contexts", + DevAppContextsPOST, + }, + + Route{ + "MeAppListGET", + strings.ToUpper("Get"), + "/dev_app/v1/app_list", + MeAppListGET, + }, + + Route{ + "IndividualSubscriptionDELETE", + strings.ToUpper("Delete"), + "/dev_app/v1/subscriptions/{subscriptionId}", + IndividualSubscriptionDELETE, + }, +} diff --git a/go-packages/meep-dai-client/.gitignore b/go-packages/meep-dai-client/.gitignore new file mode 100644 index 000000000..daf913b1b --- /dev/null +++ b/go-packages/meep-dai-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/go-packages/meep-dai-client/.swagger-codegen-ignore b/go-packages/meep-dai-client/.swagger-codegen-ignore new file mode 100644 index 000000000..c5fa491b4 --- /dev/null +++ b/go-packages/meep-dai-client/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/go-packages/meep-dai-client/.swagger-codegen/VERSION b/go-packages/meep-dai-client/.swagger-codegen/VERSION new file mode 100644 index 000000000..0667b5ffc --- /dev/null +++ b/go-packages/meep-dai-client/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.29 \ No newline at end of file diff --git a/go-packages/meep-dai-client/.travis.yml b/go-packages/meep-dai-client/.travis.yml new file mode 100644 index 000000000..f5cb2ce9a --- /dev/null +++ b/go-packages/meep-dai-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/go-packages/meep-dai-client/README.md b/go-packages/meep-dai-client/README.md new file mode 100644 index 000000000..7aad93016 --- /dev/null +++ b/go-packages/meep-dai-client/README.md @@ -0,0 +1,69 @@ +# Go API client for swagger + +The ETSI MEC ISG Device application interface API described using OpenAPI. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 2.2.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen +For more information, please visit [https://forge.etsi.org/rep/mec/gs016-dev-app-api](https://forge.etsi.org/rep/mec/gs016-dev-app-api) + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./swagger" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/sandboxname/dev_app/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AppTermApi* | [**Mec011AppTerminationPOST**](docs/AppTermApi.md#mec011appterminationpost) | **Post** /subscriptions/{subscriptionId} | MEC011 Application Termination notification for self termination +*DevAppApi* | [**AppLocationAvailabilityPOST**](docs/DevAppApi.md#applocationavailabilitypost) | **Post** /obtain_app_loc_availability | Obtain the location constraints for a new application context. +*DevAppApi* | [**DevAppContextDELETE**](docs/DevAppApi.md#devappcontextdelete) | **Delete** /app_contexts/{contextId} | Deletion of an existing application context. +*DevAppApi* | [**DevAppContextPUT**](docs/DevAppApi.md#devappcontextput) | **Put** /app_contexts/{contextId} | Updating the callbackReference and/or appLocation of an existing application context. +*DevAppApi* | [**DevAppContextsPOST**](docs/DevAppApi.md#devappcontextspost) | **Post** /app_contexts | Creation of a new application context. +*DevAppApi* | [**MeAppListGET**](docs/DevAppApi.md#meapplistget) | **Get** /app_list | Get available application information. +*UnsupportedApi* | [**IndividualSubscriptionDELETE**](docs/UnsupportedApi.md#individualsubscriptiondelete) | **Delete** /subscriptions/{subscriptionId} | Used to cancel the existing subscription. + +## Documentation For Models + + - [AddressChangeNotification](docs/AddressChangeNotification.md) + - [AppContext](docs/AppContext.md) + - [AppContextAppInfo](docs/AppContextAppInfo.md) + - [AppContextAppInfoUserAppInstanceInfo](docs/AppContextAppInfoUserAppInstanceInfo.md) + - [AppTerminationNotification](docs/AppTerminationNotification.md) + - [AppTerminationNotificationLinks](docs/AppTerminationNotificationLinks.md) + - [ApplicationContextDeleteNotification](docs/ApplicationContextDeleteNotification.md) + - [ApplicationContextUpdateNotification](docs/ApplicationContextUpdateNotification.md) + - [ApplicationContextUpdateNotificationUserAppInstanceInfo](docs/ApplicationContextUpdateNotificationUserAppInstanceInfo.md) + - [ApplicationList](docs/ApplicationList.md) + - [ApplicationListAppInfo](docs/ApplicationListAppInfo.md) + - [ApplicationListAppInfoAppCharcs](docs/ApplicationListAppInfoAppCharcs.md) + - [ApplicationListAppList](docs/ApplicationListAppList.md) + - [ApplicationListVendorSpecificExt](docs/ApplicationListVendorSpecificExt.md) + - [ApplicationLocationAvailability](docs/ApplicationLocationAvailability.md) + - [ApplicationLocationAvailabilityAppInfo](docs/ApplicationLocationAvailabilityAppInfo.md) + - [ApplicationLocationAvailabilityAppInfoAvailableLocations](docs/ApplicationLocationAvailabilityAppInfoAvailableLocations.md) + - [ApplicationLocationAvailabilityNotification](docs/ApplicationLocationAvailabilityNotification.md) + - [InlineNotification](docs/InlineNotification.md) + - [LinkType](docs/LinkType.md) + - [Links](docs/Links.md) + - [LocationConstraints](docs/LocationConstraints.md) + - [LocationConstraintsCivicAddressElement](docs/LocationConstraintsCivicAddressElement.md) + - [OneOfInlineNotification](docs/OneOfInlineNotification.md) + - [OperationActionType](docs/OperationActionType.md) + - [Polygon](docs/Polygon.md) + - [ProblemDetails](docs/ProblemDetails.md) + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + + diff --git a/go-packages/meep-dai-client/api/swagger.yaml b/go-packages/meep-dai-client/api/swagger.yaml new file mode 100644 index 000000000..59c0d8d5a --- /dev/null +++ b/go-packages/meep-dai-client/api/swagger.yaml @@ -0,0 +1,1663 @@ +openapi: 3.0.0 +info: + title: AdvantEDGE Device Application Interface + description: + Device Application Interface is AdvantEDGE's implementation of [ETSI MEC + ISG MEC016 Device Application Interface API](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/016/02.02.01_60/gs_MEC016v020201p.pdf) +

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) +

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai) +

**Type & Usage**
Edge Service used by edge applications that want to get + information about application information in the network

**Note**
AdvantEDGE supports + a selected subset Device application interface endpoints. + contact: + name: InterDigital AdvantEDGE Support + email: AdvantEDGE@InterDigital.com + license: + name: Apache 2.0 + url: https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE + version: 2.2.1 +externalDocs: + description: ETSI GS MEC016 V2.2.1 Device application interface + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/016/02.02.01_60/gs_MEC016v020201p.pdf +servers: + - url: https://localhost/sandboxname/dev_app/v1 +tags: + - name: dev_app + +paths: + /app_list: + get: + tags: + - dev_app + summary: Get available application information. + description: Used to query information about the available MEC applications. + operationId: meAppListGET + parameters: + - name: appName + in: query + description: Name to identify the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: appProvider + in: query + description: Provider of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: appSoftVersion + in: query + description: Software version of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: vendorId + in: query + description: Vendor identifier + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + - name: serviceCont + in: query + description: "Required service continuity mode for this application. Permitted\ + \ values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED." + required: false + style: form + explode: true + schema: + type: integer + enum: + - 0 + - 1 + responses: + "200": + description: The response body contains an array of the user applications + available to the querying device application. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationList' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /app_contexts: + post: + tags: + - dev_app + summary: Creation of a new application context. + description: "Used to create a new application context. Upon success, the response\ + \ contains entity body describing the created application context." + operationId: devAppContextsPOST + parameters: [] + requestBody: + description: Entity body in the request contains the Application Context as + requested by the device application. + content: + application/json: + schema: + $ref: '#/components/schemas/AppContext' + required: true + responses: + "201": + description: "The response body contains the Application Context as it was\ + \ created by the MEC system, which includes the reference URI(s) of the\ + \ associated user application instance(s). The URI of the resource created\ + \ within the MEC system associated with the request, with its specific\ + \ application context ID, shall be included in the 'Location' HTTP header\ + \ of the response." + content: + application/json: + schema: + $ref: '#/components/schemas/AppContext' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + callbacks: + notification: + '{$request.body#/appContext.callbackReference}': + post: + summary: Callback POST used to send a notification + description: Notification with content based on subscription type + operationId: notificationPOST + requestBody: + description: Subscription notification + content: + application/json: + schema: + $ref: '#/components/schemas/InlineNotification' + example: + notificationType: ApplicationContextDeleteNotification + contextId: contextId123 + required: true + responses: + "204": + description: "Upon success, a response 204 No Content without any\ + \ response body is returned." + /app_contexts/{contextId}: + put: + tags: + - dev_app + summary: Updating the callbackReference and/or appLocation of an existing application + context. + description: "Used to update the callback reference and/or application location\ + \ constraints of an existing application context. Upon successful operation,\ + \ the target resource is updated with the new application context information." + operationId: devAppContextPUT + parameters: + - name: contextId + in: path + description: Uniquely identifies the application context in the MEC system. + It is assigned by the MEC system. + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: Only the callbackReference and/or appLocation attribute values + are allowed to be updated. Other attributes and their values shall remain + untouched. + content: + application/json: + schema: + $ref: '#/components/schemas/AppContext' + required: true + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + delete: + tags: + - dev_app + summary: Deletion of an existing application context. + description: Used to delete the resource that represents the existing application + context. + operationId: devAppContextDELETE + parameters: + - name: contextId + in: path + description: Uniquely identifies the application context in the MEC system. + It is assigned by the MEC system. + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "Upon success, a response 204 No Content without any response\ + \ body is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /obtain_app_loc_availability: + post: + tags: + - dev_app + summary: Obtain the location constraints for a new application context. + description: Used to obtain the locations available for instantiation of a specific + user application in the MEC system. + operationId: appLocationAvailabilityPOST + parameters: [] + requestBody: + description: Entity body in the request contains the user application information + for the MEC system to evaluate the locations available for instantiation + of that application. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationLocationAvailability' + required: true + responses: + "200": + description: The response body contains the locations available for instantiation + of the requested user application in the MEC system. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationLocationAvailability' + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + /subscriptions/{subscriptionId}: + post: + tags: + - app_term + summary: MEC011 Application Termination notification for self termination + description: Terminates itself. + operationId: mec011AppTerminationPOST + parameters: + - name: subscriptionId + in: path + description: "Refers to created subscription, where the VIS API allocates\ + \ a unique resource name for this subscription" + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: Termination notification details + content: + application/json: + schema: + $ref: '#/components/schemas/AppTerminationNotification' + example: + notificationType: AppTerminationNotification + operationAction: TERMINATING + maxGracefulTimeout: 10 + _links: + subscription: + href: http://mec011Server.example.com/mec_app_support/v1/applications/appId1234/subscriptions/sub123 + confirmTermination: + href: http://mec011Server.example.com/mec_app_support/v1/confirm_termination + required: true + responses: + "204": + description: No Content + x-swagger-router-controller: notifications + delete: + tags: + - unsupported + summary: Used to cancel the existing subscription. + description: Used to cancel the existing subscription. + operationId: individualSubscriptionDELETE + parameters: + - name: subscriptionId + in: path + description: "Refers to created subscription, where the VIS API allocates\ + \ a unique resource name for this subscription" + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot\ + \ be mapped to a valid resource URI." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "429": + description: "Too Many Requests : used when a rate limiter has triggered." + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' +components: + schemas: + AddressChangeNotification: + required: + - appInstanceId + - contextId + - notificationType + - referenceURI + type: object + properties: + appInstanceId: + type: string + description: Identifier of the user application instance. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + contextId: + type: string + description: Uniquely identifies the application context in the MEC system. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "AddressChangeNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + referenceURI: + type: string + description: Address of the user application. Used as the reference URI + for the application. Assigned by the MEC system. + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: URI + x-etsi-ref: 6.4.2 + AppContext: + required: + - appInfo + - associateDevAppId + type: object + properties: + appAutoInstantiation: + type: boolean + description: Provides indication to the MEC system that instantiation of + the requested application is desired should a requested appLocation become + available that was not at the time of the request. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Boolean + appInfo: + $ref: '#/components/schemas/AppContext_appInfo' + appLocationUpdates: + type: boolean + description: Used by the device application to request to receive notifications + at the callbackReference URI relating to location availability for user + application instantiation. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Boolean + associateDevAppId: + maxLength: 32 + type: string + description: Uniquely identifies the device application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + callbackReference: + type: string + description: URI assigned by the device application to receive application + lifecycle related notifications. Inclusion in the request implies the + client supports the pub/sub mechanism and is capable of receiving notifications. + This endpoint shall be maintained for the lifetime of the application + context. + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + contextId: + maxLength: 32 + type: string + description: Uniquely identifies the application context in the MEC system. + Assigned by the MEC system and shall be present other than in a create + request. The length of the value shall not exceed 32 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + example: + callbackReference: http://example.com/aeiou + appInfo: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + userAppInstanceInfo: + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + appDId: appDId + appProvider: appProvider + associateDevAppId: associateDevAppId + contextId: contextId + appLocationUpdates: true + appAutoInstantiation: true + x-etsi-notes: "NOTE 1:\tIf a value of the attribute is included in the request,\ + \ the same value shall be included in the response.\nNOTE 2:\tThe design of\ + \ the current operation with callback reference assumes no web proxy between\ + \ the entity that originates the notification and the entity that receives\ + \ it.\nNOTE 3:\tThe language support for the application description may be\ + \ limited.\nNOTE 4:\tAttribute appLocationUpdates and appAutoInstantiation\ + \ shall not both be set to TRUE." + x-etsi-ref: 6.2.3 + ApplicationContextDeleteNotification: + required: + - contextId + - notificationType + type: object + properties: + contextId: + type: string + description: Uniquely identifies the application context that has been deleted + from the MEC system. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "ApplicationContextDeleteNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + x-etsi-ref: 6.4.3 + ApplicationContextUpdateNotification: + required: + - contextId + - notificationType + - userAppInstanceInfo + type: object + properties: + contextId: + type: string + description: Uniquely identifies the application context in the MEC system. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "ApplicationContextUpdateNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + userAppInstanceInfo: + minItems: 1 + required: + - appInstanceId + - referenceURI + type: array + description: List of user application instance information. + items: + $ref: '#/components/schemas/ApplicationContextUpdateNotification_userAppInstanceInfo' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: array (Structure inlined) + x-etsi-ref: 6.4.4 + ApplicationList: + type: object + properties: + appList: + minItems: 0 + required: + - appInfo + type: array + description: List of user applications available to the device application. + As defined below. + items: + $ref: '#/components/schemas/ApplicationList_appList' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: Array (Structure (inlined)) + example: + appList: + - appInfo: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + vendorSpecificExt: + vendorId: vendorId + - appInfo: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + vendorSpecificExt: + vendorId: vendorId + x-etsi-notes: "NOTE 1:\tThe vendor specific extension allows submitting information\ + \ on the application lists that have been made available to the device application\ + \ of the corresponding vendor.\nNOTE 2:\tThe language support may be limited.\ + \ The length of the value shall not exceed 128 characters." + x-etsi-ref: 6.2.2 + ApplicationLocationAvailability: + required: + - appInfo + - associateDevAppId + type: object + properties: + appInfo: + $ref: '#/components/schemas/ApplicationLocationAvailability_appInfo' + associateDevAppId: + maxLength: 32 + type: string + description: Uniquely identifies the device application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + appInfo: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + appProvider: appProvider + availableLocations: + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + associateDevAppId: associateDevAppId + x-etsi-ref: 6.2.4 + ApplicationLocationAvailabilityNotification: + required: + - availableLocations + - notificationType + type: object + properties: + availableLocations: + minItems: 1 + required: + - appLocation + type: array + description: Locations available to the MEC application. + items: + $ref: '#/components/schemas/ApplicationLocationAvailability_appInfo_availableLocations' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: array (Structure (inline)) + contextId: + type: string + description: Uniquely identifies the application context in the MEC system. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + notificationType: + type: string + description: Shall be set to "ApplicationLocationAvailabilityNotification". + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + x-etsi-ref: 6.4.5 + InlineNotification: + discriminator: + propertyName: NotificationType + oneOf: + - $ref: '#/components/schemas/AddressChangeNotification' + - $ref: '#/components/schemas/ApplicationContextDeleteNotification' + - $ref: '#/components/schemas/ApplicationContextUpdateNotification' + - $ref: '#/components/schemas/ApplicationLocationAvailabilityNotification' + LocationConstraints: + type: object + properties: + area: + $ref: '#/components/schemas/Polygon' + civicAddressElement: + minItems: 0 + required: + - caType + - caValue + type: array + description: Zero or more elements comprising the civic address. Shall be + absent if the "area" attribute is present. + items: + $ref: '#/components/schemas/LocationConstraints_civicAddressElement' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: array (Structure inlined) + countryCode: + maxLength: 2 + type: string + description: "The two-letter ISO 3166 [7] country code in capital letters.\ + \ Shall be present in case the \"area\" attribute is absent. May be absent\ + \ if the \"area\" attribute is present (see note)." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + example: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + x-etsi-notes: "NOTE:\tIf both \"countryCode\" and \"area\" are present, no conflicts\ + \ should exist between the values of these two attributes. In case of conflicts,\ + \ the API producer (e.g. MEO, MEAO) shall disregard parts of the geographic\ + \ area signalled by \"area\" that are outside the boundaries of the country\ + \ signalled by \"countryCode\". If \"countryCode\" is absent, it is solely\ + \ the \"area\" attribute that defines the location constraint." + x-etsi-ref: 6.5.2 + Polygon: + type: object + properties: + coordinates: + minItems: 1 + type: array + items: + type: array + items: + type: array + items: + type: number + format: float + x-etsi-mec-cardinality: 1 + x-etsi-mec-origin-type: array + example: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + ProblemDetails: + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + description: A URI reference that identifies the specific occurrence of + the problem + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + status: + type: integer + description: The HTTP status code for this occurrence of the problem + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Uint32 + title: + type: string + description: "A short, human-readable summary of the problem type" + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + type: + type: string + description: A URI reference according to IETF RFC 3986 that identifies + the problem type + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + Links: + required: + - self + type: object + properties: + self: + $ref: '#/components/schemas/LinkType' + description: Hyperlink related to the resource. This shall be only included + in the HTTP responses and in HTTP PUT requests. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Structure (inlined) + LinkType: + required: + - href + type: object + properties: + href: + type: string + description: URI referring to a resource + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Uri + example: + href: http://example.com/aeiou + x-etsi-ref: 6.5.13 + AppTerminationNotification: + required: + - _links + - maxGracefulTimeout + - notificationType + - operationAction + type: object + properties: + notificationType: + type: string + description: Shall be set to AppTerminationNotification. + operationAction: + $ref: '#/components/schemas/OperationActionType' + maxGracefulTimeout: + type: integer + description: Maximum timeout value in seconds for graceful termination or + graceful stop of an application instance. + format: uint32 + _links: + $ref: '#/components/schemas/AppTerminationNotification__links' + description: This type represents the information that the MEC platform notifies + the subscribed application instance about the corresponding application instance + termination/stop. + OperationActionType: + type: string + description: Operation that is being performed on the MEC application instance. + enum: + - STOPPING + - TERMINATING + AppTerminationNotification__links: + required: + - subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/LinkType' + confirmTermination: + $ref: '#/components/schemas/LinkType' + description: Object containing hyperlinks related to the resource. + AppContext_appInfo_userAppInstanceInfo: + type: object + properties: + appInstanceId: + type: string + description: Identifier of the user application instance. It shall only + be included in the response. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appLocation: + $ref: '#/components/schemas/LocationConstraints' + referenceURI: + type: string + description: Address of the user application instance. It shall only be + included in the response. + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + example: + appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + AppContext_appInfo: + required: + - appDVersion + - appName + - appProvider + - userAppInstanceInfo + type: object + properties: + appDId: + type: string + description: "Identifier of this MEC application descriptor. This attribute\ + \ shall be globally unique. It is equivalent to the appDId defined in\ + \ clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application\ + \ is one in the ApplicationList." + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appDVersion: + type: string + description: "Identifies the version of the application descriptor. It is\ + \ equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC\ + \ 0102 [1]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDescription: + maxLength: 128 + type: string + description: Human readable description of the MEC application. The length + of the value shall not exceed 128 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appName: + maxLength: 32 + type: string + description: Name of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appProvider: + maxLength: 32 + type: string + description: |- + Provider of the MEC application. + The length of the value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appSoftVersion: + maxLength: 32 + type: string + description: Software version of the MEC application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appPackageSource: + type: string + description: "URI of the application package.\nIncluded in the request if\ + \ the application is not one in the ApplicationList. appPackageSource\ + \ enables on-boarding of the application package into the MEC system.\ + \ The application package shall comply with the definitions in clause\ + \ 6.2.1.2 of ETSI GS MEC 0102 [1]." + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + userAppInstanceInfo: + minItems: 1 + type: array + description: List of user application instance information. + items: + $ref: '#/components/schemas/AppContext_appInfo_userAppInstanceInfo' + x-etsi-mec-cardinality: 1..N + x-etsi-mec-origin-type: array (Structure inlined) + example: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + userAppInstanceInfo: + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + - appInstanceId: appInstanceId + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + referenceURI: http://example.com/aeiou + appDId: appDId + appProvider: appProvider + ApplicationContextUpdateNotification_userAppInstanceInfo: + type: object + properties: + appInstanceId: + type: string + description: Identifier of the user application instance. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appLocation: + $ref: '#/components/schemas/LocationConstraints' + referenceURI: + type: string + description: Address of the user application instance. + format: uri + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: URI + ApplicationList_appInfo_appCharcs: + type: object + properties: + bandwidth: + type: integer + description: 'The required connection bandwidth in kbit/s for the use of + the MEC application instance. ' + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + latency: + type: integer + description: The target round trip time in milliseconds supported by the + MEC system for the MEC application instance. + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + memory: + type: integer + description: The maximum size in Mbytes of the memory resource expected + to be used by the MEC application instance in the MEC system. + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + serviceCont: + type: integer + description: "Required service continuity mode for this application. Permitted\ + \ values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED." + enum: + - 0 + - 1 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: Enum + storage: + type: integer + description: The maximum size in Mbytes of the storage resource expected + to be used by the MEC application instance in the MEC system. + format: uint32 + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: uint32 + description: Characteristics of the application. As defined below. The application + characteristics relate to the system resources consumed by the application. + A device application can use this information e.g. for estimating the cost + of use of the application or for the expected user experience. + example: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + ApplicationList_appInfo: + required: + - appDId + - appDVersion + - appDescription + - appName + - appProvider + - appSoftVersion + type: object + properties: + appCharcs: + $ref: '#/components/schemas/ApplicationList_appInfo_appCharcs' + appDId: + type: string + description: "Identifier of this MEC application descriptor. It is equivalent\ + \ to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. This\ + \ attribute shall be globally unique." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDVersion: + type: string + description: "Identifies the version of the application descriptor. It is\ + \ equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC\ + \ 0102 [1]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDescription: + maxLength: 128 + type: string + description: Human readable description of the MEC application (see note + 2). + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appLocation: + minItems: 0 + type: array + description: Identifies the locations of the MEC application. + items: + $ref: '#/components/schemas/LocationConstraints' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: LocationConstraints + appName: + maxLength: 32 + type: string + description: Name of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appProvider: + maxLength: 32 + type: string + description: Provider of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appSoftVersion: + maxLength: 32 + type: string + description: Software version of the MEC application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + ApplicationList_vendorSpecificExt: + required: + - vendorId + type: object + properties: + vendorId: + maxLength: 32 + type: string + description: Vendor identifier. The length of the value shall not exceed + 32 characters. The rest of the structure of vendor specific extension + is not defined. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + description: Extension for vendor specific information (see note 1). + example: + vendorId: vendorId + ApplicationList_appList: + type: object + properties: + appInfo: + $ref: '#/components/schemas/ApplicationList_appInfo' + vendorSpecificExt: + $ref: '#/components/schemas/ApplicationList_vendorSpecificExt' + example: + appInfo: + appCharcs: + serviceCont: 5 + memory: 1 + bandwidth: 0 + latency: 6 + storage: 5 + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appLocation: + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + appName: appName + appDescription: appDescription + appDId: appDId + appProvider: appProvider + vendorSpecificExt: + vendorId: vendorId + ApplicationLocationAvailability_appInfo_availableLocations: + type: object + properties: + appLocation: + $ref: '#/components/schemas/LocationConstraints' + example: + appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + ApplicationLocationAvailability_appInfo: + required: + - appDVersion + - appName + - appProvider + type: object + properties: + appDVersion: + type: string + description: "Identifies the version of the application descriptor. It is\ + \ equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC\ + \ 0102 [1]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appDescription: + maxLength: 128 + type: string + description: Human readable description of the MEC application. The length + of the value shall not exceed 128 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appName: + maxLength: 32 + type: string + description: Name of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appPackageSource: + type: string + description: "URI of the application package. Shall be included in the request.\ + \ The application package shall comply with the definitions in clause\ + \ 6.2.1.2 of ETSI GS MEC 0102 [1]." + format: uri + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: URI + appProvider: + maxLength: 32 + type: string + description: Provider of the MEC application. The length of the value shall + not exceed 32 characters. + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + appSoftVersion: + maxLength: 32 + type: string + description: Software version of the MEC application. The length of the + value shall not exceed 32 characters. + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + availableLocations: + minItems: 0 + type: array + description: 'MEC application location constraints. ' + items: + $ref: '#/components/schemas/ApplicationLocationAvailability_appInfo_availableLocations' + x-etsi-mec-cardinality: 0..N + x-etsi-mec-origin-type: array (Structure (inline)) + example: + appSoftVersion: appSoftVersion + appDVersion: appDVersion + appPackageSource: http://example.com/aeiou + appName: appName + appDescription: appDescription + appProvider: appProvider + availableLocations: + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + - appLocation: + area: + coordinates: + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + - - - 2.302136 + - 2.302136 + - - 2.302136 + - 2.302136 + countryCode: countryCode + civicAddressElement: + - caType: 7 + caValue: caValue + - caType: 7 + caValue: caValue + LocationConstraints_civicAddressElement: + type: object + properties: + caType: + type: integer + description: "Describe the content type of caValue. The value of caType\ + \ shall comply with section 3.4 of IETF RFC 4776 [6]. " + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: Integer + caValue: + type: string + description: "Content of civic address element corresponding to the caType.\ + \ The format caValue shall comply with section 3.4 of IETF RFC 4776 [6]." + x-etsi-mec-cardinality: "1" + x-etsi-mec-origin-type: String + example: + caType: 7 + caValue: caValue + responses: + "204": + description: "Upon success, a response 204 No Content without any response body\ + \ is returned." + "400": + description: "Bad Request : used to indicate that incorrect parameters were\ + \ passed to the request." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: "Unauthorized : used when the client did not submit credentials." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: "Forbidden : operation is not allowed given the current status\ + \ of the resource." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "Not Found : used when a client provided a URI that cannot be\ + \ mapped to a valid resource URI." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Query.appName: + name: appName + in: query + description: Name to identify the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.appProvider: + name: appProvider + in: query + description: Provider of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.appSoftVersion: + name: appSoftVersion + in: query + description: Software version of the MEC application. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.vendorId: + name: vendorId + in: query + description: Vendor identifier + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 32 + type: string + Query.serviceCont: + name: serviceCont + in: query + description: "Required service continuity mode for this application. Permitted\ + \ values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED." + required: false + style: form + explode: true + schema: + type: integer + enum: + - 0 + - 1 + Path.contextId: + name: contextId + in: path + description: Uniquely identifies the application context in the MEC system. + It is assigned by the MEC system. + required: true + style: simple + explode: false + schema: + type: string diff --git a/go-packages/meep-dai-client/api_dai.go b/go-packages/meep-dai-client/api_dai.go new file mode 100644 index 000000000..da4a983f3 --- /dev/null +++ b/go-packages/meep-dai-client/api_dai.go @@ -0,0 +1,666 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "context" + "fmt" + "github.com/antihax/optional" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type DevAppApiService service + +/* +DevAppApiService Obtain the location constraints for a new application context. +Used to obtain the locations available for instantiation of a specific user application in the MEC system. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Entity body in the request contains the user application information for the MEC system to evaluate the locations available for instantiation of that application. +@return ApplicationLocationAvailability +*/ +func (a *DevAppApiService) AppLocationAvailabilityPOST(ctx context.Context, body ApplicationLocationAvailability) (ApplicationLocationAvailability, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApplicationLocationAvailability + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/obtain_app_loc_availability" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ApplicationLocationAvailability + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +DevAppApiService Deletion of an existing application context. +Used to delete the resource that represents the existing application context. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param contextId Uniquely identifies the application context in the MEC system. It is assigned by the MEC system. + +*/ +func (a *DevAppApiService) DevAppContextDELETE(ctx context.Context, contextId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app_contexts/{contextId}" + localVarPath = strings.Replace(localVarPath, "{"+"contextId"+"}", fmt.Sprintf("%v", contextId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +DevAppApiService Updating the callbackReference and/or appLocation of an existing application context. +Used to update the callback reference and/or application location constraints of an existing application context. Upon successful operation, the target resource is updated with the new application context information. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Only the callbackReference and/or appLocation attribute values are allowed to be updated. Other attributes and their values shall remain untouched. + * @param contextId Uniquely identifies the application context in the MEC system. It is assigned by the MEC system. + +*/ +func (a *DevAppApiService) DevAppContextPUT(ctx context.Context, body AppContext, contextId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app_contexts/{contextId}" + localVarPath = strings.Replace(localVarPath, "{"+"contextId"+"}", fmt.Sprintf("%v", contextId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +DevAppApiService Creation of a new application context. +Used to create a new application context. Upon success, the response contains entity body describing the created application context. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Entity body in the request contains the Application Context as requested by the device application. +@return AppContext +*/ +func (a *DevAppApiService) DevAppContextsPOST(ctx context.Context, body AppContext) (AppContext, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppContext + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app_contexts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v AppContext + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +DevAppApiService Get available application information. +Used to query information about the available MEC applications. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *DevAppApiMeAppListGETOpts - Optional Parameters: + * @param "AppName" (optional.Interface of []string) - Name to identify the MEC application. + * @param "AppProvider" (optional.Interface of []string) - Provider of the MEC application. + * @param "AppSoftVersion" (optional.Interface of []string) - Software version of the MEC application. + * @param "VendorId" (optional.Interface of []string) - Vendor identifier + * @param "ServiceCont" (optional.Int32) - Required service continuity mode for this application. Permitted values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED. +@return ApplicationList +*/ + +type DevAppApiMeAppListGETOpts struct { + AppName optional.Interface + AppProvider optional.Interface + AppSoftVersion optional.Interface + VendorId optional.Interface + ServiceCont optional.Int32 +} + +func (a *DevAppApiService) MeAppListGET(ctx context.Context, localVarOptionals *DevAppApiMeAppListGETOpts) (ApplicationList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApplicationList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/app_list" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AppName.IsSet() { + localVarQueryParams.Add("appName", parameterToString(localVarOptionals.AppName.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.AppProvider.IsSet() { + localVarQueryParams.Add("appProvider", parameterToString(localVarOptionals.AppProvider.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.AppSoftVersion.IsSet() { + localVarQueryParams.Add("appSoftVersion", parameterToString(localVarOptionals.AppSoftVersion.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.VendorId.IsSet() { + localVarQueryParams.Add("vendorId", parameterToString(localVarOptionals.VendorId.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.ServiceCont.IsSet() { + localVarQueryParams.Add("serviceCont", parameterToString(localVarOptionals.ServiceCont.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/problem+json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ApplicationList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ProblemDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/go-packages/meep-dai-client/client.go b/go-packages/meep-dai-client/client.go new file mode 100644 index 000000000..aed3454db --- /dev/null +++ b/go-packages/meep-dai-client/client.go @@ -0,0 +1,488 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the ETSI GS MEC 016 Device application interface API v2.2.1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DevAppApi *DevAppApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DevAppApi = (*DevAppApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/go-packages/meep-dai-client/configuration.go b/go-packages/meep-dai-client/configuration.go new file mode 100644 index 000000000..e72fd95ef --- /dev/null +++ b/go-packages/meep-dai-client/configuration.go @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://localhost/sandboxname/dev_app/v1", + DefaultHeader: make(map[string]string), + UserAgent: "Swagger-Codegen/1.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/go-packages/meep-dai-client/docs/AddressChangeNotification.md b/go-packages/meep-dai-client/docs/AddressChangeNotification.md new file mode 100644 index 000000000..2ffbd0ec0 --- /dev/null +++ b/go-packages/meep-dai-client/docs/AddressChangeNotification.md @@ -0,0 +1,12 @@ +# AddressChangeNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInstanceId** | **string** | Identifier of the user application instance. | [default to null] +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. | [default to null] +**NotificationType** | **string** | Shall be set to \"AddressChangeNotification\". | [default to null] +**ReferenceURI** | **string** | Address of the user application. Used as the reference URI for the application. Assigned by the MEC system. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/AppContext.md b/go-packages/meep-dai-client/docs/AppContext.md new file mode 100644 index 000000000..df07f8052 --- /dev/null +++ b/go-packages/meep-dai-client/docs/AppContext.md @@ -0,0 +1,14 @@ +# AppContext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppAutoInstantiation** | **bool** | Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request. | [optional] [default to null] +**AppInfo** | [***AppContextAppInfo**](AppContext_appInfo.md) | | [default to null] +**AppLocationUpdates** | **bool** | Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation. | [optional] [default to null] +**AssociateDevAppId** | **string** | Uniquely identifies the device application. The length of the value shall not exceed 32 characters. | [default to null] +**CallbackReference** | **string** | URI assigned by the device application to receive application lifecycle related notifications. Inclusion in the request implies the client supports the pub/sub mechanism and is capable of receiving notifications. This endpoint shall be maintained for the lifetime of the application context. | [optional] [default to null] +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. Assigned by the MEC system and shall be present other than in a create request. The length of the value shall not exceed 32 characters. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/AppContextAppInfo.md b/go-packages/meep-dai-client/docs/AppContextAppInfo.md new file mode 100644 index 000000000..1039a8008 --- /dev/null +++ b/go-packages/meep-dai-client/docs/AppContextAppInfo.md @@ -0,0 +1,16 @@ +# AppContextAppInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppDId** | **string** | Identifier of this MEC application descriptor. This attribute shall be globally unique. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application is one in the ApplicationList. | [optional] [default to null] +**AppDVersion** | **string** | Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [default to null] +**AppDescription** | **string** | Human readable description of the MEC application. The length of the value shall not exceed 128 characters. | [optional] [default to null] +**AppName** | **string** | Name of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppProvider** | **string** | Provider of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppSoftVersion** | **string** | Software version of the MEC application. The length of the value shall not exceed 32 characters. | [optional] [default to null] +**AppPackageSource** | **string** | URI of the application package. Included in the request if the application is not one in the ApplicationList. appPackageSource enables on-boarding of the application package into the MEC system. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [optional] [default to null] +**UserAppInstanceInfo** | [**[]AppContextAppInfoUserAppInstanceInfo**](AppContext_appInfo_userAppInstanceInfo.md) | List of user application instance information. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/AppContextAppInfoUserAppInstanceInfo.md b/go-packages/meep-dai-client/docs/AppContextAppInfoUserAppInstanceInfo.md new file mode 100644 index 000000000..9c860343a --- /dev/null +++ b/go-packages/meep-dai-client/docs/AppContextAppInfoUserAppInstanceInfo.md @@ -0,0 +1,11 @@ +# AppContextAppInfoUserAppInstanceInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInstanceId** | **string** | Identifier of the user application instance. It shall only be included in the response. | [optional] [default to null] +**AppLocation** | [***LocationConstraints**](LocationConstraints.md) | | [optional] [default to null] +**ReferenceURI** | **string** | Address of the user application instance. It shall only be included in the response. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/AppTerminationNotification.md b/go-packages/meep-dai-client/docs/AppTerminationNotification.md new file mode 100644 index 000000000..8156e455d --- /dev/null +++ b/go-packages/meep-dai-client/docs/AppTerminationNotification.md @@ -0,0 +1,12 @@ +# AppTerminationNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationType** | **string** | Shall be set to AppTerminationNotification. | [default to null] +**OperationAction** | [***OperationActionType**](OperationActionType.md) | | [default to null] +**MaxGracefulTimeout** | **int32** | Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. | [default to null] +**Links** | [***AppTerminationNotificationLinks**](AppTerminationNotification__links.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/AppTerminationNotificationLinks.md b/go-packages/meep-dai-client/docs/AppTerminationNotificationLinks.md new file mode 100644 index 000000000..67d7f0d90 --- /dev/null +++ b/go-packages/meep-dai-client/docs/AppTerminationNotificationLinks.md @@ -0,0 +1,10 @@ +# AppTerminationNotificationLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | [***LinkType**](LinkType.md) | | [default to null] +**ConfirmTermination** | [***LinkType**](LinkType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationContextDeleteNotification.md b/go-packages/meep-dai-client/docs/ApplicationContextDeleteNotification.md new file mode 100644 index 000000000..1b1bdce5b --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationContextDeleteNotification.md @@ -0,0 +1,10 @@ +# ApplicationContextDeleteNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContextId** | **string** | Uniquely identifies the application context that has been deleted from the MEC system. | [default to null] +**NotificationType** | **string** | Shall be set to \"ApplicationContextDeleteNotification\". | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationContextUpdateNotification.md b/go-packages/meep-dai-client/docs/ApplicationContextUpdateNotification.md new file mode 100644 index 000000000..3fadb94b0 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationContextUpdateNotification.md @@ -0,0 +1,11 @@ +# ApplicationContextUpdateNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. | [default to null] +**NotificationType** | **string** | Shall be set to \"ApplicationContextUpdateNotification\". | [default to null] +**UserAppInstanceInfo** | [**[]ApplicationContextUpdateNotificationUserAppInstanceInfo**](ApplicationContextUpdateNotification_userAppInstanceInfo.md) | List of user application instance information. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationContextUpdateNotificationUserAppInstanceInfo.md b/go-packages/meep-dai-client/docs/ApplicationContextUpdateNotificationUserAppInstanceInfo.md new file mode 100644 index 000000000..d754d83ca --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationContextUpdateNotificationUserAppInstanceInfo.md @@ -0,0 +1,11 @@ +# ApplicationContextUpdateNotificationUserAppInstanceInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInstanceId** | **string** | Identifier of the user application instance. | [optional] [default to null] +**AppLocation** | [***LocationConstraints**](LocationConstraints.md) | | [optional] [default to null] +**ReferenceURI** | **string** | Address of the user application instance. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationList.md b/go-packages/meep-dai-client/docs/ApplicationList.md new file mode 100644 index 000000000..113b273da --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationList.md @@ -0,0 +1,9 @@ +# ApplicationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppList** | [**[]ApplicationListAppList**](ApplicationList_appList.md) | List of user applications available to the device application. As defined below. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationListAppInfo.md b/go-packages/meep-dai-client/docs/ApplicationListAppInfo.md new file mode 100644 index 000000000..7bc421b1b --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationListAppInfo.md @@ -0,0 +1,16 @@ +# ApplicationListAppInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppCharcs** | [***ApplicationListAppInfoAppCharcs**](ApplicationList_appInfo_appCharcs.md) | | [optional] [default to null] +**AppDId** | **string** | Identifier of this MEC application descriptor. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. This attribute shall be globally unique. | [default to null] +**AppDVersion** | **string** | Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [default to null] +**AppDescription** | **string** | Human readable description of the MEC application (see note 2). | [default to null] +**AppLocation** | [**[]LocationConstraints**](LocationConstraints.md) | Identifies the locations of the MEC application. | [optional] [default to null] +**AppName** | **string** | Name of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppProvider** | **string** | Provider of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppSoftVersion** | **string** | Software version of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationListAppInfoAppCharcs.md b/go-packages/meep-dai-client/docs/ApplicationListAppInfoAppCharcs.md new file mode 100644 index 000000000..59e4ed4fa --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationListAppInfoAppCharcs.md @@ -0,0 +1,13 @@ +# ApplicationListAppInfoAppCharcs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bandwidth** | **int32** | The required connection bandwidth in kbit/s for the use of the MEC application instance. | [optional] [default to null] +**Latency** | **int32** | The target round trip time in milliseconds supported by the MEC system for the MEC application instance. | [optional] [default to null] +**Memory** | **int32** | The maximum size in Mbytes of the memory resource expected to be used by the MEC application instance in the MEC system. | [optional] [default to null] +**ServiceCont** | **int32** | Required service continuity mode for this application. Permitted values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED. | [optional] [default to null] +**Storage** | **int32** | The maximum size in Mbytes of the storage resource expected to be used by the MEC application instance in the MEC system. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationListAppList.md b/go-packages/meep-dai-client/docs/ApplicationListAppList.md new file mode 100644 index 000000000..b167df336 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationListAppList.md @@ -0,0 +1,10 @@ +# ApplicationListAppList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInfo** | [***ApplicationListAppInfo**](ApplicationList_appInfo.md) | | [optional] [default to null] +**VendorSpecificExt** | [***ApplicationListVendorSpecificExt**](ApplicationList_vendorSpecificExt.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationListVendorSpecificExt.md b/go-packages/meep-dai-client/docs/ApplicationListVendorSpecificExt.md new file mode 100644 index 000000000..961a995c7 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationListVendorSpecificExt.md @@ -0,0 +1,9 @@ +# ApplicationListVendorSpecificExt + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VendorId** | **string** | Vendor identifier. The length of the value shall not exceed 32 characters. The rest of the structure of vendor specific extension is not defined. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationLocationAvailability.md b/go-packages/meep-dai-client/docs/ApplicationLocationAvailability.md new file mode 100644 index 000000000..a22113959 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationLocationAvailability.md @@ -0,0 +1,10 @@ +# ApplicationLocationAvailability + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppInfo** | [***ApplicationLocationAvailabilityAppInfo**](ApplicationLocationAvailability_appInfo.md) | | [default to null] +**AssociateDevAppId** | **string** | Uniquely identifies the device application. The length of the value shall not exceed 32 characters. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfo.md b/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfo.md new file mode 100644 index 000000000..25afd4bee --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfo.md @@ -0,0 +1,15 @@ +# ApplicationLocationAvailabilityAppInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppDVersion** | **string** | Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [default to null] +**AppDescription** | **string** | Human readable description of the MEC application. The length of the value shall not exceed 128 characters. | [optional] [default to null] +**AppName** | **string** | Name of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppPackageSource** | **string** | URI of the application package. Shall be included in the request. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. | [optional] [default to null] +**AppProvider** | **string** | Provider of the MEC application. The length of the value shall not exceed 32 characters. | [default to null] +**AppSoftVersion** | **string** | Software version of the MEC application. The length of the value shall not exceed 32 characters. | [optional] [default to null] +**AvailableLocations** | [**[]ApplicationLocationAvailabilityAppInfoAvailableLocations**](ApplicationLocationAvailability_appInfo_availableLocations.md) | MEC application location constraints. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfoAvailableLocations.md b/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfoAvailableLocations.md new file mode 100644 index 000000000..6e48bd031 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityAppInfoAvailableLocations.md @@ -0,0 +1,9 @@ +# ApplicationLocationAvailabilityAppInfoAvailableLocations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppLocation** | [***LocationConstraints**](LocationConstraints.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityNotification.md b/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityNotification.md new file mode 100644 index 000000000..3850feb48 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ApplicationLocationAvailabilityNotification.md @@ -0,0 +1,11 @@ +# ApplicationLocationAvailabilityNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvailableLocations** | [**[]ApplicationLocationAvailabilityAppInfoAvailableLocations**](ApplicationLocationAvailability_appInfo_availableLocations.md) | Locations available to the MEC application. | [default to null] +**ContextId** | **string** | Uniquely identifies the application context in the MEC system. | [optional] [default to null] +**NotificationType** | **string** | Shall be set to \"ApplicationLocationAvailabilityNotification\". | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/InlineNotification.md b/go-packages/meep-dai-client/docs/InlineNotification.md new file mode 100644 index 000000000..f268cd077 --- /dev/null +++ b/go-packages/meep-dai-client/docs/InlineNotification.md @@ -0,0 +1,8 @@ +# InlineNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/LinkType.md b/go-packages/meep-dai-client/docs/LinkType.md new file mode 100644 index 000000000..a8945efcd --- /dev/null +++ b/go-packages/meep-dai-client/docs/LinkType.md @@ -0,0 +1,9 @@ +# LinkType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | URI referring to a resource | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/Links.md b/go-packages/meep-dai-client/docs/Links.md new file mode 100644 index 000000000..dc27914ca --- /dev/null +++ b/go-packages/meep-dai-client/docs/Links.md @@ -0,0 +1,9 @@ +# Links + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | [***LinkType**](LinkType.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/LocationConstraints.md b/go-packages/meep-dai-client/docs/LocationConstraints.md new file mode 100644 index 000000000..c7d4e73f9 --- /dev/null +++ b/go-packages/meep-dai-client/docs/LocationConstraints.md @@ -0,0 +1,11 @@ +# LocationConstraints + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Area** | [***Polygon**](Polygon.md) | | [optional] [default to null] +**CivicAddressElement** | [**[]LocationConstraintsCivicAddressElement**](LocationConstraints_civicAddressElement.md) | Zero or more elements comprising the civic address. Shall be absent if the \"area\" attribute is present. | [optional] [default to null] +**CountryCode** | **string** | The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the \"area\" attribute is absent. May be absent if the \"area\" attribute is present (see note). | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/LocationConstraintsCivicAddressElement.md b/go-packages/meep-dai-client/docs/LocationConstraintsCivicAddressElement.md new file mode 100644 index 000000000..70e2d83be --- /dev/null +++ b/go-packages/meep-dai-client/docs/LocationConstraintsCivicAddressElement.md @@ -0,0 +1,10 @@ +# LocationConstraintsCivicAddressElement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CaType** | **int32** | Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776 [6]. | [optional] [default to null] +**CaValue** | **string** | Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776 [6]. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/OneOfInlineNotification.md b/go-packages/meep-dai-client/docs/OneOfInlineNotification.md new file mode 100644 index 000000000..442884e24 --- /dev/null +++ b/go-packages/meep-dai-client/docs/OneOfInlineNotification.md @@ -0,0 +1,8 @@ +# OneOfInlineNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/OperationActionType.md b/go-packages/meep-dai-client/docs/OperationActionType.md new file mode 100644 index 000000000..4078c9e76 --- /dev/null +++ b/go-packages/meep-dai-client/docs/OperationActionType.md @@ -0,0 +1,8 @@ +# OperationActionType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/Polygon.md b/go-packages/meep-dai-client/docs/Polygon.md new file mode 100644 index 000000000..f4cb2c96a --- /dev/null +++ b/go-packages/meep-dai-client/docs/Polygon.md @@ -0,0 +1,9 @@ +# Polygon + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Coordinates** | [**[][][]float32**](array.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/docs/ProblemDetails.md b/go-packages/meep-dai-client/docs/ProblemDetails.md new file mode 100644 index 000000000..d6f1dfeb6 --- /dev/null +++ b/go-packages/meep-dai-client/docs/ProblemDetails.md @@ -0,0 +1,13 @@ +# ProblemDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | **string** | A human-readable explanation specific to this occurrence of the problem | [optional] [default to null] +**Instance** | **string** | A URI reference that identifies the specific occurrence of the problem | [optional] [default to null] +**Status** | **int32** | The HTTP status code for this occurrence of the problem | [optional] [default to null] +**Title** | **string** | A short, human-readable summary of the problem type | [optional] [default to null] +**Type_** | **string** | A URI reference according to IETF RFC 3986 that identifies the problem type | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/go-packages/meep-dai-client/git_push.sh b/go-packages/meep-dai-client/git_push.sh new file mode 100644 index 000000000..ae01b182a --- /dev/null +++ b/go-packages/meep-dai-client/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/go-packages/meep-dai-client/go.mod b/go-packages/meep-dai-client/go.mod new file mode 100644 index 000000000..f39d62b92 --- /dev/null +++ b/go-packages/meep-dai-client/go.mod @@ -0,0 +1,9 @@ +module github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-dai-client + +go 1.12 + +require ( + github.com/antihax/optional v1.0.0 + golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 + golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a +) diff --git a/go-packages/meep-dai-client/go.sum b/go-packages/meep-dai-client/go.sum new file mode 100644 index 000000000..f04cf1014 --- /dev/null +++ b/go-packages/meep-dai-client/go.sum @@ -0,0 +1,15 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/go-packages/meep-dai-client/model_address_change_notification.go b/go-packages/meep-dai-client/model_address_change_notification.go new file mode 100644 index 000000000..8108ba21d --- /dev/null +++ b/go-packages/meep-dai-client/model_address_change_notification.go @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type AddressChangeNotification struct { + // Identifier of the user application instance. + AppInstanceId string `json:"appInstanceId"` + // Uniquely identifies the application context in the MEC system. + ContextId string `json:"contextId"` + // Shall be set to \"AddressChangeNotification\". + NotificationType string `json:"notificationType"` + // Address of the user application. Used as the reference URI for the application. Assigned by the MEC system. + ReferenceURI string `json:"referenceURI"` +} diff --git a/go-packages/meep-dai-client/model_app_context.go b/go-packages/meep-dai-client/model_app_context.go new file mode 100644 index 000000000..50a59eb8f --- /dev/null +++ b/go-packages/meep-dai-client/model_app_context.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type AppContext struct { + // Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request. + AppAutoInstantiation bool `json:"appAutoInstantiation,omitempty"` + AppInfo *AppContextAppInfo `json:"appInfo"` + // Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation. + AppLocationUpdates bool `json:"appLocationUpdates,omitempty"` + // Uniquely identifies the device application. The length of the value shall not exceed 32 characters. + AssociateDevAppId string `json:"associateDevAppId"` + // URI assigned by the device application to receive application lifecycle related notifications. Inclusion in the request implies the client supports the pub/sub mechanism and is capable of receiving notifications. This endpoint shall be maintained for the lifetime of the application context. + CallbackReference string `json:"callbackReference,omitempty"` + // Uniquely identifies the application context in the MEC system. Assigned by the MEC system and shall be present other than in a create request. The length of the value shall not exceed 32 characters. + ContextId string `json:"contextId,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_app_context_app_info.go b/go-packages/meep-dai-client/model_app_context_app_info.go new file mode 100644 index 000000000..83d6bfef3 --- /dev/null +++ b/go-packages/meep-dai-client/model_app_context_app_info.go @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type AppContextAppInfo struct { + // Identifier of this MEC application descriptor. This attribute shall be globally unique. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application is one in the ApplicationList. + AppDId string `json:"appDId,omitempty"` + // Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppDVersion string `json:"appDVersion"` + // Human readable description of the MEC application. The length of the value shall not exceed 128 characters. + AppDescription string `json:"appDescription,omitempty"` + // Name of the MEC application. The length of the value shall not exceed 32 characters. + AppName string `json:"appName"` + // Provider of the MEC application. The length of the value shall not exceed 32 characters. + AppProvider string `json:"appProvider"` + // Software version of the MEC application. The length of the value shall not exceed 32 characters. + AppSoftVersion string `json:"appSoftVersion,omitempty"` + // URI of the application package. Included in the request if the application is not one in the ApplicationList. appPackageSource enables on-boarding of the application package into the MEC system. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppPackageSource string `json:"appPackageSource,omitempty"` + // List of user application instance information. + UserAppInstanceInfo []AppContextAppInfoUserAppInstanceInfo `json:"userAppInstanceInfo"` +} diff --git a/go-packages/meep-dai-client/model_app_context_app_info_user_app_instance_info.go b/go-packages/meep-dai-client/model_app_context_app_info_user_app_instance_info.go new file mode 100644 index 000000000..06f9388ac --- /dev/null +++ b/go-packages/meep-dai-client/model_app_context_app_info_user_app_instance_info.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type AppContextAppInfoUserAppInstanceInfo struct { + // Identifier of the user application instance. It shall only be included in the response. + AppInstanceId string `json:"appInstanceId,omitempty"` + AppLocation *LocationConstraints `json:"appLocation,omitempty"` + // Address of the user application instance. It shall only be included in the response. + ReferenceURI string `json:"referenceURI,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_app_termination_notification.go b/go-packages/meep-dai-client/model_app_termination_notification.go new file mode 100644 index 000000000..67e89d6c8 --- /dev/null +++ b/go-packages/meep-dai-client/model_app_termination_notification.go @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// This type represents the information that the MEC platform notifies the subscribed application instance about the corresponding application instance termination/stop. +type AppTerminationNotification struct { + // Shall be set to AppTerminationNotification. + NotificationType string `json:"notificationType"` + OperationAction *OperationActionType `json:"operationAction"` + // Maximum timeout value in seconds for graceful termination or graceful stop of an application instance. + MaxGracefulTimeout int32 `json:"maxGracefulTimeout"` + Links *AppTerminationNotificationLinks `json:"_links"` +} diff --git a/go-packages/meep-dai-client/model_app_termination_notification__links.go b/go-packages/meep-dai-client/model_app_termination_notification__links.go new file mode 100644 index 000000000..a20d94b46 --- /dev/null +++ b/go-packages/meep-dai-client/model_app_termination_notification__links.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Object containing hyperlinks related to the resource. +type AppTerminationNotificationLinks struct { + Subscription *LinkType `json:"subscription"` + ConfirmTermination *LinkType `json:"confirmTermination,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_context_delete_notification.go b/go-packages/meep-dai-client/model_application_context_delete_notification.go new file mode 100644 index 000000000..5237b4d88 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_context_delete_notification.go @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationContextDeleteNotification struct { + // Uniquely identifies the application context that has been deleted from the MEC system. + ContextId string `json:"contextId"` + // Shall be set to \"ApplicationContextDeleteNotification\". + NotificationType string `json:"notificationType"` +} diff --git a/go-packages/meep-dai-client/model_application_context_update_notification.go b/go-packages/meep-dai-client/model_application_context_update_notification.go new file mode 100644 index 000000000..1192e9bc6 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_context_update_notification.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationContextUpdateNotification struct { + // Uniquely identifies the application context in the MEC system. + ContextId string `json:"contextId"` + // Shall be set to \"ApplicationContextUpdateNotification\". + NotificationType string `json:"notificationType"` + // List of user application instance information. + UserAppInstanceInfo []ApplicationContextUpdateNotificationUserAppInstanceInfo `json:"userAppInstanceInfo"` +} diff --git a/go-packages/meep-dai-client/model_application_context_update_notification_user_app_instance_info.go b/go-packages/meep-dai-client/model_application_context_update_notification_user_app_instance_info.go new file mode 100644 index 000000000..eb1de9a81 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_context_update_notification_user_app_instance_info.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationContextUpdateNotificationUserAppInstanceInfo struct { + // Identifier of the user application instance. + AppInstanceId string `json:"appInstanceId,omitempty"` + AppLocation *LocationConstraints `json:"appLocation,omitempty"` + // Address of the user application instance. + ReferenceURI string `json:"referenceURI,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_list.go b/go-packages/meep-dai-client/model_application_list.go new file mode 100644 index 000000000..a27432eca --- /dev/null +++ b/go-packages/meep-dai-client/model_application_list.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + package client + +type ApplicationList struct { + // List of user applications available to the device application. As defined below. + AppList []ApplicationListAppList `json:"appList,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_list_app_info.go b/go-packages/meep-dai-client/model_application_list_app_info.go new file mode 100644 index 000000000..45a5e9283 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_list_app_info.go @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + package client + +type ApplicationListAppInfo struct { + AppCharcs *ApplicationListAppInfoAppCharcs `json:"appCharcs,omitempty"` + // Identifier of this MEC application descriptor. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. This attribute shall be globally unique. + AppDId string `json:"appDId"` + // Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppDVersion string `json:"appDVersion"` + // Human readable description of the MEC application (see note 2). + AppDescription string `json:"appDescription"` + // Identifies the locations of the MEC application. + AppLocation []LocationConstraints `json:"appLocation,omitempty"` + // Name of the MEC application. The length of the value shall not exceed 32 characters. + AppName string `json:"appName"` + // Provider of the MEC application. The length of the value shall not exceed 32 characters. + AppProvider string `json:"appProvider"` + // Software version of the MEC application. The length of the value shall not exceed 32 characters. + AppSoftVersion string `json:"appSoftVersion"` +} diff --git a/go-packages/meep-dai-client/model_application_list_app_info_app_charcs.go b/go-packages/meep-dai-client/model_application_list_app_info_app_charcs.go new file mode 100644 index 000000000..23d1d5e56 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_list_app_info_app_charcs.go @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Characteristics of the application. As defined below. The application characteristics relate to the system resources consumed by the application. A device application can use this information e.g. for estimating the cost of use of the application or for the expected user experience. +type ApplicationListAppInfoAppCharcs struct { + // The required connection bandwidth in kbit/s for the use of the MEC application instance. + Bandwidth int32 `json:"bandwidth,omitempty"` + // The target round trip time in milliseconds supported by the MEC system for the MEC application instance. + Latency int32 `json:"latency,omitempty"` + // The maximum size in Mbytes of the memory resource expected to be used by the MEC application instance in the MEC system. + Memory int32 `json:"memory,omitempty"` + // Required service continuity mode for this application. Permitted values: 0 = SERVICE_CONTINUITY_NOT_REQUIRED. 1 = SERVICE_CONTINUITY_REQUIRED. + ServiceCont int32 `json:"serviceCont,omitempty"` + // The maximum size in Mbytes of the storage resource expected to be used by the MEC application instance in the MEC system. + Storage int32 `json:"storage,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_list_app_list.go b/go-packages/meep-dai-client/model_application_list_app_list.go new file mode 100644 index 000000000..a712a62d0 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_list_app_list.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + package client + +type ApplicationListAppList struct { + AppInfo *ApplicationListAppInfo `json:"appInfo,omitempty"` + VendorSpecificExt *ApplicationListVendorSpecificExt `json:"vendorSpecificExt,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_list_vendor_specific_ext.go b/go-packages/meep-dai-client/model_application_list_vendor_specific_ext.go new file mode 100644 index 000000000..2a1472ec9 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_list_vendor_specific_ext.go @@ -0,0 +1,15 @@ +/* + * ETSI GS MEC 016 Device application interface + * + * The ETSI MEC ISG Device application interface API described using OpenAPI. + * + * API version: 2.2.1 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Extension for vendor specific information (see note 1). +type ApplicationListVendorSpecificExt struct { + // Vendor identifier. The length of the value shall not exceed 32 characters. The rest of the structure of vendor specific extension is not defined. + VendorId string `json:"vendorId"` +} diff --git a/go-packages/meep-dai-client/model_application_location_availability.go b/go-packages/meep-dai-client/model_application_location_availability.go new file mode 100644 index 000000000..50994dc36 --- /dev/null +++ b/go-packages/meep-dai-client/model_application_location_availability.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationLocationAvailability struct { + AppInfo *ApplicationLocationAvailabilityAppInfo `json:"appInfo"` + // Uniquely identifies the device application. The length of the value shall not exceed 32 characters. + AssociateDevAppId string `json:"associateDevAppId"` +} diff --git a/go-packages/meep-dai-client/model_application_location_availability_app_info.go b/go-packages/meep-dai-client/model_application_location_availability_app_info.go new file mode 100644 index 000000000..bb63c74eb --- /dev/null +++ b/go-packages/meep-dai-client/model_application_location_availability_app_info.go @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationLocationAvailabilityAppInfo struct { + // Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppDVersion string `json:"appDVersion"` + // Human readable description of the MEC application. The length of the value shall not exceed 128 characters. + AppDescription string `json:"appDescription,omitempty"` + // Name of the MEC application. The length of the value shall not exceed 32 characters. + AppName string `json:"appName"` + // URI of the application package. Shall be included in the request. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. + AppPackageSource string `json:"appPackageSource,omitempty"` + // Provider of the MEC application. The length of the value shall not exceed 32 characters. + AppProvider string `json:"appProvider"` + // Software version of the MEC application. The length of the value shall not exceed 32 characters. + AppSoftVersion string `json:"appSoftVersion,omitempty"` + // MEC application location constraints. + AvailableLocations []ApplicationLocationAvailabilityAppInfoAvailableLocations `json:"availableLocations,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_location_availability_app_info_available_locations.go b/go-packages/meep-dai-client/model_application_location_availability_app_info_available_locations.go new file mode 100644 index 000000000..80f1b893a --- /dev/null +++ b/go-packages/meep-dai-client/model_application_location_availability_app_info_available_locations.go @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationLocationAvailabilityAppInfoAvailableLocations struct { + AppLocation *LocationConstraints `json:"appLocation,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_application_location_availability_notification.go b/go-packages/meep-dai-client/model_application_location_availability_notification.go new file mode 100644 index 000000000..a021440ae --- /dev/null +++ b/go-packages/meep-dai-client/model_application_location_availability_notification.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ApplicationLocationAvailabilityNotification struct { + // Locations available to the MEC application. + AvailableLocations []ApplicationLocationAvailabilityAppInfoAvailableLocations `json:"availableLocations"` + // Uniquely identifies the application context in the MEC system. + ContextId string `json:"contextId,omitempty"` + // Shall be set to \"ApplicationLocationAvailabilityNotification\". + NotificationType string `json:"notificationType"` +} diff --git a/go-packages/meep-dai-client/model_inline_notification.go b/go-packages/meep-dai-client/model_inline_notification.go new file mode 100644 index 000000000..24044c051 --- /dev/null +++ b/go-packages/meep-dai-client/model_inline_notification.go @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type InlineNotification struct { +} diff --git a/go-packages/meep-dai-client/model_link_type.go b/go-packages/meep-dai-client/model_link_type.go new file mode 100644 index 000000000..20b6fa88a --- /dev/null +++ b/go-packages/meep-dai-client/model_link_type.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type LinkType struct { + // URI referring to a resource + Href string `json:"href"` +} diff --git a/go-packages/meep-dai-client/model_links.go b/go-packages/meep-dai-client/model_links.go new file mode 100644 index 000000000..f5e061861 --- /dev/null +++ b/go-packages/meep-dai-client/model_links.go @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests. +type Links struct { + Self *LinkType `json:"self"` +} diff --git a/go-packages/meep-dai-client/model_location_constraints.go b/go-packages/meep-dai-client/model_location_constraints.go new file mode 100644 index 000000000..217ea4a55 --- /dev/null +++ b/go-packages/meep-dai-client/model_location_constraints.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type LocationConstraints struct { + Area *Polygon `json:"area,omitempty"` + // Zero or more elements comprising the civic address. Shall be absent if the \"area\" attribute is present. + CivicAddressElement []LocationConstraintsCivicAddressElement `json:"civicAddressElement,omitempty"` + // The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the \"area\" attribute is absent. May be absent if the \"area\" attribute is present (see note). + CountryCode string `json:"countryCode,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_location_constraints_civic_address_element.go b/go-packages/meep-dai-client/model_location_constraints_civic_address_element.go new file mode 100644 index 000000000..9c72b89bf --- /dev/null +++ b/go-packages/meep-dai-client/model_location_constraints_civic_address_element.go @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type LocationConstraintsCivicAddressElement struct { + // Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776 [6]. + CaType int32 `json:"caType,omitempty"` + // Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776 [6]. + CaValue string `json:"caValue,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_one_of_inline_notification.go b/go-packages/meep-dai-client/model_one_of_inline_notification.go new file mode 100644 index 000000000..55d0ffb29 --- /dev/null +++ b/go-packages/meep-dai-client/model_one_of_inline_notification.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type OneOfInlineNotification struct { + NotificationType string `json:"notificationType"` + /*AddressChangeNotification + ApplicationContextDeleteNotification + ApplicationContextUpdateNotification + ApplicationLocationAvailabilityNotification*/ +} diff --git a/go-packages/meep-dai-client/model_operation_action_type.go b/go-packages/meep-dai-client/model_operation_action_type.go new file mode 100644 index 000000000..038918c43 --- /dev/null +++ b/go-packages/meep-dai-client/model_operation_action_type.go @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +// OperationActionType : Operation that is being performed on the MEC application instance. +type OperationActionType string + +// List of OperationActionType +const ( + STOPPING_OperationActionType OperationActionType = "STOPPING" + TERMINATING_OperationActionType OperationActionType = "TERMINATING" +) diff --git a/go-packages/meep-dai-client/model_polygon.go b/go-packages/meep-dai-client/model_polygon.go new file mode 100644 index 000000000..8375ad690 --- /dev/null +++ b/go-packages/meep-dai-client/model_polygon.go @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type Polygon struct { + Coordinates [][][]float32 `json:"coordinates,omitempty"` +} diff --git a/go-packages/meep-dai-client/model_problem_details.go b/go-packages/meep-dai-client/model_problem_details.go new file mode 100644 index 000000000..40951460e --- /dev/null +++ b/go-packages/meep-dai-client/model_problem_details.go @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +type ProblemDetails struct { + // A human-readable explanation specific to this occurrence of the problem + Detail string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem + Instance string `json:"instance,omitempty"` + // The HTTP status code for this occurrence of the problem + Status int32 `json:"status,omitempty"` + // A short, human-readable summary of the problem type + Title string `json:"title,omitempty"` + // A URI reference according to IETF RFC 3986 that identifies the problem type + Type_ string `json:"type,omitempty"` +} diff --git a/go-packages/meep-dai-client/response.go b/go-packages/meep-dai-client/response.go new file mode 100644 index 000000000..6f3eeed52 --- /dev/null +++ b/go-packages/meep-dai-client/response.go @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * AdvantEDGE Application Mobility API + * + * Device application interface is AdvantEDGE's implementation of [ETSI MEC ISG MEC016 Device application interface API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_MEC016v020201p.pdf)

[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt)

**Micro-service**
[meep-dai](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-dai)

**Type & Usage**
Edge Service used by edge applications that want to get information about application mobility in the network

**Note**
AdvantEDGE supports a selected subset of Device application interface API endpoints (see below). + * + * API version: 2.2.1 + * Contact: AdvantEDGE@InterDigital.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package client + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the client operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/go-packages/meep-dai-mgr/convert.go b/go-packages/meep-dai-mgr/convert.go new file mode 100644 index 000000000..8e53fb50e --- /dev/null +++ b/go-packages/meep-dai-mgr/convert.go @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package meepdaimgr + +import ( + "encoding/json" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" +) + +func convertPolygonToJson(area *Polygon) string { + if area == nil { // This is not an error + return "" + } + jsonInfo, err := json.Marshal(*area) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertJsonToPolygon(jsonInfo string) *Polygon { + var obj Polygon + if jsonInfo != "" { // Empty string is processed as an empty array + err := json.Unmarshal([]byte(jsonInfo), &obj) + if err != nil { + log.Error(err.Error()) + return nil + } + } + return &obj +} + +func convertCivicAddressElementToJson(civicAddressElement *CivicAddressElement) string { + if civicAddressElement == nil { // This is not an error + return "" + } + jsonInfo, err := json.Marshal(*civicAddressElement) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertJsonToCivicAddressElement(jsonInfo string) *CivicAddressElement { + var obj CivicAddressElement + if jsonInfo != "" { // Empty string is processed as an empty array + err := json.Unmarshal([]byte(jsonInfo), &obj) + if err != nil { + log.Error(err.Error()) + return nil + } + } + return &obj +} + +func convertApplicationListToJson(applicationList *ApplicationList) string { + if applicationList == nil { // This is not an error + return "" + } + jsonInfo, err := json.Marshal(*applicationList) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertJsonToApplicationList(jsonInfo string) *ApplicationList { + var obj ApplicationList + if jsonInfo != "" { // Empty string is processed as an empty array + err := json.Unmarshal([]byte(jsonInfo), &obj) + if err != nil { + log.Error(err.Error()) + return nil + } + } + return &obj +} + +func NilToEmptyString(s *string) string { + if s == nil { + return "" + } + + return *s +} + +func EmptyToNilString(s *string) *string { + if s != nil && *s == "" { + return nil + } + + return s +} + +func NilToEmptyUri(s *Uri) Uri { + if s == nil { + return "" + } + + return *s +} + +func EmptyToNilUri(s *Uri) *Uri { + if s != nil && *s == "" { + return nil + } + + return s +} diff --git a/go-packages/meep-dai-mgr/docker.go b/go-packages/meep-dai-mgr/docker.go new file mode 100644 index 000000000..5329d020a --- /dev/null +++ b/go-packages/meep-dai-mgr/docker.go @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package meepdaimgr + +import ( + "errors" + "os/exec" + "strings" + "time" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + + uuid "github.com/google/uuid" + "github.com/spf13/cobra" +) + +var cbCmd = &cobra.Command{ + Use: "Testing exec", + Short: "Testing exec", + Long: "Long description", + Example: "Usage example", + Args: cobra.OnlyValidArgs, + ValidArgs: nil, + Run: nil, +} + +// Create and start a container +func DockerRun(image string, port string, timeout time.Duration) (dockerId string, out string, err error) { + // log.Debug(">>> DockerRun: port: ", port) + // log.Debug(">>> DockerRun: image: ", image) + // log.Debug(">>> DockerRun: timeout: ", timeout) + + // Sanity checks + if image == "" { + err = errors.New("Wrong parameters") + return "", "", err + } + cmd := exec.Command("docker", "images", image) + out, err = ExecuteCmd(cmd, cbCmd) + if err != nil { + log.Error(err.Error()) + return "", out, err + } + log.Debug("DockerRun: out: ", out) + if len(strings.Split(out, "\n")) < 2 { + err = errors.New("Image does not exist in repository") + log.Error(err.Error()) + return "", out, err + + } + + dockerId = uuid.New().String()[0:32] // length limited to 32 chars, see MEC-016 Clause 6.2.3 Type: AppContext + if port == "" { + cmd = exec.Command("docker", "run", "--name", dockerId, "--rm", "-d", "-t", image) + } else { + cmd = exec.Command("docker", "run", "--name", dockerId, "--rm", "--expose="+port, "-d", "-t", image) + } + out, err = ExecuteCmd(cmd, cbCmd) + if err != nil { + log.Error(err.Error()) + return "", out, err + } + log.Debug("DockerRun: dockerId: ", dockerId) + log.Debug("DockerRun: out: ", out) + + time.Sleep(timeout) // Wait for container starting + + return dockerId, out, nil +} + +// Create and start a container +func DockerTerminate(dockerId string, timeout time.Duration) (out string, err error) { + //log.Debug(">>> DockerTerminate: ", dockerId) + + // Sanity checks + if dockerId == "" { + err = errors.New("Wromg parameters") + return "", err + } + + cmd := exec.Command("docker", "kill", dockerId) + out, err = ExecuteCmd(cmd, cbCmd) + if err != nil { + log.Error(err.Error()) + return out, err + } + log.Debug("DockerRun: dockerId: ", dockerId) + log.Debug("DockerRun: out: ", out) + + time.Sleep(timeout) // Wait for container starting + + return out, nil +} diff --git a/go-packages/meep-dai-mgr/exec.go b/go-packages/meep-dai-mgr/exec.go new file mode 100644 index 000000000..a89bbc43a --- /dev/null +++ b/go-packages/meep-dai-mgr/exec.go @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package meepdaimgr + +import ( + "bytes" + "fmt" + "net" + "os" + "os/exec" + "strconv" + "strings" + "syscall" + "time" + + "github.com/spf13/cobra" +) + +func cmdExec(cli string) (appExecEntry AppExecEntry, err error) { + parts := strings.Fields(cli) + head := parts[0] + parts = parts[1:] + // fmt.Println("cmdExec: head: ", head) + // fmt.Println("cmdExec: parts: ", parts) + + appExecEntry.cmd = exec.Command(head, parts...) + appExecEntry.stdout = new(bytes.Buffer) + appExecEntry.stderr = new(bytes.Buffer) + appExecEntry.cmd.Stdout = appExecEntry.stdout + appExecEntry.cmd.Stderr = appExecEntry.stderr + err = appExecEntry.cmd.Start() + if err != nil { + fmt.Println("error in exec command: ", err, " for command: ", cli) + fmt.Println("detailed output: ", appExecEntry.stderr.String(), "---", appExecEntry.stdout.String()) + return appExecEntry, err + } + fmt.Println("cmdExec: process started: ", appExecEntry.cmd.Process.Pid) + + go func() { + err = appExecEntry.cmd.Wait() + // Flush process logs + fmt.Println("////////////////////////// stdout for process: ", appExecEntry.cmd.Process.Pid) + fmt.Println("out:", appExecEntry.stdout.String()) + fmt.Println("////////////////////////// sterr for process: ", appExecEntry.cmd.Process.Pid) + fmt.Println("err:", appExecEntry.stderr.String()) + fmt.Println("////////////////////////// Terminated process: ", appExecEntry.cmd.Process.Pid) + if err == nil { + fmt.Println("process terminated normally for pid ", appExecEntry.cmd.Process.Pid) + } else { + fmt.Println("process terminated abnormally for pid :", appExecEntry.cmd.Process.Pid, ", ", err) + } + }() + + //fmt.Println("cmdExec: appExecEntry: ", appExecEntry) + return appExecEntry, nil +} + +func terminatePidProcess(pid int) { + if pid <= 0 { + return + } + + str := "kill " + strconv.Itoa(pid) // SIGTERM + _, _ = cmdExec(str) +} + +func deletePidProcess(pid int) { + if pid <= 0 { + return + } + + str := "kill -9 " + strconv.Itoa(pid) // SIGKILL + _, _ = cmdExec(str) +} + +func pidExists(pid int) (bool, error) { + if pid <= 0 { + return false, fmt.Errorf("invalid pid %v", pid) + } + + proc, err := os.FindProcess(int(pid)) + if err != nil { + return false, err + } + + err = proc.Signal(syscall.Signal(0)) + if err == nil { + return true, nil + } + if err.Error() == "os: process already finished" { + return false, nil + } + + errno, ok := err.(syscall.Errno) + if !ok { + return false, err + } + switch errno { + case syscall.ESRCH: + return false, nil + case syscall.EPERM: + return true, nil + } + return false, err +} + +func getOutboundIP() net.IP { + conn, err := net.Dial("udp", "8.8.8.8:80") + if err != nil { + fmt.Println(err.Error()) + } + defer conn.Close() + + localAddr := conn.LocalAddr().(*net.UDPAddr) + + return localAddr.IP +} + +// ExecuteCmd wraps exec.Command.CombinedOutput with verbosity +func ExecuteCmd(cmd *exec.Cmd, cobraCmd *cobra.Command) (output string, err error) { + err = nil + verbose, _ := cobraCmd.Flags().GetBool("verbose") + + if verbose { + fmt.Println("Cmd:", cmd.Args) + } + start := time.Now() + out, err := cmd.CombinedOutput() + elapsed := time.Since(start) + output = string(out) + if verbose { + var r string + if len(output) > 0 { + r = "Result: " + output + } else { + r = "Result: OK" + } + r = FormatResult(r, elapsed, cobraCmd) + fmt.Println(r) + } + return output, err +} + +// GetProcess get a running process ID by name +func GetProcess(name string, cobraCmd *cobra.Command) (string, error) { + cmd := exec.Command("pidof", name) + pid, err := ExecuteCmd(cmd, cobraCmd) + if err != nil { + return pid, err + } + pid = strings.TrimSuffix(pid, "\n") + return pid, nil +} + +// WaitProcess get a running process ID by name +func WaitProcess(pid string, timeout string, cobraCmd *cobra.Command) error { + cmd := exec.Command("timeout", timeout, "tail", "--pid="+pid, "-f", "/dev/null") + _, err := ExecuteCmd(cmd, cobraCmd) + return err +} + +// KillProcess kill a process by PID +func KillProcess(pid string, cobraCmd *cobra.Command) { + cmd := exec.Command("kill", "-9", pid) + _, err := ExecuteCmd(cmd, cobraCmd) + if err != nil { + fmt.Println("Error terminating " + pid) + fmt.Println(err) + } +} + +// InterruptProcess SIGINT a process by PID +func InterruptProcess(pid string, cobraCmd *cobra.Command) { + cmd := exec.Command("kill", "-2", pid) + _, err := ExecuteCmd(cmd, cobraCmd) + if err != nil { + fmt.Println("Error interrupting " + pid) + fmt.Println(err) + } +} diff --git a/go-packages/meep-dai-mgr/format.go b/go-packages/meep-dai-mgr/format.go new file mode 100644 index 000000000..892524e27 --- /dev/null +++ b/go-packages/meep-dai-mgr/format.go @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package meepdaimgr + +import ( + "time" + + "github.com/spf13/cobra" +) + +// FormatResult consistent formatting for results to be displayed +func FormatResult(result string, elapsed time.Duration, cobraCmd *cobra.Command) string { + ret := result + + t, _ := cobraCmd.Flags().GetBool("time") + if t { + ret += (" [" + elapsed.Round(time.Millisecond).String() + "]") + } + + return ret +} diff --git a/go-packages/meep-dai-mgr/go.mod b/go-packages/meep-dai-mgr/go.mod new file mode 100644 index 000000000..9fbbea572 --- /dev/null +++ b/go-packages/meep-dai-mgr/go.mod @@ -0,0 +1,14 @@ +module meep-dai-mgr/meepdaimgr + +go 1.12 + +require ( + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0-20211214133749-f203f7ab4f1c + github.com/google/uuid v1.3.0 + github.com/lib/pq v1.10.6 + github.com/spf13/cobra v1.5.0 +) + +replace ( + github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger => ../../go-packages/meep-logger +) diff --git a/go-packages/meep-dai-mgr/go.sum b/go-packages/meep-dai-mgr/go.sum new file mode 100644 index 000000000..366f6ccce --- /dev/null +++ b/go-packages/meep-dai-mgr/go.sum @@ -0,0 +1,25 @@ +github.com/InterDigitalInc/AdvantEDGE v1.8.1 h1:2jZJ/Hu6IDweJifEpbOD8PP9pX03AQlZGNnrhv1Die8= +github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0-20211214133749-f203f7ab4f1c h1:pNyzqkE702/quz8AGVznklRAwW764WZSwK0izIWlTOY= +github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0-20211214133749-f203f7ab4f1c/go.mod h1:Xy2Z6nc9m0DRQRj9g0+/4E6OkDlCkFYySa65JoQ2d8g= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= +github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/go-packages/meep-dai-mgr/meep-dai-mgr.go b/go-packages/meep-dai-mgr/meep-dai-mgr.go new file mode 100644 index 000000000..b118605e6 --- /dev/null +++ b/go-packages/meep-dai-mgr/meep-dai-mgr.go @@ -0,0 +1,1479 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +This package implements MEC-016 application instantiation with the following limitation: +1) The application image is already available in the MEC system (AdvantEDGE platform) +2) Onboarding application is not supported (MEC-010-2) +3) Application list is hard-coded (to be enhance in the furture) +*/ +package meepdaimgr + +import ( + "bytes" + "database/sql" + "errors" + "io/ioutil" + "os" + "os/exec" + "strconv" + "strings" + "time" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + + _ "github.com/lib/pq" +) + +// DB Config +const ( + DbHost = "meep-postgis.default.svc.cluster.local" + DbPort = "5432" + DbUser = "" + DbPassword = "" + DbDefault = "postgres" + + DbMaxRetryCount int = 2 +) + +// Enable profiling +const profiling = false + +var profilingTimers map[string]time.Time + +// Tables fields name +const ( + FieldContextId = "contextId" + FieldAssociateDevAppId = "associateDevAppId" + FieldCallbackReference = "callbackReference" + FieldAppLocationUpdates = "appLocationUpdates" + FieldAppAutoInstantiation = "appAutoInstantiation" + FieldAppInfo = "appInfo" + FieldAppDId = "appDId" + FieldAppName = "appName" + FieldAppProvider = "appProvider" + FieldAppSoftVersion = "appSoftVersion" + FieldAppDVersion = "appDVersion" + FieldAppDescription = "appDescription" + FieldCmd = "cmd" + FieldArgs = "args" + FieldUserAppInstanceInfo = "userAppInstanceInfo" + FieldAppPackageSource = "appPackageSource" + FieldAppInstanceId = "appInstanceId" + FieldReferenceURI = "referenceURI" + FieldAppLocation = "appLocation" + FieldArea = "area" + FieldCivicAddressElement = "civicAddressElement" + FieldCountryCode = "countryCode" + FieldCoordinates = "coordinates" +) + +type Uri string + +// ETSI GS MEC 016 Clause Table 6.2.2-1: Definition of type ApplicationList +type ApplicationList struct { + AppList []AppList `json:"appList"` +} + +// ETSI GS MEC 016 Clause Table 6.2.2-1: Definition of type ApplicationList +type AppList struct { + AppInfoList []AppInfoList `json:"appInfoList"` + vendorSpecificExt *VendorSpecificExt `json:"vendorSpecificExt,omitempty"` +} + +type VendorSpecificExt struct { + vendorId string `json:"vendorId"` +} + +// ETSI GS MEC 016 Clause Table 6.2.2-1: Definition of type ApplicationList +type AppInfoList struct { + AppDId string `json:"appDId,omitempty"` + AppName string `json:"appName"` + AppProvider string `json:"appProvider"` + AppSoftVersion string `json:"appSoftVersion,omitempty"` + AppDVersion string `json:"appDVersion"` + AppDescription string `json:"appDescription,omitempty"` + AppLocation LocationConstraints `json:"appLocation,omitempty"` + AppCharcs []AppCharcs `json:"appCharcs,omitempty"` + Cmd string `json:"cmd"` // Non standard entry + Args []string `json:"args,omitempty"` // Non standard entry +} + +// ETSI GS MEC 016 Clause Table 6.2.2-1: Definition of type ApplicationList +type AppCharcs struct { + Memory *uint32 `json:"memory,omitempty"` + Storage *uint32 `json:"storage,omitempty"` + Latency *uint32 `json:"latency,omitempty"` + Bandwidth *uint32 `json:"bandwidth,omitempty"` + ServiceCont *uint32 `json:"serviceCont,omitempty"` +} + +// ETSI GS MEC 016 Clause 6.2.3 Type: AppContext +type AppContext struct { + ContextId *string //Uniquely identifies the application context in the MEC system + AssociateDevAppId string // Uniquely identifies the device application + CallbackReference Uri + AppLocationUpdates bool + AppAutoInstantiation bool + AppInfo AppInfo +} + +// ETSI GS MEC 016 Clause 6.2.3 Type: AppContext +type AppInfo struct { + AppDId *string + AppName string + AppProvider string + AppSoftVersion *string + AppDVersion string + AppDescription string + UserAppInstanceInfo UserAppInstanceInfo + AppPackageSource *Uri +} + +// ETSI GS MEC 016 Clause 6.2.3 Type: AppContext +type UserAppInstanceInfo []UserAppInstanceInfoItem +type UserAppInstanceInfoItem struct { + AppInstanceId *string + ReferenceURI *Uri + AppLocation LocationConstraints +} + +// ETSI GS MEC 016 Clause 6.5.2 Type: LocationConstraints +type LocationConstraints []LocationConstraintsItem +type LocationConstraintsItem struct { + Area *Polygon `json:"area,omitempty"` + CivicAddressElement *CivicAddressElement `json:"civicAddressElement,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` +} +type Polygon struct { + Coordinates [][][]float32 `json:"coordinates"` +} +type CivicAddressElement []CivicAddressElementItem +type CivicAddressElementItem struct { + CaType int32 `json:"caType,omitempty"` + CaValue string `json:"caValue,omitempty"` +} + +// ETSI GS MEC 016 Clause 6.2.4 Type: ApplicationLocationAvailability +type ApplicationLocationAvailability struct { + AppInfo *ApplicationLocationAvailabilityAppInfo + AssociateDevAppId string +} + +// ETSI GS MEC 016 Clause 6.2.3 Type: AppContext +type ApplicationLocationAvailabilityAppInfo struct { + AppName string + AppProvider string + AppSoftVersion *string + AppDVersion string + AppDescription string + AvailableLocations AvailableLocations + AppPackageSource *Uri +} + +// ETSI GS MEC 016 Clause 6.2.4 Type: ApplicationLocationAvailability +type AvailableLocations []AvailableLocationsItem + +// ETSI GS MEC 016 Clause 6.2.4 Type: ApplicationLocationAvailability +type AvailableLocationsItem struct { + AppLocation *LocationConstraints +} + +type AppExecEntry struct { + cmd *exec.Cmd + stdout *bytes.Buffer + stderr *bytes.Buffer +} + +var appExecEntries map[int]AppExecEntry = make(map[int]AppExecEntry) + +// DAI confioguration +type DaiCfg struct { + Name string + Namespace string + User string + Pwd string + Host string + Port string + NotifyAppContextDeletion func(string, string) +} + +// DAI Manager +type DaiMgr struct { + name string + namespace string + user string + pwd string + host string + port string + dbName string + db *sql.DB + connected bool + tickerStarted bool + updateCb func(string) +} + +// DB Table Names +const ( + AppContextTable = "app_context" + AppInfoTable = "app_info" + UserAppInstanceInfoTable = "user_app_instance_info" + LocationConstraintsTable = "location_constraints" + AvailableLocationsTable = "available_locations" + ApplicationLocationAvailabilityTable = "application_location_availability" + AppInfoListTable = "app_info_list" + AppInfoListLocationConstraintsTable = "app_info_list_location_constraints" + AppCharcsTable = "app_charcs" +) + +var daiMgr *DaiMgr +var appContexts map[string]AppContext = make(map[string]AppContext) +var notifyAppContextDeletion func(string, string) +var processCheckExpiry time.Duration = 5 * time.Second +var processCheckTicker *time.Ticker + +// Profiling init +func init() { + if profiling { + profilingTimers = make(map[string]time.Time) + } +} + +// NewDaiMgr - Creates and initializes a new DAI Manager +func NewDaiMgr(cfg DaiCfg) (am *DaiMgr, err error) { + if cfg.Name == "" { + err = errors.New("Missing connector name") + return nil, err + } + + // Create new Asset Manager + am = new(DaiMgr) + am.name = cfg.Name + if cfg.Namespace != "" { + am.namespace = cfg.Namespace + } else { + am.namespace = "default" + } + am.user = cfg.User + am.pwd = cfg.Pwd + am.host = cfg.Host + am.port = cfg.Port + + // Connect to Postgis DB + for retry := 0; retry <= DbMaxRetryCount; retry++ { + am.db, err = am.connectDB("", am.user, am.pwd, am.host, am.port) + if err == nil { + break + } + } + if err != nil { + log.Error("Failed to connect to postgis DB with err: ", err.Error()) + return nil, err + } + log.Info("Postgis Connector successfully created") + am.connected = true + defer am.db.Close() + + // Create sandbox DB if it does not exist + // Use format: '_' & replace dashes with underscores + am.dbName = strings.ToLower(strings.Replace(cfg.Namespace+"_"+cfg.Name, "-", "_", -1)) + + // Ignore DB creation error in case it already exists. + // Failure will occur at DB connection if DB was not successfully created. + _ = am.CreateDb(am.dbName) + + // Close connection to postgis DB + _ = am.db.Close() + + // Connect with sandbox-specific DB + am.db, err = am.connectDB(am.dbName, cfg.User, cfg.Pwd, cfg.Host, cfg.Port) + if err != nil { + log.Error("Failed to connect to sandbox DB with err: ", err.Error()) + return nil, err + } + log.Info("Postgis Connector successfully created") + am.connected = true + + // Start process checking timer + am.tickerStarted = cfg.NotifyAppContextDeletion != nil + if cfg.NotifyAppContextDeletion != nil { + notifyAppContextDeletion = cfg.NotifyAppContextDeletion + startProcessCheckTicker() + log.Info("ProcessCheckTicker successfully started") + } + + daiMgr = am + + return am, nil +} + +func (am *DaiMgr) connectDB(dbName, user, pwd, host, port string) (db *sql.DB, err error) { + // Set default values if none provided + if dbName == "" { + dbName = DbDefault + } + if host == "" { + host = DbHost + } + if port == "" { + port = DbPort + } + log.Debug("Connecting to Postgis DB [", dbName, "] at addr [", host, ":", port, "]") + + // Open postgis DB + connStr := "user=" + user + " password=" + pwd + " dbname=" + dbName + " host=" + host + " port=" + port + " sslmode=disable" + db, err = sql.Open("postgres", connStr) + if err != nil { + log.Warn("Failed to connect to Postgis DB with error: ", err.Error()) + return nil, err + } + + // Make sure connection is up + err = db.Ping() + if err != nil { + log.Warn("Failed to ping Postgis DB with error: ", err.Error()) + db.Close() + return nil, err + } + + log.Info("Connected to Postgis DB [", dbName, "]") + return db, nil +} + +func (am *DaiMgr) SetListener(listener func(string)) error { + am.updateCb = listener + return nil +} + +func (am *DaiMgr) notifyListener(assetName string) { + if am.updateCb != nil { + go am.updateCb(assetName) + } +} + +// DeleteDaiMgr - +func (am *DaiMgr) DeleteDaiMgr() (err error) { + + if am.tickerStarted { + stopProcessCheckTicker() + } + + if am.db == nil { + err = errors.New("Asset Manager database not initialized") + log.Error(err.Error()) + return err + } + + // Close connection to sandbox-specific DB + _ = am.db.Close() + + // Connect to Postgis DB + am.db, err = am.connectDB("", am.user, am.pwd, am.host, am.port) + if err != nil { + log.Error("Failed to connect to postgis DB with err: ", err.Error()) + return err + } + defer am.db.Close() + + // Destroy sandbox database + _ = am.DestroyDb(am.dbName) + + return nil +} + +// CreateDb -- Create new DB with provided name +func (am *DaiMgr) CreateDb(name string) (err error) { + _, err = am.db.Exec("CREATE DATABASE " + name) + if err != nil { + log.Error(err.Error()) + return err + } + + log.Info("Created database: " + name) + return nil +} + +// DestroyDb -- Destroy DB with provided name +func (am *DaiMgr) DestroyDb(name string) (err error) { + _, err = am.db.Exec("DROP DATABASE " + name) + if err != nil { + log.Error(err.Error()) + return err + } + + log.Info("Destroyed database: " + name) + return nil +} + +func (am *DaiMgr) CreateTables() (err error) { + _, err = am.db.Exec("CREATE EXTENSION IF NOT EXISTS postgis") + if err != nil { + log.Error(err.Error()) + return err + } + + // AppContext + // TODO meep-dai-mgr could be partially enhanced with MEC-10-2 Clauses 6.2.1.2 Type: AppD and Lifecycle Mgmt + _, err = am.db.Exec(`CREATE TABLE ` + AppContextTable + ` ( + contextId varchar(32) NOT NULL UNIQUE, + associateDevAppId varchar(32) NOT NULL UNIQUE, + callbackReference varchar(256) NOT NULL DEFAULT '', + appLocationUpdates boolean NOT NULL DEFAULT 'false', + appAutoInstantiation boolean NOT NULL DEFAULT 'false', + appDId varchar(32) NOT NULL UNIQUE, + PRIMARY KEY (contextId) + )`) + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", AppContextTable) + + // AppInfo Table + // TODO meep-dai-mgr could be partially enhanced with MEC-10-2 Clauses 6.2.1.2 Type: AppD and Lifecycle Mgmt + _, err = am.db.Exec(`CREATE TABLE ` + AppInfoTable + ` ( + appDId varchar(32) NOT NULL UNIQUE, + appName varchar(32) NOT NULL DEFAULT '', + appProvider varchar(32) NOT NULL DEFAULT '', + appSoftVersion varchar(32) NOT NULL DEFAULT '', + appDVersion varchar(32) NOT NULL DEFAULT '', + appDescription varchar(256) NOT NULL DEFAULT '', + appPackageSource varchar(256) NOT NULL DEFAULT '', + PRIMARY KEY (appDId), + FOREIGN KEY (appDId) REFERENCES ` + AppContextTable + `(appDId) ON DELETE CASCADE + )`) + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", AppInfoTable) + + // UserAppInstanceInfo Table + // Warning: appInstanceId shall be present + _, err = am.db.Exec(`CREATE TABLE ` + UserAppInstanceInfoTable + ` ( + appDId varchar(32) NOT NULL, + appInstanceId varchar(32) NOT NULL UNIQUE, + referenceURI varchar(256) NOT NULL DEFAULT '', + PRIMARY KEY (appInstanceId), + FOREIGN KEY (appDId) REFERENCES ` + AppInfoTable + `(appDId) ON DELETE CASCADE + )`) + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", UserAppInstanceInfoTable) + + // LocationConstraintsTable Table + // Warning: appInstanceId shall be present + _, err = am.db.Exec(`CREATE TABLE ` + LocationConstraintsTable + ` ( + appInstanceId varchar(32) UNIQUE, + appDId varchar(32) NOT NULL DEFAULT '', + area varchar(1024) NOT NULL DEFAULT '', + civicAddressElement varchar(256) NOT NULL DEFAULT '', + countryCode varchar(256) NOT NULL DEFAULT '', + PRIMARY KEY (appInstanceId), + FOREIGN KEY (appDId) REFERENCES ` + AppInfoTable + `(appDId) ON DELETE CASCADE + )`) + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", ApplicationLocationAvailabilityTable) + + // AppInfoList Table + _, err = am.db.Exec(`CREATE TABLE ` + AppInfoListTable + ` ( + appDId varchar(32) UNIQUE, + appName varchar(32) NOT NULL DEFAULT '', + appProvider varchar(32) NOT NULL DEFAULT '', + appSoftVersion varchar(32) NOT NULL DEFAULT '', + appDVersion varchar(32) NOT NULL DEFAULT '', + appDescription varchar(256) NOT NULL DEFAULT '', + cmd varchar(256) DEFAULT '', + args varchar(256) DEFAULT '', + PRIMARY KEY (appDId) + )`) // FIXME Fields image and cmd are used to support basic of onboarded applications + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", AppInfoListTable) + + // AppInfoListLocationConstraintsTable Table + _, err = am.db.Exec(`CREATE TABLE ` + AppInfoListLocationConstraintsTable + ` ( + appDId varchar(32) NOT NULL DEFAULT '', + area varchar(1024) NOT NULL DEFAULT '', + civicAddressElement varchar(256) NOT NULL DEFAULT '', + countryCode varchar(256) NOT NULL DEFAULT '', + FOREIGN KEY (appDId) REFERENCES ` + AppInfoListTable + `(appDId) ON DELETE CASCADE + )`) + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", ApplicationLocationAvailabilityTable) + + // AppCharcsTable Table + _, err = am.db.Exec(`CREATE TABLE ` + AppCharcsTable + ` ( + appDId varchar(32) DEFAULT '', + memory integer DEFAULT '0', + storage integer DEFAULT '0', + latency integer DEFAULT '0', + bandwidth integer DEFAULT '0', + serviceCont integer DEFAULT '0', + PRIMARY KEY (appDId), + FOREIGN KEY (appDId) REFERENCES ` + AppInfoListTable + `(appDId) ON DELETE CASCADE + )`) + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Created DAI table: ", AppCharcsTable) + + return nil +} + +// DeleteTables - Delete all postgis tables +func (am *DaiMgr) DeleteTables() (err error) { + _ = am.DeleteTable(AppContextTable) + _ = am.DeleteTable(AppInfoTable) + _ = am.DeleteTable(UserAppInstanceInfoTable) + _ = am.DeleteTable(LocationConstraintsTable) + _ = am.DeleteTable(AvailableLocationsTable) + _ = am.DeleteTable(ApplicationLocationAvailabilityTable) + _ = am.DeleteTable(AppInfoListTable) + _ = am.DeleteTable(AppInfoListLocationConstraintsTable) + _ = am.DeleteTable(AppCharcsTable) + return nil +} + +// DeleteTable - Delete postgis table with provided name +func (am *DaiMgr) DeleteTable(tableName string) (err error) { + result, err := am.db.Exec("DROP TABLE IF EXISTS " + tableName + " CASCADE") + if err != nil { + log.Error(err.Error()) + return err + } + rowCnt, err := result.RowsAffected() + if err != nil { + log.Error(err.Error()) + return err + } + log.Info("Deleted table: " + tableName + " - #rows: " + strconv.Itoa(int(rowCnt))) + return nil +} + +// DeleteAppInfoList - Delete DeleteAppContextTable entry +func (am *DaiMgr) DeleteAppInfoList(appDId string) (err error) { + if profiling { + profilingTimers["DeleteAppInfoList"] = time.Now() + } + + // Validate input + if appDId == "" { + err = errors.New("Missing appDId") + return err + } + + result, err := am.db.Exec(`DELETE FROM `+AppInfoListTable+` WHERE name = ($1)`, appDId) + if err != nil { + log.Error(err.Error()) + return err + } + rowCnt, err := result.RowsAffected() + if err != nil { + log.Error(err.Error()) + return err + } + if rowCnt == 0 { + return errors.New("ContextId not found") + } + + if profiling { + now := time.Now() + log.Debug("DeleteAppInfoList: ", now.Sub(profilingTimers["DeleteAppInfoList"])) + } + return nil +} + +// DeleteAppContext - Delete all DeleteAppContextTable entries +func (am *DaiMgr) DeleteAllAppInfoList() (err error) { + if profiling { + profilingTimers["DeleteAllAppInfoList"] = time.Now() + } + + _, err = am.db.Exec(`DELETE FROM ` + AppInfoListTable) + if err != nil { + log.Error(err.Error()) + return err + } + + if profiling { + now := time.Now() + log.Debug("DeleteAllAppInfoList: ", now.Sub(profilingTimers["DeleteAllAppInfoList"])) + } + return nil +} + +// DeleteAppContext - Delete DeleteAppContextTable entry +func (am *DaiMgr) DeleteAppContext(appContextId string) (err error) { + if profiling { + profilingTimers["DeleteAppContext"] = time.Now() + } + + // Validate input + if appContextId == "" { + err = errors.New("Missing appContextId") + return err + } + + // Whe deleting the context, un-instantiate the application + // TODO meep-dai-mgr could be partially enhanced with MEC-10-2 Clauses 6.2.1.2 Type: AppD and Lifecycle Mgmt + // Un-instantiate the MEC application process + pid, err := strconv.ParseInt(appContextId, 10, 64) // FIXME To be enhanced to get outputs + if err != nil { + log.Error(err.Error()) + return err + } + // TODO Check if the process is running + + terminatePidProcess(int(pid)) + log.Debug("Just terminated subprocess ", strconv.Itoa(int(pid))) + // Delete entries + delete(appExecEntries, int(pid)) + delete(appContexts, strconv.Itoa(int(pid))) + + result, err := am.db.Exec(`DELETE FROM `+AppContextTable+` WHERE contextId = ($1)`, appContextId) + if err != nil { + log.Error(err.Error()) + return err + } + rowCnt, err := result.RowsAffected() + if err != nil { + log.Error(err.Error()) + return err + } + if rowCnt == 0 { + return errors.New("ContextId not found") + } + + // Notify listener + am.notifyListener(appContextId) + + if profiling { + now := time.Now() + log.Debug("DeleteAppContext: ", now.Sub(profilingTimers["DeleteAppContext"])) + } + + return nil +} + +// DeleteAppContext - Delete all DeleteAppContextTable enterprises +// Only for testing purpose +func (am *DaiMgr) DeleteAllAppContext() (err error) { + if profiling { + profilingTimers["DeleteAllAppContext"] = time.Now() + } + + _, err = am.db.Exec(`DELETE FROM ` + AppContextTable) + if err != nil { + log.Error(err.Error()) + return err + } + + if profiling { + now := time.Now() + log.Debug("DeleteAllAppContext: ", now.Sub(profilingTimers["DeleteAllAppContext"])) + } + return nil +} + +// LoadOnboardedMecApplications -- This function simulates an existing onboarded MEC Application on platform. It shall be removed later +// // TODO meep-dai-mgr could be partially enhanced with MEC-10-2 Clauses 6.2.1.2 Type: AppD and Lifecycle Mgmt +func (am *DaiMgr) LoadOnboardedMecApplications(folder string) (err error) { + log.Info("LoadOnboardedMecApplications: ", folder) + + var onboardedAppList ApplicationList + // Read the list of yaml file + files, err := ioutil.ReadDir(folder) + if err != nil { + log.Error(err.Error()) + } else { + for _, file := range files { + if !file.IsDir() && strings.HasPrefix(file.Name(), "onboarded-demo") { // Hard-coded in HELM charts + log.Info("LoadOnboardedMecApplications: Processing file ", file.Name()) + + jsonFile, err := os.Open(folder + file.Name()) + if err != nil { + log.Error(err.Error()) + continue + } + defer jsonFile.Close() + byteValue, err := ioutil.ReadAll(jsonFile) + if err != nil { + log.Error(err.Error()) + continue + } + //log.Info("LoadOnboardedMecApplications: Converting ", string(byteValue)) + applicationList := convertJsonToApplicationList(string(byteValue)) + if applicationList == nil { + err = errors.New("Failed to convert file " + file.Name()) + log.Error(err.Error()) + continue + } + if len(applicationList.AppList) == 0 || len(applicationList.AppList[0].AppInfoList) == 0 { + err = errors.New("AppInfoList description is missing for " + file.Name()) + log.Error(err.Error()) + continue + } + err = am.CreateAppEntry(applicationList.AppList[0].AppInfoList[0]) + if err != nil { + log.Error(err.Error()) + continue + } + + onboardedAppList.AppList = append(onboardedAppList.AppList, applicationList.AppList[0]) + } + } // End of 'for' statement + } + + if len(onboardedAppList.AppList) == 0 { + log.Error("No onboarded MEC application found") + } + + log.Info("Created onboarded user application") + return nil +} + +func (am *DaiMgr) CreateAppEntry(appInfoList AppInfoList) (err error) { + if profiling { + profilingTimers["CreateAppEntry"] = time.Now() + } + + // Sanity checks + if appInfoList.AppDId == "" { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Missing AppDId") + } + if appInfoList.AppName == "" { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Missing AppName") + } + if appInfoList.AppProvider == "" { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Missing AppProvider") + } + if appInfoList.AppSoftVersion == "" { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Missing AppSoftVersion") + } + if appInfoList.AppDVersion == "" { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Missing AppDVersion") + } + if appInfoList.AppDescription == "" { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Missing AppDescription") + } + if len(appInfoList.AppCharcs) > 1 { // ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList + return errors.New("Too many entries in AppCharcs") + } + + // Create AppInfoList entries + query := `INSERT INTO ` + AppInfoListTable + ` (appDId, appName, appProvider, appSoftVersion, appDVersion, appDescription, cmd, args) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)` + _, err = am.db.Exec( + query, + appInfoList.AppDId, + appInfoList.AppName, + appInfoList.AppProvider, + appInfoList.AppSoftVersion, + appInfoList.AppDVersion, + appInfoList.AppDescription, + appInfoList.Cmd, + strings.Join(appInfoList.Args, " "), + ) + if err != nil { + log.Error(err.Error(), " for ", appInfoList.AppDId) + return err + } + // Create AppInfoList.AppLocation entries if any + if len(appInfoList.AppLocation) != 0 { + for _, appLocation := range appInfoList.AppLocation { + // Create AppInfoListLocationConstraintsTable entries + query = `INSERT INTO ` + AppInfoListLocationConstraintsTable + ` (appDId, area, civicAddressElement, countryCode) VALUES ($1, $2, $3, $4)` + _, err = am.db.Exec(query, appInfoList.AppDId, convertPolygonToJson(appLocation.Area), convertCivicAddressElementToJson(appLocation.CivicAddressElement), NilToEmptyString(appLocation.CountryCode)) + if err != nil { + am.DeleteAppInfoList(appInfoList.AppDId) + log.Error(err.Error()) + return err + } + } // End of 'for' statement + } + // Create AppInfoList.AppCharcs entries if any + if len(appInfoList.AppCharcs) != 0 { + for _, appCharcs := range appInfoList.AppCharcs { + // Create AppCharcsTable entries + query := `INSERT INTO ` + AppCharcsTable + ` (appDId, memory, storage, latency, bandwidth, serviceCont) VALUES ($1, $2, $3, $4, $5, $6)` + _, err = am.db.Exec( + query, + appInfoList.AppDId, + appCharcs.Memory, + appCharcs.Storage, + appCharcs.Latency, + appCharcs.Bandwidth, + appCharcs.ServiceCont, + ) + if err != nil { + am.DeleteAppInfoList(appInfoList.AppDId) + log.Error(err.Error()) + return err + } + } // End of 'for' statement + } + + if profiling { + now := time.Now() + log.Debug("CreateAppEntry: ", now.Sub(profilingTimers["CreateAppEntry"])) + } + + return nil +} + +func (am *DaiMgr) GetAppInfoListEntry(appDId string) (appInfoList *AppInfoList, err error) { + if profiling { + profilingTimers["GetAppInfoListEntry"] = time.Now() + } + + // Create AppContext map + appInfoList = new(AppInfoList) + + var rows *sql.Rows + rows, err = am.db.Query( + `SELECT * FROM `+AppInfoListTable+` AS appInfoList `+ + `LEFT JOIN `+AppCharcsTable+` AS appCharcs `+ + `ON (appInfoList.appDId = appCharcs.appDId) `+ + `WHERE appInfoList.appDId = ($1)`, appDId) + if err != nil { + log.Error(err.Error()) + return appInfoList, err + } + defer rows.Close() + + // Scan results + appInfoList = new(AppInfoList) + for rows.Next() { + + appInfoList, err := am.processAppInfoListRecord(rows, appInfoList) + if err != nil { + log.Error(err.Error()) + return appInfoList, err + } + } // End of 'for' statement + if appInfoList == nil || appInfoList.AppName == "" { + err = errors.New("AppInfoList not found for appDId " + appDId) + return nil, err + } + + if profiling { + now := time.Now() + log.Debug("GetAppInfoListEntry: ", now.Sub(profilingTimers["GetAppInfoListEntry"])) + } + + return appInfoList, nil +} + +func (am *DaiMgr) GetAllAppInfoListEntry() (appInfoList map[string]*AppInfoList, err error) { + if profiling { + profilingTimers["GetAllAppInfoListEntry"] = time.Now() + } + + // Create AppContext map + appInfoList = make(map[string]*AppInfoList) + + var rows *sql.Rows + rows, err = am.db.Query( + `SELECT * FROM ` + AppInfoListTable + ` AS appInfoList ` + + `LEFT JOIN ` + AppCharcsTable + ` AS appCharcs ` + + `ON (appInfoList.appDId = appCharcs.appDId)`) + if err != nil { + log.Error(err.Error()) + return appInfoList, err + } + defer rows.Close() + + // Scan results + for rows.Next() { + + appInfoListEntry := new(AppInfoList) + appInfoListEntry, err := am.processAppInfoListRecord(rows, appInfoListEntry) + if err != nil { + log.Error(err.Error()) + return appInfoList, err + } + // Get AppContext entry from UE map (create new entry if not found) + ac := appInfoList[appInfoListEntry.AppDId] + if ac == nil { + ac = appInfoListEntry + appInfoList[appInfoListEntry.AppDId] = ac + } + + } // End of 'for' statement + if appInfoList == nil { + err = errors.New("AppInfoList not found") + return nil, err + } + + if profiling { + now := time.Now() + log.Debug("GetAllAppInfoListEntry: ", now.Sub(profilingTimers["GetAllAppInfoListEntry"])) + } + + return appInfoList, nil +} + +func (am *DaiMgr) CreateAppContext(appContext *AppContext, remoteUrl string, sanboxName string) (app *AppContext, err error) { + if profiling { + profilingTimers["CreateAppContext"] = time.Now() + } + + // Sanity checks + if appContext == nil { + return nil, errors.New("CreateAppContext: Invalid input parameters") + } + app = appContext + if app.ContextId != nil { // ETSI GS MEC 016 Clause 6.2.3 Type: AppContext. + return nil, errors.New("ContextId shall not be set") + } + if app.AssociateDevAppId == "" { // ETSI GS MEC 016 Clause 6.2.3 Type: AppContext. + return nil, errors.New("Missing AssociateDevAppId") + } + if len(app.AppInfo.UserAppInstanceInfo) == 0 { // ETSI GS MEC 016 Clause 6.2.3 Type: AppContext. + return nil, errors.New("Missing at least one UserAppInstanceInfo item") + } + for _, item := range app.AppInfo.UserAppInstanceInfo { + if item.AppInstanceId != nil { + return nil, errors.New("UserAppInstanceInfo.AppInstanceId shall not be set") + } + if item.ReferenceURI != nil { + return nil, errors.New("UserAppInstanceInfo.ReferenceURI shall not be set") + } + if len(item.AppLocation) > 1 { + return nil, errors.New("Only one AppLocation item expected") + } + } // End of 'for' statement + + // Whe creating the context, instantiate the application + // Retrieve the MEC application description + appInfo, err := am.GetAppInfoListEntry(*app.AppInfo.AppDId) + if err != nil { + log.Error(err.Error()) + return nil, err + } + log.Debug("CreateAppContext: appInfo ", appInfo) + log.Debug("CreateAppContext: appInfo.Cmd ", appInfo.Cmd) + + appExecEntry, err := cmdExec(appInfo.Cmd) + if err != nil { + log.Error(err.Error()) + return nil, err + } + log.Debug("Just ran subprocess ", strconv.Itoa(appExecEntry.cmd.Process.Pid)) + targetIp := getOutboundIP() + log.Debug("CreateAppContext: targetIp: ", targetIp) + + // Create the AppContext + app.ContextId = new(string) + *app.ContextId = strconv.Itoa(appExecEntry.cmd.Process.Pid) + // Update + for i := range app.AppInfo.UserAppInstanceInfo { + app.AppInfo.UserAppInstanceInfo[i].AppInstanceId = new(string) + *app.AppInfo.UserAppInstanceInfo[i].AppInstanceId = *app.ContextId + app.AppInfo.UserAppInstanceInfo[i].ReferenceURI = new(Uri) + log.Debug("CreateAppContext: app.AppInfo.AppName: ", app.AppInfo.AppName) + *app.AppInfo.UserAppInstanceInfo[i].ReferenceURI = Uri(remoteUrl + "/" + sanboxName + "/" + app.AppInfo.AppName) + *app.AppInfo.UserAppInstanceInfo[i].ReferenceURI = Uri(string(*app.AppInfo.UserAppInstanceInfo[i].ReferenceURI)) //Uri(strings.Replace(string(*app.AppInfo.UserAppInstanceInfo[i].ReferenceURI), "http:", "https:", 1)) + } // End of 'for' statement + log.Debug("CreateAppContext: *app.ContextId: ", *app.ContextId) + log.Debug("CreateAppContext: app.AppInfo: ", app.AppInfo) + log.Debug("CreateAppContext: app.AppInfo.UserAppInstanceInfo: ", app.AppInfo.UserAppInstanceInfo) + + // Create AppContext entries + query := `INSERT INTO ` + AppContextTable + ` (contextId, associateDevAppId, callbackReference, appLocationUpdates, appAutoInstantiation, appDId) VALUES ($1, $2, $3, $4, $5, $6)` + _, err = am.db.Exec(query, *app.ContextId, app.AssociateDevAppId, app.CallbackReference, app.AppLocationUpdates, app.AppAutoInstantiation, app.AppInfo.AppDId) + if err != nil { + terminatePidProcess(int(appExecEntry.cmd.Process.Pid)) + log.Error(err.Error()) + return nil, err + } + // Create AppInfo entries + query = `INSERT INTO ` + AppInfoTable + ` (appDId, appName, appProvider, appSoftVersion, appDVersion, appDescription, appPackageSource) VALUES ($1, $2, $3, $4, $5, $6, $7)` + _, err = am.db.Exec( + query, + NilToEmptyString(app.AppInfo.AppDId), + app.AppInfo.AppName, + app.AppInfo.AppProvider, + NilToEmptyString(app.AppInfo.AppSoftVersion), + app.AppInfo.AppDVersion, + app.AppInfo.AppDescription, + NilToEmptyUri(app.AppInfo.AppPackageSource), + ) + if err != nil { + terminatePidProcess(int(appExecEntry.cmd.Process.Pid)) + am.DeleteAppContext(*app.ContextId) + log.Error(err.Error()) + return nil, err + } + + // Create UserAppInstanceInfo entries + for _, userAppInstanceInfo := range app.AppInfo.UserAppInstanceInfo { + query = `INSERT INTO ` + UserAppInstanceInfoTable + ` (appDId, appInstanceId, referenceURI) VALUES ($1, $2, $3)` + _, err = am.db.Exec(query, *app.AppInfo.AppDId, userAppInstanceInfo.AppInstanceId, userAppInstanceInfo.ReferenceURI) + if err != nil { + terminatePidProcess(int(appExecEntry.cmd.Process.Pid)) + am.DeleteAppContext(*app.ContextId) + log.Error(err.Error()) + return nil, err + } + // Create AppLocation entries + if userAppInstanceInfo.AppLocation != nil { + for _, appLocation := range userAppInstanceInfo.AppLocation { + query = `INSERT INTO ` + LocationConstraintsTable + ` (appInstanceId, appDId, area, civicAddressElement, countryCode) VALUES ($1, $2, $3, $4, $5)` + _, err = am.db.Exec(query, userAppInstanceInfo.AppInstanceId, *app.AppInfo.AppDId, convertPolygonToJson(appLocation.Area), convertCivicAddressElementToJson(appLocation.CivicAddressElement), NilToEmptyString(appLocation.CountryCode)) + if err != nil { + terminatePidProcess(int(appExecEntry.cmd.Process.Pid)) + am.DeleteAppContext(*app.ContextId) + log.Error(err.Error()) + return nil, err + } + } // End of 'for' statement + } + } // End of 'for' statement + + process, err := os.FindProcess(int(appExecEntry.cmd.Process.Pid)) + if err != nil { + log.Error(err.Error()) + } + log.Debug("Process info: ", *process) + appExecEntries[appExecEntry.cmd.Process.Pid] = appExecEntry + log.Debug("appExecEntries ", appExecEntries) + appContexts[*app.ContextId] = *app + log.Debug("appContexts ", appContexts) + + // Notify listener + am.notifyListener(*app.ContextId) + + if profiling { + now := time.Now() + log.Debug("CreateAppContext: ", now.Sub(profilingTimers["CreateAppContext"])) + } + + return app, nil +} + +func (am *DaiMgr) PutAppContext(appContext AppContext) (err error) { + if profiling { + profilingTimers["PutAppContext"] = time.Now() + } + + // Sanity checks + if appContext.ContextId == nil || *appContext.ContextId == "" { // ETSI GS MEC 016 Clause 6.2.3 Type: AppContext. + return errors.New("ContextId shall be set") + } + log.Debug("PutAppContext: appContext: ", appContext) + + // Retrieve the existing AppContext + curAppContext, err := am.GetAppContext(*appContext.ContextId) + if err != nil { + return errors.New("ContextId not found") + } + log.Debug("PutAppContext: curAppContext: ", curAppContext) + + // Update the curAppContext + update := false + if curAppContext.CallbackReference != appContext.CallbackReference { + curAppContext.CallbackReference = appContext.CallbackReference + update = true + } + + if update { + query := `UPDATE ` + AppContextTable + ` SET callbackReference = ($1) WHERE contextId = ($2)` + result, err := am.db.Exec(query, curAppContext.CallbackReference, *curAppContext.ContextId) + if err != nil { + log.Error(err.Error()) + return err + } + rowCnt, err := result.RowsAffected() + if err != nil { + log.Fatal(err) + return err + } + if rowCnt == 0 { + return errors.New("Failed to update record") + } + + // Notify listener + am.notifyListener(*curAppContext.ContextId) + } + + if profiling { + now := time.Now() + log.Debug("PutAppContext: ", now.Sub(profilingTimers["PutAppContext"])) + } + + return nil +} + +func (am *DaiMgr) GetAllAppList() (jsonString string, err error) { + if profiling { + profilingTimers["GetAllAppList"] = time.Now() + } + + jsonString = "" + + var rows *sql.Rows + rows, err = am.db.Query( + `SELECT * FROM ` + AppInfoTable + ` AS appContext ` + + `LEFT JOIN ` + LocationConstraintsTable + ` AS locationConstraints ` + + `ON (appContext.appDId = locationConstraints.appDId) ` + + `LEFT JOIN ` + AppCharcsTable + ` AS appCharts ` + + `ON (appContext.appDId = appCharts.appDId)`) + if err != nil { + log.Error(err.Error()) + return jsonString, err + } + defer rows.Close() + + // Fill ApplicationList and convert into JSon to retur the results + + if profiling { + now := time.Now() + log.Debug("GetAppList: ", now.Sub(profilingTimers["GetAppList"])) + } + + return jsonString, nil +} + +func (am *DaiMgr) GetAppContext(contextId string) (appContext *AppContext, err error) { + if profiling { + profilingTimers["GetAppContext"] = time.Now() + } + + // Create AppContext map + appContext = new(AppContext) + + var rows *sql.Rows + rows, err = am.db.Query( + `SELECT * FROM `+AppContextTable+` AS appContext `+ + `LEFT JOIN `+AppInfoTable+` AS appInfo `+ + `ON (appContext.appDId = appInfo.appDId) `+ + `LEFT JOIN `+UserAppInstanceInfoTable+` AS userAppInstanceInfo `+ + `ON (userAppInstanceInfo.appDId = appInfo.appDId) `+ + `WHERE appContext.contextId = ($1)`, contextId) + if err != nil { + log.Error(err.Error()) + return appContext, err + } + defer rows.Close() + + // Scan results + appInfoEntry := new(AppInfo) + for rows.Next() { + + userAppInstanceInfoItem := new(UserAppInstanceInfoItem) + appContext, appInfoEntry, userAppInstanceInfoItem, err := am.processAppContextRecord(rows, appContext, appInfoEntry, userAppInstanceInfoItem) + if err != nil { + log.Error(err.Error()) + return appContext, err + } + // Update UserAppInstanceInfo + appInfoEntry.UserAppInstanceInfo = append(appInfoEntry.UserAppInstanceInfo, *userAppInstanceInfoItem) + } // End of 'for' statement + if appContext.ContextId == nil { + err = errors.New("AppContext not found") + return nil, err + } + appContext.AppInfo = *appInfoEntry + + if profiling { + now := time.Now() + log.Debug("GetAppContext: ", now.Sub(profilingTimers["GetAppContext"])) + } + + return appContext, nil +} + +func (am *DaiMgr) GetAllAppContext() (appContext map[string]*AppContext, err error) { + if profiling { + profilingTimers["GetAllAppContext"] = time.Now() + } + + // Create AppContext map + appContext = make(map[string]*AppContext) + + var rows *sql.Rows + rows, err = am.db.Query( + `SELECT * FROM ` + AppContextTable + ` AS appContext ` + + `LEFT JOIN ` + AppInfoTable + ` AS appInfo ` + + `ON (appContext.appDId = appInfo.appDId) ` + + `LEFT JOIN ` + UserAppInstanceInfoTable + ` AS userAppInstanceInfo ` + + `ON (userAppInstanceInfo.appDId = appInfo.appDId)`) + if err != nil { + log.Error(err.Error()) + return appContext, err + } + defer rows.Close() + + // Scan results + for rows.Next() { + appContextEntry := new(AppContext) + appInfoEntry := new(AppInfo) + + userAppInstanceInfoItem := new(UserAppInstanceInfoItem) + appContextEntry, appInfoEntry, userAppInstanceInfoItem, err := am.processAppContextRecord(rows, appContextEntry, appInfoEntry, userAppInstanceInfoItem) + if err != nil { + log.Error(err.Error()) + return appContext, err + } + appContextEntry.AppInfo = *appInfoEntry + // Get AppContext entry from UE map (create new entry if not found) + ac := appContext[*appContextEntry.ContextId] + if ac == nil { + ac = appContextEntry + appContext[*appContextEntry.ContextId] = ac + } + appContext[*appContextEntry.ContextId].AppInfo.UserAppInstanceInfo = append(appContext[*appContextEntry.ContextId].AppInfo.UserAppInstanceInfo, *userAppInstanceInfoItem) + } // End of 'for' statement + err = rows.Err() + if err != nil { + log.Error(err) + } + + if profiling { + now := time.Now() + log.Debug("GetAllAppContext: ", now.Sub(profilingTimers["GetAllAppContext"])) + } + + return appContext, nil +} + +///////////////////////////////////////////////////////////////////////// + +func (am *DaiMgr) processAppInfoListRecord(rows *sql.Rows, appInfoListEntry *AppInfoList) (*AppInfoList, error) { + var appCharcsAppDId sql.NullString + appCharcs := new(AppCharcs) + var args string + err := rows.Scan( + &appInfoListEntry.AppDId, + &appInfoListEntry.AppName, + &appInfoListEntry.AppProvider, + &appInfoListEntry.AppSoftVersion, + &appInfoListEntry.AppDVersion, + &appInfoListEntry.AppDescription, + &appInfoListEntry.Cmd, + &args, + &appCharcsAppDId, // AppCharcs reference + &appCharcs.Memory, + &appCharcs.Storage, + &appCharcs.Latency, + &appCharcs.Bandwidth, + &appCharcs.ServiceCont, + ) + if err != nil { + log.Error(err.Error()) + return nil, err + } + + if appInfoListEntry.AppDId == "" { + // record not found + err := errors.New("No record found") + log.Error(err.Error()) + return nil, err + } + appInfoListEntry.Args = strings.Split(args, " ") + if appCharcsAppDId.Valid { + appInfoListEntry.AppCharcs = append(appInfoListEntry.AppCharcs, *appCharcs) + } + // Update AppLocation + var rows_1 *sql.Rows + rows_1, err = am.db.Query( + `SELECT * FROM `+AppInfoListLocationConstraintsTable+` WHERE appDId = ($1)`, + appInfoListEntry.AppDId) + if err != nil { + log.Error(err.Error()) + return appInfoListEntry, err + } + // Scan results + for rows_1.Next() { + var applicationLocationAppDId string + var area string + var civicAddressElement string + var countryCode string + err = rows_1.Scan( + &applicationLocationAppDId, + &area, + &civicAddressElement, + &countryCode, + ) + if err != nil { + log.Error(err.Error()) + return nil, err + } + locationItem := new(LocationConstraintsItem) + locationItem.Area = convertJsonToPolygon(area) + if len(locationItem.Area.Coordinates) == 0 { + locationItem.Area = nil + } + locationItem.CivicAddressElement = convertJsonToCivicAddressElement(civicAddressElement) + if len(*locationItem.CivicAddressElement) == 0 { + locationItem.CivicAddressElement = nil + } + if countryCode == "" { + locationItem.CountryCode = nil + } else { + locationItem.CountryCode = new(string) + *locationItem.CountryCode = countryCode + } + + appInfoListEntry.AppLocation = append(appInfoListEntry.AppLocation, *locationItem) + + } // End of 'for' statement + + return appInfoListEntry, err +} + +///////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////// +func (am *DaiMgr) processAppContextRecord(rows *sql.Rows, appContext *AppContext, appInfoEntry *AppInfo, userAppInstanceInfoItem *UserAppInstanceInfoItem) (*AppContext, *AppInfo, *UserAppInstanceInfoItem, error) { + var userAppInstanceInfoAppDId string + //userAppInstanceInfoItem := new(UserAppInstanceInfoItem) + err := rows.Scan( + &appContext.ContextId, + &appContext.AssociateDevAppId, + &appContext.CallbackReference, + &appContext.AppLocationUpdates, + &appContext.AppAutoInstantiation, + &appInfoEntry.AppDId, // AppContext.AppInfo reference + &appInfoEntry.AppDId, // AppInfo reference + &appInfoEntry.AppName, + &appInfoEntry.AppProvider, + &appInfoEntry.AppSoftVersion, + &appInfoEntry.AppDVersion, + &appInfoEntry.AppDescription, + &appInfoEntry.AppPackageSource, + &userAppInstanceInfoAppDId, // UserAppInstanceInfo reference + &userAppInstanceInfoItem.AppInstanceId, + &userAppInstanceInfoItem.ReferenceURI, + ) + if err != nil { + log.Error(err.Error()) + return nil, nil, nil, err + } + appInfoEntry.AppDId = EmptyToNilString(appInfoEntry.AppDId) + appInfoEntry.AppSoftVersion = EmptyToNilString(appInfoEntry.AppSoftVersion) + appInfoEntry.AppPackageSource = EmptyToNilUri(appInfoEntry.AppPackageSource) + userAppInstanceInfoItem.AppInstanceId = EmptyToNilString(userAppInstanceInfoItem.AppInstanceId) + userAppInstanceInfoItem.ReferenceURI = EmptyToNilUri(userAppInstanceInfoItem.ReferenceURI) + // Update AppLocation + var rows_1 *sql.Rows + rows_1, err = am.db.Query( + `SELECT * FROM `+LocationConstraintsTable+` WHERE appDId = ($1) AND appInstanceId = ($2)`, + userAppInstanceInfoAppDId, *userAppInstanceInfoItem.AppInstanceId) + if err != nil { + log.Error(err.Error()) + return nil, nil, nil, err + } + // Scan results + for rows_1.Next() { + var applicationLocationConstraintsAppDId string + var applicationLocationConstraintsAppInstanceId string + var area string + var civicAddressElement string + var countryCode string + err = rows_1.Scan( + &applicationLocationConstraintsAppDId, + &applicationLocationConstraintsAppInstanceId, + &area, + &civicAddressElement, + &countryCode, + ) + if err != nil { + log.Error(err.Error()) + return nil, nil, nil, err + } + locationConstraintsItem := new(LocationConstraintsItem) + locationConstraintsItem.Area = convertJsonToPolygon(area) + if len(locationConstraintsItem.Area.Coordinates) == 0 { + locationConstraintsItem.Area = nil + } + locationConstraintsItem.CivicAddressElement = convertJsonToCivicAddressElement(civicAddressElement) + if len(*locationConstraintsItem.CivicAddressElement) == 0 { + locationConstraintsItem.CivicAddressElement = nil + } + if countryCode == "" { + locationConstraintsItem.CountryCode = nil + } else { + locationConstraintsItem.CountryCode = new(string) + *locationConstraintsItem.CountryCode = countryCode + } + + userAppInstanceInfoItem.AppLocation = append(userAppInstanceInfoItem.AppLocation, *locationConstraintsItem) + } // End of 'for' statement + + return appContext, appInfoEntry, userAppInstanceInfoItem, err +} + +func startProcessCheckTicker() { + // Make sure ticker is not running + if processCheckTicker != nil { + log.Warn("Registration ticker already running") + return + } + + // Start registration ticker + processCheckTicker = time.NewTicker(processCheckExpiry) + go func() { + + for range processCheckTicker.C { + + if len(appExecEntries) != 0 { // No process running + for _, appExecEntry := range appExecEntries { + + res, err := pidExists(appExecEntry.cmd.Process.Pid) + if err != nil { + log.Error(err.Error()) + continue + } + if res == false { + // Process terminated, delete all entries + appContextId := strconv.Itoa(appExecEntry.cmd.Process.Pid) + if appContexts[appContextId].CallbackReference != "" { + notifyUrl := appContexts[appContextId].CallbackReference + daiMgr.DeleteAppContext(appContextId) + // Notify event + notifyAppContextDeletion(string(notifyUrl), appContextId) + } + } + } // End of 'for' statement + } + + continue // Infinite loop till stopProcessCheckTicker is call + } // End of 'for' statement + }() +} + +func stopProcessCheckTicker() { + if processCheckTicker != nil { + log.Info("Stopping App Enablement registration ticker") + processCheckTicker.Stop() + processCheckTicker = nil + } +} + +/////////////////////////////////////////////////////////////////////// diff --git a/go-packages/meep-dai-mgr/meep-dai-mgr_test.go b/go-packages/meep-dai-mgr/meep-dai-mgr_test.go new file mode 100644 index 000000000..118ac4028 --- /dev/null +++ b/go-packages/meep-dai-mgr/meep-dai-mgr_test.go @@ -0,0 +1,1285 @@ +/* + * Copyright (c) 2022 The AdvantEDGE Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package meepdaimgr + +import ( + "fmt" + "os/exec" + //"sort" + //"strings" + //"strconv" + //"regexp" + "testing" + + log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" + + "github.com/spf13/cobra" +) + +const ( + amName = "pc" + amNamespace = "postgis-ns" + amDBUser = "postgres" + amDBPwd = "pwd" + amDBHost = "localhost" + amDBPort = "30432" + + associateDevAppId1 = "associateDevAppId1" + callbackReference1 = "callbackReference1" + appLocationUpdates1 = true + appAutoInstantiation1 = false + appName1 = "appName1" + appProvider1 = "appProvider1" + appDVersion1 = "appDVersion1" + appDescription1 = "appDescription1" + appCmd1 = "ps" + + associateDevAppId2 = "associateDevAppId2" + callbackReference2 = "callbackReference2" + appLocationUpdates2 = false + appAutoInstantiation2 = false + appName2 = "appName2" + appProvider2 = "appProvider2" + appDVersion2 = "appDVersion2" + appDescription2 = "appDescription2" + appCmd2 = "ls" + + associateDevAppId3 = "associateDevAppId3" + callbackReference3 = "callbackReference3" + appLocationUpdates3 = true + appAutoInstantiation3 = true + appName3 = "appName3" + appProvider3 = "appProvider3" + appDVersion3 = "appDVersion3" + appDescription3 = "appDescription3" + appCmd3 = "uptime" +) + +var ( // Need to take address + contextId1 string = "contextId1" + appDId1 string = "appDId1" + appSoftVersion1 string = "appSoftVersion1" + appPackageSource1 Uri = "appPackageSource1" + appInstanceId1_1 string = "appInstanceId1-1" + appInstanceId1_2 string = "appInstanceId1-2" + appInstanceId1_3 string = "appInstanceId1-3" + referenceURI1_1 Uri = "referenceURI1-1" + referenceURI1_3 Uri = "referenceURI1-3" + area1 = Polygon{[][][]float32{{{7.420433, 43.729942}, {7.420659, 43.73036}, {7.420621, 43.731045}, {7.420922, 43.73129}}, {{7.420434, 43.729943}, {7.420659, 43.73036}, {7.420621, 43.731045}, {7.420922, 43.73129}}}} + area1_str string = "{\"coordinates\":[[[7.420433,43.729942],[7.420659,43.73036],[7.420621,43.731045],[7.420922,43.73129]],[[7.420434,43.729942],[7.420659,43.73036],[7.420621,43.731045],[7.420922,43.73129]]]}" + civicAddressElement1 = CivicAddressElement{{1, "Value1"}, {10, "Value10"}} + civicAddressElement1_str string = "[{\"caType\":1,\"caValue\":\"Value1\"},{\"caType\":10,\"caValue\":\"Value10\"}]" + countryCode1 string = "countryCode1" + memory1 uint32 = 1024 + storage1 uint32 = 1024 + latency1 uint32 = 1024 + bandwidth1 uint32 = 1024 + serviceCont1 uint32 = 0 + + contextId2 string = "contextId2" + appDId2 string = "appDId2" + appSoftVersion2 string = "appSoftVersion2" + appPackageSource2 Uri = "appPackageSource2" + appInstanceId2_1 string = "appInstanceId2-1" + appInstanceId2_2 string = "appInstanceId2-2" + referenceURI2_1 Uri = "referenceURI2-1" + referenceURI2_2 Uri = "referenceURI2-2" + area2 = Polygon{[][][]float32{{{7.43166, 43.736156}, {7.431723, 43.736115}, {7.431162, 43.735607}, {7.430685, 43.73518}}}} + civicAddressElement2 = CivicAddressElement{{2, "Value2"}, {20, "Value20"}} + countryCode2 string = "countryCode2" + memory2 uint32 = 1024 * 2 + storage2 uint32 = 1024 * 2 + latency2 uint32 = 1024 * 2 + bandwidth2 uint32 = 1024 * 2 + serviceCont2 uint32 = 0 + + contextId3 string = "contextId3" + appDId3 string = "appDId3" + appSoftVersion3 string = "appSoftVersion3" + //appPackageSource3 Uri = "appPackageSource3" + appInstanceId3_1 string = "appInstanceId3-1" + appInstanceId3_2 string = "appInstanceId3-2" +) + +var cobraCmd = &cobra.Command{ + Use: "Testing exec", + Short: "Testing exec", + Long: "Long description", + Example: "Usage example", + Args: cobra.OnlyValidArgs, + ValidArgs: nil, + Run: nil, +} + +func TestExecuteCmd(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + cmd := exec.Command("ls", "-ltr") + cmd.Dir = "." + out, err := ExecuteCmd(cmd, cobraCmd) + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println(out) + + cmd = exec.Command("ps", "-ltr") + _, err = ExecuteCmd(cmd, cobraCmd) + if err == nil { + t.Fatalf("ExecuteCmd should have failed") + } + + //docker run --rm --expose=31111 -t meep-docker-registry:30001/onboarded-demo4 + /*dockerId, out, err := DockerRun("meep-docker-registry:30001/onboarded-demo4", "31124", 3*time.Second) + fmt.Println(out) + if err != nil { + t.Fatalf(err.Error()) + } + out, err = DockerTerminate(dockerId, 3*time.Second) + fmt.Println(out) + if err != nil { + t.Fatalf(err.Error()) + } + + dockerId, out, err = DockerRun("", "31124", 3*time.Second) + fmt.Println(out) + if err == nil { + t.Fatalf("DockerRun should have failed") + } + + dockerId, out, err = DockerRun("voila", "31124", 3*time.Second) + fmt.Println(out) + if err == nil { + t.Fatalf("DockerRun should have failed") + } + + out, err = DockerTerminate("", 3*time.Second) + fmt.Println(out) + if err == nil { + t.Fatalf("DockerTerminate should have failed") + } + + out, err = DockerTerminate("voila", 3*time.Second) + fmt.Println(out) + if err == nil { + t.Fatalf("DockerTerminate should have failed") + }*/ + +} + +func TestConvertCivicAddressElementToJson(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + civicAddressElementArray := make(CivicAddressElement, 0) + retCode := convertCivicAddressElementToJson(&civicAddressElementArray) + if retCode == "" { + t.Fatalf("Failed to convert empty CivicAddressElement array") + } + if retCode != "[]" { + t.Fatalf("Unexpected conversion result") + } + + retCode = convertCivicAddressElementToJson(&civicAddressElement1) + if retCode == "" { + t.Fatalf("Failed to convert empty CivicAddressElement array") + } + if retCode != civicAddressElement1_str { + t.Fatalf("Unexpected conversion result") + } +} + +func TestConvertJsonToCivicAddressElement(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + retCode := convertJsonToCivicAddressElement("") + if retCode == nil { + t.Fatalf("Failed to convert empty CivicAddressElement array") + } + if len(*retCode) != 0 { + t.Fatalf("Unexpected conversion result") + } + + retCode = convertJsonToCivicAddressElement(civicAddressElement1_str) + if retCode == nil { + t.Fatalf("Failed to convert empty CivicAddressElement array") + } + fmt.Println("CivicAddressElement: ", *retCode) + p := *retCode + if p[0] != civicAddressElement1[0] { + t.Fatalf("Unexpected conversion result") + } +} + +func TestConvertPolygonToJson(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + retCode := convertPolygonToJson(&area1) + if retCode == "" { + t.Fatalf("Failed to convert empty Polygon") + } + if retCode != area1_str { + t.Fatalf("Unexpected conversion result") + } +} + +func TestConvertJsonToPolygon(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + retCode := convertJsonToPolygon("") + if retCode == nil { + t.Fatalf("Failed to convert empty Polygon") + } + + retCode = convertJsonToPolygon(area1_str) + if retCode == nil { + t.Fatalf("Failed to convert empty Polygon array") + } + p := *retCode + if p.Coordinates[0][0][0] != 7.420433 || p.Coordinates[0][0][1] != 43.729942 || + p.Coordinates[1][0][0] != 7.420434 || p.Coordinates[1][0][1] != 43.729943 { + t.Fatalf("Unexpected conversion result") + } +} + +func TestNewDaiMgr(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + // Invalid Connector + fmt.Println("Invalid DAI Manager") + am, err := NewDaiMgr(DaiCfg { "", amNamespace, amDBUser, amDBPwd, amDBHost, amDBPort, nil }) + if err == nil || am != nil { + t.Fatalf("DB connection should have failed") + } + am, err = NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, "invalid-host", amDBPort, nil }) + if err == nil || am != nil { + t.Fatalf("DB connection should have failed") + } + am, err = NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, amDBHost, "invalid-port", nil }) + if err == nil || am != nil { + t.Fatalf("DB connection should have failed") + } + am, err = NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, "invalid-pwd", amDBHost, amDBPort, nil }) + if err == nil || am != nil { + t.Fatalf("DB connection should have failed") + } + + // Valid Connector + fmt.Println("Create valid DAI Manager") + am, err = NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, amDBHost, amDBPort, nil }) + if err != nil || am == nil { + t.Fatalf("Failed to create DAI Manager") + } + + // Cleanup + _ = am.DeleteTable(AppContextTable) + _ = am.DeleteTable(AppInfoTable) + _ = am.DeleteTable(UserAppInstanceInfoTable) + _ = am.DeleteTable(LocationConstraintsTable) + _ = am.DeleteTable(AppInfoListTable) + _ = am.DeleteTable(AppCharcsTable) + _ = am.DeleteTable(AppInfoListLocationConstraintsTable) + + // Create tables + fmt.Println("Create Tables") + err = am.CreateTables() + if err != nil { + t.Fatalf("Failed to create tables") + } + + // Cleanup + err = am.DeleteTables() + if err != nil { + t.Fatalf("Failed to create tables") + } + + err = am.DeleteDaiMgr() + if err != nil { + t.Fatalf("Failed to delete DaiMgr") + } + + // t.Fatalf("DONE") +} + +func TestDaiMgrCreateAppList(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + // Create Connector + fmt.Println("Create valid Dai Manager") + am, err := NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, amDBHost, amDBPort, nil }) + if err != nil || am == nil { + t.Fatalf("Failed to create Dai Manager") + } + + // Cleanup + _ = am.DeleteTables() + + // Create tables + fmt.Println("Create Tables") + err = am.CreateTables() + if err != nil { + t.Fatalf("Failed to create tables") + } + + // Make sure AppInfoList don't exist + fmt.Println("Verify no AppInfoList present") + appListMap, err := am.GetAllAppList() + if err != nil { + t.Fatalf("Failed to get all AppInfoList") + } + if len(appListMap) != 0 { + t.Fatalf("No AppInfoList should be present") + } + + // Build a complete AppInfoList data structure + appLocation1 := make([]LocationConstraintsItem, 2) + appLocation1[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appLocation1[1] = LocationConstraintsItem{nil, &civicAddressElement1, nil} + appCharcs1 := make([]AppCharcs, 1) + appCharcs1[0] = AppCharcs{&memory1, &storage1, &latency1, &bandwidth1, &serviceCont1} + appInfoList1 := AppInfoList{appDId1, appName1, appProvider1, appSoftVersion1, appDVersion1, appDescription1, appLocation1, appCharcs1, appCmd1, []string{}} + + // Create an invalid AppInfoList - ContextId + fmt.Println("Create an invalid AppInfoList - AppDId") + appInfoList1.AppDId = "" + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppDId") + } + appInfoList1.AppDId = appDId1 + + fmt.Println("Create an invalid AppInfoList - AppName") + appInfoList1.AppName = "" + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppName") + } + appInfoList1.AppName = appName1 + + fmt.Println("Create an invalid AppInfoList - AppProvider") + appInfoList1.AppProvider = "" + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppProvider") + } + appInfoList1.AppProvider = appProvider1 + + fmt.Println("Create an invalid AppInfoList - AppSoftVersion") + appInfoList1.AppSoftVersion = "" + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppSoftVersion") + } + appInfoList1.AppSoftVersion = appSoftVersion1 + + fmt.Println("Create an invalid AppInfoList - AppDVersion") + appInfoList1.AppDVersion = "" + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppDVersion") + } + appInfoList1.AppDVersion = appDVersion1 + + fmt.Println("Create an invalid AppInfoList - AppDescription") + appInfoList1.AppDescription = "" + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppDescription") + } + appInfoList1.AppDescription = appDescription1 + + fmt.Println("Create an invalid AppInfoList - AppCharcs") + appInfoList1.AppCharcs = make([]AppCharcs, 2) + appInfoList1.AppCharcs[0] = AppCharcs{&memory1, &storage1, &latency1, &bandwidth1, &serviceCont1} + appInfoList1.AppCharcs[1] = AppCharcs{&memory2, &storage2, &latency2, &bandwidth2, &serviceCont2} + err = am.CreateAppEntry(appInfoList1) + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AppCharcs") + } + appInfoList1.AppCharcs = appCharcs1 + + // Create a valid AppInfoList + fmt.Println("Create a valid AppInfoList: ", appInfoList1) + err = am.CreateAppEntry(appInfoList1) + if err != nil { + t.Fatalf(err.Error()) + } + appInfoList, err := am.GetAppInfoListEntry(appDId1) + if err != nil { + t.Fatalf(err.Error()) + } + if !validateAppInfoList(appInfoList, appInfoList1) { + t.Fatalf("AppInfoList validation failed") + } + appInfoListMap, err := am.GetAllAppInfoListEntry() + if err != nil || len(appInfoListMap) != 1 { + t.Fatalf(err.Error()) + } + if !validateAppInfoList(appInfoListMap[appDId1], appInfoList1) { + t.Fatalf("AppInfoList validation failed") + } + + // Build another complete AppInfoList data structure + fmt.Println("Create another valid AppInfoList") + appLocation2 := make([]LocationConstraintsItem, 2) + appLocation2[0] = LocationConstraintsItem{&area2, nil, &countryCode2} + appLocation2[1] = LocationConstraintsItem{nil, &civicAddressElement2, nil} + appCharcs2 := make([]AppCharcs, 1) + appCharcs2[0] = AppCharcs{&memory2, &storage2, &latency2, &bandwidth2, &serviceCont2} + appInfoList2 := AppInfoList{appDId2, appName2, appProvider2, appSoftVersion2, appDVersion2, appDescription2, appLocation2, appCharcs2, appCmd2, []string{}} + err = am.CreateAppEntry(appInfoList2) + if err != nil { + t.Fatalf(err.Error()) + } + appInfoList, err = am.GetAppInfoListEntry(appDId2) + if err != nil { + t.Fatalf(err.Error()) + } + if !validateAppInfoList(appInfoList, appInfoList2) { + t.Fatalf("AppInfoList validation failed") + } + appInfoListMap, err = am.GetAllAppInfoListEntry() + if err != nil || len(appInfoListMap) != 2 { + t.Fatalf(err.Error()) + } + if !validateAppInfoList(appInfoListMap[appDId2], appInfoList2) { + t.Fatalf("AppInfoList validation failed") + } + if validateAppInfoList(appInfoListMap[appDId2], appInfoList1) { + t.Fatalf("AppInfoList validation should failed") + } + + // Build another complete AppInfoList data structure without any optional field + fmt.Println("Create another valid AppInfoList without any optional field") + appLocation3 := make([]LocationConstraintsItem, 0) + appCharcs3 := make([]AppCharcs, 0) + appInfoList3 := AppInfoList{appDId3, appName3, appProvider3, appSoftVersion3, appDVersion3, appDescription3, appLocation3, appCharcs3, appCmd2, []string{}} + err = am.CreateAppEntry(appInfoList3) + if err != nil { + t.Fatalf(err.Error()) + } + appInfoList, err = am.GetAppInfoListEntry(appDId3) + if err != nil { + t.Fatalf(err.Error()) + } + if !validateAppInfoList(appInfoList, appInfoList3) { + t.Fatalf("AppInfoList validation failed") + } + + // Delete all AppInfoList entries + fmt.Println("Delete all AppInfoList entries") + err = am.DeleteAllAppInfoList() + if err != nil { + t.Fatalf("Failed to delete all AppInfoList entries") + } + appInfoListMap, err = am.GetAllAppInfoListEntry() + if err != nil || len(appInfoListMap) != 0 { + t.Fatalf("AppInfoList entry should no longer exist") + } + + err = am.DeleteDaiMgr() + if err != nil { + t.Fatalf("Failed to delete DaiMgr") + } + + // t.Fatalf("DONE") +} + +func TestDaiMgrCreateAppContext(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + // Create Connector + fmt.Println("Create valid Dai Manager") + am, err := NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, amDBHost, amDBPort, nil }) + if err != nil || am == nil { + t.Fatalf("Failed to create Dai Manager") + } + + // Cleanup + _ = am.DeleteTables() + + // Create tables + fmt.Println("Create Tables") + err = am.CreateTables() + if err != nil { + t.Fatalf("Failed to create tables") + } + + // Make sure AppContexts don't exist + fmt.Println("Verify no AppContext present") + appContextMap, err := am.GetAllAppContext() + if err != nil { + t.Fatalf("Failed to get all AppContexts") + } + if len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + + // Fill AppInfoList table + fmt.Println("Fill AppInfoList table") + appLocation1 := make([]LocationConstraintsItem, 2) + appLocation1[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appLocation1[1] = LocationConstraintsItem{nil, &civicAddressElement1, nil} + appCharcs1 := make([]AppCharcs, 1) + appCharcs1[0] = AppCharcs{&memory1, &storage1, &latency1, &bandwidth1, &serviceCont1} + appInfoList1 := AppInfoList{appDId1, appName1, appProvider1, appSoftVersion1, appDVersion1, appDescription1, appLocation1, appCharcs1, appCmd1, []string{}} + err = am.CreateAppEntry(appInfoList1) + if err != nil { + t.Fatalf(err.Error()) + } + appLocation2 := make([]LocationConstraintsItem, 2) + appLocation2[0] = LocationConstraintsItem{&area2, nil, &countryCode2} + appLocation2[1] = LocationConstraintsItem{nil, &civicAddressElement2, nil} + appCharcs2 := make([]AppCharcs, 1) + appCharcs2[0] = AppCharcs{&memory2, &storage2, &latency2, &bandwidth2, &serviceCont2} + appInfoList2 := AppInfoList{appDId2, appName2, appProvider2, appSoftVersion2, appDVersion2, appDescription2, appLocation2, appCharcs2, appCmd2, []string{}} + err = am.CreateAppEntry(appInfoList2) + if err != nil { + t.Fatalf(err.Error()) + } + appLocation3 := make([]LocationConstraintsItem, 0) + appCharcs3 := make([]AppCharcs, 0) + appInfoList3 := AppInfoList{appDId3, appName3, appProvider3, appSoftVersion3, appDVersion3, appDescription3, appLocation3, appCharcs3, appCmd3, []string{}} + err = am.CreateAppEntry(appInfoList3) + if err != nil { + t.Fatalf(err.Error()) + } + + // Build a complete AppContexts data structure + userAppInstanceInfo1 := make([]UserAppInstanceInfoItem, 1) + userAppInstanceInfo1[0] = UserAppInstanceInfoItem{nil, nil, nil} + userAppInstanceInfo1[0].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo1[0].AppLocation[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appInfo1 := AppInfo{&appDId1, appName1, appProvider1, &appSoftVersion1, appDVersion1, appDescription1, userAppInstanceInfo1, &appPackageSource1} + appContext1 := AppContext{&contextId1, associateDevAppId1, callbackReference1, appLocationUpdates1, appAutoInstantiation1, appInfo1} + + // Create an invalid AppContexts - ContextId + fmt.Println("Create an invalid AppContexts - ContextId") + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid ContextId") + } + appContext1.ContextId = nil + + // Create an invalid AppContext - AssociateDevAppId + fmt.Println("Create an invalid AppContext - AssociateDevAppId") + appContext1.AssociateDevAppId = "" + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - Invalid AssociateDevAppId") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + appContext1.AssociateDevAppId = associateDevAppId1 + + // Create an invalid AppContexts - Empty AppInfo.UserAppInstanceInfo + fmt.Println("Create an invalid AppContexts - Empty AppInfo.UserAppInstanceInfo") + appContext1.AppInfo.UserAppInstanceInfo = make([]UserAppInstanceInfoItem, 0) + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - Empty AppInfo.UserAppInstanceInfo") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + + // Create an invalid AppContexts - AppInfo.UserAppInstanceInfo with AppInstanceId set + fmt.Println("Create an invalid AppContexts - AppInfo.UserAppInstanceInfo with AppInstanceId set") + appContext1.AppInfo.UserAppInstanceInfo = make([]UserAppInstanceInfoItem, 1) + appContext1.AppInfo.UserAppInstanceInfo[0] = UserAppInstanceInfoItem{&appInstanceId1_1, nil, nil} + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - AppInfo.UserAppInstanceInfo with AppInstanceId set") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + // Create an invalid AppContexts - AppInfo.UserAppInstanceInfo with ReferenceURI set + appContext1.AppInfo.UserAppInstanceInfo[0] = UserAppInstanceInfoItem{nil, &referenceURI1_1, nil} + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - AppInfo.UserAppInstanceInfo with ReferenceURI set") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + // Create an invalid AppContexts - AppInfo.UserAppInstanceInfo with both AppInstanceId and ReferenceURI set + appContext1.AppInfo.UserAppInstanceInfo = make([]UserAppInstanceInfoItem, 2) + appContext1.AppInfo.UserAppInstanceInfo[0] = UserAppInstanceInfoItem{&appInstanceId1_1, nil, nil} + appContext1.AppInfo.UserAppInstanceInfo[1] = UserAppInstanceInfoItem{nil, &referenceURI1_1, nil} + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - AppInfo.UserAppInstanceInfo with both AppInstanceId and ReferenceURI set") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + appContext1.AppInfo.UserAppInstanceInfo = userAppInstanceInfo1 + + // Create an invalid AppContexts - More than one entries in UserAppInstanceInfo.AppLocation + fmt.Println("Create an invalid AppContexts - More than one entries in UserAppInstanceInfo.AppLocation") + userAppInstanceInfo_wrong := make([]UserAppInstanceInfoItem, 1) // Two entries in userAppInstanceInfo1[0].AppLocation + userAppInstanceInfo_wrong[0] = UserAppInstanceInfoItem{&appInstanceId1_1, &referenceURI1_1, nil} + userAppInstanceInfo_wrong[0].AppLocation = make([]LocationConstraintsItem, 2) + userAppInstanceInfo_wrong[0].AppLocation[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + userAppInstanceInfo_wrong[0].AppLocation[1] = LocationConstraintsItem{nil, nil, &countryCode1} + appContext1.AppInfo.UserAppInstanceInfo = userAppInstanceInfo_wrong + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - More than one entries in UserAppInstanceInfo.AppLocation") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + + // Create an invalid AppContexts - Multiple instance of UserAppInstanceInfo with the same AppInstanceId + fmt.Println("Create an invalid AppContexts - Multiple instance of UserAppInstanceInfo with the same AppInstanceId") + userAppInstanceInfo_wrong = make([]UserAppInstanceInfoItem, 2) // Two entries in userAppInstanceInfo with same AppInstanceId + userAppInstanceInfo_wrong[0] = UserAppInstanceInfoItem{&appInstanceId1_1, &referenceURI1_1, nil} + userAppInstanceInfo_wrong[0].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo_wrong[0].AppLocation[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + userAppInstanceInfo_wrong[1] = UserAppInstanceInfoItem{&appInstanceId1_1, &referenceURI1_1, nil} + userAppInstanceInfo_wrong[1].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo_wrong[1].AppLocation[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appContext1.AppInfo.UserAppInstanceInfo = userAppInstanceInfo_wrong + _, err = am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err == nil { + t.Fatalf("AppContext creation should have failed - Multiple instance of UserAppInstanceInfo with the same AppInstanceId") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + + appContext1.AppInfo.UserAppInstanceInfo = userAppInstanceInfo1 + + // Create a valid AppContext + fmt.Println("Create a valid AppContext: ", contextId1) + appContext, err := am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err != nil { + t.Fatalf(err.Error()) + } + appContext, err = am.GetAppContext(*appContext.ContextId) + if err != nil { + t.Fatalf(err.Error()) + } + if !validateAppContexts(appContext, appContext1) { + t.Fatalf("AppContext validation failed") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 1 { + t.Fatalf(err.Error()) + } + if !validateAppContexts(appContextMap[*appContext.ContextId], appContext1) { + t.Fatalf("AppContext validation failed") + } + + // Create another valid AppContext + fmt.Println("Create another valid AppContext: ", contextId2) + userAppInstanceInfo2 := make([]UserAppInstanceInfoItem, 1) + userAppInstanceInfo2[0] = UserAppInstanceInfoItem{nil, nil, nil} + userAppInstanceInfo2[0].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo2[0].AppLocation[0] = LocationConstraintsItem{&area2, &civicAddressElement2, &countryCode2} + appInfo2 := AppInfo{&appDId2, appName2, appProvider2, &appSoftVersion2, appDVersion2, appDescription2, userAppInstanceInfo2, &appPackageSource2} + appContext2 := AppContext{nil, associateDevAppId2, callbackReference2, appLocationUpdates2, appAutoInstantiation2, appInfo2} + appContext, err = am.CreateAppContext(&appContext2, "http://examples.io", "sandbox") + if err != nil { + t.Fatalf(err.Error()) + } + appContext, err = am.GetAppContext(*appContext.ContextId) + if err != nil { + t.Fatalf(err.Error()) + } + if !validateAppContexts(appContext, appContext2) { + t.Fatalf("AppContext validation failed") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 2 { + t.Fatalf(err.Error()) + } + if !validateAppContexts(appContextMap[*appContext.ContextId], appContext2) { + t.Fatalf("AppContext validation failed") + } + if validateAppContexts(appContextMap[contextId2], appContext2) { + t.Fatalf("AppContext validation should failed") + } + + // Create another valid AppContext without any optional field + fmt.Println("Create another valid AppContext: ", contextId3) + userAppInstanceInfo3 := make([]UserAppInstanceInfoItem, 1) + userAppInstanceInfo3[0] = UserAppInstanceInfoItem{nil, nil, nil} + userAppInstanceInfo3[0].AppLocation = make([]LocationConstraintsItem, 0) + appInfo3 := AppInfo{&appDId3, appName3, appProvider3, nil, appDVersion3, appDescription3, userAppInstanceInfo3, nil} + fmt.Println("Create another valid appInfo3: ", appInfo3) + appContext3 := AppContext{nil, associateDevAppId3, callbackReference3, appLocationUpdates3, appAutoInstantiation3, appInfo3} + fmt.Println("Create another valid appContext3: ", appContext3) + appContext, err = am.CreateAppContext(&appContext3, "http://examples.io", "sandbox") + if err != nil { + t.Fatalf(err.Error()) + } + appContext, err = am.GetAppContext(*appContext.ContextId) + if err != nil { + t.Fatalf(err.Error()) + } + if !validateAppContexts(appContext, appContext3) { + t.Fatalf("AppContext validation failed") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 3 { + t.Fatalf(err.Error()) + } + if !validateAppContexts(appContextMap[*appContext.ContextId], appContext3) { + t.Fatalf("AppContext validation failed") + } + if validateAppContexts(appContextMap[contextId3], appContext3) { + t.Fatalf("AppContext validation should failed") + } + + // Delete all AppContexts + fmt.Println("Delete all AppContexts") + err = am.DeleteAllAppContext() + if err != nil { + t.Fatalf("Failed to delete all AppContexts") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("AppContext entry should no longer exist") + } + + err = am.DeleteDaiMgr() + if err != nil { + t.Fatalf("Failed to delete DaiMgr") + } + + // t.Fatalf("DONE") +} + +func TestDaiMgrDeleteAppContext(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + // Create Connector + fmt.Println("Create valid Dai Manager") + am, err := NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, amDBHost, amDBPort, nil }) + if err != nil || am == nil { + t.Fatalf("Failed to create Dai Manager") + } + + // Cleanup + _ = am.DeleteTables() + + // Create tables + fmt.Println("Create Tables") + err = am.CreateTables() + if err != nil { + t.Fatalf("Failed to create tables") + } + + // Make sure AppContexts don't exist + fmt.Println("Verify no AppContext present") + appContextMap, err := am.GetAllAppContext() + if err != nil { + t.Fatalf("Failed to get all AppContexts") + } + if len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + + // Fill AppInfoList table + fmt.Println("Fill AppInfoList table") + appLocation1 := make([]LocationConstraintsItem, 2) + appLocation1[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appLocation1[1] = LocationConstraintsItem{nil, &civicAddressElement1, nil} + appCharcs1 := make([]AppCharcs, 1) + appCharcs1[0] = AppCharcs{&memory1, &storage1, &latency1, &bandwidth1, &serviceCont1} + appInfoList1 := AppInfoList{appDId1, appName1, appProvider1, appSoftVersion1, appDVersion1, appDescription1, appLocation1, appCharcs1, appCmd1, []string{}} + err = am.CreateAppEntry(appInfoList1) + if err != nil { + t.Fatalf(err.Error()) + } + + // Build a complete AppContexts data structure + userAppInstanceInfo1 := make([]UserAppInstanceInfoItem, 1) + userAppInstanceInfo1[0] = UserAppInstanceInfoItem{nil, nil, nil} + userAppInstanceInfo1[0].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo1[0].AppLocation[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appInfo1 := AppInfo{&appDId1, appName1, appProvider1, &appSoftVersion1, appDVersion1, appDescription1, userAppInstanceInfo1, &appPackageSource1} + appContext1 := AppContext{nil, associateDevAppId1, callbackReference1, appLocationUpdates1, appAutoInstantiation1, appInfo1} + + // Create a valid AppContext + fmt.Println("Create a valid AppContext: ", appContext1) + appContext, err := am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err != nil { + t.Fatalf(err.Error()) + } + fmt.Println("Created AppContext: ", appContext) + + // Delete an invalid AppContext + fmt.Println("Delete an invalid AppContext: ", contextId1) + err = am.DeleteAppContext(contextId1) + if err == nil { + t.Fatalf("AppContext deletion should failed") + } + + // Delete a valid AppContext + fmt.Println("Delete a valid AppContext: ", appContext.ContextId) + err = am.DeleteAppContext(*appContext.ContextId) + if err != nil { + t.Fatalf("AppContext deletion failed") + } + _, err = am.GetAppContext(*appContext.ContextId) + if err == nil { + t.Fatalf("AppContext still exists after deletion") + } + + // Delete all AppContexts entries + fmt.Println("Delete all AppContexts entries") + err = am.DeleteAllAppContext() + if err != nil { + t.Fatalf("Failed to delete all AppContexts") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("AppContext entry should no longer exist") + } + + err = am.DeleteDaiMgr() + if err != nil { + t.Fatalf("Failed to delete DaiMgr") + } + + // t.Fatalf("DONE") +} + +func TestDaiMgrPutAppContext(t *testing.T) { + fmt.Println("--- ", t.Name()) + log.MeepTextLogInit(t.Name()) + + // Create Connector + fmt.Println("Create valid Dai Manager") + am, err := NewDaiMgr(DaiCfg { amName, amNamespace, amDBUser, amDBPwd, amDBHost, amDBPort, nil }) + if err != nil || am == nil { + t.Fatalf("Failed to create Dai Manager") + } + + // Cleanup + _ = am.DeleteTables() + + // Create tables + fmt.Println("Create Tables") + err = am.CreateTables() + if err != nil { + t.Fatalf("Failed to create tables") + } + + // Make sure AppContexts don't exist + fmt.Println("Verify no AppContext present") + appContextMap, err := am.GetAllAppContext() + if err != nil { + t.Fatalf("Failed to get all AppContexts") + } + if len(appContextMap) != 0 { + t.Fatalf("No AppContext entry should be present") + } + + // Fill AppInfoList table + fmt.Println("Fill AppInfoList table") + appLocation1 := make([]LocationConstraintsItem, 2) + appLocation1[0] = LocationConstraintsItem{&area1, nil, &countryCode1} + appLocation1[1] = LocationConstraintsItem{nil, &civicAddressElement1, nil} + appCharcs1 := make([]AppCharcs, 1) + appCharcs1[0] = AppCharcs{&memory1, &storage1, &latency1, &bandwidth1, &serviceCont1} + appInfoList1 := AppInfoList{appDId1, appName1, appProvider1, appSoftVersion1, appDVersion1, appDescription1, appLocation1, appCharcs1, appCmd1, []string{}} + err = am.CreateAppEntry(appInfoList1) + if err != nil { + t.Fatalf(err.Error()) + } + + // Build a complete AppContexts data structure + userAppInstanceInfo1 := make([]UserAppInstanceInfoItem, 1) + userAppInstanceInfo1[0] = UserAppInstanceInfoItem{nil, nil, nil} + userAppInstanceInfo1[0].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo1[0].AppLocation[0] = LocationConstraintsItem{&area1, &civicAddressElement1, &countryCode1} + appInfo1 := AppInfo{&appDId1, appName1, appProvider1, &appSoftVersion1, appDVersion1, appDescription1, userAppInstanceInfo1, &appPackageSource1} + appContext1 := AppContext{nil, associateDevAppId1, callbackReference1, appLocationUpdates1, appAutoInstantiation1, appInfo1} + // Build another complete AppContexts data structure for invalid behavior tests + userAppInstanceInfo2 := make([]UserAppInstanceInfoItem, 1) + userAppInstanceInfo2[0] = UserAppInstanceInfoItem{&appInstanceId2_1, &referenceURI2_1, nil} + userAppInstanceInfo2[0].AppLocation = make([]LocationConstraintsItem, 1) + userAppInstanceInfo2[0].AppLocation[0] = LocationConstraintsItem{&area2, nil, &countryCode2} + appInfo2 := AppInfo{&appDId2, appName2, appProvider2, &appSoftVersion2, appDVersion2, appDescription2, userAppInstanceInfo2, &appPackageSource2} + appContext2 := AppContext{&contextId2, associateDevAppId2, callbackReference2, appLocationUpdates2, appAutoInstantiation2, appInfo2} + + // Create a valid AppContext + fmt.Println("Create a valid AppContext: ", contextId1) + appContext, err := am.CreateAppContext(&appContext1, "http://examples.io", "sandbox") + if err != nil { + t.Fatalf(err.Error()) + } + + // Update an invalid AppContext + fmt.Println("Update an invalid AppContext: ", contextId2) + err = am.PutAppContext(appContext2) + if err == nil { + t.Fatalf("AppContext update should failed") + } + + // Update a valid AppContext - CallbackReference + fmt.Println("Update a valid AppContext - CallbackReference: ", *appContext.ContextId) + appContext.CallbackReference = callbackReference3 + err = am.PutAppContext(*appContext) + if err != nil { + t.Fatalf("AppContext update failed") + } + appContext, err = am.GetAppContext(*appContext.ContextId) + if err != nil { + t.Fatalf("AppContext should exist after update") + } + if appContext.CallbackReference != callbackReference3 { + t.Fatalf("failed to update AppContext - CallbackReference") + } + + // Delete all AppContexts entries + fmt.Println("Delete all AppContexts") + err = am.DeleteAllAppContext() + if err != nil { + t.Fatalf("Failed to delete all AppContexts") + } + appContextMap, err = am.GetAllAppContext() + if err != nil || len(appContextMap) != 0 { + t.Fatalf("AppContext entry should no longer exist") + } + + err = am.DeleteDaiMgr() + if err != nil { + t.Fatalf("Failed to delete DaiMgr") + } + + // t.Fatalf("DONE") +} + +func validateAppInfoList(appInfoListEntry *AppInfoList, appInfoList AppInfoList) bool { + + if appInfoListEntry.AppDId != appInfoList.AppDId { + fmt.Println("appInfoListEntry.AppDId != appInfoList.AppDId") + return false + } + if appInfoListEntry.AppName != appInfoList.AppName { + fmt.Println("appInfoListEntry.AppName != appInfoList.AppName") + return false + } + if appInfoListEntry.AppProvider != appInfoList.AppProvider { + fmt.Println("appInfoListEntry.AppProvider != appInfoList.AppProvider") + return false + } + if appInfoListEntry.AppSoftVersion != appInfoList.AppSoftVersion { + fmt.Println("appInfoListEntry.AppSoftVersion != appInfoList.AppSoftVersion") + return false + } + if appInfoListEntry.AppDVersion != appInfoList.AppDVersion { + fmt.Println("appInfoListEntry.AppDVersion != appInfoList.AppDVersion") + return false + } + if appInfoListEntry.AppDescription != appInfoList.AppDescription { + fmt.Println("appInfoListEntry.AppDescription != appInfoList.AppDescription") + return false + } + if len(appInfoListEntry.AppCharcs) != len(appInfoList.AppCharcs) { + fmt.Println("len(appInfoListEntry.AppCharcs) != len(appInfoList.AppCharcs)") + return false + } + if len(appInfoListEntry.AppCharcs) != 0 { + for i, appCharcs := range appInfoListEntry.AppCharcs { + if appCharcs.Memory != nil && appInfoList.AppCharcs[i].Memory != nil { + if *appCharcs.Memory != *appInfoList.AppCharcs[i].Memory { + fmt.Println("appCharcs.Memory != appInfoList.AppCharcs[i].Memory") + return false + } + } else if (appCharcs.Memory == nil) != (appInfoList.AppCharcs[i].Memory != nil) { + fmt.Println("appCharcs.Memory != appInfoList.AppCharcs[i].Memory") + return false + } + if appCharcs.Storage != nil && appInfoList.AppCharcs[i].Storage != nil { + if *appCharcs.Storage != *appInfoList.AppCharcs[i].Storage { + fmt.Println("appCharcs.Storage != appInfoList.AppCharcs[i].Storage") + return false + } + } else if (appCharcs.Storage == nil) != (appInfoList.AppCharcs[i].Storage != nil) { + fmt.Println("appCharcs.Storage != appInfoList.AppCharcs[i].Storage") + return false + } + if appCharcs.Latency != nil && appInfoList.AppCharcs[i].Latency != nil { + if *appCharcs.Latency != *appInfoList.AppCharcs[i].Latency { + fmt.Println("appCharcs.Latency != appInfoList.AppCharcs[i].Latency") + return false + } + } else if (appCharcs.Latency == nil) != (appInfoList.AppCharcs[i].Latency != nil) { + fmt.Println("appCharcs.Latency != appInfoList.AppCharcs[i].Latency") + return false + } + if appCharcs.Bandwidth != nil && appInfoList.AppCharcs[i].Bandwidth != nil { + if *appCharcs.Bandwidth != *appInfoList.AppCharcs[i].Bandwidth { + fmt.Println("appCharcs.Bandwidth != appInfoList.AppCharcs[i].Bandwidth") + return false + } + } else if (appCharcs.Bandwidth == nil) != (appInfoList.AppCharcs[i].Bandwidth != nil) { + fmt.Println("appCharcs.Bandwidth != appInfoList.AppCharcs[i].Bandwidth") + return false + } + if appCharcs.ServiceCont != nil && appInfoList.AppCharcs[i].ServiceCont != nil { + if *appCharcs.ServiceCont != *appInfoList.AppCharcs[i].ServiceCont { + fmt.Println("appCharcs.ServiceCont != appInfoList.AppCharcs[i].ServiceCont") + return false + } + } else if (appCharcs.ServiceCont == nil) != (appInfoList.AppCharcs[i].ServiceCont != nil) { + fmt.Println("appCharcs.ServiceCont != appInfoList.AppCharcs[i].ServiceCont") + return false + } + } // End of 'for' statement + } + if len(appInfoListEntry.AppLocation) != len(appInfoList.AppLocation) { + fmt.Println("len(appInfoListEntry.AppLocation) != len(appInfoList.AppLocation)") + return false + } + if len(appInfoListEntry.AppLocation) != 0 { + for j, item1 := range appInfoListEntry.AppLocation { + if item1.Area != nil && appInfoList.AppLocation[j].Area != nil { + if len(item1.Area.Coordinates) != len(appInfoList.AppLocation[j].Area.Coordinates) { + fmt.Println("len(item1.Area.Coordinates) != len(appInfoList.AppLocation[j].Area.Coordinates)") + return false + } + // TODO Compare content + } else if (item1.Area == nil) != (appInfoList.AppLocation[j].Area == nil) { + fmt.Println("item1.Area != appInfoList.AppLocation[j].Area") + return false + } + + if item1.CivicAddressElement != nil && appInfoList.AppLocation[j].CivicAddressElement != nil { + if len(*item1.CivicAddressElement) != len(*appInfoList.AppLocation[j].CivicAddressElement) { + fmt.Println("len(item1.CivicAddressElement) != len(appInfoList.AppLocation[j].CivicAddressElement") + return false + } + appContextCivicAddressElements := *appInfoList.AppLocation[j].CivicAddressElement + for k, cv := range *item1.CivicAddressElement { + if cv != appContextCivicAddressElements[k] { + fmt.Println("cv.CivicAddressElement != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement") + return false + } + } // End of 'for' statement + } else if (item1.CivicAddressElement == nil) != (appInfoList.AppLocation[j].CivicAddressElement == nil) { + fmt.Println("item1.CivicAddressElement != appInfoList.AppLocation[j].CivicAddressElement)") + return false + } + + if item1.CountryCode != nil && appInfoList.AppLocation[j].CountryCode != nil { + if *item1.CountryCode != *appInfoList.AppLocation[j].CountryCode { + fmt.Println("item1.CountryCode != appInfoList.AppLocation[j].CountryCode") + return false + } + } else if (item1.CountryCode == nil) != (appInfoList.AppLocation[j].CountryCode == nil) { + fmt.Println("item1.CountryCode != appInfoList.AppLocation[j].CountryCode") + return false + } + } // End of 'for' statement + } + + return true +} + +func validateAppContexts(appContextEntry *AppContext, appContext AppContext) bool { + + if appContextEntry == nil { + fmt.Println("appContextEntry should not be nil") + return false + } + if appContextEntry.ContextId == nil || appContextEntry.ContextId == appContext.ContextId { + fmt.Println("appContextEntry.ContextId != ContextId") + return false + } + if appContextEntry.AssociateDevAppId != appContext.AssociateDevAppId { + fmt.Println("appContextEntry.AssociateDevAppId != AssociateDevAppId") + return false + } + if appContextEntry.CallbackReference != appContext.CallbackReference { + fmt.Println("appContextEntry.CallbackReference != CallbackReference") + return false + } + if appContextEntry.AppLocationUpdates != appContext.AppLocationUpdates { + fmt.Println("appContextEntry.AppLocationUpdates != AppLocationUpdates") + return false + } + if appContextEntry.AppAutoInstantiation != appContext.AppAutoInstantiation { + fmt.Println("appContextEntry.AppAutoInstantiation != AppAutoInstantiation") + return false + } + + if appContextEntry.AppInfo.AppDId != nil && appContext.AppInfo.AppDId != nil { + fmt.Println("*appContext.AppInfo.AppDId: ", *appContext.AppInfo.AppDId) + fmt.Println("*appContextEntry.AppInfo.AppDId: ", *appContextEntry.AppInfo.AppDId) + if *appContextEntry.AppInfo.AppDId != *appContext.AppInfo.AppDId { + fmt.Println("*appContextEntry.AppInfo.AppDId != *AppInfo.AppDId") + return false + } + } else if appContextEntry.AppInfo.AppDId != nil || appContext.AppInfo.AppDId != nil { + fmt.Println("appContextEntry.AppInfo.AppDId != AppInfo.AppDId") + return false + } + if appContextEntry.AppInfo.AppName != appContext.AppInfo.AppName { + fmt.Println("appContextEntry.AppInfo.AppName != AppInfo.AppName") + return false + } + if appContextEntry.AppInfo.AppProvider != appContext.AppInfo.AppProvider { + fmt.Println("appContextEntry.AppInfo.AppProvider != AppInfo.AppProvider") + return false + } + if appContextEntry.AppInfo.AppSoftVersion != nil && appContext.AppInfo.AppSoftVersion != nil { + if *appContextEntry.AppInfo.AppSoftVersion != *appContext.AppInfo.AppSoftVersion { + fmt.Println("*appContextEntry.AppInfo.AppSoftVersion != *AppInfo.AppSoftVersion") + return false + } + } else if appContextEntry.AppInfo.AppSoftVersion != nil || appContext.AppInfo.AppSoftVersion != nil { + fmt.Println("appContextEntry.AppInfo.AppSoftVersion != AppInfo.AppSoftVersion") + return false + } + if appContextEntry.AppInfo.AppDVersion != appContext.AppInfo.AppDVersion { + fmt.Println("appContextEntry.AppInfo.AppDVersion != AppInfo.AppDVersion") + return false + } + if appContextEntry.AppInfo.AppDescription != appContext.AppInfo.AppDescription { + fmt.Println("appContextEntry.AppInfo.AppDescription != AppInfo.AppDescription") + return false + } + if appContextEntry.AppInfo.AppPackageSource != nil && appContext.AppInfo.AppPackageSource != nil { + if *appContextEntry.AppInfo.AppPackageSource != *appContext.AppInfo.AppPackageSource { + fmt.Println("*appContextEntry.AppInfo.AppPackageSource != *AppInfo.AppPackageSource") + return false + } + } else if appContextEntry.AppInfo.AppPackageSource != nil || appContext.AppInfo.AppPackageSource != nil { + fmt.Println("appContextEntry.AppInfo.AppPackageSource != AppInfo.AppPackageSource") + return false + } + if appContextEntry.AppInfo.UserAppInstanceInfo == nil || appContext.AppInfo.UserAppInstanceInfo == nil { + fmt.Println("appContextEntry.AppInfo.UserAppInstanceInfo != AppInfo.UserAppInstanceInfo") + return false + } + if len(appContextEntry.AppInfo.UserAppInstanceInfo) == 0 || len(appContext.AppInfo.UserAppInstanceInfo) == 0 { + fmt.Println("appContextEntry.AppInfo.UserAppInstanceInfo len shall be at leat one") + return false + } + if len(appContextEntry.AppInfo.UserAppInstanceInfo) != len(appContext.AppInfo.UserAppInstanceInfo) { + fmt.Println("len(appContextEntry.AppInfo.UserAppInstanceInfo) != len(AppInfo.UserAppInstanceInfo)") + return false + } + for i, item := range appContextEntry.AppInfo.UserAppInstanceInfo { + fmt.Println("validateAppContexts: Process item i#", i) + fmt.Println("validateAppContexts: item: ", item) + // fmt.Println("validateAppContexts: appContext.AppInfo.UserAppInstanceInfo[i].AppInstanceId: ", *appContext.AppInfo.UserAppInstanceInfo[i].AppInstanceId) + // fmt.Println("validateAppContexts: appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI: ", *appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI) + if item.AppInstanceId != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppInstanceId != nil { + if *item.AppInstanceId != *appContext.AppInfo.UserAppInstanceInfo[i].AppInstanceId { + fmt.Println("*item.AppInstanceId != *AppInfo.UserAppInstanceInfo.AppInstanceId") + return false + } + } else if (item.AppInstanceId == nil) != (appContext.AppInfo.UserAppInstanceInfo[i].AppInstanceId == nil) { + fmt.Println("item.AppInstanceId != AppInfo.UserAppInstanceInfo.AppInstanceId") + return false + } + fmt.Println("validateAppContexts: item.ReferenceURI: ", item.ReferenceURI) + fmt.Println("validateAppContexts: appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI: ", appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI) + if item.ReferenceURI != nil && appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI != nil { + if *item.ReferenceURI != *appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI { + fmt.Println("*item.ReferenceURI != *AppInfo.UserAppInstanceInfo.ReferenceURI") + return false + } + } else if (item.ReferenceURI == nil) != (appContext.AppInfo.UserAppInstanceInfo[i].ReferenceURI == nil) { + fmt.Println("item.ReferenceURI != AppInfo.UserAppInstanceInfo.ReferenceURI") + return false + } + if item.AppLocation != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppLocation != nil { + // fmt.Println("len(item.AppLocation): ", len(item.AppLocation)) + // fmt.Println("len(appContext.AppInfo.UserAppInstanceInfo.AppLocation): ", len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation)) + if len(item.AppLocation) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation) { + fmt.Println("len(item1)!= len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation") + return false + } + for j, item1 := range item.AppLocation { + // fmt.Println("validateAppContexts: Process item j#", j) + // fmt.Println("validateAppContexts: item1.Area: ", item1.Area) + // fmt.Println("validateAppContexts: item1.CivicAddressElement: ", item1.CivicAddressElement) + // fmt.Println("validateAppContexts: item1.CountryCode: ", item1.CountryCode) + // fmt.Println("validateAppContexts: appContext.AppInfo.UserAppInstanceInfo[i].Area: ", appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].Area) + // fmt.Println("validateAppContexts: appContext.AppInfo.UserAppInstanceInfo[i].CivicAddressElement: ", appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement) + // fmt.Println("validateAppContexts: appContext.AppInfo.UserAppInstanceInfo[i].CountryCode: ", appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CountryCode) + if item1.Area != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].Area != nil { + if len(item1.Area.Coordinates) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].Area.Coordinates) { + fmt.Println("len(item1.Area.Coordinates) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].Area.Coordinates)") + return false + } + // TODO Compare content + } else if (item1.Area == nil) != (appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].Area == nil) { + fmt.Println("item1.Area != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].Area") + return false + } + + if item1.CivicAddressElement != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement != nil { + if len(*item1.CivicAddressElement) != len(*appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement) { + fmt.Println("len(item1.CivicAddressElement) != len(appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement") + return false + } + appContextCivicAddressElements := *appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement + for k, cv := range *item1.CivicAddressElement { + fmt.Println("validateAppContexts: Process item k#", k) + fmt.Println("validateAppContexts: cv: ", cv) + fmt.Println("validateAppContexts: civicAddressElements[k]: ", appContextCivicAddressElements) + if cv != appContextCivicAddressElements[k] { + fmt.Println("cv.CivicAddressElement != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement") + return false + } + } // End of 'for' statement + } else if (item1.CivicAddressElement == nil) != (appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CivicAddressElement == nil) { + fmt.Println("item1.CivicAddressElement != AppInfo.UserAppInstanceInfo.CivicAddressElement)") + return false + } + + if item1.CountryCode != nil && appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CountryCode != nil { + if *item1.CountryCode != *appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CountryCode { + fmt.Println("item1.CountryCode != appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CountryCode") + return false + } + } else if (item1.CountryCode == nil) != (appContext.AppInfo.UserAppInstanceInfo[i].AppLocation[j].CountryCode == nil) { + fmt.Println("item1.CountryCode != AppInfo.UserAppInstanceInfo.CountryCode") + return false + } + } // End of 'for' statement + } + + } // End of 'for' statement + + return true +}