@@ -12,14 +12,24 @@ const vpc2Path = "/v2/vpc2"
12
12
13
13
// VPC2Service is the interface to interact with the VPC 2.0 endpoints on the Vultr API
14
14
// Link : https://www.vultr.com/api/#tag/vpc2
15
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
16
+ // future release
15
17
type VPC2Service interface {
18
+ // Deprecated: VPC2 is no longer supported
16
19
Create (ctx context.Context , createReq * VPC2Req ) (* VPC2 , * http.Response , error )
20
+ // Deprecated: VPC2 is no longer supported
17
21
Get (ctx context.Context , vpcID string ) (* VPC2 , * http.Response , error )
22
+ // Deprecated: VPC2 is no longer supported
18
23
Update (ctx context.Context , vpcID string , description string ) error
24
+ // Deprecated: VPC2 is no longer supported
19
25
Delete (ctx context.Context , vpcID string ) error
26
+ // Deprecated: VPC2 is no longer supported
20
27
List (ctx context.Context , options * ListOptions ) ([]VPC2 , * Meta , * http.Response , error )
28
+ // Deprecated: VPC2 is no longer supported
21
29
ListNodes (ctx context.Context , vpc2ID string , options * ListOptions ) ([]VPC2Node , * Meta , * http.Response , error )
30
+ // Deprecated: VPC2 is no longer supported
22
31
Attach (ctx context.Context , vpcID string , attachReq * VPC2AttachDetachReq ) error
32
+ // Deprecated: VPC2 is no longer supported
23
33
Detach (ctx context.Context , vpcID string , detachReq * VPC2AttachDetachReq ) error
24
34
}
25
35
@@ -29,6 +39,8 @@ type VPC2ServiceHandler struct {
29
39
}
30
40
31
41
// VPC2 represents a Vultr VPC 2.0
42
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
43
+ // future release
32
44
type VPC2 struct {
33
45
ID string `json:"id"`
34
46
Region string `json:"region"`
@@ -77,6 +89,8 @@ type vpc2NodesBase struct {
77
89
}
78
90
79
91
// Create creates a new VPC 2.0. A VPC 2.0 can only be used at the location for which it was created.
92
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
93
+ // future release
80
94
func (n * VPC2ServiceHandler ) Create (ctx context.Context , createReq * VPC2Req ) (* VPC2 , * http.Response , error ) {
81
95
req , err := n .client .NewRequest (ctx , http .MethodPost , vpc2Path , createReq )
82
96
if err != nil {
@@ -93,6 +107,8 @@ func (n *VPC2ServiceHandler) Create(ctx context.Context, createReq *VPC2Req) (*V
93
107
}
94
108
95
109
// Get gets the VPC 2.0 of the requested ID
110
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
111
+ // future release
96
112
func (n * VPC2ServiceHandler ) Get (ctx context.Context , vpcID string ) (* VPC2 , * http.Response , error ) {
97
113
uri := fmt .Sprintf ("%s/%s" , vpc2Path , vpcID )
98
114
req , err := n .client .NewRequest (ctx , http .MethodGet , uri , nil )
@@ -110,6 +126,8 @@ func (n *VPC2ServiceHandler) Get(ctx context.Context, vpcID string) (*VPC2, *htt
110
126
}
111
127
112
128
// Update updates a VPC 2.0
129
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
130
+ // future release
113
131
func (n * VPC2ServiceHandler ) Update (ctx context.Context , vpcID , description string ) error {
114
132
uri := fmt .Sprintf ("%s/%s" , vpc2Path , vpcID )
115
133
@@ -124,6 +142,8 @@ func (n *VPC2ServiceHandler) Update(ctx context.Context, vpcID, description stri
124
142
}
125
143
126
144
// Delete deletes a VPC 2.0. Before deleting, a VPC 2.0 must be disabled from all instances
145
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
146
+ // future release
127
147
func (n * VPC2ServiceHandler ) Delete (ctx context.Context , vpcID string ) error {
128
148
uri := fmt .Sprintf ("%s/%s" , vpc2Path , vpcID )
129
149
req , err := n .client .NewRequest (ctx , http .MethodDelete , uri , nil )
@@ -135,6 +155,8 @@ func (n *VPC2ServiceHandler) Delete(ctx context.Context, vpcID string) error {
135
155
}
136
156
137
157
// List lists all VPCs 2.0 on the current account
158
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
159
+ // future release
138
160
func (n * VPC2ServiceHandler ) List (ctx context.Context , options * ListOptions ) ([]VPC2 , * Meta , * http.Response , error ) { //nolint:dupl
139
161
req , err := n .client .NewRequest (ctx , http .MethodGet , vpc2Path , nil )
140
162
if err != nil {
@@ -158,6 +180,8 @@ func (n *VPC2ServiceHandler) List(ctx context.Context, options *ListOptions) ([]
158
180
}
159
181
160
182
// ListNodes lists all nodes attached to a VPC 2.0 network
183
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
184
+ // future release
161
185
func (n * VPC2ServiceHandler ) ListNodes (ctx context.Context , vpc2ID string , options * ListOptions ) ([]VPC2Node , * Meta , * http.Response , error ) { //nolint:dupl,lll
162
186
uri := fmt .Sprintf ("%s/%s/nodes" , vpc2Path , vpc2ID )
163
187
@@ -183,6 +207,8 @@ func (n *VPC2ServiceHandler) ListNodes(ctx context.Context, vpc2ID string, optio
183
207
}
184
208
185
209
// Attach attaches nodes to a VPC 2.0 network
210
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
211
+ // future release
186
212
func (n * VPC2ServiceHandler ) Attach (ctx context.Context , vpcID string , attachReq * VPC2AttachDetachReq ) error {
187
213
uri := fmt .Sprintf ("%s/%s/nodes/attach" , vpc2Path , vpcID )
188
214
@@ -196,6 +222,8 @@ func (n *VPC2ServiceHandler) Attach(ctx context.Context, vpcID string, attachReq
196
222
}
197
223
198
224
// Detach detaches nodes from a VPC 2.0 network
225
+ // Deprecated: VPC2 is no longer supported and functionality will cease in a
226
+ // future release
199
227
func (n * VPC2ServiceHandler ) Detach (ctx context.Context , vpcID string , detachReq * VPC2AttachDetachReq ) error {
200
228
uri := fmt .Sprintf ("%s/%s/nodes/detach" , vpc2Path , vpcID )
201
229
0 commit comments