File: floating_ip.go

package info (click to toggle)
golang-github-hetznercloud-hcloud-go 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,072 kB
  • sloc: sh: 5; makefile: 2
file content (118 lines) | stat: -rw-r--r-- 4,219 bytes parent folder | download
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
package schema

import "time"

// FloatingIP defines the schema of a Floating IP.
type FloatingIP struct {
	ID           int64                `json:"id"`
	Description  *string              `json:"description"`
	Created      time.Time            `json:"created"`
	IP           string               `json:"ip"`
	Type         string               `json:"type"`
	Server       *int64               `json:"server"`
	DNSPtr       []FloatingIPDNSPtr   `json:"dns_ptr"`
	HomeLocation Location             `json:"home_location"`
	Blocked      bool                 `json:"blocked"`
	Protection   FloatingIPProtection `json:"protection"`
	Labels       map[string]string    `json:"labels"`
	Name         string               `json:"name"`
}

// FloatingIPProtection represents the protection level of a Floating IP.
type FloatingIPProtection struct {
	Delete bool `json:"delete"`
}

// FloatingIPDNSPtr contains reverse DNS information for a
// IPv4 or IPv6 Floating IP.
type FloatingIPDNSPtr struct {
	IP     string `json:"ip"`
	DNSPtr string `json:"dns_ptr"`
}

// FloatingIPGetResponse defines the schema of the response when
// retrieving a single Floating IP.
type FloatingIPGetResponse struct {
	FloatingIP FloatingIP `json:"floating_ip"`
}

// FloatingIPUpdateRequest defines the schema of the request to update a Floating IP.
type FloatingIPUpdateRequest struct {
	Description string             `json:"description,omitempty"`
	Labels      *map[string]string `json:"labels,omitempty"`
	Name        string             `json:"name,omitempty"`
}

// FloatingIPUpdateResponse defines the schema of the response when updating a Floating IP.
type FloatingIPUpdateResponse struct {
	FloatingIP FloatingIP `json:"floating_ip"`
}

// FloatingIPListResponse defines the schema of the response when
// listing Floating IPs.
type FloatingIPListResponse struct {
	FloatingIPs []FloatingIP `json:"floating_ips"`
}

// FloatingIPCreateRequest defines the schema of the request to
// create a Floating IP.
type FloatingIPCreateRequest struct {
	Type         string             `json:"type"`
	HomeLocation *string            `json:"home_location,omitempty"`
	Server       *int64             `json:"server,omitempty"`
	Description  *string            `json:"description,omitempty"`
	Labels       *map[string]string `json:"labels,omitempty"`
	Name         *string            `json:"name,omitempty"`
}

// FloatingIPCreateResponse defines the schema of the response
// when creating a Floating IP.
type FloatingIPCreateResponse struct {
	FloatingIP FloatingIP `json:"floating_ip"`
	Action     *Action    `json:"action"`
}

// FloatingIPActionAssignRequest defines the schema of the request to
// create an assign Floating IP action.
type FloatingIPActionAssignRequest struct {
	Server int64 `json:"server"`
}

// FloatingIPActionAssignResponse defines the schema of the response when
// creating an assign action.
type FloatingIPActionAssignResponse struct {
	Action Action `json:"action"`
}

// FloatingIPActionUnassignRequest defines the schema of the request to
// create an unassign Floating IP action.
type FloatingIPActionUnassignRequest struct{}

// FloatingIPActionUnassignResponse defines the schema of the response when
// creating an unassign action.
type FloatingIPActionUnassignResponse struct {
	Action Action `json:"action"`
}

// FloatingIPActionChangeDNSPtrRequest defines the schema for the request to
// change a Floating IP's reverse DNS pointer.
type FloatingIPActionChangeDNSPtrRequest struct {
	IP     string  `json:"ip"`
	DNSPtr *string `json:"dns_ptr"`
}

// FloatingIPActionChangeDNSPtrResponse defines the schema of the response when
// creating a change_dns_ptr Floating IP action.
type FloatingIPActionChangeDNSPtrResponse struct {
	Action Action `json:"action"`
}

// FloatingIPActionChangeProtectionRequest defines the schema of the request to change the resource protection of a Floating IP.
type FloatingIPActionChangeProtectionRequest struct {
	Delete *bool `json:"delete,omitempty"`
}

// FloatingIPActionChangeProtectionResponse defines the schema of the response when changing the resource protection of a Floating IP.
type FloatingIPActionChangeProtectionResponse struct {
	Action Action `json:"action"`
}