# Copyright (c) ETSI 2017.
# https://forge.etsi.org/etsi-forge-copyright-notice.txt

definitions:
  Alarm:
    description: >
      The alarm data type encapsulates information about an alarm.
    type: object
    required:
      - id
      - managedObjectId
      - alarmRaisedTime
      - ackState
      - perceivedSeverity
      - eventTime
      - eventType
      - probableCause
      - isRootCause
      - _links
    properties:
      id:
        description: >
          Identifier of this Alarm information element.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      managedObjectId:
        description: >
          Identifier of the affected VNF instance.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfcInstanceIds:
        description: >
          Identifiers of the affected VNFC instances.
        type: array
        items:
          $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVnf"
      rootCauseFaultyResource:
        description: >
          The virtualised resources that are causing the VNF fault.
        $ref: "../../../definitions/SOL002SOL003VNFFaultManagement_def.yaml#/definitions/FaultyResourceInfo"
      alarmRaisedTime:
        description: >
          Time stamp indicating when the alarm is raised by the managed
          object.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/DateTime"
      alarmChangedTime:
        description: >
          Time stamp indicating when the alarm was last changed. It shall be
          present if the alarm has been updated.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/DateTime"
      alarmClearedTime:
        description: >
          Time stamp indicating when the alarm was cleared. It shall be
          present if the alarm has been cleared.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/DateTime"
      alarmAcknowledgedTime:
        description: >
          Time stamp indicating when the alarm was
          acknowledged. It shall be present if the alarm has
          been acknowledged.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/DateTime"
      ackState:
        description: >
          Acknowledgement state of the alarm. 
          Permitted values:
          * UNACKNOWLEDGED
          * ACKNOWLEDGED.
        type: string
        enum:
          - UNACKNOWLEDGED
          - ACKNOWLEDGED
      perceivedSeverity:
        description: >
          Perceived severity of the managed object failure.
        $ref: "../../../definitions/SOL002SOL003VNFFaultManagement_def.yaml#/definitions/PerceivedSeverityType"
      eventTime:
        description: >
          Time stamp indicating when the fault was observed.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/DateTime"
      eventType:
        description: >
          Type of event.
        $ref: "../../../definitions/SOL002SOL003VNFFaultManagement_def.yaml#/definitions/EventType"
        type: string
      faultType:
        description: >
          Additional information to clarify the type of the fault.
        type: string
      probableCause:
        description: >
          Information about the probable cause of the fault.
        type: string
      isRootCause:
        description: >
          Attribute indicating if this fault is the root for other correlated
          alarms. If TRUE, then the alarms listed in the attribute
          CorrelatedAlarmId are caused by this fault.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Boolean"
      correlatedAlarmIds:
        description: >
          List of identifiers of other alarms correlated to this fault.
        type: array
        items:
          $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      faultDetails:
        description: >
          Provides additional information about the fault.
        type: array
        items:
          type: string
      _links:
        description: >
          Links for this resource.
        type: object
        required:
          - self
        properties:
          self:
            description: >
              URI of this resource.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"
          objectInstance:
            description: >
              Link to the resource representing the VNF instance to which the
              notified alarm is correlated. Shall be present if the VNF
              instance information is accessible as a resource.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"

  PerceivedSeverityRequest:
    description: >
      This type represents the escalated value of the perceived severity for an alarm.
    required:
      - proposedPerceivedSeverity
    properties:
      proposedPerceivedSeverity:
        description: >
          Indicates the proposed escalated perceived severity for an alarm.
        $ref: "../../../definitions/SOL002SOL003VNFFaultManagement_def.yaml#/definitions/PerceivedSeverityType"