# Copyright (c) ETSI 2017.
# https://forge.etsi.org/etsi-forge-copyright-notice.txt
definitions:
  AlarmNotification:
    description: >
      This type represents an alarm notification about NS faults.
    type: object
    required:
      - id
      - notificationType
      - subscriptionId
      - timeStamp
      - alarm
      - _links
    properties:
      id:
        description: >
          Identifier of this notification. If a notification is sent
          multiple times due to multiple subscriptions, the "id"
          attribute of all these notifications shall have the same value.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      notificationType:
        description: >
          Discriminator for the different notification types.
          Shall be set to "AlarmNotification" for this notification type.
        type: string
        enum:
          - AlarmClearedNotification
      subscriptionId:
        description: >
          Identifier of the subscription that this notification relates to.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      timeStamp:
        description: >
          Date-time of the generation of the notification.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/DateTime"
      alarm:
        description: >
          Information about an alarm including AlarmId, affected
          NS identifier, and FaultDetails.
        $ref: "../../NSFaultManagement/definitions/SOL005NSFaultManagement_def.yaml#/definitions/Alarm"
      alarmClearedTime:
        description: >
          The time stamp indicating when the alarm was cleared.
      _links:
        description: >
          Links to resources related to this notification.
        type: object
        required:
          - subscription
          - alarm
        properties:
          subscription:
            description: >
              Link to the related subscription.
            $ref: "../../definitions/SOL005_def.yaml#/definitions/NotificationLink"
          alarm:
            description: >
              Link to the resource that represents the related alarm.
            $ref: "../../definitions/SOL005_def.yaml#/definitions/Link"

  AlarmClearedNotification:
    description: >
      This type represents an alarm cleared notification about VNF faults.
      The notification shall be triggered by the VNFM when an alarm has been
      cleared.
    type: object
    required:
      - id
      - notificationType
      - subscriptionId
      - timeStamp
      - alarmId
      - alarmClearedTime
      - _links
    properties:
      id:
        description: >
          Identifier of this notification. If a notification is sent multiple
          times due to multiple subscriptions, the "id" attribute of all these
          notifications shall have the same value.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      notificationType:
        description: >
          Discriminator for the different notification types. Shall be set to
          "AlarmClearedNotification" for this notification type.
        type: string
        enum:
          - AlarmClearedNotification
      subscriptionId:
        description: >
          Identifier of the subscription that this notification relates to.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      timeStamp:
        description: >
          Date-time of the generation of the notification.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/DateTime"
      alarmId:
        description: >
          Alarm identifier.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      alarmClearedTime:
        description: >
          The time stamp indicating when the alarm was cleared.
      _links:
        description: >
          Links to resources related to this notification.
        type: object
        required:
          - subscription
          - alarm
        properties:
          subscription:
            description: >
              Link to the related subscription.
            $ref: "../../definitions/SOL005_def.yaml#/definitions/NotificationLink"
          alarm:
            description: >
              Link to the resource that represents the related alarm.
            $ref: "../../definitions/SOL005_def.yaml#/definitions/NotificationLink"

  AlarmListRebuiltNotification:
    description: >
      This type represents a notification that the alarm list has been
      rebuilt, e.g. if the VNFM detects its storage holding the alarm
      list is corrupted.
      The notification shall be triggered by the VNFM when the alarm list has
      been rebuilt.
    type: object
    required:
      - id
      - notificationType
      - subscriptionId
      - timeStamp
      - _links
    properties:
      id:
        description: >
          Identifier of this notification. If a notification is sent multiple
          times due to multiple subscriptions, the "id" attribute of all these
          notifications shall have the same value.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      notificationType:
        description: >
          Discriminator for the different notification types. Shall be set to
          "AlarmListRebuiltNotification" for this notification type.
        type: string
        enum:
          - AlarmListRebuiltNotification
      subscriptionId:
        description: >
          Identifier of the subscription that this notification relates to.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/Identifier"
      timeStamp:
        description: >
          Date-time of the generation of the notification.
        $ref: "../../definitions/SOL005_def.yaml#/definitions/DateTime"
      _links:
        description: >
          Links to resources related to this notification.
        type: object
        required:
          - subscription
          - alarms
        properties:
          subscription:
            description: >
              Link to the related subscription.
            $ref: "../../definitions/SOL005_def.yaml#/definitions/NotificationLink"
          alarms:
            description: >
              Link to the alarm list, i.e. the "Alarms" resource.
            $ref: "../../definitions/SOL005_def.yaml#/definitions/NotificationLink"