-
Notifications
You must be signed in to change notification settings - Fork 21
/
types.go
68 lines (51 loc) · 2.08 KB
/
types.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
/*
Copyright 2023 IONOS Cloud.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
// VirtualMachineState describes the state of a VM.
type VirtualMachineState string
const (
// VirtualMachineStateNotFound is the string representing a VM that
// cannot be located.
VirtualMachineStateNotFound VirtualMachineState = "notfound"
// VirtualMachineStatePending is the string representing a VM with an in-flight task.
VirtualMachineStatePending VirtualMachineState = "pending"
// VirtualMachineStateReady is the string representing a powered-on VM with reported IP addresses.
VirtualMachineStateReady VirtualMachineState = "ready"
)
// VirtualMachine represents data about a Proxmox virtual machine object.
type VirtualMachine struct {
// Node is the VM node.
Node string `json:"node"`
// Name is the VM's name.
Name string `json:"name"`
// VMID is the VM's ID.
VMID uint64 `json:"vmID"`
// State is the VM's state.
State VirtualMachineState `json:"state"`
// Network is the status of the VM's network devices.
Network []NetworkStatus `json:"network"`
}
// NetworkStatus provides information about one of a VM's networks.
type NetworkStatus struct {
// Connected is a flag that indicates whether this network is currently
// connected to the VM.
Connected bool `json:"connected,omitempty"`
// IPAddrs is one or more IP addresses reported by vm-tools.
// +optional
IPAddrs []string `json:"ipAddrs,omitempty"`
// MACAddr is the MAC address of the network device.
MACAddr string `json:"macAddr"`
// NetworkName is the name of the network.
// +optional
NetworkName string `json:"networkName,omitempty"`
}