forked from CiscoDevNet/ydk-go
/
drivers_mpa_infra_cfg.go
134 lines (110 loc) · 5.21 KB
/
drivers_mpa_infra_cfg.go
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// This module contains a collection of YANG definitions
// for Cisco IOS-XR drivers-mpa-infra package configuration.
//
// This module contains definitions
// for the following management objects:
// hardware-module: Configure subslot h/w module
//
// Copyright (c) 2013-2018 by Cisco Systems, Inc.
// All rights reserved.
package drivers_mpa_infra_cfg
import (
"fmt"
"github.com/CiscoDevNet/ydk-go/ydk"
"github.com/CiscoDevNet/ydk-go/ydk/types"
"github.com/CiscoDevNet/ydk-go/ydk/types/yfilter"
"github.com/CiscoDevNet/ydk-go/ydk/models/cisco_ios_xr"
"reflect"
)
func init() {
ydk.YLogDebug(fmt.Sprintf("Registering top level entities for package drivers_mpa_infra_cfg"))
ydk.RegisterEntity("{http://cisco.com/ns/yang/Cisco-IOS-XR-drivers-mpa-infra-cfg hardware-module}", reflect.TypeOf(HardwareModule{}))
ydk.RegisterEntity("Cisco-IOS-XR-drivers-mpa-infra-cfg:hardware-module", reflect.TypeOf(HardwareModule{}))
}
// HwModuleShutdownPowerMode represents Hw module shutdown power mode
type HwModuleShutdownPowerMode string
const (
// Keep the showdown module powered (default)
HwModuleShutdownPowerMode_powered HwModuleShutdownPowerMode = "powered"
)
// HardwareModule
// Configure subslot h/w module
type HardwareModule struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// subslot h/w module.
Nodes HardwareModule_Nodes
}
func (hardwareModule *HardwareModule) GetEntityData() *types.CommonEntityData {
hardwareModule.EntityData.YFilter = hardwareModule.YFilter
hardwareModule.EntityData.YangName = "hardware-module"
hardwareModule.EntityData.BundleName = "cisco_ios_xr"
hardwareModule.EntityData.ParentYangName = "Cisco-IOS-XR-drivers-mpa-infra-cfg"
hardwareModule.EntityData.SegmentPath = "Cisco-IOS-XR-drivers-mpa-infra-cfg:hardware-module"
hardwareModule.EntityData.AbsolutePath = hardwareModule.EntityData.SegmentPath
hardwareModule.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
hardwareModule.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
hardwareModule.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
hardwareModule.EntityData.Children = types.NewOrderedMap()
hardwareModule.EntityData.Children.Append("nodes", types.YChild{"Nodes", &hardwareModule.Nodes})
hardwareModule.EntityData.Leafs = types.NewOrderedMap()
hardwareModule.EntityData.YListKeys = []string {}
return &(hardwareModule.EntityData)
}
// HardwareModule_Nodes
// subslot h/w module
type HardwareModule_Nodes struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// The identifier for a SPA node. The type is slice of
// HardwareModule_Nodes_Node.
Node []*HardwareModule_Nodes_Node
}
func (nodes *HardwareModule_Nodes) GetEntityData() *types.CommonEntityData {
nodes.EntityData.YFilter = nodes.YFilter
nodes.EntityData.YangName = "nodes"
nodes.EntityData.BundleName = "cisco_ios_xr"
nodes.EntityData.ParentYangName = "hardware-module"
nodes.EntityData.SegmentPath = "nodes"
nodes.EntityData.AbsolutePath = "Cisco-IOS-XR-drivers-mpa-infra-cfg:hardware-module/" + nodes.EntityData.SegmentPath
nodes.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
nodes.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
nodes.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
nodes.EntityData.Children = types.NewOrderedMap()
nodes.EntityData.Children.Append("node", types.YChild{"Node", nil})
for i := range nodes.Node {
nodes.EntityData.Children.Append(types.GetSegmentPath(nodes.Node[i]), types.YChild{"Node", nodes.Node[i]})
}
nodes.EntityData.Leafs = types.NewOrderedMap()
nodes.EntityData.YListKeys = []string {}
return &(nodes.EntityData)
}
// HardwareModule_Nodes_Node
// The identifier for a SPA node
type HardwareModule_Nodes_Node struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
YListKey string
// This attribute is a key. A SPA node. The type is string with pattern:
// ([a-zA-Z0-9_]*\d+/){1,2}([a-zA-Z0-9_]*\d+).
NodeName interface{}
// Shutdown a subslot h/w module. The type is HwModuleShutdownPowerMode.
Shutdown interface{}
}
func (node *HardwareModule_Nodes_Node) GetEntityData() *types.CommonEntityData {
node.EntityData.YFilter = node.YFilter
node.EntityData.YangName = "node"
node.EntityData.BundleName = "cisco_ios_xr"
node.EntityData.ParentYangName = "nodes"
node.EntityData.SegmentPath = "node" + types.AddKeyToken(node.NodeName, "node-name")
node.EntityData.AbsolutePath = "Cisco-IOS-XR-drivers-mpa-infra-cfg:hardware-module/nodes/" + node.EntityData.SegmentPath
node.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
node.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
node.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
node.EntityData.Children = types.NewOrderedMap()
node.EntityData.Leafs = types.NewOrderedMap()
node.EntityData.Leafs.Append("node-name", types.YLeaf{"NodeName", node.NodeName})
node.EntityData.Leafs.Append("shutdown", types.YLeaf{"Shutdown", node.Shutdown})
node.EntityData.YListKeys = []string {"NodeName"}
return &(node.EntityData)
}