Skip to content
Snippets Groups Projects
Commit ca80137a authored by Laskaratos Dimitris's avatar Laskaratos Dimitris
Browse files

Added network functions support and fixed edge cloud bugs

parent c4fac3fb
No related branches found
No related tags found
1 merge request!1Dev dimitris
......@@ -15,8 +15,7 @@ def create_qod_session(body: dict):
pi_edge_factory = PiEdgeAPIClientFactory()
api_client = pi_edge_factory.create_pi_edge_api_client()
response = api_client.create_qod_session(body)
return response
return response.json()
except ValidationError as e:
return jsonify({"error": "Invalid input", "details": e.errors()}), 400
......@@ -40,7 +39,7 @@ def delete_qod_session(sessionId: str):
api_client = pi_edge_factory.create_pi_edge_api_client()
response = api_client.delete_qod_session(sessionId=sessionId)
return response.json()
return response.text
except ValidationError as e:
return jsonify({"error": "Invalid input", "details": e.errors()}), 400
......@@ -85,7 +84,7 @@ def create_traffic_influence_resource(body: dict):
pi_edge_factory = PiEdgeAPIClientFactory()
api_client = pi_edge_factory.create_pi_edge_api_client()
response = api_client.create_traffic_influence_resource(body)
return response
return response.json()
except ValidationError as e:
return jsonify({"error": "Invalid input", "details": e.errors()}), 400
......@@ -100,7 +99,7 @@ def get_traffic_influence_resource(id: str):
pi_edge_factory = PiEdgeAPIClientFactory()
api_client = pi_edge_factory.create_pi_edge_api_client()
response = api_client.get_traffic_influence_resource(id)
return response
return response.json()
except ValidationError as e:
return jsonify({"error": "Invalid input", "details": e.errors()}), 400
......@@ -116,7 +115,7 @@ def delete_traffic_influence_resource(id: str):
pi_edge_factory = PiEdgeAPIClientFactory()
api_client = pi_edge_factory.create_pi_edge_api_client()
response = api_client.delete_traffic_influence_resource(id)
return response
return response.text
except ValidationError as e:
return jsonify({"error": "Invalid input", "details": e.errors()}), 400
......
......@@ -298,12 +298,12 @@ class PiEdgeAPIClient:
return e.args
def create_traffic_influence_resource(self, body_dict):
url = f"{self.base_url}/traffic-influences/"
url = f"{self.base_url}/traffic-influences"
request_headers = self._get_headers()
try:
response = requests.post(url, json=body_dict, headers=request_headers,verify=False)
response.raise_for_status()
return response.json()
return response
except Exception as e:
logger.info(e.args)
return e.args
......@@ -325,7 +325,7 @@ class PiEdgeAPIClient:
try:
response = requests.get(url, headers=request_headers,verify=False)
response.raise_for_status()
return response.json()
return response
except Exception as e:
logger.info(e.args)
return e.args
......@@ -336,7 +336,7 @@ class PiEdgeAPIClient:
try:
response = requests.get(url, headers=request_headers,verify=False)
response.raise_for_status()
return response.json()
return response
except Exception as e:
logger.info(e.args)
return e.args
......
......@@ -712,7 +712,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/'
$ref: '#/components/schemas/QoDSchema'
responses:
"200":
description: Session created.
......@@ -770,7 +770,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/'
$ref: '#/components/schemas/TrafficInfluenceSchema'
responses:
"200":
description: Resource created.
......@@ -1308,6 +1308,122 @@ components:
schemas:
QoDSchema:
type: object
properties:
device:
type: object
properties:
phoneNumber:
type: string
networkAccessIdentifier:
type: string
ipv4Address:
type: object
properties:
publicAddress:
type: string
publicPort:
type: integer
ipv6Address:
type: string
applicationServer:
type: object
properties:
ipv4Address:
type: string
ipv6Address:
type: string
devicePorts:
type: object
properties:
ranges:
type: array
items:
type: object
required:
- from
- to
properties:
from:
type: integer
to:
type: integer
ports:
type: array
items:
type: integer
applicationServerPorts:
type: object
properties:
ranges:
type: array
items:
type: object
required:
- from
- to
properties:
from:
type: integer
to:
type: integer
ports:
type: array
items:
type: integer
qosProfile:
type: string
sink:
type: string
duration:
type: integer
TrafficInfluenceSchema:
type: object
properties:
apiConsumerId:
type: string
appId:
type: string
appInstanceId:
type: string
edgeCloudRegion:
type: string
edgeCloudZoneId:
type: string
sourceTrafficFilters:
type: object
properties:
sourcePort:
type: integer
destinationTrafficFilters:
type: object
properties:
destinationPort:
type: integer
destinationProtocol:
type: string
notificationUri:
type: string
notificationAuthToken:
type: string
notificationSink:
type: object
properties:
sink:
type: string
sinkCredentials:
type: object
properties:
credentialtype:
type: string
accessToken:
type: string
accessTokenExpireUtc:
type: string
accessTokenType:
type: string
AccessEndpoint:
type: object
description: |
......@@ -1596,16 +1712,16 @@ components:
AppProvider:
type: string
pattern: ^[A-Za-z][A-Za-z0-9_]{7,63}$
# pattern: ^[A-Za-z][A-Za-z0-9_]{7,63}$
description: Human readable name of the Application Provider.
AppIdentifier:
pattern: "^[A-Za-z][A-Za-z0-9_]{7,63}$"
# pattern: "^[A-Za-z][A-Za-z0-9_]{7,63}$"
type: string
description: Identifier used to refer to an application.
AppProviderId:
pattern: "^[A-Za-z][A-Za-z0-9_]{7,63}$"
# pattern: "^[A-Za-z][A-Za-z0-9_]{7,63}$"
type: string
description: UserId of the app provider. Identifier is relevant only in context
of this federation.
......@@ -1654,7 +1770,7 @@ components:
description: "Latitude,Longitude as decimal fraction up to 4 digit precision"
InstanceIdentifier:
pattern: "^[A-Za-z0-9][A-Za-z0-9_]{6,62}[A-Za-z0-9]$"
# pattern: "^[A-Za-z0-9][A-Za-z0-9_]{6,62}[A-Za-z0-9]$"
type: string
description: Unique identifier generated by the partner OP to identify an instance
of the application on a specific zone.
......@@ -2745,14 +2861,3 @@ components:
status: 503
code: UNAVAILABLE
message: "Service unavailable"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment