|
| 1 | +# SPDX-FileCopyrightText: 2025 diffo_example contributors <https://github.com/diffo-dev/diffo_example/graphs.contributors> |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
| 5 | +defmodule DiffoExample.Nbn do |
| 6 | + @moduledoc """ |
| 7 | + Diffo - TMF Service and Resource Management with a difference |
| 8 | +
|
| 9 | + Nbn - example NBN domain |
| 10 | +
|
| 11 | + Models NBN network resources including the Ethernet circuit (NbnEthernet) |
| 12 | + and its constituent resources: UNI (dedicated), AVC (dedicated), NTD, |
| 13 | + CVC (aggregates AVCs, terminates at NNI Group), NNI Group, and NNI. |
| 14 | + """ |
| 15 | + use Ash.Domain, |
| 16 | + otp_app: :diffo |
| 17 | + |
| 18 | + alias DiffoExample.Nbn.NbnEthernet |
| 19 | + alias DiffoExample.Nbn.Uni |
| 20 | + alias DiffoExample.Nbn.Avc |
| 21 | + alias DiffoExample.Nbn.Ntd |
| 22 | + alias DiffoExample.Nbn.Cvc |
| 23 | + alias DiffoExample.Nbn.NniGroup |
| 24 | + alias DiffoExample.Nbn.Nni |
| 25 | + |
| 26 | + domain do |
| 27 | + description "An example showing how TMF Resources for a fictional NBN domain can be extended from the Provider domain" |
| 28 | + end |
| 29 | + |
| 30 | + resources do |
| 31 | + resource NbnEthernet do |
| 32 | + define :get_nbn_ethernet_by_id, action: :read, get_by: :id |
| 33 | + define :build_nbn_ethernet, action: :build |
| 34 | + define :define_nbn_ethernet, action: :define |
| 35 | + define :relate_nbn_ethernet, action: :relate |
| 36 | + end |
| 37 | + |
| 38 | + resource Uni do |
| 39 | + define :get_uni_by_id, action: :read, get_by: :id |
| 40 | + define :build_uni, action: :build |
| 41 | + define :define_uni, action: :define |
| 42 | + define :relate_uni, action: :relate |
| 43 | + end |
| 44 | + |
| 45 | + resource Avc do |
| 46 | + define :get_avc_by_id, action: :read, get_by: :id |
| 47 | + define :build_avc, action: :build |
| 48 | + define :define_avc, action: :define |
| 49 | + define :relate_avc, action: :relate |
| 50 | + end |
| 51 | + |
| 52 | + resource Ntd do |
| 53 | + define :get_ntd_by_id, action: :read, get_by: :id |
| 54 | + define :build_ntd, action: :build |
| 55 | + define :define_ntd, action: :define |
| 56 | + define :relate_ntd, action: :relate |
| 57 | + end |
| 58 | + |
| 59 | + resource Cvc do |
| 60 | + define :get_cvc_by_id, action: :read, get_by: :id |
| 61 | + define :build_cvc, action: :build |
| 62 | + define :define_cvc, action: :define |
| 63 | + define :assign_cvlan, action: :assign_cvlan |
| 64 | + define :relate_cvc, action: :relate |
| 65 | + end |
| 66 | + |
| 67 | + resource NniGroup do |
| 68 | + define :get_nni_group_by_id, action: :read, get_by: :id |
| 69 | + define :build_nni_group, action: :build |
| 70 | + define :define_nni_group, action: :define |
| 71 | + define :assign_svlan, action: :assign_svlan |
| 72 | + define :relate_nni_group, action: :relate |
| 73 | + end |
| 74 | + |
| 75 | + resource Nni do |
| 76 | + define :get_nni_by_id, action: :read, get_by: :id |
| 77 | + define :build_nni, action: :build |
| 78 | + define :define_nni, action: :define |
| 79 | + define :relate_nni, action: :relate |
| 80 | + end |
| 81 | + end |
| 82 | +end |
0 commit comments