File: References.pl

package info (click to toggle)
libconfig-model-itself-perl 2.025-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 468 kB
  • sloc: perl: 3,507; makefile: 12
file content (99 lines) | stat: -rw-r--r-- 2,929 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
use strict;
use warnings;

return [
    [
        name      => 'MasterModel::References::Host',
        'element' => [
            if => {
                type              => 'hash',
                index_type        => 'string',
                cargo_type        => 'node',
                config_class_name => 'MasterModel::References::If',
            },
            trap => {
                type       => 'leaf',
                value_type => 'string'
            }
        ]
    ],
    [
        name    => 'MasterModel::References::If',
        element => [
            ip => {
                type       => 'leaf',
                value_type => 'string'
            }
        ]
    ],
    [
        name    => 'MasterModel::References::Lan',
        element => [
            node => {
                type              => 'hash',
                index_type        => 'string',
                cargo_type        => 'node',
                config_class_name => 'MasterModel::References::Node',
            },
        ]
    ],
    [
        name    => 'MasterModel::References::Node',
        element => [
            host => {
                type       => 'leaf',
                value_type => 'reference',
                refer_to   => '- host'
            },
            if => {
                type       => 'leaf',
                value_type => 'reference',
                refer_to   => [ '  - host:$h if ', h => '- host' ]
            },
            ip => {
                type       => 'leaf',
                value_type => 'string',
                compute    => [
                    '$ip',
                    ip   => '- host:$h if:$card ip',
                    h    => '- host',
                    card => '- if'
                ]
            }
        ]
    ],
    [
        name    => 'MasterModel::References',
        element => [
            host => {
                type              => 'hash',
                index_type        => 'string',
                cargo_type        => 'node',
                config_class_name => 'MasterModel::References::Host'
            },
            lan => {
                type              => 'hash',
                index_type        => 'string',
                cargo_type        => 'node',
                config_class_name => 'MasterModel::References::Lan'
            },
            host_and_choice => {
                type       => 'leaf',
                value_type => 'reference',
                refer_to   => ['- host '],
                choice     => [qw/foo bar/]
            },
            dumb_list => {
                type       => 'list',
                cargo_type => 'leaf',
                cargo_args => { value_type => 'string' }
            },
            refer_to_list_enum => {
                type       => 'leaf',
                value_type => 'reference',
                refer_to   => '- dumb_list',
            },

        ]
    ]
];