-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpc-components.yang
99 lines (90 loc) · 2.03 KB
/
pc-components.yang
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
module pc-components {
yang-version 1.1;
namespace "urn:example:pc-components";
prefix pc;
organization "Example Organization";
contact "[email protected]";
description "YANG module for describing PC components.";
revision "2024-06-03" {
description "Initial Revision";
}
container pc {
description "Personal Computer (PC) component.";
// Define the main components of a PC
// CPU component
container cpu {
description "Central Processing Unit (CPU) component.";
leaf brand {
type string;
description "Brand of the CPU.";
}
leaf model {
type string;
description "Model of the CPU.";
}
leaf cores {
type uint16;
description "Number of CPU cores.";
}
leaf speed {
type decimal64 {
fraction-digits 2;
}
description "Speed of the CPU in GHz.";
}
}
// Memory component
container memory {
description "Random Access Memory (RAM) component.";
leaf size {
type uint64;
description "Size of the RAM in megabytes (MB).";
}
leaf type {
type string;
description "Type of memory (e.g., DDR4).";
}
leaf speed {
type uint32;
description "Speed of the RAM in MHz.";
}
}
// Storage component
container storage {
description "Storage component (e.g., Hard Disk Drive, Solid State Drive).";
leaf type {
type enumeration {
enum HDD;
enum SSD;
}
description "Type of storage (HDD or SSD).";
}
leaf capacity {
type uint64;
description "Capacity of the storage in gigabytes (GB).";
}
}
// Peripheral devices component
container peripherals {
description "Peripheral devices connected to the PC.";
list device {
key name;
description "List of peripheral devices.";
leaf name {
type string;
description "Name of the peripheral device.";
}
leaf type {
type enumeration {
enum keyboard;
enum mouse;
enum monitor;
enum printer;
// Add more peripheral types as needed
}
description "Type of the peripheral device.";
}
}
}
}
}