openapi: 3.0.0
info:
  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.3.0-alpha.1
externalDocs:
  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"
  variables:
    apiRoot:
      default: https://example.com
      description: apiRoot as defined in clause 7.5 of 3GPP TS 29.222
paths:
  /{aefId}/logs:
    post:
      description: Creates a new log entry for service API invocations.
      operationId: aef_id_logs_post
      parameters:
      - description: Identifier of the API exposing function
        explode: false
        in: path
        name: aefId
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvocationLog'
        required: true
      responses:
        "201":
          content:
            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.
          headers:
            Location:
              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:
                type: string
              style: simple
        "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
      x-openapi-router-controller: api_invocation_logs.controllers.default_controller
  /{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.
      example:
        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: ""
      properties:
        aefId:
          description: |
            Identity information of the API exposing function requesting logging of service API invocations
          title: aefId
          type: string
        apiInvokerId:
          description: Identity of the API invoker which invoked the service API
          title: apiInvokerId
          type: string
        logs:
          description: Service API invocation log
          items:
            $ref: '#/components/schemas/Log'
          minItems: 1
          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]*$"
          title: supportedFeatures
          type: string
      required:
      - aefId
      - apiInvokerId
      - logs
      title: InvocationLog
      type: object
    Log:
      description: Represents an individual service API invocation log entry.
      example:
        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: ""
      properties:
        apiId:
          description: String identifying the API invoked.
          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 clause 5.2.4 of 3GPP TS 29.122.
          title: apiName
          type: string
        apiVersion:
          description: Version of the API which was invoked
          title: apiVersion
          type: string
        resourceName:
          description: Name of the specific resource invoked
          title: resourceName
          type: string
        uri:
          description: string providing an URI formatted according to IETF RFC 3986.
          title: Uri
          type: string
        protocol:
          $ref: '#/components/schemas/Protocol'
        operation:
          $ref: '#/components/schemas/Operation'
        result:
          description: "For HTTP protocol, it contains HTTP status code of the invocation"
          title: result
          type: string
        invocationTime:
          description: string with format "date-time" as defined in OpenAPI.
          format: date-time
          title: DateTime
          type: string
        invocationLatency:
          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.
          title: inputParameters
        outputParameters:
          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
          title: fwdInterface
          type: string
      required:
      - apiId
      - apiName
      - apiVersion
      - protocol
      - resourceName
      - result
      title: Log
      type: object
    DurationMs:
      description: Represents a period of time in units of milliseconds.
      minimum: 0
      title: DurationMs
      type: integer
    ProblemDetails:
      description: Represents additional information and details on an error response.
      properties:
        type:
          description: string providing an URI formatted according to IETF RFC 3986.
          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. \n"
          title: title
          type: string
        status:
          description: The HTTP status code for this occurrence of the problem.
          title: status
          type: integer
        detail:
          description: A human-readable explanation specific to this occurrence of
            the problem.
          title: detail
          type: string
        instance:
          description: string providing an URI formatted according to IETF RFC 3986.
          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.
          title: cause
          type: string
        invalidParams:
          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]*$"
          title: supportedFeatures
          type: string
      title: ProblemDetails
      type: object
    Uri:
      description: string providing an URI formatted according to IETF RFC 3986.
      title: Uri
      type: string
    InvalidParam:
      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."
          title: param
          type: string
        reason:
          description: "A human-readable reason, e.g. \"must be a positive integer\"\
            ."
          title: reason
          type: string
      required:
      - param
      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]*$"
      title: supportedFeatures
      type: string
    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: "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:
      - 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: "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.
      format: date-time
      title: DateTime
      type: string
    InterfaceDescription:
      description: Represents the description of an API's interface.
      example:
        ipv6Addr: ipv6Addr
        securityMethods:
        - 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.
          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.
          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.
          items:
            $ref: '#/components/schemas/SecurityMethod'
          minItems: 1
          title: securityMethods
          type: array
      title: InterfaceDescription
      type: object
    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: "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.
      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.
      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
