podman

Форк
0
/
info.go 
168 строк · 6.2 Кб
1
package define
2

3
import (
4
	"github.com/containers/common/libnetwork/types"
5
	"github.com/containers/storage/pkg/idtools"
6
)
7

8
// Info is the overall struct that describes the host system
9
// running libpod/podman
10
// swagger:model LibpodInfo
11
type Info struct {
12
	Host       *HostInfo              `json:"host"`
13
	Store      *StoreInfo             `json:"store"`
14
	Registries map[string]interface{} `json:"registries"`
15
	Plugins    Plugins                `json:"plugins"`
16
	Version    Version                `json:"version"`
17
}
18

19
// SecurityInfo describes the libpod host
20
type SecurityInfo struct {
21
	AppArmorEnabled     bool   `json:"apparmorEnabled"`
22
	DefaultCapabilities string `json:"capabilities"`
23
	Rootless            bool   `json:"rootless"`
24
	SECCOMPEnabled      bool   `json:"seccompEnabled"`
25
	SECCOMPProfilePath  string `json:"seccompProfilePath"`
26
	SELinuxEnabled      bool   `json:"selinuxEnabled"`
27
}
28

29
// HostInfo describes the libpod host
30
type HostInfo struct {
31
	Arch               string            `json:"arch"`
32
	BuildahVersion     string            `json:"buildahVersion"`
33
	CgroupManager      string            `json:"cgroupManager"`
34
	CgroupsVersion     string            `json:"cgroupVersion"`
35
	CgroupControllers  []string          `json:"cgroupControllers"`
36
	Conmon             *ConmonInfo       `json:"conmon"`
37
	CPUs               int               `json:"cpus"`
38
	CPUUtilization     *CPUUsage         `json:"cpuUtilization"`
39
	DatabaseBackend    string            `json:"databaseBackend"`
40
	Distribution       DistributionInfo  `json:"distribution"`
41
	EventLogger        string            `json:"eventLogger"`
42
	FreeLocks          *uint32           `json:"freeLocks,omitempty"`
43
	Hostname           string            `json:"hostname"`
44
	IDMappings         IDMappings        `json:"idMappings,omitempty"`
45
	Kernel             string            `json:"kernel"`
46
	LogDriver          string            `json:"logDriver"`
47
	MemFree            int64             `json:"memFree"`
48
	MemTotal           int64             `json:"memTotal"`
49
	NetworkBackend     string            `json:"networkBackend"`
50
	NetworkBackendInfo types.NetworkInfo `json:"networkBackendInfo"`
51
	OCIRuntime         *OCIRuntimeInfo   `json:"ociRuntime"`
52
	OS                 string            `json:"os"`
53
	// RemoteSocket returns the UNIX domain socket the Podman service is listening on
54
	RemoteSocket *RemoteSocket `json:"remoteSocket,omitempty"`
55
	// RootlessNetworkCmd returns the default rootless network command (slirp4netns or pasta)
56
	RootlessNetworkCmd string                 `json:"rootlessNetworkCmd"`
57
	RuntimeInfo        map[string]interface{} `json:"runtimeInfo,omitempty"`
58
	// ServiceIsRemote is true when the podman/libpod service is remote to the client
59
	ServiceIsRemote bool         `json:"serviceIsRemote"`
60
	Security        SecurityInfo `json:"security"`
61
	Slirp4NetNS     SlirpInfo    `json:"slirp4netns,omitempty"`
62
	Pasta           PastaInfo    `json:"pasta,omitempty"`
63

64
	SwapFree  int64  `json:"swapFree"`
65
	SwapTotal int64  `json:"swapTotal"`
66
	Uptime    string `json:"uptime"`
67
	Variant   string `json:"variant"`
68
	Linkmode  string `json:"linkmode"`
69
}
70

71
// RemoteSocket describes information about the API socket
72
type RemoteSocket struct {
73
	Path   string `json:"path,omitempty"`
74
	Exists bool   `json:"exists"`
75
}
76

77
// SlirpInfo describes the slirp executable that is being used
78
type SlirpInfo struct {
79
	Executable string `json:"executable"`
80
	Package    string `json:"package"`
81
	Version    string `json:"version"`
82
}
83

84
// PastaInfo describes the pasta executable that is being used
85
type PastaInfo struct {
86
	Executable string `json:"executable"`
87
	Package    string `json:"package"`
88
	Version    string `json:"version"`
89
}
90

91
// IDMappings describe the GID and UID mappings
92
type IDMappings struct {
93
	GIDMap []idtools.IDMap `json:"gidmap"`
94
	UIDMap []idtools.IDMap `json:"uidmap"`
95
}
96

97
// DistributionInfo describes the host distribution for libpod
98
type DistributionInfo struct {
99
	Distribution string `json:"distribution"`
100
	Variant      string `json:"variant,omitempty"`
101
	Version      string `json:"version"`
102
	Codename     string `json:"codename,omitempty"`
103
}
104

105
// ConmonInfo describes the conmon executable being used
106
type ConmonInfo struct {
107
	Package string `json:"package"`
108
	Path    string `json:"path"`
109
	Version string `json:"version"`
110
}
111

112
// OCIRuntimeInfo describes the runtime (crun or runc) being
113
// used with podman
114
type OCIRuntimeInfo struct {
115
	Name    string `json:"name"`
116
	Package string `json:"package"`
117
	Path    string `json:"path"`
118
	Version string `json:"version"`
119
}
120

121
// StoreInfo describes the container storage and its
122
// attributes
123
type StoreInfo struct {
124
	ConfigFile      string                 `json:"configFile"`
125
	ContainerStore  ContainerStore         `json:"containerStore"`
126
	GraphDriverName string                 `json:"graphDriverName"`
127
	GraphOptions    map[string]interface{} `json:"graphOptions"`
128
	GraphRoot       string                 `json:"graphRoot"`
129
	// GraphRootAllocated is how much space the graphroot has in bytes
130
	GraphRootAllocated uint64 `json:"graphRootAllocated"`
131
	// GraphRootUsed is how much of graphroot is used in bytes
132
	GraphRootUsed   uint64            `json:"graphRootUsed"`
133
	GraphStatus     map[string]string `json:"graphStatus"`
134
	ImageCopyTmpDir string            `json:"imageCopyTmpDir"`
135
	ImageStore      ImageStore        `json:"imageStore"`
136
	RunRoot         string            `json:"runRoot"`
137
	VolumePath      string            `json:"volumePath"`
138
	TransientStore  bool              `json:"transientStore"`
139
}
140

141
// ImageStore describes the image store.  Right now only the number
142
// of images present
143
type ImageStore struct {
144
	Number int `json:"number"`
145
}
146

147
// ContainerStore describes the quantity of containers in the
148
// store by status
149
type ContainerStore struct {
150
	Number  int `json:"number"`
151
	Paused  int `json:"paused"`
152
	Running int `json:"running"`
153
	Stopped int `json:"stopped"`
154
}
155

156
type Plugins struct {
157
	Volume  []string `json:"volume"`
158
	Network []string `json:"network"`
159
	Log     []string `json:"log"`
160
	// Authorization is provided for compatibility, will always be nil as Podman has no daemon
161
	Authorization []string `json:"authorization"`
162
}
163

164
type CPUUsage struct {
165
	UserPercent   float64 `json:"userPercent"`
166
	SystemPercent float64 `json:"systemPercent"`
167
	IdlePercent   float64 `json:"idlePercent"`
168
}
169

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.