{
  "description": "This type represents a logging job. It shall comply with the provisions defined in table 8.6.2.6-1.",
  "type": "object",
  "required": ["id", "objectInstanceIds", "jobCriteria", "jobConfig", "_links"],
  "properties": {
    "id": {
      "description": "An identifier with the intention of being globally unique.\n",
      "type": "string"
    },
    "objectInstanceIds": {
      "description": "Identifiers of the object instance for which logging information is collected. This attribute shall contain the identifier of the instance of the object that is logged according to their type.",
      "type": "array",
      "items": {
        "description": "This type represents the identifier to reference a managed object of a  particular type. \n",
        "type": "object",
        "properties": {
          "type": {
            "description": "Indicates the type of managed object. Permitted values:\n  - MANO_ENTITY\n  - MANO_SERVICE\n  - MANO_SERVICE_IF\n  - CONSUMED_MANO_IF\n  - MANO_ENTITY_COMPONENT\n\nThe \"MANO_ENTITY COMPONENT\" is only applicable if attribute \"manoEntityComponents\" in \"ManoEntity\" is supported by the API producer.\n",
            "type": "string",
            "enum": [
              "MANO_ENTITY",
              "MANO_SERVICE",
              "MANO_SERVICE_IF",
              "CONSUMED_MANO_IF",
              "MANO_ENTITY_COMPONENT"
            ]
          },
          "objectId": {
            "description": "An identifier with the intention of being globally unique.\n",
            "type": "string"
          },
          "subObjectId": {
            "description": "An identifier that is unique for the respective type within a NFV-MANO functional entity, but that need not be globally unique. Representation: string of variable length..\n",
            "type": "string"
          }
        },
        "required": ["type", "objectId"]
      }
    },
    "jobCriteria": {
      "description": "This type represents collection criteria for logging jobs. * NOTE:\tThe value of the loggingType has dependency on the object that is requested to be logged\n        (refer to the CreateLoggingJobRequest): a) the logging of messages is only applicable to\n        ManoServiceInterface and ConsumedManoInterface objects.",
      "type": "object",
      "required": ["loggingType"],
      "properties": {
        "loggingType": {
          "description": "Type of logging. This defines the types of logged information to collect.\nPermitted values: - MESSAGES: logged NFV-MANO service interface messages. - SERVICES: logged messages about processes pertaining to NFV-MANO services. - SYSTEM: logged messages about the NFV-MANO functional entityΓÇÖs system enabled by the provider.\nSee note.",
          "type": "string",
          "enum": ["MESSAGES", "SERVICES", "SYSTEM"]
        },
        "messagesLogDetail": {
          "description": "This type represents criteria for logging jobs to collect logged messages on NFV-MANO service interfaces. * NOTE:\tIf a matching pattern is present, at least one of the \"srcIpAddress\", \"dstIpAddress\", \"requestMethod\",\n        \"requestUriPattern\" or \"responseCodes\" shall be provided.",
          "type": "object",
          "required": ["direction"],
          "properties": {
            "direction": {
              "description": "The direction of the interface messages to match.\nPermitted values: - IN: input messages into the interface. - OUT: output messages from the interface. - ALL: both input and output messages into/from the interface.",
              "type": "string",
              "enum": ["IN", "OUT", "ALL"]
            },
            "matchingPatterns": {
              "description": "Patterns to be matched in the interface message. If provided, only messages that match all the values provided in the sub-attributes shall be logged. An API consumer can provide more than one \"matchingPattern\" if combinations of patterns are to be considered to match diverse sets of interface messages. See note.",
              "type": "array",
              "items": {
                "type": "object",
                "anyOf": [
                  {
                    "required": ["srcIpAddress"]
                  },
                  {
                    "required": ["dstIpAddress"]
                  },
                  {
                    "required": ["requestMethod"]
                  },
                  {
                    "required": ["requestUriPattern"]
                  },
                  {
                    "required": ["responseCodes"]
                  }
                ],
                "properties": {
                  "srcIpAddress": {
                    "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
                    "type": "string",
                    "format": "IP"
                  },
                  "requestMethod": {
                    "description": "HTTP request method to be matched. To match, the HTTP request method of the message shall be the same as the value of this attribute. Valid values are specified in IETF RFC 7231. The API producer shall support this attribute.",
                    "type": "string"
                  },
                  "requestUriPattern": {
                    "description": "Substring to be matched in the request URI. To match, the request URI shall include the value of\n  this attribute as a substring. This is typically used to match messages which associate to RESTful\n  resources, or to a specific API (e.g., by using the \"apiName\" of the API). The API producer shall\n  support this attribute.",
                    "type": "string"
                  },
                  "dstIpAddress": {
                    "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
                    "type": "string",
                    "format": "IP"
                  },
                  "responseCodes": {
                    "description": "HTTP response codes or patterns to match. A list of all valid HTTP response codes and their specification documents can be obtained from the HTTP status code registry. In addition, if supported, the following patterns may be used (case-insensitive): - \"1XX\": for matching any kind of informational response. - \"2XX\": for matching any kind of success response. - \"3XX\": for matching any kind redirection response. - \"4XX\": for matching any kind of client error response. - \"5XX\": for matching any kind of server error response.\nThe API producer shall support this attribute",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "headerField": {
                    "description": "Name of the header field to be matched. The header field name shall be one of the supported fields in a request message as defined in clause 4.2.2 of ETSI GS NFV-SOL 013 or in a response message as defined in clause 4.2.3 of ETSI GS NFV-SOL 013, in accordance with the \"direction\" criteria input. The API producer may support this attribute.",
                    "type": "string"
                  },
                  "headerValue": {
                    "description": "Value in the header to be matched. To match, the value in the header field indicated by \"headerField\" shall be the same as in this attribute. Shall be provided if a \"headerField\" is provided. The API producer may support this attribute.",
                    "type": "string"
                  },
                  "bodyValues": {
                    "description": "A list of strings to be matched in the body part of the interface message (e.g., the body of an HTTP message). If provided, only messages with text in the body part containing all the values from the list shall match the filter. In addition to a matching filter for the body of the message, a corresponding \"headerField\" filter shall also be provided, with \"headerField\" set to \"Content-Type\", to restrict matching to appropriate textual payloads such as \"application/json\" or \"text/plain\". The API producer may support this attribute",
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "servicesLogDetail": {
          "description": "This type represents criteria for logging jobs to collect logged messages about processes pertaining to NFV-MANO services. * NOTE:\tIn the present version of the present document, only one attribute, i.e.\n        \"logGarbageCollection\", is available.",
          "type": "object",
          "properties": {
            "logGarbageCollection": {
              "description": "Indicates to collect logged information about garbage collection processes associated to NFV-MANO services. See note.",
              "type": "boolean"
            }
          }
        },
        "systemLogDetail": {
          "description": "This type represents criteria for logging jobs to collect logged system events of the NFV-MANO functional entity. * NOTE:\tThe set of properties and values for this attribute are assumed to be known to the consumer\n        by means defined outside of the present document.",
          "type": "object",
          "required": ["systemLogs", "severityLevel"],
          "properties": {
            "systemLogs": {
              "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of keyvalue pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 8259. In the following example, a list of key-value pairs with four keys (\"aString\", \"aNumber\", \"anArray\" and \"anObject\") is provided to illustrate that the values associated with different keys can be of different type.\n",
              "type": "object"
            },
            "severityLevelScheme": {
              "description": "Identifies a severity level scheme. The default value is \"rfc5424\", which represents the set of values specified in the clause 6.2.1, table 2 of IETF RFC 5424. Other values may be used to signal different schemes.",
              "type": "string"
            },
            "severityLevel": {
              "description": "The severity level, which determines the severity of the system messages to collect. The NFV-MANO functional entity shall collect system log messages, as indicated by the \"systemLogs\" attribute, with severity levels lower (i.e., more severe) or equal to the value provided by this present attribute.",
              "type": "number"
            }
          }
        }
      }
    },
    "jobConfig": {
      "description": "This type represents configuration data for a logging job. It shall comply with the provisions defined in table 8.6.3.6-1. NOTE: The present document version does not specify the support for \"log compilation and reporting based on events\" as specified in clause 6.6.2.2 of ETSI GS NFV-IFA 031.\n* NOTE 1:\tThe minimumReportingPeriod is used to throttle possible flooding of reports by providing a lower\n            limit on the gap between two log availability notification to be emitted by the same logging job.\n  NOTE 2:\tMore than one logCompilingCondition is possible to provide a combination of different conditions\n            for the compilation. This covers use cases when the compilation of the log can be based on, e.g.\n            a timer value and a size value, whichever first condition is met first. For instance, compile a\n            log every 3 600 seconds, or whenever during the 3 600 seconds period the log grows in\n            size to 1 000 000 bytes.\n  NOTE 3:\tThe value is indicative, as the actual size of the compiled log files might not match the provided\n            compileBySizeValue due to possible deviations in the tracking of the size of the log data by the\n            API producer, and the size of individual logged data entries when these are collected.",
      "type": "object",
      "required": ["reportingCondition", "securityConf"],
      "properties": {
        "startTime": {
          "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
          "type": "string",
          "format": "date-time"
        },
        "endTime": {
          "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
          "type": "string",
          "format": "date-time"
        },
        "reportingCondition": {
          "description": "Specifies the condition under which the producer will report to the consumer about the compiled log data.",
          "required": ["reportingType"],
          "properties": {
            "reportingType": {
              "description": "Specifies the type of reporting condition. Permitted values: - REPORTING_ON_COMPILATION: the producer shall notify the consumer once the compilation of the\n                collected logging data into a file is completed and a new log report is available.\n- NO_REPORTING: no reporting is requested (the consumer can query the logging jobs to know about the\n                availability of new log reports).",
              "type": "string",
              "enum": ["REPORTING_ON_COMPILATION", "NO_REPORTING"]
            },
            "minimumReportingPeriod": {
              "description": "Specifies the minimum periodicity at which the producer will report to the consumer about the collected log information, in seconds. See note 1.",
              "type": "integer",
              "format": "int32"
            }
          }
        },
        "compileBySizeValue": {
          "description": "An indicative size threshold for compiling the collected log data, in bytes. It is used when the compilation is based on the size of the collected log data. If not present, a default value as specified with the \"defaultLogCompileBySizeValue\" configuration in the \"ManoEntityConfigurableParams\" shall be used. See note 2 and note 3.",
          "type": "integer",
          "format": "int32"
        },
        "compileByTimerValue": {
          "description": "The periodicity threshold for compiling the filtered log, in seconds. It is used when the compilation is based on a timer (e.g., every 24 hours). If not present, a default value as specified with the \"defaultLogCompileByTimerValue\" configuration in the \"ManoEntityConfigurableParams\" shall be used. See note 2.",
          "type": "integer",
          "format": "int32"
        },
        "securityConf": {
          "description": "Configuration about the security aspects of the logging job.",
          "type": "object",
          "properties": {
            "logFileEncryption": {
              "description": "Information about the encryption of the compiled log files. Shall be present if the log file is requested to be encrypted.",
              "required": ["encryptionCertificate", "cipherAlgorithm"],
              "type": "object",
              "properties": {
                "encryptionCertificate": {
                  "description": "X.509 certificate with the public key to use for the encryption of the compiled log file.",
                  "type": "string"
                },
                "cipherAlgorithm": {
                  "description": "Cryptographic algorithm to be used for the encryption of the compiled log file. More than one algorithm can be provided from higher (lower array index) to lower (higher array index) precedence. Valid values are: \"AES-CBC-128\", \"AES-GCM-128\", \"AES-CBC-256\", and \"AES-GCM-256\", as specified in clause 6.5 of ETSI GS NFV-SEC 012",
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minItems": 1
                  }
                },
                "encryptAndSignOrder": {
                  "description": "Indication about the order in signing and encrypting the compiled log file. Valid values are: \"encryptFirst\", to apply the order \"first encrypt, then sign\", and \"signFirst\" for the order \"first sign, then encrypt\". Default value is \"encryptFirst\".",
                  "type": "string"
                }
              }
            },
            "logTransferSecurity": {
              "description": "Information about the security measures for retrieving/accessing the compiled log files.",
              "type": "object",
              "properties": {
                "publicKey": {
                  "description": "The public key of the API consumer used for the client authentication with the file server. Shall be provided if required by the type of transfer protocol. May be omitted if the key has been provided to the API producer by other means, or if it has already been provided in some previous CreateLoggingJobRequest issued by the same API consumer, whose public key has not changed.",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "logReports": {
      "description": "Information about available log reports created by the logging job.",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["logReportId", "logReportLoc"],
        "properties": {
          "logReportId": {
            "description": "An identifier with the intention of being globally unique.\n",
            "type": "string"
          },
          "logReportLoc": {
            "description": "This type represents a link to a resource using an absolute URI.\n",
            "type": "object",
            "required": ["href"],
            "properties": {
              "href": {
                "description": "String formatted according to IETF RFC 3986.\n",
                "type": "string"
              }
            }
          }
        }
      }
    },
    "_links": {
      "description": "Links for this resource.",
      "type": "object",
      "required": ["self"],
      "properties": {
        "self": {
          "description": "This type represents a link to a resource using an absolute URI.\n",
          "type": "object",
          "required": ["href"],
          "properties": {
            "href": {
              "description": "String formatted according to IETF RFC 3986.\n",
              "type": "string"
            }
          }
        },
        "objects": {
          "description": "Links to resources representing the object instances that are logged. Shall be present if the logged object instance information is accessible as a resource.",
          "type": "array",
          "items": {
            "description": "This type represents a link to a resource using an absolute URI.\n",
            "type": "object",
            "required": ["href"],
            "properties": {
              "href": {
                "description": "String formatted according to IETF RFC 3986.\n",
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
