aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/yandex/deploy/podagent/responses.go
blob: e97c70dc7c9817fa7691565d41bc022eb230a612 (plain) (blame)
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
package podagent

import (
	"encoding/json"
	"net"
)

type BoxStatus struct {
	ID       string `json:"id"`
	Revision uint32 `json:"revision"`
}

type WorkloadStatus struct {
	ID       string `json:"id"`
	Revision uint32 `json:"revision"`
}

type PodStatusResponse struct {
	Boxes     []BoxStatus      `json:"boxes"`
	Workloads []WorkloadStatus `json:"workloads"`
}

type MemoryResource struct {
	Guarantee uint64 `json:"memory_guarantee_bytes"`
	Limit     uint64 `json:"memory_limit_bytes"`
}

type CPUResource struct {
	Guarantee float64 `json:"cpu_guarantee_millicores"`
	Limit     float64 `json:"cpu_limit_millicores"`
}

type ResourceRequirements struct {
	Memory MemoryResource `json:"memory"`
	CPU    CPUResource    `json:"cpu"`
}

type NodeMeta struct {
	DC      string `json:"dc"`
	Cluster string `json:"cluster"`
	FQDN    string `json:"fqdn"`
}

type PodMeta struct {
	PodID       string          `json:"pod_id"`
	PodSetID    string          `json:"pod_set_id"`
	Annotations json.RawMessage `json:"annotations"`
	Labels      json.RawMessage `json:"labels"`
}

type Resources struct {
	Boxes map[string]ResourceRequirements `json:"box_resource_requirements"`
	Pod   ResourceRequirements            `json:"resource_requirements"`
}

type InternetAddress struct {
	Address net.IP `json:"ip4_address"`
	ID      string `json:"id"`
}

type VirtualService struct {
	IPv4Addrs []net.IP `json:"ip4_addresses"`
	IPv6Addrs []net.IP `json:"ip6_addresses"`
}

type IPAllocation struct {
	InternetAddress InternetAddress   `json:"internet_address"`
	TransientFQDN   string            `json:"transient_fqdn"`
	PersistentFQDN  string            `json:"persistent_fqdn"`
	Addr            net.IP            `json:"address"`
	VlanID          string            `json:"vlan_id"`
	VirtualServices []VirtualService  `json:"virtual_services"`
	Labels          map[string]string `json:"labels"`
}

type PodAttributesResponse struct {
	NodeMeta          NodeMeta                        `json:"node_meta"`
	PodMeta           PodMeta                         `json:"metadata"`
	BoxesRequirements map[string]ResourceRequirements `json:"box_resource_requirements"`
	PodRequirements   ResourceRequirements            `json:"resource_requirements"`
	IPAllocations     []IPAllocation                  `json:"ip6_address_allocations"`
}