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

definitions:
  GrantRequest:
    description: >
      This type represents a grant request.
    type: object
    required:
      - vnfInstanceId
      - vnfLcmOpOccId
      - vnfdId
      - operation
      - isAutomaticInvocation
      - _links
    properties:
      vnfInstanceId:
        description: >
          Identifier of the VNF instance which this grant request is related
          to. Shall also be provided for VNFs that not yet exist but are
          planned to exist in the future, i.e. if the grant is requested for
          InstantiateVNF.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfLcmOpOccId:
        description: >
          The identifier of the VNF lifecycle management operation occurrence
          associated to the GrantRequest.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfdId:
        description: >
          Identifier of the VNFD that defines the VNF for which the LCM
          operation is to be granted.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      flavourId:
        description: >
          Identifier of the VNF deployment flavour of the VNFD that defines
          the VNF for which the LCM operation is to be granted.
          Shall be provided when instantiating the VNF or changing the
          deployment flavour of the VNF instance.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      operation:
        description: >
          The lifecycle management operation for which granting is requested.
          The VNF LCM operations CreateVnfIdentifier, DeleteVnfIdentifier,
          QueryVnf and ModifyVnfInformation can be executed by the VNFM
          without requesting granting.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/GrantedLcmOperationType"
      isAutomaticInvocation:
        description: >
          Set to true if this VNF LCM operation occurrence has been triggered
          by an automated procedure inside the VNFM
          (i.e. ScaleVnf / ScaleVnfToLevel triggered by auto-scale, or HealVnf
          triggered by auto-heal).
          Set to false otherwise.
        type: boolean
      instantiationLevelId:
        description: >
          If operation=INSTANTIATE, the identifier of the instantiation level
          may be provided as an alternative way to define the resources to be
          added. This attribute shall only be used if operation=INSTANTIATE.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      addResources:
        description: >
          List of resource definitions in the VNFD for resources to be added
          by the LCM operation which is related to this grant request, with
          one entry per resource.
          If the granting request is for InstantiateVNF, either
          instantiationLevel or addResources shall be present.
        type: array
        items:
          $ref: "#/definitions/ResourceDefinition"
      tempResources:
        description: >
          List of resource definitions in the VNFD for resources to be
          temporarily instantiated during the runtime of the LCM operation
          which is related to this grant request, with one entry per
          resource.
          The NFVO will assume that the VNFM will be responsible to both
          allocate and release the temporary resource during the runtime of
          the LCM operation. This means, the resource can be allocated and
          consumed after the "start" notification for the LCM operation is
          sent by the VNFM, and the resource will be released before the
          "result" notification of the VNF LCM operation is sent by the VNFM.
        type: array
        items:
          $ref: "#/definitions/ResourceDefinition"
      removeResources:
        description: >
          Provides the definitions of resources to be removed by the LCM
          operation which is related to this grant request, with one entry per
          resource.
        type: array
        items:
          $ref: "#/definitions/ResourceDefinition"
      updateResources:
        description: >
          Provides the definitions of resources to be modified by the LCM
          operation which is related to this grant request, with one entry per
          resource.
        type: array
        items:
          $ref: "#/definitions/ResourceDefinition"
      placementConstraints:
        description: >
          Placement constraints that the VNFM may send to the NFVO in order to
          influence the resource placement decision. If sent, the NFVO shall
          take the constraints into consideration when making resource
          placement decisions, and shall reject the grant if they cannot be
          honoured.
          The affinity/anti-affinity rules defined in the VNFD , and the
          placement constraints in the GrantVnfLifecycleOperation as defined
          in this clause should be conflict-free. In case of conflicts, the
          placement constraints in the GrantVnfLifecycleOperation shall take
          precedence.
          Passing constraints allows the VNFM or the lifecycle management
          scripts to influence resource placement decisions by the NFVO to
          ensure VNF properties such as performance or fault tolerance.
          If fallbackBestEffort is present in placement constraints and set
          to “true”, the NFVO shall process the Affinity/AntiAffinity constraint
          in a best effort manner, in which case, if specified resources cannot be
          allocated based on specified placement constraint, the NFVO looks for an
          alternate best effort placement for the specified resources to be granted.
          In the best effort anti-affinity case, the resources are expected to be
          spread optimally over all available instances of scope (e.g. zones),
          and in the best effort affinity case, they are expected to be distributed
          optimally over fewer possible instances of scope.
        type: array
        items:
          $ref: "#/definitions/PlacementConstraint"
      vimConstraints:
        description: >
          Used by the VNFM to require that multiple resources are managed
          through the same VIM connection. If sent, the NFVO shall take the
          constraints into consideration when making VIM selection decisions,
          and shall reject the grant if they cannot be honoured.
          This attribute shall be supported if VNF-related Resource Management
          in direct mode is applicable.
          The applicability and further details of this attribute for indirect
          mode are left for future specification.
        type: array
        items:
          $ref: "#/definitions/VimConstraint"
      additionalParams:
        description: >
          Additional parameters passed by the VNFM, specific to the VNF and
          the LCM operation.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/KeyValuePairs"
      _links:
        description: >
          Links to resources related to this request.
        type: object
        required:
          - vnfLcmOpOcc
          - vnfInstance
        properties:
          vnfLcmOpOcc:
            description: >
              Related lifecycle management operation occurrence.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"
          vnfInstance:
            description: >
              Related VNF instance.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"

  Grant:
    description: >
      This type represents a grant.
    type: object
    required:
      - id
      - vnfInstanceId
      - vnfLcmOpOccId
      - _links
    properties:
      id:
        description: >
          Identifier of the grant.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfInstanceId:
        description: >
          Identifier of the related VNF instance.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfLcmOpOccId:
        description: >
          Identifier of the related VNF lifecycle management operation
          occurrence.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vimConnections:
        description: >
          Provides information regarding VIM connections that are approved to
          be used by the VNFM to allocate resources, and provides parameters
          of these VIM connections.
          The VNFM shall update the " vimConnectionInfo" attribute of the
          "VnfInstance" structure by adding unknown entries received in this
          attribute.
          This attribute is not intended for the modification of VimConnection
          entries passed earlier; for that, the VnfInfoModificationRequest
          structure shall be used.
          This attribute shall only be supported when VNF-related Resource
          Management in direct mode is applicable. In direct mode, this
          parameter shall be absent if the VIM information was configured to
          the VNFM in another way, present otherwise.
          This interface allows to signal the use of multiple VIMs per VNF.
          However, due to the partial support of this feature in the present
          release, it is recommended in the present document that the number
          of entries in the "vims" attribute in the Grant is not greater than
          1.
        type: array
        items:
          $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/VimConnectionInfo"
      zones:
        description: >
          Identifies resource zones where the resources are approved to be
          allocated by the VNFM.
        type: array
        items:
          $ref: "#/definitions/ZoneInfo"
      zoneGroups:
        description: >
          Information about groups of resource zones that are related and that
          the NFVO has chosen to fulfil a zoneGroup constraint in the
          GrantVnfLifecycleOperation request.
          This information confirms that the NFVO has honoured the zoneGroup
          constraints that were passed as part of "placementConstraints" in the
          GrantRequest.
        type: array
        items:
          $ref: "#/definitions/ZoneGroupInfo"
      computeReservationId:
        description: >
          Information that identifies a reservation applicable to the compute
          resource requirements of the corresponding grant request.
          At least one of (computeReservationId, networkReservationId,
          storageReservationId) shall be present when policy is
          GRANT_RESERVE_SINGLE and an applicable reservation exists. None of
          these shall be present otherwise.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"
      networkReservationId:
        description: >
          Information that identifies a reservation applicable to the network
          resource requirements of the corresponding grant request.
          At least one of (computeReservationId, networkReservationId,
          storageReservationId) shall be present when policy is
          GRANT_RESERVE_SINGLE and an applicable reservation exists. None of
          these shall be present otherwise.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"
      storageReservationId:
        description: >
          Information that identifies a reservation applicable to the storage
          resource requirements of the corresponding grant request.
          At least one of (computeReservationId, networkReservationId,
          storageReservationId) shall be present when policy is
          GRANT_RESERVE_SINGLE and an applicable reservation exists. None of
          these shall be present otherwise.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"
      addResources:
        description: >
          List of resources that are approved to be added, with one entry per
          resource.
        type: array
        items:
          $ref: "#/definitions/GrantInfo"
      tempResources:
        description: >
          List of resources that are approved to be temporarily instantiated
          during the runtime of the lifecycle operation, with one entry per
          resource.
        type: array
        items:
          $ref: "#/definitions/GrantInfo"
      removeResources:
        description: >
          List of resources that are approved to be removed, with one entry
          per resource.
        type: array
        items:
          $ref: "#/definitions/GrantInfo"
      updateResources:
        description: >
          List of resources that are approved to be modified, with one entry
          per resource.
        type: array
        items:
          $ref: "#/definitions/GrantInfo"
      vimAssets:
        description: >
          Information about assets for the VNF that are managed by the NFVO
          in the VIM, such as software images and virtualised compute resource
          flavours.
          The Grant response allows the NFVO to pass to the VNFM VIM assets
          related to the VNF package that is identified by the vnfdId attribute
          in the corresponding Grant request. The NFVO may send in each Grant
          response the full set of VIM assets related to the VNF package defined
          by the vnfdId in the related Grant request, but shall send this information
          if the vnfdId in the related Grant request differs from the vnfdId passed
          in the previous Grant request, or if the Grant response is related to an
          InstantiateVnf operation.
          The set of VIM assets shall not change between subsequent Grant responses
          if the vnfdId has not changed. During each LCM operation occurrence,
          the VIM assets that relate to the VNF package identified by the current value
          of the vnfdId attribute in the “VnfInstance” structure shall be used by the
          VNFM for newly created resources. If the VNF package identifier of the
          VNF instance has been updated, VIM assets that relate to the previously-used
          VNF package(s), and that were communicated in previous Grant responses,
          apply to existing resources.
        type: object
        properties:
          computeResourceFlavours:
            description: >
              Mappings between virtual compute descriptors defined in the VNFD
              and compute resource flavours managed in the VIM.
            type: array
            items:
              $ref: "#/definitions/VimComputeResourceFlavour"
          softwareImages:
            description: >
              Mappings between software images defined in the VNFD and
              software images managed in the VIM.
            type: array
            items:
              $ref: "#/definitions/VimSoftwareImage"
      extVirtualLinks:
        description: >
          Information about external VLs to connect the VNF to.
          External and/or externally-managed internal VLs can be passed in VNF
          lifecycle management operation requests such as InstantiateVnf or
          ChangeVnfFlavor, and/or in the grant response. The NFVO may choose
          to override in the grant response external and/or externally-managed
          VL instances that have been passed previously in the associated VNF
          lifecycle management request, if the lifecycle management request
          has originated from the NFVO itself.
          If this attribute is present , it need not contain
          those entries that are unchanged compared to the entries that were passed
          in the LCM operation which is related to this granting exchange.
          External and/or externally-managed internal VLs can be passed in
          VNF lifecycle management operation requests such as InstantiateVnf
          or ChangeVnfFlavour, and/or in the grant response. The NFVO may choose
          to override in the grant response external and/or externally-managed VL
          instances that have been passed previously in the associated VNF lifecycle
          management request, if the lifecycle management request has originated from the NFVO itself.
        type: array
        items:
          $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/ExtVirtualLinkData"
      extManagedVirtualLinks:
        description: >
          Information about internal VLs that are managed by other entities
          than the VNFM.
          The indication of externally-managed internal VLs is needed in case
          networks have been pre-configured for use with certain VNFs, for
          instance to ensure that these networks have certain properties such
          as security or acceleration features, or to address particular
          network topologies. The present document assumes that
          externally-managed internal VLs are managed by the NFVO and created
          towards the VIM.
          External and/or externally-managed internal VLs can be passed in VNF
          lifecycle management operation requests such as InstantiateVnf or
          ChangeVnfFlavor, and/or in the grant response. The NFVO may choose
          to override in the grant response external and/or externally-managed
          VL instances that have been passed previously in the associated VNF
          lifecycle management request, if the lifecycle management request
          has originated from the NFVO itself.
        type: array
        items:
          $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/ExtManagedVirtualLinkData"
      additionalParams:
        description: >
          Additional parameters passed by the NFVO, specific to the VNF and
          the LCM operation.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/KeyValuePairs"
      _links:
        description: >
          Links to resources related to this resource.
        type: object
        required:
          - self
          - vnfLcmOpOcc
          - vnfInstance
        properties:
          self:
            description: >
              URI of this resource.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"
          vnfLcmOpOcc:
            description: >
              Related VNF lifecycle management operation occurrence.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"
          vnfInstance:
            description: >
              Related VNF instance.
            $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Link"

  ResourceDefinition:
    description: >
      This type provides information of an existing or proposed resource used
      by the VNF.
    type: object
    required:
      - id
      - type
    properties:
      id:
        description: >
          Identifier of this "ResourceDefinition" structure, unique at least
          within the scope of the "GrantRequest" structure.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierLocal"
      type:
        description: >
          Type of the resource definition referenced.
          Permitted values:
          * COMPUTE
          * VL
          * STORAGE
          * LINKPORT
        type: string
        enum:
          - COMPUTE
          - VL
          - STORAGE
          - LINKPORT
      vduId:
        description: >
          Reference to the related VDU in the VNFD applicable to this
          resource.
          Shall only be present if a VDU is applicable to this resource.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVnfd"
      resourceTemplateId:
        description: >
          Reference to a resource template (VnfVirtualLinkDesc,
          VirtualComputeDesc, VnfExtCpd, VirtualStorageDesc) in the
          VNFD.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVnfd"
      resource:
        description: >
          Resource information for an existing resource. Shall be present for
          resources that are planned to be deleted or modified. Shall be
          absent otherwise.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/ResourceHandle"

  GrantInfo:
    description: >
      This type contains information about a Compute, storage or network
      resource whose addition/update/deletion was granted.
    type: object
    required:
      - resourceDefinitionId
    properties:
      resourceDefinitionId:
        description: >
          Identifier of the related "ResourceDefinition" structure from the
          related "GrantRequest" structure.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierLocal"
      reservationId:
        description: >
          The reservation identifier applicable to the
          VNFC/VirtualLink/VirtualStorage. It shall be present for new
          resources when policy is GRANT_RESERVE_MULTI and an applicable
          reservation exists; shall not be present otherwise.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vimConnectionId:
        description: >
          Identifier of the VIM connection to be used to manage this resource.
          Shall be present for new resources, and shall be absent for
          resources that have already been allocated.
          The applicable "VimConnectionInfo" structure, which is referenced by
          vimConnectionId, can be obtained from the "vimConnectionInfo"
          attribute of the "VnfInstance" structure.
          This attribute shall only be supported when VNF-related Resource
          Management in direct mode is applicable.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      resourceProviderId:
        description: >
          Identifies the entity responsible for the management of the
          virtualised resource. Shall be present for new resources, and shall
          be absent for resources that have already been allocated.
          This attribute shall only be supported when VNF-related Resource
          Management in indirect mode is applicable. The identification scheme
          is outside the scope of the present document.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      zoneId:
        description: >
          Reference to the identifier of the "ZoneInfo" structure in the
          "Grant" structure defining the resource zone into which this
          resource is to be placed. Shall be present for new resources if the
          zones concept is applicable to them (typically, Compute resources),
          and shall be absent for resources that have already been allocated.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierLocal"
      resourceGroupId:
        description: >
          Identifier of the "infrastructure resource group", logical grouping
          of virtual resources assigned to a tenant within an Infrastructure
          Domain, to be provided when allocating the resource.
          If the VIM connection referenced by "vimConnectionId" applies to
          multiple infrastructure resource groups, this attribute shall be
          present for new resources.
          If the VIM connection referenced by "vimConnectionId" applies to a
          single infrastructure resource group, this attribute may be present
          for new resources.
          This attribute shall be absent for resources that have already been
          allocated.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"

  ZoneInfo:
    description: >
      This type provides information regarding a resource zone.
    type: object
    required:
      - id
      - zoneId
    properties:
      id:
        description: >
          The identifier of this ZoneInfo instance, for the purpose of
          referencing it from other structures in the "Grant" structure.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierLocal"
      zoneId:
        description: >
          The identifier of the resource zone, as managed by the resource
          management layer (typically, the VIM).
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vimConnectionId:
        description: >
          Identifier of the connection to the VIM that manages the resource
          zone.
          The applicable "VimConnectionInfo" structure, which is referenced by
          vimConnectionId, can be obtained from the " vimConnectionInfo"
          attribute of the "VnfInstance" structure.
          This attribute shall only be supported and present when VNF-related
          Resource Management in direct mode is applicable.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      resourceProviderId:
        description: >
          Identifies the entity responsible for the management the resource
          zone.
          This attribute shall only be supported and present when VNF-related
          Resource Management in indirect mode is applicable. The
          identification scheme is outside the scope of the present document.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"

  ZoneGroupInfo:
    description: >
      This type provides information regarding a resource zone group. A
      resource zone group is a group of one or more related resource zones
      which can be used in resource placement constraints. To fulfil such
      constraint, the NFVO may decide to place a resource into any zone that
      belongs to a particular group.
      NOTE: A resource zone group can be used to support overflow from one
      resource zone into another, in case a particular deployment supports
      only non-elastic resource zones.
    type: object
    required:
      - zoneId
    properties:
      zoneId:
        description: >
          References of identifiers of "ZoneInfo" structures, each of which
          provides information about a resource zone that belongs to this
          group.
        type: array
        items:
          $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierLocal"

  PlacementConstraint:
    description: >
      This type provides information regarding a resource placement
      constraint. A set of such constraints may be sent by the VNFM to the
      NFVO to influence the resource placement decisions made by the NFVO as
      part of the granting process.
      A placement constraint defines a condition to the placement of new
      resources, considering other new resources as well as existing resources.
      EXAMPLE:
      The following rules influence the placement of a set of resources such
      that they are placed in the same Network Function Virtualisation
      Infrastructure Point of Presence (NFVI-PoP) but in different resource
      zones:
      {type="AFFINITY"; scope="NFVI_POP"; {resource1,resource2}}
      {type="ANTI_AFFINITY"; scope="ZONE"; {resource1,resource2}}
    type: object
    required:
      - affinityOrAntiAffinity
      - scope
      - resource
    properties:
      affinityOrAntiAffinity:
        description: >
          The type of the constraint.
          Permitted values:
          * AFFINITY
          * ANTI_AFFINITY
        type: string
        enum:
          - AFFINITY
          - ANTI_AFFINITY
      scope:
        description: >
          The scope of the placement constraint indicating the category of the
          "place" where the constraint applies.
          Permitted values:
          * NFVI_POP
          * ZONE
          * ZONE_GROUP
          * NFVI_NODE
        type: string
        enum:
          - NFVI_POP
          - ZONE
          - ZONE_GROUP
          - NFVI_NODE
      resource:
        description: >
          References to resources in the constraint rule.
        type: array
        minItems: 2
        items:
          $ref: "#/definitions/ConstraintResourceRef"
      fallbackBestEffort:
        description: >
          Indication if the constraint is handled with fall back best effort. Default value is “false”.
          If set to true, the Affinity/Anti_Affinity placement constraint need not be fully satisfied,
          i.e. if the allocation cannot be honoured with the placement constraint, the request is
          processed in a best effort manner.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Boolean"

  VimConstraint:
    description: >
      This type provides information regarding a VIM selection constraint. A
      set of such constraints may be sent by the VNFM to the NFVO to influence
      the VIM selection decisions made by the NFVO as part of the granting
      process.
    type: object
    required:
      - resource
    properties:
      sameResourceGroup:
        description: >
          If present and set to true, this signals that the constraint applies
          not only to the same VIM connection, but also to the same
          infrastructure resource group.
        type: boolean
      resource:
        description: >
          References to resources in the constraint rule.
          The NFVO shall ensure that all resources in this list are managed
          through the same VIM connection. If "sameResourceGroup" is set to
          true, the NFVO shall further ensure that all resources in this list
          are part of the same infrastructure resource group in that VIM
          connection.
        type: array
        minItems: 2
        items:
          $ref: "#/definitions/ConstraintResourceRef"

  ConstraintResourceRef:
    description: >
      This type references a resource either by its VIM-level identifier for
      existing resources, or by the identifier of a "ResourceDefinition"
      structure in the "GrantRequest" structure for new resources.
    type: object
    required:
      - idType
      - resourceId
    properties:
      idType:
        description: >
          The type of the identifier.
          Permitted values:
          * RES_MGMT: Resource-management-level identifier; this identifier is
            managed by the VIM in the direct mode of VNF-related resource
            management, and is managed by the NFVO in the indirect mode)
          * GRANT: Reference to the identifier of a "ResourceDefinition"
          structure in the "GrantRequest" structure.
        type: string
        enum:
          - RES_MGMT
          - GRANT
      resourceId:
        description: >
          An actual resource-management-level identifier (idType=RES_MGMT),
          or an identifier that references a "ResourceDefinition" structure in
          the related "GrantRequest" structure (idType=GRANT).
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"
      vimConnectionId:
        description: >
          Identifier of the VIM connection for managing the resource. It shall
          only be present when idType = RES_MGMT.
          The applicable "VimConnectionInfo" structure, which is referenced by
          vimConnectionId, can be obtained from the "vimConnectionInfo"
          attribute of the "VnfInstance" structure.
          This attribute shall only be supported when VNF-related resource
          management in direct mode is applicable.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      resourceProviderId:
        description: >
          Identifier of the resource provider. It shall only be present when
          idType = RES_MGMT.
          This attribute shall only be supported when VNF-related resource
          management in indirect mode is applicable. The identification scheme
          is outside the scope of the present document.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"

  VimComputeResourceFlavour:
    description: >
      If the VIM requires the use of virtual compute resource flavours during
      compute resource instantiation, it is assumed that such flavours are
      selected or created by the NFVO based on the information in the virtual
      compute descriptor defined in the VNFD.
      This type defines the mapping between a virtual compute descriptor in
      the VNFD and the corresponding compute resource flavour managed by the
      NFVO in the VIM.
    type: object
    required:
      - vnfdVirtualComputeDescId
      - vimFlavourId
    properties:
      vimConnectionId:
        description: >
          Identifier of the VIM connection to access the flavour referenced in
          this structure.
          The applicable "VimConnectionInfo" structure, which is referenced by
          vimConnectionId, can be obtained from the "vimConnectionInfo"
          attribute of the "VnfInstance" structure.
          This attribute shall only be supported and present if VNF-related
          resource management in direct mode is applicable.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      resourceProviderId:
        description: >
          Identifies the entity responsible for the management of the
          virtualised resource.
          This attribute shall only be supported and present if VNF-related
          resource management in indirect mode is applicable. The
          identification scheme is outside the scope of the present document.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfdVirtualComputeDescId:
        description: >
          Identifier which references the virtual compute descriptor in the
          VNFD that maps to this flavour.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVnfd"
      vimFlavourId:
        description: >
          Identifier of the compute resource flavour in the resource
          management layer (i.e. VIM).
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"

  VimSoftwareImage:
    description: >
      This type contains a mapping between a software image definition the
      VNFD and the corresponding software image managed by the NFVO in the
      VIM which is needed during compute resource instantiation.
    type: object
    required:
      - vnfdSoftwareImageId
      - vimSoftwareImageId
    properties:
      vimConnectionId:
        description: >
          Identifier of the VIM connection to access the software image
          referenced in this structure.
          The applicable "VimConnectionInfo" structure, which is referenced by
          vimConnectionId, can be obtained from the "vimConnectionInfo"
          attribute of the "VnfInstance" structure.
          This attribute shall only be supported and present if VNF-related
          resource management in direct mode is applicable.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      resourceProviderId:
        description: >
          Identifies the entity responsible for the management of the
          virtualised resource.
          This attribute shall only be supported and present if VNF-related
          resource management in indirect mode is applicable. The
          identification scheme is outside the scope of the present document.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/Identifier"
      vnfdSoftwareImageId:
        description: >
          Identifier which references the software image descriptor in the
          VNFD.
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVnfd"
      vimSoftwareImageId:
        description: >
          Identifier of the software image in the resource management layer
          (i.e. VIM).
        $ref: "../../../definitions/SOL002SOL003_def.yaml#/definitions/IdentifierInVim"