From 9b6d5c664453fa1d5d0836a4d312ebc87047fe4e Mon Sep 17 00:00:00 2001 From: Pelayo Torres Date: Mon, 22 Jul 2024 11:36:50 +0200 Subject: [PATCH] REL18 Logging Service --- .../.openapi-generator/FILES | 11 +- .../.openapi-generator/VERSION | 2 +- .../README.md | 2 +- .../controllers/default_controller.py | 12 +- ..._controller_.py => security_controller.py} | 0 .../api_invocation_logs/encoder.py | 5 +- .../api_invocation_logs/models/__init__.py | 6 - .../models/{base_model_.py => base_model.py} | 9 +- .../models/interface_description.py | 99 ++++- .../models/invalid_param.py | 13 +- .../models/invocation_log.py | 29 +- .../api_invocation_logs/models/log.py | 85 +++-- .../api_invocation_logs/models/operation.py | 7 +- .../models/operation_any_of.py | 45 --- .../models/problem_details.py | 53 ++- .../api_invocation_logs/models/protocol.py | 7 +- .../models/protocol_any_of.py | 42 --- .../models/security_method.py | 7 +- .../models/security_method_any_of.py | 43 --- .../api_invocation_logs/openapi/openapi.yaml | 345 +++++++++++------- .../api_invocation_logs/test/__init__.py | 16 + .../test/test_default_controller.py | 34 ++ .../api_invocation_logs/typing_utils.py | 2 - .../api_invocation_logs/util.py | 13 +- .../git_push.sh | 6 +- .../setup.py | 4 +- .../test-requirements.txt | 6 +- .../tox.ini | 2 +- 28 files changed, 459 insertions(+), 446 deletions(-) rename services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/{security_controller_.py => security_controller.py} (100%) rename services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/{base_model_.py => base_model.py} (92%) delete mode 100644 services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation_any_of.py delete mode 100644 services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol_any_of.py delete mode 100644 services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method_any_of.py create mode 100644 services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py create mode 100644 services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES index 42622dc..691fa78 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES @@ -1,32 +1,31 @@ .dockerignore .gitignore +.openapi-generator-ignore .travis.yml Dockerfile README.md +git_push.sh api_invocation_logs/__init__.py api_invocation_logs/__main__.py api_invocation_logs/controllers/__init__.py api_invocation_logs/controllers/default_controller.py -api_invocation_logs/controllers/security_controller_.py +api_invocation_logs/controllers/security_controller.py api_invocation_logs/encoder.py api_invocation_logs/models/__init__.py -api_invocation_logs/models/base_model_.py +api_invocation_logs/models/base_model.py api_invocation_logs/models/interface_description.py api_invocation_logs/models/invalid_param.py api_invocation_logs/models/invocation_log.py api_invocation_logs/models/log.py api_invocation_logs/models/operation.py -api_invocation_logs/models/operation_any_of.py api_invocation_logs/models/problem_details.py api_invocation_logs/models/protocol.py -api_invocation_logs/models/protocol_any_of.py api_invocation_logs/models/security_method.py -api_invocation_logs/models/security_method_any_of.py api_invocation_logs/openapi/openapi.yaml api_invocation_logs/test/__init__.py +api_invocation_logs/test/test_default_controller.py api_invocation_logs/typing_utils.py api_invocation_logs/util.py -git_push.sh requirements.txt setup.py test-requirements.txt diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION index 4b448de..18bb418 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0-SNAPSHOT \ No newline at end of file +7.5.0 diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md b/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md index 4c9ab92..9d33023 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m api_invocation_logs +python3 -m openapi_server ``` and open your browser to here: diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py index 7ce9972..dea9277 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py @@ -1,6 +1,11 @@ import connexion +from typing import Dict +from typing import Tuple +from typing import Union -from ..models.invocation_log import InvocationLog # noqa: E501 +from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 +from api_invocation_logs.models.problem_details import ProblemDetails # noqa: E501 +from api_invocation_logs import util from ..core.invocationlogs import LoggingInvocationOperations @@ -14,7 +19,6 @@ logging_invocation_operations = LoggingInvocationOperations() valid_user = ControlAccess() - def cert_validation(): def _cert_validation(f): @wraps(f) @@ -51,17 +55,15 @@ def aef_id_logs_post(aef_id, body): # noqa: E501 :param invocation_log: :type invocation_log: dict | bytes - :rtype: InvocationLog + :rtype: Union[InvocationLog, Tuple[InvocationLog, int], Tuple[InvocationLog, int, Dict[str, str]] """ current_app.logger.info("API Invocation Logs") if connexion.request.is_json: body = InvocationLog.from_dict(connexion.request.get_json()) # noqa: E501 - res = logging_invocation_operations.add_invocationlog(aef_id, body) if res.status_code == 201: current_app.logger.info("Invocation Logs stored successfully") return res - diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller_.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller.py similarity index 100% rename from services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller_.py rename to services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller.py diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/encoder.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/encoder.py index 80bad8f..ab1ac22 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/encoder.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/encoder.py @@ -1,7 +1,6 @@ from connexion.apps.flask_app import FlaskJSONEncoder -import six -from models.base_model_ import Model +from api_invocation_logs.models.base_model import Model class JSONEncoder(FlaskJSONEncoder): @@ -10,7 +9,7 @@ class JSONEncoder(FlaskJSONEncoder): def default(self, o): if isinstance(o, Model): dikt = {} - for attr, _ in six.iteritems(o.openapi_types): + for attr in o.openapi_types: value = getattr(o, attr) if value is None and not self.include_nulls: continue diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py index 6660505..fa9b0e5 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/__init__.py @@ -1,16 +1,10 @@ -# coding: utf-8 - # flake8: noqa -from __future__ import absolute_import # import models into model package from api_invocation_logs.models.interface_description import InterfaceDescription from api_invocation_logs.models.invalid_param import InvalidParam from api_invocation_logs.models.invocation_log import InvocationLog from api_invocation_logs.models.log import Log from api_invocation_logs.models.operation import Operation -from api_invocation_logs.models.operation_any_of import OperationAnyOf from api_invocation_logs.models.problem_details import ProblemDetails from api_invocation_logs.models.protocol import Protocol -from api_invocation_logs.models.protocol_any_of import ProtocolAnyOf from api_invocation_logs.models.security_method import SecurityMethod -from api_invocation_logs.models.security_method_any_of import SecurityMethodAnyOf diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model_.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py similarity index 92% rename from services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model_.py rename to services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py index 31d9751..642d94a 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model_.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/base_model.py @@ -1,6 +1,5 @@ import pprint -import six import typing from api_invocation_logs import util @@ -8,14 +7,14 @@ from api_invocation_logs import util T = typing.TypeVar('T') -class Model(object): +class Model: # openapiTypes: The key is attribute name and the # value is attribute type. - openapi_types = {} + openapi_types: typing.Dict[str, type] = {} # attributeMap: The key is attribute name and the # value is json key in definition. - attribute_map = {} + attribute_map: typing.Dict[str, str] = {} @classmethod def from_dict(cls: typing.Type[T], dikt) -> T: @@ -29,7 +28,7 @@ class Model(object): """ result = {} - for attr, _ in six.iteritems(self.openapi_types): + for attr in self.openapi_types: value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py index b484946..89a5d90 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py @@ -1,15 +1,14 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.security_method import SecurityMethod +import re from api_invocation_logs import util from api_invocation_logs.models.security_method import SecurityMethod # noqa: E501 +import re # noqa: E501 class InterfaceDescription(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,35 +16,45 @@ class InterfaceDescription(Model): Do not edit the class manually. """ - def __init__(self, ipv4_addr=None, ipv6_addr=None, port=None, security_methods=None): # noqa: E501 + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501 """InterfaceDescription - a model defined in OpenAPI :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 :type ipv4_addr: str :param ipv6_addr: The ipv6_addr of this InterfaceDescription. # noqa: E501 :type ipv6_addr: str + :param fqdn: The fqdn of this InterfaceDescription. # noqa: E501 + :type fqdn: str :param port: The port of this InterfaceDescription. # noqa: E501 :type port: int + :param api_prefix: The api_prefix of this InterfaceDescription. # noqa: E501 + :type api_prefix: str :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 :type security_methods: List[SecurityMethod] """ self.openapi_types = { 'ipv4_addr': str, 'ipv6_addr': str, + 'fqdn': str, 'port': int, + 'api_prefix': str, 'security_methods': List[SecurityMethod] } self.attribute_map = { 'ipv4_addr': 'ipv4Addr', 'ipv6_addr': 'ipv6Addr', + 'fqdn': 'fqdn', 'port': 'port', + 'api_prefix': 'apiPrefix', 'security_methods': 'securityMethods' } self._ipv4_addr = ipv4_addr self._ipv6_addr = ipv6_addr + self._fqdn = fqdn self._port = port + self._api_prefix = api_prefix self._security_methods = security_methods @classmethod @@ -60,10 +69,10 @@ class InterfaceDescription(Model): return util.deserialize_model(dikt, cls) @property - def ipv4_addr(self): + def ipv4_addr(self) -> str: """Gets the ipv4_addr of this InterfaceDescription. - string identifying a Ipv4 address formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166. # noqa: E501 + string identifying a Ipv4 address formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166. # noqa: E501 :return: The ipv4_addr of this InterfaceDescription. :rtype: str @@ -71,10 +80,10 @@ class InterfaceDescription(Model): return self._ipv4_addr @ipv4_addr.setter - def ipv4_addr(self, ipv4_addr): + def ipv4_addr(self, ipv4_addr: str): """Sets the ipv4_addr of this InterfaceDescription. - string identifying a Ipv4 address formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166. # noqa: E501 + string identifying a Ipv4 address formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166. # noqa: E501 :param ipv4_addr: The ipv4_addr of this InterfaceDescription. :type ipv4_addr: str @@ -83,10 +92,10 @@ class InterfaceDescription(Model): self._ipv4_addr = ipv4_addr @property - def ipv6_addr(self): + def ipv6_addr(self) -> str: """Gets the ipv6_addr of this InterfaceDescription. - string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. # noqa: E501 + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. # noqa: E501 :return: The ipv6_addr of this InterfaceDescription. :rtype: str @@ -94,10 +103,10 @@ class InterfaceDescription(Model): return self._ipv6_addr @ipv6_addr.setter - def ipv6_addr(self, ipv6_addr): + def ipv6_addr(self, ipv6_addr: str): """Sets the ipv6_addr of this InterfaceDescription. - string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. # noqa: E501 + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. # noqa: E501 :param ipv6_addr: The ipv6_addr of this InterfaceDescription. :type ipv6_addr: str @@ -106,7 +115,36 @@ class InterfaceDescription(Model): self._ipv6_addr = ipv6_addr @property - def port(self): + def fqdn(self) -> str: + """Gets the fqdn of this InterfaceDescription. + + Fully Qualified Domain Name # noqa: E501 + + :return: The fqdn of this InterfaceDescription. + :rtype: str + """ + return self._fqdn + + @fqdn.setter + def fqdn(self, fqdn: str): + """Sets the fqdn of this InterfaceDescription. + + Fully Qualified Domain Name # noqa: E501 + + :param fqdn: The fqdn of this InterfaceDescription. + :type fqdn: str + """ + if fqdn is not None and len(fqdn) > 253: + raise ValueError("Invalid value for `fqdn`, length must be less than or equal to `253`") # noqa: E501 + if fqdn is not None and len(fqdn) < 4: + raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501 + if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501 + raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501 + + self._fqdn = fqdn + + @property + def port(self) -> int: """Gets the port of this InterfaceDescription. Unsigned integer with valid values between 0 and 65535. # noqa: E501 @@ -117,7 +155,7 @@ class InterfaceDescription(Model): return self._port @port.setter - def port(self, port): + def port(self, port: int): """Sets the port of this InterfaceDescription. Unsigned integer with valid values between 0 and 65535. # noqa: E501 @@ -133,10 +171,33 @@ class InterfaceDescription(Model): self._port = port @property - def security_methods(self): + def api_prefix(self) -> str: + """Gets the api_prefix of this InterfaceDescription. + + A string representing a sequence of path segments that starts with the slash character. # noqa: E501 + + :return: The api_prefix of this InterfaceDescription. + :rtype: str + """ + return self._api_prefix + + @api_prefix.setter + def api_prefix(self, api_prefix: str): + """Sets the api_prefix of this InterfaceDescription. + + A string representing a sequence of path segments that starts with the slash character. # noqa: E501 + + :param api_prefix: The api_prefix of this InterfaceDescription. + :type api_prefix: str + """ + + self._api_prefix = api_prefix + + @property + def security_methods(self) -> List[SecurityMethod]: """Gets the security_methods of this InterfaceDescription. - Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. # noqa: E501 + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. # noqa: E501 :return: The security_methods of this InterfaceDescription. :rtype: List[SecurityMethod] @@ -144,10 +205,10 @@ class InterfaceDescription(Model): return self._security_methods @security_methods.setter - def security_methods(self, security_methods): + def security_methods(self, security_methods: List[SecurityMethod]): """Sets the security_methods of this InterfaceDescription. - Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. # noqa: E501 + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. # noqa: E501 :param security_methods: The security_methods of this InterfaceDescription. :type security_methods: List[SecurityMethod] diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py index 58f04d6..d7ec573 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invalid_param.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model +from api_invocation_logs.models.base_model import Model from api_invocation_logs import util @@ -48,7 +45,7 @@ class InvalidParam(Model): return util.deserialize_model(dikt, cls) @property - def param(self): + def param(self) -> str: """Gets the param of this InvalidParam. Attribute's name encoded as a JSON Pointer, or header's name. # noqa: E501 @@ -59,7 +56,7 @@ class InvalidParam(Model): return self._param @param.setter - def param(self, param): + def param(self, param: str): """Sets the param of this InvalidParam. Attribute's name encoded as a JSON Pointer, or header's name. # noqa: E501 @@ -73,7 +70,7 @@ class InvalidParam(Model): self._param = param @property - def reason(self): + def reason(self) -> str: """Gets the reason of this InvalidParam. A human-readable reason, e.g. \"must be a positive integer\". # noqa: E501 @@ -84,7 +81,7 @@ class InvalidParam(Model): return self._reason @reason.setter - def reason(self, reason): + def reason(self, reason: str): """Sets the reason of this InvalidParam. A human-readable reason, e.g. \"must be a positive integer\". # noqa: E501 diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py index 79a228c..ded1b79 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/invocation_log.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.log import Log import re from api_invocation_logs import util @@ -62,10 +59,10 @@ class InvocationLog(Model): return util.deserialize_model(dikt, cls) @property - def aef_id(self): + def aef_id(self) -> str: """Gets the aef_id of this InvocationLog. - Identity information of the API exposing function requesting logging of service API invocations # noqa: E501 + Identity information of the API exposing function requesting logging of service API invocations # noqa: E501 :return: The aef_id of this InvocationLog. :rtype: str @@ -73,10 +70,10 @@ class InvocationLog(Model): return self._aef_id @aef_id.setter - def aef_id(self, aef_id): + def aef_id(self, aef_id: str): """Sets the aef_id of this InvocationLog. - Identity information of the API exposing function requesting logging of service API invocations # noqa: E501 + Identity information of the API exposing function requesting logging of service API invocations # noqa: E501 :param aef_id: The aef_id of this InvocationLog. :type aef_id: str @@ -87,7 +84,7 @@ class InvocationLog(Model): self._aef_id = aef_id @property - def api_invoker_id(self): + def api_invoker_id(self) -> str: """Gets the api_invoker_id of this InvocationLog. Identity of the API invoker which invoked the service API # noqa: E501 @@ -98,7 +95,7 @@ class InvocationLog(Model): return self._api_invoker_id @api_invoker_id.setter - def api_invoker_id(self, api_invoker_id): + def api_invoker_id(self, api_invoker_id: str): """Sets the api_invoker_id of this InvocationLog. Identity of the API invoker which invoked the service API # noqa: E501 @@ -112,7 +109,7 @@ class InvocationLog(Model): self._api_invoker_id = api_invoker_id @property - def logs(self): + def logs(self) -> List[Log]: """Gets the logs of this InvocationLog. Service API invocation log # noqa: E501 @@ -123,7 +120,7 @@ class InvocationLog(Model): return self._logs @logs.setter - def logs(self, logs): + def logs(self, logs: List[Log]): """Sets the logs of this InvocationLog. Service API invocation log # noqa: E501 @@ -139,10 +136,10 @@ class InvocationLog(Model): self._logs = logs @property - def supported_features(self): + def supported_features(self) -> str: """Gets the supported_features of this InvocationLog. - A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported # noqa: E501 + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 :return: The supported_features of this InvocationLog. :rtype: str @@ -150,10 +147,10 @@ class InvocationLog(Model): return self._supported_features @supported_features.setter - def supported_features(self, supported_features): + def supported_features(self, supported_features: str): """Sets the supported_features of this InvocationLog. - A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported # noqa: E501 + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 :param supported_features: The supported_features of this InvocationLog. :type supported_features: str diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py index 8f45706..41076a0 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.interface_description import InterfaceDescription from api_invocation_logs.models.operation import Operation from api_invocation_logs.models.protocol import Protocol @@ -119,7 +116,7 @@ class Log(Model): return util.deserialize_model(dikt, cls) @property - def api_id(self): + def api_id(self) -> str: """Gets the api_id of this Log. String identifying the API invoked. # noqa: E501 @@ -130,7 +127,7 @@ class Log(Model): return self._api_id @api_id.setter - def api_id(self, api_id): + def api_id(self, api_id: str): """Sets the api_id of this Log. String identifying the API invoked. # noqa: E501 @@ -144,10 +141,10 @@ class Log(Model): self._api_id = api_id @property - def api_name(self): + def api_name(self) -> str: """Gets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. # noqa: E501 + Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 :return: The api_name of this Log. :rtype: str @@ -155,10 +152,10 @@ class Log(Model): return self._api_name @api_name.setter - def api_name(self, api_name): + def api_name(self, api_name: str): """Sets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. # noqa: E501 + Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 :param api_name: The api_name of this Log. :type api_name: str @@ -169,7 +166,7 @@ class Log(Model): self._api_name = api_name @property - def api_version(self): + def api_version(self) -> str: """Gets the api_version of this Log. Version of the API which was invoked # noqa: E501 @@ -180,7 +177,7 @@ class Log(Model): return self._api_version @api_version.setter - def api_version(self, api_version): + def api_version(self, api_version: str): """Sets the api_version of this Log. Version of the API which was invoked # noqa: E501 @@ -194,7 +191,7 @@ class Log(Model): self._api_version = api_version @property - def resource_name(self): + def resource_name(self) -> str: """Gets the resource_name of this Log. Name of the specific resource invoked # noqa: E501 @@ -205,7 +202,7 @@ class Log(Model): return self._resource_name @resource_name.setter - def resource_name(self, resource_name): + def resource_name(self, resource_name: str): """Sets the resource_name of this Log. Name of the specific resource invoked # noqa: E501 @@ -219,7 +216,7 @@ class Log(Model): self._resource_name = resource_name @property - def uri(self): + def uri(self) -> str: """Gets the uri of this Log. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -230,7 +227,7 @@ class Log(Model): return self._uri @uri.setter - def uri(self, uri): + def uri(self, uri: str): """Sets the uri of this Log. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -242,7 +239,7 @@ class Log(Model): self._uri = uri @property - def protocol(self): + def protocol(self) -> Protocol: """Gets the protocol of this Log. @@ -252,7 +249,7 @@ class Log(Model): return self._protocol @protocol.setter - def protocol(self, protocol): + def protocol(self, protocol: Protocol): """Sets the protocol of this Log. @@ -265,7 +262,7 @@ class Log(Model): self._protocol = protocol @property - def operation(self): + def operation(self) -> Operation: """Gets the operation of this Log. @@ -275,7 +272,7 @@ class Log(Model): return self._operation @operation.setter - def operation(self, operation): + def operation(self, operation: Operation): """Sets the operation of this Log. @@ -286,7 +283,7 @@ class Log(Model): self._operation = operation @property - def result(self): + def result(self) -> str: """Gets the result of this Log. For HTTP protocol, it contains HTTP status code of the invocation # noqa: E501 @@ -297,7 +294,7 @@ class Log(Model): return self._result @result.setter - def result(self, result): + def result(self, result: str): """Sets the result of this Log. For HTTP protocol, it contains HTTP status code of the invocation # noqa: E501 @@ -311,7 +308,7 @@ class Log(Model): self._result = result @property - def invocation_time(self): + def invocation_time(self) -> datetime: """Gets the invocation_time of this Log. string with format \"date-time\" as defined in OpenAPI. # noqa: E501 @@ -322,7 +319,7 @@ class Log(Model): return self._invocation_time @invocation_time.setter - def invocation_time(self, invocation_time): + def invocation_time(self, invocation_time: datetime): """Sets the invocation_time of this Log. string with format \"date-time\" as defined in OpenAPI. # noqa: E501 @@ -334,10 +331,10 @@ class Log(Model): self._invocation_time = invocation_time @property - def invocation_latency(self): + def invocation_latency(self) -> int: """Gets the invocation_latency of this Log. - Unsigned integer identifying a period of time in units of milliseconds. # noqa: E501 + Represents a period of time in units of milliseconds. # noqa: E501 :return: The invocation_latency of this Log. :rtype: int @@ -345,10 +342,10 @@ class Log(Model): return self._invocation_latency @invocation_latency.setter - def invocation_latency(self, invocation_latency): + def invocation_latency(self, invocation_latency: int): """Sets the invocation_latency of this Log. - Unsigned integer identifying a period of time in units of milliseconds. # noqa: E501 + Represents a period of time in units of milliseconds. # noqa: E501 :param invocation_latency: The invocation_latency of this Log. :type invocation_latency: int @@ -359,10 +356,10 @@ class Log(Model): self._invocation_latency = invocation_latency @property - def input_parameters(self): + def input_parameters(self) -> object: """Gets the input_parameters of this Log. - List of input parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 + List of input parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 :return: The input_parameters of this Log. :rtype: object @@ -370,10 +367,10 @@ class Log(Model): return self._input_parameters @input_parameters.setter - def input_parameters(self, input_parameters): + def input_parameters(self, input_parameters: object): """Sets the input_parameters of this Log. - List of input parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 + List of input parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 :param input_parameters: The input_parameters of this Log. :type input_parameters: object @@ -382,10 +379,10 @@ class Log(Model): self._input_parameters = input_parameters @property - def output_parameters(self): + def output_parameters(self) -> object: """Gets the output_parameters of this Log. - List of output parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 + List of output parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 :return: The output_parameters of this Log. :rtype: object @@ -393,10 +390,10 @@ class Log(Model): return self._output_parameters @output_parameters.setter - def output_parameters(self, output_parameters): + def output_parameters(self, output_parameters: object): """Sets the output_parameters of this Log. - List of output parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 + List of output parameters. Can be any value - string, number, boolean, array or object. # noqa: E501 :param output_parameters: The output_parameters of this Log. :type output_parameters: object @@ -405,7 +402,7 @@ class Log(Model): self._output_parameters = output_parameters @property - def src_interface(self): + def src_interface(self) -> InterfaceDescription: """Gets the src_interface of this Log. @@ -415,7 +412,7 @@ class Log(Model): return self._src_interface @src_interface.setter - def src_interface(self, src_interface): + def src_interface(self, src_interface: InterfaceDescription): """Sets the src_interface of this Log. @@ -426,7 +423,7 @@ class Log(Model): self._src_interface = src_interface @property - def dest_interface(self): + def dest_interface(self) -> InterfaceDescription: """Gets the dest_interface of this Log. @@ -436,7 +433,7 @@ class Log(Model): return self._dest_interface @dest_interface.setter - def dest_interface(self, dest_interface): + def dest_interface(self, dest_interface: InterfaceDescription): """Sets the dest_interface of this Log. @@ -447,10 +444,10 @@ class Log(Model): self._dest_interface = dest_interface @property - def fwd_interface(self): + def fwd_interface(self) -> str: """Gets the fwd_interface of this Log. - It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 # noqa: E501 + It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 # noqa: E501 :return: The fwd_interface of this Log. :rtype: str @@ -458,10 +455,10 @@ class Log(Model): return self._fwd_interface @fwd_interface.setter - def fwd_interface(self, fwd_interface): + def fwd_interface(self, fwd_interface: str): """Sets the fwd_interface of this Log. - It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 # noqa: E501 + It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 # noqa: E501 :param fwd_interface: The fwd_interface of this Log. :type fwd_interface: str diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py index e4cdbe4..513f6d0 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation.py @@ -1,15 +1,10 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model -from api_invocation_logs.models.operation_any_of import OperationAnyOf +from api_invocation_logs.models.base_model import Model from api_invocation_logs import util -from api_invocation_logs.models.operation_any_of import OperationAnyOf # noqa: E501 class Operation(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation_any_of.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation_any_of.py deleted file mode 100644 index 46c1921..0000000 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/operation_any_of.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model_ import Model -from api_invocation_logs import util - - -class OperationAnyOf(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - GET = "GET" - POST = "POST" - PUT = "PUT" - PATCH = "PATCH" - DELETE = "DELETE" - def __init__(self): # noqa: E501 - """OperationAnyOf - a model defined in OpenAPI - - """ - self.openapi_types = { - } - - self.attribute_map = { - } - - @classmethod - def from_dict(cls, dikt) -> 'OperationAnyOf': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Operation_anyOf of this OperationAnyOf. # noqa: E501 - :rtype: OperationAnyOf - """ - return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py index e4cb2c9..5774417 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/problem_details.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model +from api_invocation_logs.models.base_model import Model from api_invocation_logs.models.invalid_param import InvalidParam import re from api_invocation_logs import util @@ -82,7 +79,7 @@ class ProblemDetails(Model): return util.deserialize_model(dikt, cls) @property - def type(self): + def type(self) -> str: """Gets the type of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -93,7 +90,7 @@ class ProblemDetails(Model): return self._type @type.setter - def type(self, type): + def type(self, type: str): """Sets the type of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -105,10 +102,10 @@ class ProblemDetails(Model): self._type = type @property - def title(self): + def title(self) -> str: """Gets the title of this ProblemDetails. - A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 + A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 :return: The title of this ProblemDetails. :rtype: str @@ -116,10 +113,10 @@ class ProblemDetails(Model): return self._title @title.setter - def title(self, title): + def title(self, title: str): """Sets the title of this ProblemDetails. - A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 + A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 :param title: The title of this ProblemDetails. :type title: str @@ -128,7 +125,7 @@ class ProblemDetails(Model): self._title = title @property - def status(self): + def status(self) -> int: """Gets the status of this ProblemDetails. The HTTP status code for this occurrence of the problem. # noqa: E501 @@ -139,7 +136,7 @@ class ProblemDetails(Model): return self._status @status.setter - def status(self, status): + def status(self, status: int): """Sets the status of this ProblemDetails. The HTTP status code for this occurrence of the problem. # noqa: E501 @@ -151,7 +148,7 @@ class ProblemDetails(Model): self._status = status @property - def detail(self): + def detail(self) -> str: """Gets the detail of this ProblemDetails. A human-readable explanation specific to this occurrence of the problem. # noqa: E501 @@ -162,7 +159,7 @@ class ProblemDetails(Model): return self._detail @detail.setter - def detail(self, detail): + def detail(self, detail: str): """Sets the detail of this ProblemDetails. A human-readable explanation specific to this occurrence of the problem. # noqa: E501 @@ -174,7 +171,7 @@ class ProblemDetails(Model): self._detail = detail @property - def instance(self): + def instance(self) -> str: """Gets the instance of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -185,7 +182,7 @@ class ProblemDetails(Model): return self._instance @instance.setter - def instance(self, instance): + def instance(self, instance: str): """Sets the instance of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -197,10 +194,10 @@ class ProblemDetails(Model): self._instance = instance @property - def cause(self): + def cause(self) -> str: """Gets the cause of this ProblemDetails. - A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 :return: The cause of this ProblemDetails. :rtype: str @@ -208,10 +205,10 @@ class ProblemDetails(Model): return self._cause @cause.setter - def cause(self, cause): + def cause(self, cause: str): """Sets the cause of this ProblemDetails. - A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 :param cause: The cause of this ProblemDetails. :type cause: str @@ -220,10 +217,10 @@ class ProblemDetails(Model): self._cause = cause @property - def invalid_params(self): + def invalid_params(self) -> List[InvalidParam]: """Gets the invalid_params of this ProblemDetails. - Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 + Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 :return: The invalid_params of this ProblemDetails. :rtype: List[InvalidParam] @@ -231,10 +228,10 @@ class ProblemDetails(Model): return self._invalid_params @invalid_params.setter - def invalid_params(self, invalid_params): + def invalid_params(self, invalid_params: List[InvalidParam]): """Sets the invalid_params of this ProblemDetails. - Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 + Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 :param invalid_params: The invalid_params of this ProblemDetails. :type invalid_params: List[InvalidParam] @@ -245,10 +242,10 @@ class ProblemDetails(Model): self._invalid_params = invalid_params @property - def supported_features(self): + def supported_features(self) -> str: """Gets the supported_features of this ProblemDetails. - A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported # noqa: E501 + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 :return: The supported_features of this ProblemDetails. :rtype: str @@ -256,10 +253,10 @@ class ProblemDetails(Model): return self._supported_features @supported_features.setter - def supported_features(self, supported_features): + def supported_features(self, supported_features: str): """Sets the supported_features of this ProblemDetails. - A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported # noqa: E501 + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 :param supported_features: The supported_features of this ProblemDetails. :type supported_features: str diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py index 023ba4d..ec4bf3b 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol.py @@ -1,15 +1,10 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model -from api_invocation_logs.models.protocol_any_of import ProtocolAnyOf +from api_invocation_logs.models.base_model import Model from api_invocation_logs import util -from api_invocation_logs.models.protocol_any_of import ProtocolAnyOf # noqa: E501 class Protocol(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol_any_of.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol_any_of.py deleted file mode 100644 index b7966df..0000000 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/protocol_any_of.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model_ import Model -from api_invocation_logs import util - - -class ProtocolAnyOf(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _1_1 = "HTTP_1_1" - _2 = "HTTP_2" - def __init__(self): # noqa: E501 - """ProtocolAnyOf - a model defined in OpenAPI - - """ - self.openapi_types = { - } - - self.attribute_map = { - } - - @classmethod - def from_dict(cls, dikt) -> 'ProtocolAnyOf': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Protocol_anyOf of this ProtocolAnyOf. # noqa: E501 - :rtype: ProtocolAnyOf - """ - return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py index e059b81..b47fd3e 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method.py @@ -1,15 +1,10 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from api_invocation_logs.models.base_model_ import Model -from api_invocation_logs.models.security_method_any_of import SecurityMethodAnyOf +from api_invocation_logs.models.base_model import Model from api_invocation_logs import util -from api_invocation_logs.models.security_method_any_of import SecurityMethodAnyOf # noqa: E501 class SecurityMethod(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method_any_of.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method_any_of.py deleted file mode 100644 index 877c646..0000000 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/security_method_any_of.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from api_invocation_logs.models.base_model_ import Model -from api_invocation_logs import util - - -class SecurityMethodAnyOf(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - PSK = "PSK" - PKI = "PKI" - OAUTH = "OAUTH" - def __init__(self): # noqa: E501 - """SecurityMethodAnyOf - a model defined in OpenAPI - - """ - self.openapi_types = { - } - - self.attribute_map = { - } - - @classmethod - def from_dict(cls, dikt) -> 'SecurityMethodAnyOf': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The SecurityMethod_anyOf of this SecurityMethodAnyOf. # noqa: E501 - :rtype: SecurityMethodAnyOf - """ - return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml index 85b35aa..f1a9390 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml @@ -1,20 +1,18 @@ openapi: 3.0.0 info: - description: | - API for invocation logs. - © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. + description: "API for invocation logs. \n© 2022, 3GPP Organizational Partners (ARIB,\ + \ ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Logging_API_Invocation_API - version: 1.2.0-alpha.1 + version: 1.3.0-alpha.1 externalDocs: - description: 3GPP TS 29.222 V17.1.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ + description: 3GPP TS 29.222 V18.0.0 Common API Framework for 3GPP Northbound APIs + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: -- url: '{apiRoot}/api-invocation-logs/v1' +- url: "{apiRoot}/api-invocation-logs/v1" variables: apiRoot: default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222 + description: apiRoot as defined in clause 7.5 of 3GPP TS 29.222 paths: /{aefId}/logs: post: @@ -41,12 +39,12 @@ paths: application/json: schema: $ref: '#/components/schemas/InvocationLog' - description: Log of service API invocations provided by API exposing function - successfully stored on the CAPIF core function. + description: | + Log of service API invocations provided by API exposing function successfully stored on the CAPIF core function. headers: Location: - description: 'Contains the URI of the newly created resource, according - to the structure: {apiRoot}/api-invocation-logs/v1/{aefId}/logs/{logId}' + description: | + Contains the URI of the newly created resource, according to the structure {apiRoot}/api-invocation-logs/v1/{aefId}/logs/{logId} explode: false required: true schema: @@ -87,7 +85,7 @@ paths: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' - description: Payload Too Large + description: Content Too Large "415": content: application/problem+json: @@ -118,10 +116,73 @@ paths: /{aefId}/logs/{logId}: description: Creates a new log entry for service API invocations. components: + responses: + "400": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Bad request + "401": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Unauthorized + "403": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Forbidden + "404": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Not Found + "411": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Length Required + "413": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Content Too Large + "415": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Unsupported Media Type + "429": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Too Many Requests + "500": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server Error + "503": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Service Unavailable + default: + description: Generic Error schemas: InvocationLog: - description: Represents a set of Service API invocation logs to be stored in - a CAPIF core function. + description: | + Represents a set of Service API invocation logs to be stored in a CAPIF core function. example: supportedFeatures: supportedFeatures apiInvokerId: apiInvokerId @@ -132,9 +193,11 @@ components: srcInterface: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr fwdInterface: fwdInterface resourceName: resourceName @@ -142,14 +205,18 @@ components: inputParameters: "" invocationLatency: 0 result: result + protocol: HTTP_1_1 apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr + operation: GET apiId: apiId outputParameters: "" - apiName: apiName @@ -157,9 +224,11 @@ components: srcInterface: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr fwdInterface: fwdInterface resourceName: resourceName @@ -167,20 +236,24 @@ components: inputParameters: "" invocationLatency: 0 result: result + protocol: HTTP_1_1 apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr + operation: GET apiId: apiId outputParameters: "" properties: aefId: - description: Identity information of the API exposing function requesting - logging of service API invocations + description: | + Identity information of the API exposing function requesting logging of service API invocations title: aefId type: string apiInvokerId: @@ -195,19 +268,9 @@ components: title: logs type: array supportedFeatures: - description: A string used to indicate the features supported by an API - that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall - contain a bitmask indicating supported features in hexadecimal representation - Each character in the string shall take a value of "0" to "9", "a" to - "f" or "A" to "F" and shall represent the support of 4 features as described - in table 5.2.2-3. The most significant character representing the highest-numbered - features shall appear first in the string, and the character representing - features 1 to 4 shall appear last in the string. The list of features - and their numbering (starting with 1) are defined separately for each - API. If the string contains a lower number of characters than there are - defined features for an API, all features that would be represented by - characters that are not present in the string are not supported - pattern: ^[A-Fa-f0-9]*$ + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" title: supportedFeatures type: string required: @@ -224,9 +287,11 @@ components: srcInterface: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr fwdInterface: fwdInterface resourceName: resourceName @@ -234,14 +299,18 @@ components: inputParameters: "" invocationLatency: 0 result: result + protocol: HTTP_1_1 apiVersion: apiVersion destInterface: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr + operation: GET apiId: apiId outputParameters: "" properties: @@ -250,8 +319,8 @@ components: title: apiId type: string apiName: - description: Name of the API which was invoked, it is set as {apiName} part - of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. + description: | + Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. title: apiName type: string apiVersion: @@ -271,7 +340,7 @@ components: operation: $ref: '#/components/schemas/Operation' result: - description: For HTTP protocol, it contains HTTP status code of the invocation + description: "For HTTP protocol, it contains HTTP status code of the invocation" title: result type: string invocationTime: @@ -280,26 +349,25 @@ components: title: DateTime type: string invocationLatency: - description: Unsigned integer identifying a period of time in units of milliseconds. + description: Represents a period of time in units of milliseconds. minimum: 0 title: DurationMs type: integer inputParameters: - description: List of input parameters. Can be any value - string, number, - boolean, array or object. + description: | + List of input parameters. Can be any value - string, number, boolean, array or object. title: inputParameters outputParameters: - description: List of output parameters. Can be any value - string, number, - boolean, array or object. + description: | + List of output parameters. Can be any value - string, number, boolean, array or object. title: outputParameters srcInterface: $ref: '#/components/schemas/InterfaceDescription' destInterface: $ref: '#/components/schemas/InterfaceDescription' fwdInterface: - description: It includes the node identifier (as defined in IETF RFC 7239 - of all forwarding entities between the API invoker and the AEF, concatenated - with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 + description: | + It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 title: fwdInterface type: string required: @@ -312,7 +380,7 @@ components: title: Log type: object DurationMs: - description: Unsigned integer identifying a period of time in units of milliseconds. + description: Represents a period of time in units of milliseconds. minimum: 0 title: DurationMs type: integer @@ -324,8 +392,8 @@ components: title: Uri type: string title: - description: A short, human-readable summary of the problem type. It should - not change from occurrence to occurrence of the problem. + description: "A short, human-readable summary of the problem type. It should\ + \ not change from occurrence to occurrence of the problem. \n" title: title type: string status: @@ -342,33 +410,22 @@ components: title: Uri type: string cause: - description: A machine-readable application error cause specific to this - occurrence of the problem. This IE should be present and provide application-related - error information, if available. + description: | + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. title: cause type: string invalidParams: - description: Description of invalid parameters, for a request rejected due - to invalid parameters. + description: | + Description of invalid parameters, for a request rejected due to invalid parameters. items: $ref: '#/components/schemas/InvalidParam' minItems: 1 title: invalidParams type: array supportedFeatures: - description: A string used to indicate the features supported by an API - that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall - contain a bitmask indicating supported features in hexadecimal representation - Each character in the string shall take a value of "0" to "9", "a" to - "f" or "A" to "F" and shall represent the support of 4 features as described - in table 5.2.2-3. The most significant character representing the highest-numbered - features shall appear first in the string, and the character representing - features 1 to 4 shall appear last in the string. The list of features - and their numbering (starting with 1) are defined separately for each - API. If the string contains a lower number of characters than there are - defined features for an API, all features that would be represented by - characters that are not present in the string are not supported - pattern: ^[A-Fa-f0-9]*$ + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" title: supportedFeatures type: string title: ProblemDetails @@ -378,15 +435,16 @@ components: title: Uri type: string InvalidParam: - description: Represents the description of invalid parameters, for a request - rejected due to invalid parameters. + description: | + Represents the description of invalid parameters, for a request rejected due to invalid parameters. properties: param: - description: Attribute's name encoded as a JSON Pointer, or header's name. + description: "Attribute's name encoded as a JSON Pointer, or header's name." title: param type: string reason: - description: A human-readable reason, e.g. "must be a positive integer". + description: "A human-readable reason, e.g. \"must be a positive integer\"\ + ." title: reason type: string required: @@ -394,38 +452,43 @@ components: title: InvalidParam type: object SupportedFeatures: - description: A string used to indicate the features supported by an API that - is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain - a bitmask indicating supported features in hexadecimal representation Each - character in the string shall take a value of "0" to "9", "a" to "f" or "A" - to "F" and shall represent the support of 4 features as described in table 5.2.2-3. - The most significant character representing the highest-numbered features - shall appear first in the string, and the character representing features - 1 to 4 shall appear last in the string. The list of features and their numbering - (starting with 1) are defined separately for each API. If the string contains - a lower number of characters than there are defined features for an API, all - features that would be represented by characters that are not present in the - string are not supported - pattern: ^[A-Fa-f0-9]*$ + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" title: supportedFeatures type: string Protocol: anyOf: - - $ref: '#/components/schemas/Protocol_anyOf' + - enum: + - HTTP_1_1 + - HTTP_2 + - MQTT + - WEBSOCKET + type: string - description: | This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. type: string - description: | - Possible values are - HTTP_1_1: HTTP version 1.1 - HTTP_2: HTTP version 2 + description: "Indicates a protocol and protocol version used by the API. \n\ + Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ + \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ + \ Indicates that the protocol is Message Queuing Telemetry Transport.\n- WEBSOCKET:\ + \ Indicates that the protocol is Websocket.\n" title: Protocol Operation: anyOf: - - $ref: '#/components/schemas/Operation_anyOf' + - enum: + - GET + - POST + - PUT + - PATCH + - DELETE + type: string - description: | This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. type: string - description: | - Possible values are - GET: HTTP GET method - POST: HTTP POST method - PUT: HTTP PUT method - PATCH: HTTP PATCH method - DELETE: HTTP DELETE method + description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ + \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ + \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" title: Operation DateTime: description: string with format "date-time" as defined in OpenAPI. @@ -437,36 +500,53 @@ components: example: ipv6Addr: ipv6Addr securityMethods: - - null - - null + - PSK + - PSK + fqdn: fqdn port: 39500 + apiPrefix: apiPrefix ipv4Addr: ipv4Addr + nullable: true oneOf: - required: - ipv4Addr - required: - ipv6Addr + - required: + - fqdn properties: ipv4Addr: - description: string identifying a Ipv4 address formatted in the "dotted - decimal" notation as defined in IETF RFC 1166. + description: | + string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. title: Ipv4Addr type: string ipv6Addr: - description: string identifying a Ipv6 address formatted according to clause - 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 - of IETF RFC 5952 shall not be used. + description: | + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. title: Ipv6Addr type: string + fqdn: + description: Fully Qualified Domain Name + maxLength: 253 + minLength: 4 + pattern: "^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\\.)+[A-Za-z]{2,63}\\\ + .?$" + title: Fqdn + type: string port: description: Unsigned integer with valid values between 0 and 65535. maximum: 65535 minimum: 0 title: Port type: integer + apiPrefix: + description: | + A string representing a sequence of path segments that starts with the slash character. + title: apiPrefix + type: string securityMethods: - description: Security methods supported by the interface, it take precedence - over the security methods provided in AefProfile, for this specific interface. + description: | + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. items: $ref: '#/components/schemas/SecurityMethod' minItems: 1 @@ -476,49 +556,40 @@ components: type: object SecurityMethod: anyOf: - - $ref: '#/components/schemas/SecurityMethod_anyOf' + - enum: + - PSK + - PKI + - OAUTH + type: string - description: | This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. type: string - description: | - Possible values are - PSK: Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122 - PKI: Security method 2 (Using PKI) as described in 3GPP TS 33.122 - OAUTH: Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122 + description: "Indicates the security method. \nPossible values are:\n- PSK:\ + \ Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122.\n- PKI:\ + \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ + \ Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122.\n" title: SecurityMethod Ipv4Addr: - description: string identifying a Ipv4 address formatted in the "dotted decimal" - notation as defined in IETF RFC 1166. + description: | + string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. title: Ipv4Addr type: string Ipv6Addr: - description: string identifying a Ipv6 address formatted according to clause - 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of - IETF RFC 5952 shall not be used. + description: | + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. title: Ipv6Addr type: string + Fqdn: + description: Fully Qualified Domain Name + maxLength: 253 + minLength: 4 + pattern: "^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\\.)+[A-Za-z]{2,63}\\\ + .?$" + title: Fqdn + type: string Port: description: Unsigned integer with valid values between 0 and 65535. maximum: 65535 minimum: 0 title: Port type: integer - Protocol_anyOf: - enum: - - HTTP_1_1 - - HTTP_2 - title: Protocol_anyOf - type: string - Operation_anyOf: - enum: - - GET - - POST - - PUT - - PATCH - - DELETE - title: Operation_anyOf - type: string - SecurityMethod_anyOf: - enum: - - PSK - - PKI - - OAUTH - title: SecurityMethod_anyOf - type: string diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py new file mode 100644 index 0000000..52299ec --- /dev/null +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/__init__.py @@ -0,0 +1,16 @@ +import logging + +import connexion +from flask_testing import TestCase + +from api_invocation_logs.encoder import JSONEncoder + + +class BaseTestCase(TestCase): + + def create_app(self): + logging.getLogger('connexion.operation').setLevel('ERROR') + app = connexion.App(__name__, specification_dir='../openapi/') + app.app.json_encoder = JSONEncoder + app.add_api('openapi.yaml', pythonic_params=True) + return app.app diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py new file mode 100644 index 0000000..92ad8cf --- /dev/null +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py @@ -0,0 +1,34 @@ +import unittest + +from flask import json + +from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 +from api_invocation_logs.models.problem_details import ProblemDetails # noqa: E501 +from api_invocation_logs.test import BaseTestCase + + +class TestDefaultController(BaseTestCase): + """DefaultController integration test stubs""" + + def test_aef_id_logs_post(self): + """Test case for aef_id_logs_post + + + """ + invocation_log = {"supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","aefId":"aefId","logs":[{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""},{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""}]} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api-invocation-logs/v1/{aef_id}/logs'.format(aef_id='aef_id_example'), + method='POST', + headers=headers, + data=json.dumps(invocation_log), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py index 0563f81..74e3c91 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/typing_utils.py @@ -1,5 +1,3 @@ -# coding: utf-8 - import sys if sys.version_info < (3, 7): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/util.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/util.py index baaea56..f6fdbc5 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/util.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/util.py @@ -1,7 +1,7 @@ import datetime -import six -import typing_utils +import typing +from api_invocation_logs import typing_utils def serialize_clean_camel_case(obj): @@ -55,7 +55,6 @@ def dict_to_camel_case(my_dict): return result - def _deserialize(data, klass): """Deserializes dict, list, str into an object. @@ -67,7 +66,7 @@ def _deserialize(data, klass): if data is None: return None - if klass in six.integer_types or klass in (float, str, bool, bytearray): + if klass in (int, float, str, bool, bytearray): return _deserialize_primitive(data, klass) elif klass == object: return _deserialize_object(data) @@ -96,7 +95,7 @@ def _deserialize_primitive(data, klass): try: value = klass(data) except UnicodeEncodeError: - value = six.u(data) + value = data except TypeError: value = data return value @@ -161,7 +160,7 @@ def deserialize_model(data, klass): if not instance.openapi_types: return data - for attr, attr_type in six.iteritems(instance.openapi_types): + for attr, attr_type in instance.openapi_types.items(): if data is not None \ and instance.attribute_map[attr] in data \ and isinstance(data, (list, dict)): @@ -196,4 +195,4 @@ def _deserialize_dict(data, boxed_type): :rtype: dict """ return {k: _deserialize(v, boxed_type) - for k, v in six.iteritems(data)} + for k, v in data.items() } diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/git_push.sh b/services/TS29222_CAPIF_Logging_API_Invocation_API/git_push.sh index 9405f72..f53a75d 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/git_push.sh +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/git_push.sh @@ -1,7 +1,7 @@ #!/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 openapi-pestore-perl "minor update" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git 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://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py index cf63e4a..9b7d55e 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py @@ -1,5 +1,3 @@ -# coding: utf-8 - import sys from setuptools import setup, find_packages @@ -33,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['api_invocation_logs=api_invocation_logs.__main__:main']}, long_description="""\ - API for invocation logs. © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for invocation logs. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt b/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt index 202a684..58f51d6 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/test-requirements.txt @@ -1,4 +1,4 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=7.1.0 pytest-cov>=2.8.1 -pytest-randomly == 1.2.3 # needed for python 2.7+3.4 -Flask-Testing == 0.8.0 +pytest-randomly>=1.2.3 +Flask-Testing==0.8.1 diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/tox.ini b/services/TS29222_CAPIF_Logging_API_Invocation_API/tox.ini index 01a6d21..312ba2e 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/tox.ini +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/tox.ini @@ -5,7 +5,7 @@ skipsdist=True [testenv] deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt - {toxinidir} + {toxinidir} commands= pytest --cov=api_invocation_logs -- GitLab