# 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
      - rootCauseFaultyResource
      - 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"
      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"
      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"
      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.
        type: 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"

  AlarmNotification:
    description: >
      This type represents an alarm notification about VNF faults.
      This notification shall be triggered by the VNFM when:
      * An alarm has been created.
      * An alarm has been updated, e.g. if the severity of the alarm has
        changed.
    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/SOL002SOL003_def.yaml#/definitions/Identifier"
      notificationType:
        description: >
          Discriminator for the different notification types. Shall be set to
          "AlarmNotification" for this notification type.
        type: string
        enum: 
          - AlarmNotification
      subscriptionId:
        description: >
          Identifier of the subscription that this notification relates to.
        $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      timeStamp:
        description: >
          Date-time of the generation of the notification.
        $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/DateTime"
      alarm:
        description: >
          Information about an alarm including AlarmId, affected VNF
          identifier, and FaultDetails.
        $ref: "#/definitions/Alarm"
      _links:
        description: >
          Links to resources related to this notification.
        type: object
        required: 
          - subscription
        properties: 
          subscription: 
            description: >
              Link to the related subscription.
            $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/NotificationLink"
            
  VnfInfoModificationRequest:
    description: >
      This type represents attribute modifications for an
      "Individual VNF instance" resource, i.e. modifications to a resource
      representation based on the "VnfInstance" data type.
    type: object
    properties:
      vnfInstanceName:
        description: >
          New value of the "vnfInstanceName" attribute in "VnfInstance", or
          "null" to remove the attribute.      
        type: string
      vnfInstanceDescription:
        description: >
          New value of the "vnfInstanceDescription" attribute in
          "VnfInstance", or "null" to remove the attribute.  
        type: string
      vnfPkgId:
        description: >
          New value of the "vnfPkgId" attribute in "VnfInstance".
          The value "null" is not permitted.  
        $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfConfigurableProperties:
        description: >
          Modifications of the "vnfConfigurableProperties" attribute in
          "VnfInstance". If present, these modifications shall be applied
          according to the rules of JSON Merge PATCH (see IETF RFC 7396).
        $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/KeyValuePairs"
      metadata:
        description: >
          Modifications of the "metadata" attribute in "VnfInstance". If
          present, these modifications shall be applied according to the rules
          of JSON Merge PATCH (see IETF RFC 7396).
        $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/KeyValuePairs"
      extensions:
        description: >
          Modifications of the "extensions" attribute in "VnfInstance". If
          present, these modifications shall be applied according to the rules
          of JSON Merge PATCH (see IETF RFC 7396).
        $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/KeyValuePairs"
      vimConnectionInfo:
        description: >
          New content of certain entries in the "vimConnectionInfo" attribute
          array in "VnfInstance", as defined below this table.
        type: array
        items: 
          $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/VimConnectionInfo"
      vimConnectionInfoDeleteIds:
        description: >
          List of identifiers entries to be deleted from the "vimConnectionInfo" 
          attribute array in "VnfInstance", to be used as "deleteIdList" as defined 
          below this table.
        type: array
        items:
          $ref: "../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"