# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# 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.

import logging
from flask import jsonify
import requests
logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger()
BASE_URL = 'http://10.1.7.197/camara/qod/v0'
#def test_create_SESSION():
#    service_data={  
#                    "device":
#                        {"ipv4Address":"84.75.11.12/25" },
#                            "applicationServer": {
#                                    "ipv4Address": "192.168.0.1/26",
#                                                                    },
#                    "duration":10000000.00,
#                    "qos_profile_id": "f46d563f-9f1a-44c8-9649-5fde673236d6",
#                }      
#    post_response = requests.post(f'{BASE_URL}/sessions', json=service_data).json()
#    #id=post_response['sessionID']
#    #get_response = requests.get(f'{BASE_URL}/sessions/{id}').json()
#    get_response = requests.get(f'{BASE_URL}/sessions').json()


#def test_delete_session_by_id():
#    session_id = '83d4b75a-9b09-40f4-b9a9-f31d591fa319' 
#    response = requests.delete(f'{BASE_URL}/sessions/{session_id}')

#def test_update_session_by_id():
#    session_id='3ac2ff12-d763-4ded-9e13-7e82709b16cd'
#    session_data={"session_id":'3ac2ff12-d763-4ded-9e13-7e82709b16cd',
#                   "device":
#                   {"ipv4Address":"84.75.11.12/25" },
#                       "applicationServer": {
#                   "ipv4Address": "192.168.0.1/26",
#                    },
#                   "duration":2000000000.00,
#                   "qos_profile_id": "28499a15-c1d9-428c-9732-82859a727235"}
#    put_response=requests.put(f'{BASE_URL}/sessions/{session_id}',json=session_data).json()