diff --git a/driver/fakeClient.go b/driver/fakeClient.go index 4f9c9385..524a2acc 100644 --- a/driver/fakeClient.go +++ b/driver/fakeClient.go @@ -196,21 +196,6 @@ func (f *FakeInstance) GetNeighbors(_ context.Context, _ string) (*govultr.Neigh panic("implement me") } -// ListPrivateNetworks gets private networks -func (f *FakeInstance) ListPrivateNetworks(_ context.Context, _ string, _ *govultr.ListOptions) ([]govultr.PrivateNetwork, *govultr.Meta, *http.Response, error) { //nolint:lll - panic("implement me") -} - -// AttachPrivateNetwork attches private networks -func (f *FakeInstance) AttachPrivateNetwork(_ context.Context, _, _ string) error { - panic("implement me") -} - -// DetachPrivateNetwork detaches private network from instance -func (f *FakeInstance) DetachPrivateNetwork(_ context.Context, _, _ string) error { - panic("implement me") -} - // ListVPCInfo is not implemented func (f *FakeInstance) ListVPCInfo(ctx context.Context, instanceID string, options *govultr.ListOptions) ([]govultr.VPCInfo, *govultr.Meta, *http.Response, error) { //nolint:lll panic("implement me") diff --git a/go.mod b/go.mod index c6845bc2..0c5cdd79 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/container-storage-interface/spec v1.10.0 github.com/golang/protobuf v1.5.4 github.com/sirupsen/logrus v1.9.3 - github.com/vultr/govultr/v3 v3.9.1 + github.com/vultr/govultr/v3 v3.11.1 github.com/vultr/metadata v1.1.0 golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 diff --git a/go.sum b/go.sum index 4981a56a..5d9cac52 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/vultr/govultr/v3 v3.9.1 h1:uxSIb8Miel7tqTs3ee+z3t+JelZikwqBBsZzCOPBy/8= -github.com/vultr/govultr/v3 v3.9.1/go.mod h1:Rd8ebpXm7jxH3MDmhnEs+zrlYW212ouhx+HeUMfHm2o= +github.com/vultr/govultr/v3 v3.11.1 h1:Wc6wFTwh/gBZlOqSK1Hn3P9JWoFa7NCf52vGLwQcJOg= +github.com/vultr/govultr/v3 v3.11.1/go.mod h1:q34Wd76upKmf+vxFMgaNMH3A8BbsPBmSYZUGC8oZa5w= github.com/vultr/metadata v1.1.0 h1:RUjCnH5Mdlz7uuyfb1jOZNkU72zl/HwK76jLzVFdiOo= github.com/vultr/metadata v1.1.0/go.mod h1:4yocaI6h2EFJzwN0m1KnnC/vDCx2axIqnyxmtF/LWoQ= golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= diff --git a/vendor/github.com/godbus/dbus/v5/conn_other.go b/vendor/github.com/godbus/dbus/v5/conn_other.go index 94ff6576..90289ca8 100644 --- a/vendor/github.com/godbus/dbus/v5/conn_other.go +++ b/vendor/github.com/godbus/dbus/v5/conn_other.go @@ -1,4 +1,3 @@ -//go:build !darwin // +build !darwin package dbus @@ -43,10 +42,10 @@ func getSessionBusPlatformAddress() (string, error) { // It tries different techniques employed by different operating systems, // returning the first valid address it finds, or an empty string. // -// - /run/user//bus if this exists, it *is* the bus socket. present on -// Ubuntu 18.04 -// - /run/user//dbus-session: if this exists, it can be parsed for the bus -// address. present on Ubuntu 16.04 +// * /run/user//bus if this exists, it *is* the bus socket. present on +// Ubuntu 18.04 +// * /run/user//dbus-session: if this exists, it can be parsed for the bus +// address. present on Ubuntu 16.04 // // See https://dbus.freedesktop.org/doc/dbus-launch.1.html func tryDiscoverDbusSessionBusAddress() string { diff --git a/vendor/github.com/godbus/dbus/v5/conn_unix.go b/vendor/github.com/godbus/dbus/v5/conn_unix.go index 1a0daa65..58aee7d2 100644 --- a/vendor/github.com/godbus/dbus/v5/conn_unix.go +++ b/vendor/github.com/godbus/dbus/v5/conn_unix.go @@ -1,5 +1,4 @@ -//go:build !windows && !solaris && !darwin -// +build !windows,!solaris,!darwin +//+build !windows,!solaris,!darwin package dbus diff --git a/vendor/github.com/godbus/dbus/v5/conn_windows.go b/vendor/github.com/godbus/dbus/v5/conn_windows.go index 0515dd00..4291e451 100644 --- a/vendor/github.com/godbus/dbus/v5/conn_windows.go +++ b/vendor/github.com/godbus/dbus/v5/conn_windows.go @@ -1,5 +1,4 @@ -//go:build windows -// +build windows +//+build windows package dbus diff --git a/vendor/github.com/godbus/dbus/v5/default_handler.go b/vendor/github.com/godbus/dbus/v5/default_handler.go index 7ea7e75e..13132c6b 100644 --- a/vendor/github.com/godbus/dbus/v5/default_handler.go +++ b/vendor/github.com/godbus/dbus/v5/default_handler.go @@ -18,9 +18,9 @@ func newIntrospectIntf(h *defaultHandler) *exportedIntf { return newExportedIntf(methods, true) } -// NewDefaultHandler returns an instance of the default -// call handler. This is useful if you want to implement only -// one of the two handlers but not both. +//NewDefaultHandler returns an instance of the default +//call handler. This is useful if you want to implement only +//one of the two handlers but not both. // // Deprecated: this is the default value, don't use it, it will be unexported. func NewDefaultHandler() *defaultHandler { @@ -242,9 +242,9 @@ func (obj *exportedIntf) isFallbackInterface() bool { return obj.includeSubtree } -// NewDefaultSignalHandler returns an instance of the default -// signal handler. This is useful if you want to implement only -// one of the two handlers but not both. +//NewDefaultSignalHandler returns an instance of the default +//signal handler. This is useful if you want to implement only +//one of the two handlers but not both. // // Deprecated: this is the default value, don't use it, it will be unexported. func NewDefaultSignalHandler() *defaultSignalHandler { diff --git a/vendor/github.com/godbus/dbus/v5/doc.go b/vendor/github.com/godbus/dbus/v5/doc.go index 09eedc71..8f25a00d 100644 --- a/vendor/github.com/godbus/dbus/v5/doc.go +++ b/vendor/github.com/godbus/dbus/v5/doc.go @@ -7,7 +7,7 @@ on remote objects and emit or receive signals. Using the Export method, you can arrange D-Bus methods calls to be directly translated to method calls on a Go value. -# Conversion Rules +Conversion Rules For outgoing messages, Go types are automatically converted to the corresponding D-Bus types. See the official specification at @@ -15,25 +15,25 @@ https://dbus.freedesktop.org/doc/dbus-specification.html#type-system for more information on the D-Bus type system. The following types are directly encoded as their respective D-Bus equivalents: - Go type | D-Bus type - ------------+----------- - byte | BYTE - bool | BOOLEAN - int16 | INT16 - uint16 | UINT16 - int | INT32 - uint | UINT32 - int32 | INT32 - uint32 | UINT32 - int64 | INT64 - uint64 | UINT64 - float64 | DOUBLE - string | STRING - ObjectPath | OBJECT_PATH - Signature | SIGNATURE - Variant | VARIANT - interface{} | VARIANT - UnixFDIndex | UNIX_FD + Go type | D-Bus type + ------------+----------- + byte | BYTE + bool | BOOLEAN + int16 | INT16 + uint16 | UINT16 + int | INT32 + uint | UINT32 + int32 | INT32 + uint32 | UINT32 + int64 | INT64 + uint64 | UINT64 + float64 | DOUBLE + string | STRING + ObjectPath | OBJECT_PATH + Signature | SIGNATURE + Variant | VARIANT + interface{} | VARIANT + UnixFDIndex | UNIX_FD Slices and arrays encode as ARRAYs of their element type. @@ -57,7 +57,7 @@ of STRUCTs. Incoming STRUCTS are represented as a slice of empty interfaces containing the struct fields in the correct order. The Store function can be used to convert such values to Go structs. -# Unix FD passing +Unix FD passing Handling Unix file descriptors deserves special mention. To use them, you should first check that they are supported on a connection by calling SupportsUnixFDs. @@ -66,5 +66,6 @@ UnixFD's to messages that are accompanied by the given file descriptors with the UnixFD values being substituted by the correct indices. Similarly, the indices of incoming messages are automatically resolved. It shouldn't be necessary to use UnixFDIndex. + */ package dbus diff --git a/vendor/github.com/godbus/dbus/v5/sequential_handler.go b/vendor/github.com/godbus/dbus/v5/sequential_handler.go index 886b5eb1..ef2fcdba 100644 --- a/vendor/github.com/godbus/dbus/v5/sequential_handler.go +++ b/vendor/github.com/godbus/dbus/v5/sequential_handler.go @@ -93,7 +93,7 @@ func (scd *sequentialSignalChannelData) bufferSignals() { var queue []*Signal for { if len(queue) == 0 { - signal, ok := <-scd.in + signal, ok := <- scd.in if !ok { return } diff --git a/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go b/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go index a61a8208..697739ef 100644 --- a/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go +++ b/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go @@ -1,5 +1,4 @@ -//go:build !windows -// +build !windows +//+build !windows package dbus diff --git a/vendor/github.com/godbus/dbus/v5/transport_unix.go b/vendor/github.com/godbus/dbus/v5/transport_unix.go index ffccff0c..0a8c712e 100644 --- a/vendor/github.com/godbus/dbus/v5/transport_unix.go +++ b/vendor/github.com/godbus/dbus/v5/transport_unix.go @@ -1,5 +1,4 @@ -//go:build !windows && !solaris -// +build !windows,!solaris +//+build !windows,!solaris package dbus diff --git a/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go index f1693df9..91198f81 100644 --- a/vendor/github.com/google/go-querystring/query/encode.go +++ b/vendor/github.com/google/go-querystring/query/encode.go @@ -6,15 +6,15 @@ // // As a simple example: // -// type Options struct { -// Query string `url:"q"` -// ShowAll bool `url:"all"` -// Page int `url:"page"` -// } +// type Options struct { +// Query string `url:"q"` +// ShowAll bool `url:"all"` +// Page int `url:"page"` +// } // -// opt := Options{ "foo", true, 2 } -// v, _ := query.Values(opt) -// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" +// opt := Options{ "foo", true, 2 } +// v, _ := query.Values(opt) +// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" // // The exact mapping between Go values and url.Values is described in the // documentation for the Values() function. @@ -47,8 +47,8 @@ type Encoder interface { // // Each exported struct field is encoded as a URL parameter unless // -// - the field's tag is "-", or -// - the field is empty and its tag specifies the "omitempty" option +// - the field's tag is "-", or +// - the field is empty and its tag specifies the "omitempty" option // // The empty values are false, 0, any nil pointer or interface value, any array // slice, map, or string of length zero, and any type (such as time.Time) that @@ -59,19 +59,19 @@ type Encoder interface { // field's tag value is the key name, followed by an optional comma and // options. For example: // -// // Field is ignored by this package. -// Field int `url:"-"` +// // Field is ignored by this package. +// Field int `url:"-"` // -// // Field appears as URL parameter "myName". -// Field int `url:"myName"` +// // Field appears as URL parameter "myName". +// Field int `url:"myName"` // -// // Field appears as URL parameter "myName" and the field is omitted if -// // its value is empty -// Field int `url:"myName,omitempty"` +// // Field appears as URL parameter "myName" and the field is omitted if +// // its value is empty +// Field int `url:"myName,omitempty"` // -// // Field appears as URL parameter "Field" (the default), but the field -// // is skipped if empty. Note the leading comma. -// Field int `url:",omitempty"` +// // Field appears as URL parameter "Field" (the default), but the field +// // is skipped if empty. Note the leading comma. +// Field int `url:",omitempty"` // // For encoding individual field values, the following type-dependent rules // apply: @@ -88,8 +88,8 @@ type Encoder interface { // "url" tag) will use the value of the "layout" tag as a layout passed to // time.Format. For example: // -// // Encode a time.Time as YYYY-MM-DD -// Field time.Time `layout:"2006-01-02"` +// // Encode a time.Time as YYYY-MM-DD +// Field time.Time `layout:"2006-01-02"` // // Slice and Array values default to encoding as multiple URL values of the // same name. Including the "comma" option signals that the field should be @@ -103,9 +103,9 @@ type Encoder interface { // from the "url" tag) will use the value of the "del" tag as the delimiter. // For example: // -// // Encode a slice of bools as ints ("1" for true, "0" for false), -// // separated by exclamation points "!". -// Field []bool `url:",int" del:"!"` +// // Encode a slice of bools as ints ("1" for true, "0" for false), +// // separated by exclamation points "!". +// Field []bool `url:",int" del:"!"` // // Anonymous struct fields are usually encoded as if their inner exported // fields were fields in the outer struct, subject to the standard Go @@ -117,7 +117,7 @@ type Encoder interface { // Nested structs are encoded including parent fields in value names for // scoping. e.g: // -// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" +// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" // // All other values are encoded using their default string representation. // diff --git a/vendor/github.com/hashicorp/go-cleanhttp/doc.go b/vendor/github.com/hashicorp/go-cleanhttp/doc.go index 905859c7..05841092 100644 --- a/vendor/github.com/hashicorp/go-cleanhttp/doc.go +++ b/vendor/github.com/hashicorp/go-cleanhttp/doc.go @@ -16,4 +16,5 @@ // connecting to the same hosts repeatedly from the same client, you can use // DefaultPooledClient to receive a client that has connection pooling // semantics similar to http.DefaultClient. +// package cleanhttp diff --git a/vendor/github.com/sirupsen/logrus/doc.go b/vendor/github.com/sirupsen/logrus/doc.go index 51392be8..da67aba0 100644 --- a/vendor/github.com/sirupsen/logrus/doc.go +++ b/vendor/github.com/sirupsen/logrus/doc.go @@ -1,25 +1,25 @@ /* Package logrus is a structured logger for Go, completely API compatible with the standard library logger. + The simplest way to use Logrus is simply the package-level exported logger: - package main + package main - import ( - log "github.com/sirupsen/logrus" - ) + import ( + log "github.com/sirupsen/logrus" + ) - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } + func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "number": 1, + "size": 10, + }).Info("A walrus appears") + } Output: - - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 + time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 For a full guide visit https://github.com/sirupsen/logrus */ diff --git a/vendor/github.com/sirupsen/logrus/formatter.go b/vendor/github.com/sirupsen/logrus/formatter.go index 8c761551..40888377 100644 --- a/vendor/github.com/sirupsen/logrus/formatter.go +++ b/vendor/github.com/sirupsen/logrus/formatter.go @@ -30,12 +30,12 @@ type Formatter interface { // This is to not silently overwrite `time`, `msg`, `func` and `level` fields when // dumping it. If this code wasn't there doing: // -// logrus.WithField("level", 1).Info("hello") +// logrus.WithField("level", 1).Info("hello") // // Would just silently drop the user provided level. Instead with this code // it'll logged as: // -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} +// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} // // It's not exported because it's still using Data in an opinionated way. It's to // avoid code duplication between the two default formatters. diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go index df059412..5ff0aef6 100644 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -76,12 +76,12 @@ func (mw *MutexWrap) Disable() { // `Out` and `Hooks` directly on the default logger instance. You can also just // instantiate your own: // -// var log = &logrus.Logger{ -// Out: os.Stderr, -// Formatter: new(logrus.TextFormatter), -// Hooks: make(logrus.LevelHooks), -// Level: logrus.DebugLevel, -// } +// var log = &logrus.Logger{ +// Out: os.Stderr, +// Formatter: new(logrus.TextFormatter), +// Hooks: make(logrus.LevelHooks), +// Level: logrus.DebugLevel, +// } // // It's recommended to make this a global instance called `log`. func New() *Logger { @@ -347,9 +347,9 @@ func (logger *Logger) Exit(code int) { logger.ExitFunc(code) } -// When file is opened with appending mode, it's safe to -// write concurrently to a file (within 4k message on Linux). -// In these cases user can choose to disable the lock. +//When file is opened with appending mode, it's safe to +//write concurrently to a file (within 4k message on Linux). +//In these cases user can choose to disable the lock. func (logger *Logger) SetNoLock() { logger.mu.Disable() } diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go index 45de3e2b..2403de98 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go @@ -1,4 +1,3 @@ -//go:build appengine // +build appengine package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go index e3fa38b7..49978998 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go @@ -1,4 +1,3 @@ -//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && !js // +build darwin dragonfly freebsd netbsd openbsd // +build !js diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_js.go b/vendor/github.com/sirupsen/logrus/terminal_check_js.go index 9e951f1b..ebdae3ec 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_js.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_js.go @@ -1,4 +1,3 @@ -//go:build js // +build js package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go b/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go index 04232da1..97af92c6 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go @@ -1,4 +1,3 @@ -//go:build js || nacl || plan9 // +build js nacl plan9 package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go index 1b4a99e3..3293fb3c 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go @@ -1,4 +1,3 @@ -//go:build !appengine && !js && !windows && !nacl && !plan9 // +build !appengine,!js,!windows,!nacl,!plan9 package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go index f3154b17..04748b85 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go @@ -1,4 +1,3 @@ -//go:build (linux || aix || zos) && !js // +build linux aix zos // +build !js diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go index 893c6241..2879eb50 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go @@ -1,4 +1,3 @@ -//go:build !appengine && !js && windows // +build !appengine,!js,windows package logrus diff --git a/vendor/github.com/vultr/govultr/v3/.golangci.yaml b/vendor/github.com/vultr/govultr/v3/.golangci.yaml index c5060cb0..232f761c 100644 --- a/vendor/github.com/vultr/govultr/v3/.golangci.yaml +++ b/vendor/github.com/vultr/govultr/v3/.golangci.yaml @@ -68,7 +68,6 @@ linters: - dogsled - dupl - errcheck - - exportloopref - funlen - gochecknoinits - goconst diff --git a/vendor/github.com/vultr/govultr/v3/CHANGELOG.md b/vendor/github.com/vultr/govultr/v3/CHANGELOG.md index 71ac9ae5..bab0a157 100644 --- a/vendor/github.com/vultr/govultr/v3/CHANGELOG.md +++ b/vendor/github.com/vultr/govultr/v3/CHANGELOG.md @@ -1,4 +1,39 @@ # Change Log +## [3.11.1](https://github.com/vultr/govultr/compare/v3.11.0...v3.11.1) (2024-10-24) +### Bug Fixes +* Database: Fix quota create endpoint param for Kafka [PR 341](https://github.com/vultr/govultr/pull/341) + +## [3.11.0](https://github.com/vultr/govultr/compare/v3.10.0...v3.11.0) (2024-10-22) +### Enhancements +* Database: Add support for managed Kafka [PR 337](https://github.com/vultr/govultr/pull/337) + +### Automation +* Remove deprecated exportloopref linter [PR 338](https://github.com/vultr/govultr/pull/338) +* Add Github CODEOWNERS file [PR 339](https://github.com/vultr/govultr/pull/339) + +## [3.10.0](https://github.com/vultr/govultr/compare/v3.9.1...v3.10.0) (2024-10-10) +### Enhancements +* Load Balancers: Add HTTP2/3 and timeout options [PR 325](https://github.com/vultr/govultr/pull/325) +* CDN: add vanity domain and SSL options [PR 326](https://github.com/vultr/govultr/pull/326) +* Instance: add user scheme field [PR 328](https://github.com/vultr/govultr/pull/328) +* Bare Metal: add user scheme field [PR 335](https://github.com/vultr/govultr/pull/335) +* Sub-accounts: Add support for sub-accounts [PR 329](https://github.com/vultr/govultr/pull/329) + +### Bug Fixes +* CDN: Fix default empty struct fields and list files endpoint URL [PR 330](https://github.com/vultr/govultr/pull/330) +* Sub-accounts: Fix base struct on create [PR 331](https://github.com/vultr/govultr/pull/331) + +### Clean Up +* Remove deprecated private network functionality [PR 324](https://github.com/vultr/govultr/pull/324) +* Bare Metal: remove deprecated tag fields [PR 327](https://github.com/vultr/govultr/pull/327) +* Firewall: remove deprecated type fields [PR 327](https://github.com/vultr/govultr/pull/327) +* Instance: remove deprecated tag fields [PR 327](https://github.com/vultr/govultr/pull/327) + +### Dependencies & Automation +* Update go from v1.21 to v1.23 [PR 333](https://github.com/vultr/govultr/pull/333) +* Update github workflows to go 1.23 [PR 334](https://github.com/vultr/govultr/pull/334) +* Add CDN & Sub-account tests [PR 332](https://github.com/vultr/govultr/pull/332) + ## [3.9.1](https://github.com/vultr/govultr/compare/v3.9.0...v3.9.1) (2024-08-13) ### Enhancements * Database: Add support for Managed MySQL advanced config [PR 322](https://github.com/vultr/govultr/pull/322) diff --git a/vendor/github.com/vultr/govultr/v3/bare_metal_server.go b/vendor/github.com/vultr/govultr/v3/bare_metal_server.go index 6ad0fddd..7c25f8be 100644 --- a/vendor/github.com/vultr/govultr/v3/bare_metal_server.go +++ b/vendor/github.com/vultr/govultr/v3/bare_metal_server.go @@ -53,72 +53,69 @@ type BareMetalServerServiceHandler struct { // BareMetalServer represents a Bare Metal server on Vultr type BareMetalServer struct { - ID string `json:"id"` - Os string `json:"os"` - RAM string `json:"ram"` - Disk string `json:"disk"` - MainIP string `json:"main_ip"` - CPUCount int `json:"cpu_count"` - Region string `json:"region"` - DefaultPassword string `json:"default_password"` - DateCreated string `json:"date_created"` - Status string `json:"status"` - NetmaskV4 string `json:"netmask_v4"` - GatewayV4 string `json:"gateway_v4"` - Plan string `json:"plan"` - V6Network string `json:"v6_network"` - V6MainIP string `json:"v6_main_ip"` - V6NetworkSize int `json:"v6_network_size"` - MacAddress int `json:"mac_address"` - Label string `json:"label"` - // Deprecated: Tag should no longer be used. Instead, use Tags. - Tag string `json:"tag"` - OsID int `json:"os_id"` - AppID int `json:"app_id"` - ImageID string `json:"image_id"` - Features []string `json:"features"` - Tags []string `json:"tags"` + ID string `json:"id"` + Os string `json:"os"` + RAM string `json:"ram"` + Disk string `json:"disk"` + MainIP string `json:"main_ip"` + CPUCount int `json:"cpu_count"` + Region string `json:"region"` + DefaultPassword string `json:"default_password"` + DateCreated string `json:"date_created"` + Status string `json:"status"` + NetmaskV4 string `json:"netmask_v4"` + GatewayV4 string `json:"gateway_v4"` + Plan string `json:"plan"` + V6Network string `json:"v6_network"` + V6MainIP string `json:"v6_main_ip"` + V6NetworkSize int `json:"v6_network_size"` + MacAddress int `json:"mac_address"` + Label string `json:"label"` + OsID int `json:"os_id"` + AppID int `json:"app_id"` + ImageID string `json:"image_id"` + Features []string `json:"features"` + Tags []string `json:"tags"` + UserScheme string `json:"user_scheme"` } // BareMetalCreate represents the optional parameters that can be set when creating a Bare Metal server type BareMetalCreate struct { - Region string `json:"region,omitempty"` - Plan string `json:"plan,omitempty"` - OsID int `json:"os_id,omitempty"` - StartupScriptID string `json:"script_id,omitempty"` - SnapshotID string `json:"snapshot_id,omitempty"` - EnableIPv6 *bool `json:"enable_ipv6,omitempty"` - Label string `json:"label,omitempty"` - SSHKeyIDs []string `json:"sshkey_id,omitempty"` - AppID int `json:"app_id,omitempty"` - ImageID string `json:"image_id,omitempty"` - UserData string `json:"user_data,omitempty"` - ActivationEmail *bool `json:"activation_email,omitempty"` - Hostname string `json:"hostname,omitempty"` - MdiskMode string `json:"mdisk_mode,omitempty"` - // Deprecated: Tag should no longer be used. Instead, use Tags. - Tag string `json:"tag,omitempty"` - ReservedIPv4 string `json:"reserved_ipv4,omitempty"` - PersistentPxe *bool `json:"persistent_pxe,omitempty"` - Tags []string `json:"tags"` - AttachVPC2 []string `json:"attach_vpc2,omitempty"` - DetachVPC2 []string `json:"detach_vpc2,omitempty"` - EnableVPC2 *bool `json:"enable_vpc2,omitempty"` - AppVariables map[string]string `json:"app_variables,omitempty"` + Region string `json:"region"` + Plan string `json:"plan"` + OsID int `json:"os_id,omitempty"` + StartupScriptID string `json:"script_id,omitempty"` + SnapshotID string `json:"snapshot_id,omitempty"` + EnableIPv6 *bool `json:"enable_ipv6,omitempty"` + Label string `json:"label,omitempty"` + SSHKeyIDs []string `json:"sshkey_id,omitempty"` + AppID int `json:"app_id,omitempty"` + ImageID string `json:"image_id,omitempty"` + UserData string `json:"user_data,omitempty"` + ActivationEmail *bool `json:"activation_email,omitempty"` + Hostname string `json:"hostname,omitempty"` + MdiskMode string `json:"mdisk_mode,omitempty"` + ReservedIPv4 string `json:"reserved_ipv4,omitempty"` + PersistentPxe *bool `json:"persistent_pxe,omitempty"` + Tags []string `json:"tags,omitempty"` + UserScheme string `json:"user_scheme,omitempty"` + AttachVPC2 []string `json:"attach_vpc2,omitempty"` + DetachVPC2 []string `json:"detach_vpc2,omitempty"` + EnableVPC2 *bool `json:"enable_vpc2,omitempty"` + AppVariables map[string]string `json:"app_variables,omitempty"` } // BareMetalUpdate represents the optional parameters that can be set when updating a Bare Metal server type BareMetalUpdate struct { - OsID int `json:"os_id,omitempty"` - EnableIPv6 *bool `json:"enable_ipv6,omitempty"` - Label string `json:"label,omitempty"` - AppID int `json:"app_id,omitempty"` - ImageID string `json:"image_id,omitempty"` - UserData string `json:"user_data,omitempty"` - MdiskMode string `json:"mdisk_mode,omitempty"` - // Deprecated: Tag should no longer be used. Instead, use Tags. - Tag *string `json:"tag,omitempty"` - Tags []string `json:"tags"` + OsID int `json:"os_id,omitempty"` + EnableIPv6 *bool `json:"enable_ipv6,omitempty"` + Label string `json:"label,omitempty"` + AppID int `json:"app_id,omitempty"` + ImageID string `json:"image_id,omitempty"` + UserData string `json:"user_data,omitempty"` + MdiskMode string `json:"mdisk_mode,omitempty"` + Tags []string `json:"tags,omitempty"` + UserScheme string `json:"user_scheme,omitempty"` AttachVPC2 []string `json:"attach_vpc2,omitempty"` DetachVPC2 []string `json:"detach_vpc2,omitempty"` EnableVPC2 *bool `json:"enable_vpc2,omitempty"` diff --git a/vendor/github.com/vultr/govultr/v3/cdn.go b/vendor/github.com/vultr/govultr/v3/cdn.go index 1b19ced5..c506a73e 100644 --- a/vendor/github.com/vultr/govultr/v3/cdn.go +++ b/vendor/github.com/vultr/govultr/v3/cdn.go @@ -41,15 +41,18 @@ type CDNZone struct { DateCreated string `json:"date_created"` Status string `json:"status"` Label string `json:"label"` - OriginScheme string `json:"origin_scheme,omitempty"` - OriginDomain string `json:"origin_domain,omitempty"` + OriginScheme string `json:"origin_scheme"` + OriginDomain string `json:"origin_domain"` + VanityDomain string `json:"vanity_domain"` + SSLCert string `json:"ssl_cert"` + SSLCertKey string `json:"ssl_cert_key"` CDNURL string `json:"cdn_url"` CacheSize int `json:"cache_size"` Requests int `json:"requests"` BytesIn int `json:"in_bytes"` BytesOut int `json:"out_bytes"` PacketsPerSec int `json:"packets_per_sec"` - DatePurged string `json:"last_purge,omitempty"` + DatePurged string `json:"last_purge"` CORS bool `json:"cors"` GZIP bool `json:"gzip"` BlockAI bool `json:"block_ai"` @@ -62,10 +65,13 @@ type CDNZoneReq struct { Label string `json:"label"` OriginScheme string `json:"origin_scheme,omitempty"` OriginDomain string `json:"origin_domain,omitempty"` - CORS bool `json:"cors"` - GZIP bool `json:"gzip"` - BlockAI bool `json:"block_ai"` - BlockBadBots bool `json:"block_bad_bots"` + VanityDomain string `json:"vanity_domain,omitempty"` + SSLCert string `json:"ssl_cert,omitempty"` + SSLCertKey string `json:"ssl_cert_key,omitempty"` + CORS *bool `json:"cors,omitempty"` + GZIP *bool `json:"gzip,omitempty"` + BlockAI *bool `json:"block_ai,omitempty"` + BlockBadBots *bool `json:"block_bad_bots,omitempty"` Regions []string `json:"regions,omitempty"` } @@ -333,7 +339,7 @@ func (c *CDNServiceHandler) CreatePushZoneFileEndpoint(ctx context.Context, zone // ListPushZoneFiles will retrieve all CDN push zone file data that have been // uploaded func (c *CDNServiceHandler) ListPushZoneFiles(ctx context.Context, zoneID string) (*CDNZoneFileData, *http.Response, error) { - cdnPushFilesPath := fmt.Sprintf("%s/%s", cdnPushPath, zoneID) + cdnPushFilesPath := fmt.Sprintf("%s/%s/files", cdnPushPath, zoneID) req, err := c.client.NewRequest(ctx, http.MethodGet, cdnPushFilesPath, nil) if err != nil { return nil, nil, err diff --git a/vendor/github.com/vultr/govultr/v3/database.go b/vendor/github.com/vultr/govultr/v3/database.go index 8952949e..ea231d53 100644 --- a/vendor/github.com/vultr/govultr/v3/database.go +++ b/vendor/github.com/vultr/govultr/v3/database.go @@ -35,6 +35,17 @@ type DatabaseService interface { GetDB(ctx context.Context, databaseID string, dbname string) (*DatabaseDB, *http.Response, error) DeleteDB(ctx context.Context, databaseID string, dbname string) error + ListTopics(ctx context.Context, databaseID string) ([]DatabaseTopic, *Meta, *http.Response, error) + CreateTopic(ctx context.Context, databaseID string, databaseTopicReq *DatabaseTopicCreateReq) (*DatabaseTopic, *http.Response, error) + GetTopic(ctx context.Context, databaseID string, topicName string) (*DatabaseTopic, *http.Response, error) + UpdateTopic(ctx context.Context, databaseID string, topicName string, databaseTopicReq *DatabaseTopicUpdateReq) (*DatabaseTopic, *http.Response, error) //nolint:lll + DeleteTopic(ctx context.Context, databaseID string, topicName string) error + + ListQuotas(ctx context.Context, databaseID string) ([]DatabaseQuota, *Meta, *http.Response, error) + CreateQuota(ctx context.Context, databaseID string, databaseQuotaReq *DatabaseQuotaCreateReq) (*DatabaseQuota, *http.Response, error) + GetQuota(ctx context.Context, databaseID string, clientID, username string) (*DatabaseQuota, *http.Response, error) + DeleteQuota(ctx context.Context, databaseID string, clientID, username string) error + ListMaintenanceUpdates(ctx context.Context, databaseID string) ([]string, *http.Response, error) StartMaintenance(ctx context.Context, databaseID string) (string, *http.Response, error) @@ -124,7 +135,8 @@ type Database struct { PlanDisk int `json:"plan_disk"` PlanRAM int `json:"plan_ram"` PlanVCPUs int `json:"plan_vcpus"` - PlanReplicas int `json:"plan_replicas"` + PlanReplicas *int `json:"plan_replicas,omitempty"` + PlanBrokers int `json:"plan_brokers,omitempty"` Region string `json:"region"` DatabaseEngine string `json:"database_engine"` DatabaseEngineVersion string `json:"database_engine_version"` @@ -136,9 +148,12 @@ type Database struct { FerretDBCredentials *FerretDBCredentials `json:"ferretdb_credentials,omitempty"` Host string `json:"host"` PublicHost string `json:"public_host,omitempty"` + Port string `json:"port"` + SASLPort string `json:"sasl_port,omitempty"` User string `json:"user"` Password string `json:"password"` - Port string `json:"port"` + AccessKey string `json:"access_key,omitempty"` + AccessCert string `json:"access_cert,omitempty"` MaintenanceDOW string `json:"maintenance_dow"` MaintenanceTime string `json:"maintenance_time"` LatestBackup string `json:"latest_backup"` @@ -254,6 +269,9 @@ type DatabaseUser struct { Password string `json:"password"` Encryption string `json:"encryption,omitempty"` AccessControl *DatabaseUserACL `json:"access_control,omitempty"` + Permission string `json:"permission,omitempty"` + AccessKey string `json:"access_key,omitempty"` + AccessCert string `json:"access_cert,omitempty"` } // DatabaseUserACL represents an access control configuration for a user within a Redis Managed Database cluster @@ -264,12 +282,13 @@ type DatabaseUserACL struct { RedisACLKeys []string `json:"redis_acl_keys"` } -// DatabaseUserACLReq represents input for updating a user's access control within a Redis Managed Database cluster +// DatabaseUserACLReq represents input for updating a user's access control within a Managed Database cluster type DatabaseUserACLReq struct { RedisACLCategories *[]string `json:"redis_acl_categories,omitempty"` RedisACLChannels *[]string `json:"redis_acl_channels,omitempty"` RedisACLCommands *[]string `json:"redis_acl_commands,omitempty"` RedisACLKeys *[]string `json:"redis_acl_keys,omitempty"` + Permission string `json:"permission,omitempty"` } // databaseUserBase holds the API response for retrieving a single database user within a Managed Database @@ -288,6 +307,7 @@ type DatabaseUserCreateReq struct { Username string `json:"username"` Password string `json:"password,omitempty"` Encryption string `json:"encryption,omitempty"` + Permission string `json:"permission,omitempty"` } // DatabaseUserUpdateReq struct used to update a user within a Managed Database. @@ -316,6 +336,72 @@ type DatabaseDBCreateReq struct { Name string `json:"name"` } +// DatabaseTopic represents a Kafka topic within a Managed Database cluster +type DatabaseTopic struct { + Name string `json:"name"` + Partitions int `json:"partitions"` + Replication int `json:"replication"` + RetentionHours int `json:"retention_hours"` + RetentionBytes int `json:"retention_bytes"` +} + +// databaseTopicBase holds the API response for retrieving a single Kafka topic within a Managed Database +type databaseTopicBase struct { + DatabaseTopic *DatabaseTopic `json:"topic"` +} + +// databaseTopicsBase holds the API response for retrieving a list of Kafka topics within a Managed Database +type databaseTopicsBase struct { + DatabaseTopics []DatabaseTopic `json:"topics"` + Meta *Meta `json:"meta"` +} + +// DatabaseTopicCreateReq struct used to create a Kafka topic within a Managed Database. +type DatabaseTopicCreateReq struct { + Name string `json:"name"` + Partitions int `json:"partitions"` + Replication int `json:"replication"` + RetentionHours int `json:"retention_hours"` + RetentionBytes int `json:"retention_bytes"` +} + +// DatabaseTopicUpdateReq struct used to update a Kafka topic within a Managed Database. +type DatabaseTopicUpdateReq struct { + Partitions int `json:"partitions"` + Replication int `json:"replication"` + RetentionHours int `json:"retention_hours"` + RetentionBytes int `json:"retention_bytes"` +} + +// DatabaseQuota represents a Kafka quota within a Managed Database cluster +type DatabaseQuota struct { + ClientID string `json:"client_id"` + ConsumerByteRate int `json:"consumer_byte_rate"` + ProducerByteRate int `json:"producer_byte_rate"` + RequestPercentage int `json:"request_percentage"` + User string `json:"user"` +} + +// databaseQuotaBase holds the API response for retrieving a single Kafka quota within a Managed Database +type databaseQuotaBase struct { + DatabaseQuota *DatabaseQuota `json:"quota"` +} + +// databaseQuotasBase holds the API response for retrieving a list of Kafka quotas within a Managed Database +type databaseQuotasBase struct { + DatabaseQuotas []DatabaseQuota `json:"quotas"` + Meta *Meta `json:"meta"` +} + +// DatabaseQuotaCreateReq struct used to create a Kafka quota within a Managed Database. +type DatabaseQuotaCreateReq struct { + ClientID string `json:"client_id"` + ConsumerByteRate int `json:"consumer_byte_rate"` + ProducerByteRate int `json:"producer_byte_rate"` + RequestPercentage int `json:"request_percentage"` + User string `json:"user"` +} + // databaseDBsBase holds the API response for retrieving a list of available maintenance updates within a Managed Database type databaseUpdatesBase struct { AvailableUpdates []string `json:"available_updates"` @@ -465,74 +551,120 @@ type DatabaseConnectionPoolUpdateReq struct { // DatabaseAdvancedOptions represents user configurable advanced options within a MySQL/PostgreSQL Managed Database cluster type DatabaseAdvancedOptions struct { - AutovacuumAnalyzeScaleFactor float32 `json:"autovacuum_analyze_scale_factor,omitempty"` - AutovacuumAnalyzeThreshold int `json:"autovacuum_analyze_threshold,omitempty"` - AutovacuumFreezeMaxAge int `json:"autovacuum_freeze_max_age,omitempty"` - AutovacuumMaxWorkers int `json:"autovacuum_max_workers,omitempty"` - AutovacuumNaptime int `json:"autovacuum_naptime,omitempty"` - AutovacuumVacuumCostDelay int `json:"autovacuum_vacuum_cost_delay,omitempty"` - AutovacuumVacuumCostLimit int `json:"autovacuum_vacuum_cost_limit,omitempty"` - AutovacuumVacuumScaleFactor float32 `json:"autovacuum_vacuum_scale_factor,omitempty"` - AutovacuumVacuumThreshold int `json:"autovacuum_vacuum_threshold,omitempty"` - BGWRITERDelay int `json:"bgwriter_delay,omitempty"` - BGWRITERFlushAFter int `json:"bgwriter_flush_after,omitempty"` - BGWRITERLRUMaxPages int `json:"bgwriter_lru_maxpages,omitempty"` - BGWRITERLRUMultiplier float32 `json:"bgwriter_lru_multiplier,omitempty"` - ConnectTimeout int `json:"connect_timeout,omitempty"` - DeadlockTimeout int `json:"deadlock_timeout,omitempty"` - DefaultToastCompression string `json:"default_toast_compression,omitempty"` - GroupConcatMaxLen int `json:"group_concat_max_len,omitempty"` - IdleInTransactionSessionTimeout int `json:"idle_in_transaction_session_timeout,omitempty"` - InnoDBChangeBufferMaxSize int `json:"innodb_change_buffer_max_size,omitempty"` - InnoDBFlushNeighbors int `json:"innodb_flush_neighbors,omitempty"` - InnoDBFTMinTokenSize int `json:"innodb_ft_min_token_size,omitempty"` - InnoDBFTServerStopwordTable string `json:"innodb_ft_server_stopword_table,omitempty"` - InnoDBLockWaitTimeout int `json:"innodb_lock_wait_timeout,omitempty"` - InnoDBLogBufferSize int `json:"innodb_log_buffer_size,omitempty"` - InnoDBOnlineAlterLogMaxSize int `json:"innodb_online_alter_log_max_size,omitempty"` - InnoDBPrintAllDeadlocks *bool `json:"innodb_print_all_deadlocks,omitempty"` - InnoDBReadIOThreads int `json:"innodb_read_io_threads,omitempty"` - InnoDBRollbackOnTimeout *bool `json:"innodb_rollback_on_timeout,omitempty"` - InnoDBThreadConcurrency int `json:"innodb_thread_concurrency,omitempty"` - InnoDBWriteIOThreads int `json:"innodb_write_io_threads,omitempty"` - InteractiveTimeout int `json:"interactive_timeout,omitempty"` - InternalTmpMemStorageEngine string `json:"internal_tmp_mem_storage_engine,omitempty"` - Jit *bool `json:"jit,omitempty"` - LogAutovacuumMinDuration int `json:"log_autovacuum_min_duration,omitempty"` - LogErrorVerbosity string `json:"log_error_verbosity,omitempty"` - LogLinePrefix string `json:"log_line_prefix,omitempty"` - LogMinDurationStatement int `json:"log_min_duration_statement,omitempty"` - MaxAllowedPacket int `json:"max_allowed_packet,omitempty"` - MaxFilesPerProcess int `json:"max_files_per_process,omitempty"` - MaxHeapTableSize int `json:"max_heap_table_size,omitempty"` - MaxLocksPerTransaction int `json:"max_locks_per_transaction,omitempty"` - MaxLogicalReplicationWorkers int `json:"max_logical_replication_workers,omitempty"` - MaxParallelWorkers int `json:"max_parallel_workers,omitempty"` - MaxParallelWorkersPerGather int `json:"max_parallel_workers_per_gather,omitempty"` - MaxPredLocksPerTransaction int `json:"max_pred_locks_per_transaction,omitempty"` - MaxPreparedTransactions int `json:"max_prepared_transactions,omitempty"` - MaxReplicationSlots int `json:"max_replication_slots,omitempty"` - MaxStackDepth int `json:"max_stack_depth,omitempty"` - MaxStandbyArchiveDelay int `json:"max_standby_archive_delay,omitempty"` - MaxStandbyStreamingDelay int `json:"max_standby_streaming_delay,omitempty"` - MaxWalSenders int `json:"max_wal_senders,omitempty"` - MaxWorkerProcesses int `json:"max_worker_processes,omitempty"` - NetBufferLength int `json:"net_buffer_length,omitempty"` - NetReadTimeout int `json:"net_read_timeout,omitempty"` - NetWriteTimeout int `json:"net_write_timeout,omitempty"` - PGPartmanBGWInterval int `json:"pg_partman_bgw.interval,omitempty"` - PGPartmanBGWRole string `json:"pg_partman_bgw.role,omitempty"` - PGStateStatementsTrack string `json:"pg_stat_statements.track,omitempty"` - SortBufferSize int `json:"sort_buffer_size,omitempty"` - TempFileLimit int `json:"temp_file_limit,omitempty"` - TmpTableSize int `json:"tmp_table_size,omitempty"` - TrackActivityQuerySize int `json:"track_activity_query_size,omitempty"` - TrackCommitTimestamp string `json:"track_commit_timestamp,omitempty"` - TrackFunctions string `json:"track_functions,omitempty"` - TrackIOTiming string `json:"track_io_timing,omitempty"` - WaitTimeout int `json:"wait_timeout,omitempty"` - WALSenderTImeout int `json:"wal_sender_timeout,omitempty"` - WALWriterDelay int `json:"wal_writer_delay,omitempty"` + AutovacuumAnalyzeScaleFactor float32 `json:"autovacuum_analyze_scale_factor,omitempty"` + AutovacuumAnalyzeThreshold int `json:"autovacuum_analyze_threshold,omitempty"` + AutovacuumFreezeMaxAge int `json:"autovacuum_freeze_max_age,omitempty"` + AutovacuumMaxWorkers int `json:"autovacuum_max_workers,omitempty"` + AutovacuumNaptime int `json:"autovacuum_naptime,omitempty"` + AutovacuumVacuumCostDelay int `json:"autovacuum_vacuum_cost_delay,omitempty"` + AutovacuumVacuumCostLimit int `json:"autovacuum_vacuum_cost_limit,omitempty"` + AutovacuumVacuumScaleFactor float32 `json:"autovacuum_vacuum_scale_factor,omitempty"` + AutovacuumVacuumThreshold int `json:"autovacuum_vacuum_threshold,omitempty"` + BGWRITERDelay int `json:"bgwriter_delay,omitempty"` + BGWRITERFlushAFter int `json:"bgwriter_flush_after,omitempty"` + BGWRITERLRUMaxPages int `json:"bgwriter_lru_maxpages,omitempty"` + BGWRITERLRUMultiplier float32 `json:"bgwriter_lru_multiplier,omitempty"` + DeadlockTimeout int `json:"deadlock_timeout,omitempty"` + DefaultToastCompression string `json:"default_toast_compression,omitempty"` + IdleInTransactionSessionTimeout int `json:"idle_in_transaction_session_timeout,omitempty"` + Jit *bool `json:"jit,omitempty"` + LogAutovacuumMinDuration int `json:"log_autovacuum_min_duration,omitempty"` + LogErrorVerbosity string `json:"log_error_verbosity,omitempty"` + LogLinePrefix string `json:"log_line_prefix,omitempty"` + LogMinDurationStatement int `json:"log_min_duration_statement,omitempty"` + MaxFilesPerProcess int `json:"max_files_per_process,omitempty"` + MaxLocksPerTransaction int `json:"max_locks_per_transaction,omitempty"` + MaxLogicalReplicationWorkers int `json:"max_logical_replication_workers,omitempty"` + MaxParallelWorkers int `json:"max_parallel_workers,omitempty"` + MaxParallelWorkersPerGather int `json:"max_parallel_workers_per_gather,omitempty"` + MaxPredLocksPerTransaction int `json:"max_pred_locks_per_transaction,omitempty"` + MaxPreparedTransactions int `json:"max_prepared_transactions,omitempty"` + MaxReplicationSlots int `json:"max_replication_slots,omitempty"` + MaxStackDepth int `json:"max_stack_depth,omitempty"` + MaxStandbyArchiveDelay int `json:"max_standby_archive_delay,omitempty"` + MaxStandbyStreamingDelay int `json:"max_standby_streaming_delay,omitempty"` + MaxWalSenders int `json:"max_wal_senders,omitempty"` + MaxWorkerProcesses int `json:"max_worker_processes,omitempty"` + PGPartmanBGWInterval int `json:"pg_partman_bgw.interval,omitempty"` + PGPartmanBGWRole string `json:"pg_partman_bgw.role,omitempty"` + PGStateStatementsTrack string `json:"pg_stat_statements.track,omitempty"` + TempFileLimit int `json:"temp_file_limit,omitempty"` + TrackActivityQuerySize int `json:"track_activity_query_size,omitempty"` + TrackCommitTimestamp string `json:"track_commit_timestamp,omitempty"` + TrackFunctions string `json:"track_functions,omitempty"` + TrackIOTiming string `json:"track_io_timing,omitempty"` + WALSenderTImeout int `json:"wal_sender_timeout,omitempty"` + WALWriterDelay int `json:"wal_writer_delay,omitempty"` + ConnectTimeout int `json:"connect_timeout,omitempty"` + GroupConcatMaxLen int `json:"group_concat_max_len,omitempty"` + InnoDBChangeBufferMaxSize int `json:"innodb_change_buffer_max_size,omitempty"` + InnoDBFlushNeighbors int `json:"innodb_flush_neighbors,omitempty"` + InnoDBFTMinTokenSize int `json:"innodb_ft_min_token_size,omitempty"` + InnoDBFTServerStopwordTable string `json:"innodb_ft_server_stopword_table,omitempty"` + InnoDBLockWaitTimeout int `json:"innodb_lock_wait_timeout,omitempty"` + InnoDBLogBufferSize int `json:"innodb_log_buffer_size,omitempty"` + InnoDBOnlineAlterLogMaxSize int `json:"innodb_online_alter_log_max_size,omitempty"` + InnoDBPrintAllDeadlocks *bool `json:"innodb_print_all_deadlocks,omitempty"` + InnoDBReadIOThreads int `json:"innodb_read_io_threads,omitempty"` + InnoDBRollbackOnTimeout *bool `json:"innodb_rollback_on_timeout,omitempty"` + InnoDBThreadConcurrency int `json:"innodb_thread_concurrency,omitempty"` + InnoDBWriteIOThreads int `json:"innodb_write_io_threads,omitempty"` + InteractiveTimeout int `json:"interactive_timeout,omitempty"` + InternalTmpMemStorageEngine string `json:"internal_tmp_mem_storage_engine,omitempty"` + MaxAllowedPacket int `json:"max_allowed_packet,omitempty"` + MaxHeapTableSize int `json:"max_heap_table_size,omitempty"` + NetBufferLength int `json:"net_buffer_length,omitempty"` + NetReadTimeout int `json:"net_read_timeout,omitempty"` + NetWriteTimeout int `json:"net_write_timeout,omitempty"` + SortBufferSize int `json:"sort_buffer_size,omitempty"` + TmpTableSize int `json:"tmp_table_size,omitempty"` + WaitTimeout int `json:"wait_timeout,omitempty"` + CompressionType string `json:"compression_type,omitempty"` + GroupInitialRebalanceDelayMS int `json:"group_initial_rebalance_delay_ms,omitempty"` + GroupMinSessinTimeoutMS int `json:"group_min_session_timeout_ms,omitempty"` + GroupMaxSessionTimeoutMS int `json:"group_max_session_timeout_ms,omitempty"` + ConnectionsMaxIdleMS int `json:"connections_max_idle_ms,omitempty"` + MaxIncrementalFetchSessionCacheSlots int `json:"max_incremental_fetch_session_cache_slots,omitempty"` + MessageMaxBytes int `json:"message_max_bytes,omitempty"` + OffsetsRetentionMinutes int `json:"offsets_retention_minutes,omitempty"` + LogCleanerDeleteRetentionMS int `json:"log_cleaner_delete_retention_ms,omitempty"` + LogCleanerMinCleanableRatio float32 `json:"log_cleaner_min_cleanable_ratio,omitempty"` + LogCleanerMaxCompactionLagMS int `json:"log_cleaner_max_compaction_lag_ms,omitempty"` + LogCleanerMinCompactionLagMS int `json:"log_cleaner_min_compaction_lag_ms,omitempty"` + LogCleanupPolicy string `json:"log_cleanup_policy,omitempty"` + LogFlushIntervalMessages int `json:"log_flush_interval_messages,omitempty"` + LogFlushIntervalMS int `json:"log_flush_interval_ms,omitempty"` + LogIndexIntervalBytes int `json:"log_index_interval_bytes,omitempty"` + LogindexSizeMaxBytes int `json:"log_index_size_max_bytes,omitempty"` + LogLocalRetentionMS int `json:"log_local_retention_ms,omitempty"` + LogLocalRetentionBytes int `json:"log_local_retention_bytes,omitempty"` + LogMessageDownconversionEnable *bool `json:"log_message_downconversion_enable,omitempty"` + LogMessageTimestampType string `json:"log_message_timestamp_type,omitempty"` + LogMessageTimestampDifferenceMaxMS int `json:"log_message_timestamp_difference_max_ms,omitempty"` + LogPreallocate *bool `json:"log_preallocate,omitempty"` + LogRetentionBytes int `json:"log_retention_bytes,omitempty"` + LogRetentionHours int `json:"log_retention_hours,omitempty"` + LogRetentionMS int `json:"log_retention_ms,omitempty"` + LogRollJitterMS int `json:"log_roll_jitter_ms,omitempty"` + LogRollMS int `json:"log_roll_ms,omitempty"` + LogSegmentBytes int `json:"log_segment_bytes,omitempty"` + LogSegmentDeleteDelayMS int `json:"log_segment_delete_delay_ms,omitempty"` + AutoCreateTopicsEnable *bool `json:"auto_create_topics_enable,omitempty"` + MinInsyncReplicas int `json:"min_insync_replicas,omitempty"` + NumPartitions int `json:"num_partitions,omitempty"` + DefaultReplicationRefactor int `json:"default_replication_factor,omitempty"` + ReplicaFetchMaxBytes int `json:"replica_fetch_max_bytes,omitempty"` + ReplicaFetchResponseMaxBytes int `json:"replica_fetch_response_max_bytes,omitempty"` + MaxConnectionsPerIP int `json:"max_connections_per_ip,omitempty"` + ProducerPurgatoryPurgeIntervalRequests int `json:"producer_purgatory_purge_interval_requests,omitempty"` + SASLOauthbearerExpectedAudience string `json:"sasl_oauthbearer_expected_audience,omitempty"` + SASLOauthbearerExpectedIssuer string `json:"sasl_oauthbearer_expected_issuer,omitempty"` + SASLOauthbearerJwksEndpointURL string `json:"sasl_oauthbearer_jwks_endpoint_url,omitempty"` + SASLOauthbearerSubClaimName string `json:"sasl_oauthbearer_sub_claim_name,omitempty"` + SocketRequestMaxBytes int `json:"socket_request_max_bytes,omitempty"` + TransactionStateLogSegmentBytes int `json:"transaction_state_log_segment_bytes,omitempty"` + TransactionRemoveExpiredTransactionCleanupIntervalMS int `json:"transaction_remove_expired_transaction_cleanup_interval_ms,omitempty"` + TransactionPartitionVerificationEnable *bool `json:"transaction_partition_verification_enable,omitempty"` } // AvailableOption represents an available advanced configuration option for a PostgreSQL Managed Database cluster @@ -540,8 +672,8 @@ type AvailableOption struct { Name string `json:"name"` Type string `json:"type"` Enumerals []string `json:"enumerals,omitempty"` - MinValue *int `json:"min_value,omitempty"` - MaxValue *int `json:"max_value,omitempty"` + MinValue *float32 `json:"min_value,omitempty"` + MaxValue *float32 `json:"max_value,omitempty"` AltValues []int `json:"alt_values,omitempty"` Units string `json:"units,omitempty"` } @@ -765,7 +897,7 @@ func (d *DatabaseServiceHandler) UpdateUser(ctx context.Context, databaseID, use return databaseUser.DatabaseUser, resp, nil } -// DeleteUser will delete a user within the Managed database. All data will be permanently lost. +// DeleteUser will delete a user within the Managed database func (d *DatabaseServiceHandler) DeleteUser(ctx context.Context, databaseID, username string) error { uri := fmt.Sprintf("%s/%s/users/%s", databasePath, databaseID, username) @@ -863,6 +995,158 @@ func (d *DatabaseServiceHandler) DeleteDB(ctx context.Context, databaseID, dbnam return err } +// ListTopics retrieves all Kafka topics on your Managed Database. +func (d *DatabaseServiceHandler) ListTopics(ctx context.Context, databaseID string) ([]DatabaseTopic, *Meta, *http.Response, error) { //nolint:dupl,lll + uri := fmt.Sprintf("%s/%s/topics", databasePath, databaseID) + + req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, nil, nil, err + } + + databaseTopics := new(databaseTopicsBase) + resp, err := d.client.DoWithContext(ctx, req, databaseTopics) + if err != nil { + return nil, nil, nil, err + } + + return databaseTopics.DatabaseTopics, databaseTopics.Meta, resp, nil +} + +// CreateTopic will create a Kafka topic within the Managed Database with the given parameters +func (d *DatabaseServiceHandler) CreateTopic(ctx context.Context, databaseID string, databaseTopicReq *DatabaseTopicCreateReq) (*DatabaseTopic, *http.Response, error) { //nolint:lll + uri := fmt.Sprintf("%s/%s/topics", databasePath, databaseID) + + req, err := d.client.NewRequest(ctx, http.MethodPost, uri, databaseTopicReq) + if err != nil { + return nil, nil, err + } + + databaseTopic := new(databaseTopicBase) + resp, err := d.client.DoWithContext(ctx, req, databaseTopic) + if err != nil { + return nil, nil, err + } + + return databaseTopic.DatabaseTopic, resp, nil +} + +// GetTopic retrieves information on an individual Kafka topic within a Managed Database based on a topicName and databaseID +func (d *DatabaseServiceHandler) GetTopic(ctx context.Context, databaseID, topicName string) (*DatabaseTopic, *http.Response, error) { + uri := fmt.Sprintf("%s/%s/topics/%s", databasePath, databaseID, topicName) + + req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, nil, err + } + + databaseTopic := new(databaseTopicBase) + resp, err := d.client.DoWithContext(ctx, req, databaseTopic) + if err != nil { + return nil, nil, err + } + + return databaseTopic.DatabaseTopic, resp, nil +} + +// UpdateTopic will update a Kafka topic within the Managed Database with the given parameters +func (d *DatabaseServiceHandler) UpdateTopic(ctx context.Context, databaseID, topicName string, databaseTopicReq *DatabaseTopicUpdateReq) (*DatabaseTopic, *http.Response, error) { //nolint:lll,dupl + uri := fmt.Sprintf("%s/%s/topics/%s", databasePath, databaseID, topicName) + + req, err := d.client.NewRequest(ctx, http.MethodPut, uri, databaseTopicReq) + if err != nil { + return nil, nil, err + } + + databaseTopic := new(databaseTopicBase) + resp, err := d.client.DoWithContext(ctx, req, databaseTopic) + if err != nil { + return nil, nil, err + } + + return databaseTopic.DatabaseTopic, resp, nil +} + +// DeleteTopic will delete a Kafka topic within the Managed database +func (d *DatabaseServiceHandler) DeleteTopic(ctx context.Context, databaseID, topicName string) error { + uri := fmt.Sprintf("%s/%s/topics/%s", databasePath, databaseID, topicName) + + req, err := d.client.NewRequest(ctx, http.MethodDelete, uri, nil) + if err != nil { + return err + } + + _, err = d.client.DoWithContext(ctx, req, nil) + return err +} + +// ListQuotas retrieves all Kafka quotas on your Managed Database. +func (d *DatabaseServiceHandler) ListQuotas(ctx context.Context, databaseID string) ([]DatabaseQuota, *Meta, *http.Response, error) { //nolint:dupl,lll + uri := fmt.Sprintf("%s/%s/quotas", databasePath, databaseID) + + req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, nil, nil, err + } + + databaseQuotas := new(databaseQuotasBase) + resp, err := d.client.DoWithContext(ctx, req, databaseQuotas) + if err != nil { + return nil, nil, nil, err + } + + return databaseQuotas.DatabaseQuotas, databaseQuotas.Meta, resp, nil +} + +// CreateQuota will create a Kafka quota within the Managed Database with the given parameters +func (d *DatabaseServiceHandler) CreateQuota(ctx context.Context, databaseID string, databaseQuotaReq *DatabaseQuotaCreateReq) (*DatabaseQuota, *http.Response, error) { //nolint:lll + uri := fmt.Sprintf("%s/%s/quotas", databasePath, databaseID) + + req, err := d.client.NewRequest(ctx, http.MethodPost, uri, databaseQuotaReq) + if err != nil { + return nil, nil, err + } + + databaseQuota := new(databaseQuotaBase) + resp, err := d.client.DoWithContext(ctx, req, databaseQuota) + if err != nil { + return nil, nil, err + } + + return databaseQuota.DatabaseQuota, resp, nil +} + +// GetQuota retrieves information on an individual Kafka quota within a Managed Database based on a clientID and databaseID +func (d *DatabaseServiceHandler) GetQuota(ctx context.Context, databaseID, clientID, username string) (*DatabaseQuota, *http.Response, error) { //nolint:lll + uri := fmt.Sprintf("%s/%s/quotas/%s/%s", databasePath, databaseID, clientID, username) + + req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, nil, err + } + + databaseQuota := new(databaseQuotaBase) + resp, err := d.client.DoWithContext(ctx, req, databaseQuota) + if err != nil { + return nil, nil, err + } + + return databaseQuota.DatabaseQuota, resp, nil +} + +// DeleteQuota will delete a Kafka quota within the Managed database +func (d *DatabaseServiceHandler) DeleteQuota(ctx context.Context, databaseID, clientID, username string) error { + uri := fmt.Sprintf("%s/%s/quotas/%s/%s", databasePath, databaseID, clientID, username) + + req, err := d.client.NewRequest(ctx, http.MethodDelete, uri, nil) + if err != nil { + return err + } + + _, err = d.client.DoWithContext(ctx, req, nil) + return err +} + // ListMaintenanceUpdates retrieves all available maintenance updates for your Managed Database. func (d *DatabaseServiceHandler) ListMaintenanceUpdates(ctx context.Context, databaseID string) ([]string, *http.Response, error) { uri := fmt.Sprintf("%s/%s/maintenance", databasePath, databaseID) @@ -1124,7 +1408,7 @@ func (d *DatabaseServiceHandler) UpdateConnectionPool(ctx context.Context, datab return databaseConnectionPool.ConnectionPool, resp, nil } -// DeleteConnectionPool will delete a user within the Managed database. All data will be permanently lost. +// DeleteConnectionPool will delete a connection pool within the Managed database func (d *DatabaseServiceHandler) DeleteConnectionPool(ctx context.Context, databaseID, poolName string) error { uri := fmt.Sprintf("%s/%s/connection-pools/%s", databasePath, databaseID, poolName) diff --git a/vendor/github.com/vultr/govultr/v3/firewall_rule.go b/vendor/github.com/vultr/govultr/v3/firewall_rule.go index 727b6a07..26091017 100644 --- a/vendor/github.com/vultr/govultr/v3/firewall_rule.go +++ b/vendor/github.com/vultr/govultr/v3/firewall_rule.go @@ -24,10 +24,8 @@ type FireWallRuleServiceHandler struct { // FirewallRule represents a Vultr firewall rule type FirewallRule struct { - ID int `json:"id"` - Action string `json:"action"` - // Deprecated: Type should no longer be used. Instead, use IPType. - Type string `json:"type"` + ID int `json:"id"` + Action string `json:"action"` IPType string `json:"ip_type"` Protocol string `json:"protocol"` Port string `json:"port"` diff --git a/vendor/github.com/vultr/govultr/v3/govultr.go b/vendor/github.com/vultr/govultr/v3/govultr.go index 4d8af5d6..684d1d9b 100644 --- a/vendor/github.com/vultr/govultr/v3/govultr.go +++ b/vendor/github.com/vultr/govultr/v3/govultr.go @@ -19,7 +19,7 @@ import ( ) const ( - version = "3.9.1" + version = "3.11.1" defaultBase = "https://api.vultr.com" userAgent = "govultr/" + version rateLimit = 500 * time.Millisecond @@ -59,20 +59,19 @@ type Client struct { Kubernetes KubernetesService LoadBalancer LoadBalancerService Marketplace MarketplaceService - // Deprecated: Network should no longer be used. Instead, use VPC. - Network NetworkService - ObjectStorage ObjectStorageService - OS OSService - Plan PlanService - Region RegionService - ReservedIP ReservedIPService - Inference InferenceService - Snapshot SnapshotService - SSHKey SSHKeyService - StartupScript StartupScriptService - User UserService - VPC VPCService - VPC2 VPC2Service + ObjectStorage ObjectStorageService + OS OSService + Plan PlanService + Region RegionService + ReservedIP ReservedIPService + Inference InferenceService + Snapshot SnapshotService + SSHKey SSHKeyService + StartupScript StartupScriptService + SubAccount SubAccountService + User UserService + VPC VPCService + VPC2 VPC2Service // Optional function called after every successful request made to the Vultr API onRequestCompleted RequestCompletionCallback @@ -134,7 +133,6 @@ func NewClient(httpClient *http.Client) *Client { client.Kubernetes = &KubernetesHandler{client} client.LoadBalancer = &LoadBalancerHandler{client} client.Marketplace = &MarketplaceServiceHandler{client} - client.Network = &NetworkServiceHandler{client} client.ObjectStorage = &ObjectStorageServiceHandler{client} client.OS = &OSServiceHandler{client} client.Plan = &PlanServiceHandler{client} @@ -144,6 +142,7 @@ func NewClient(httpClient *http.Client) *Client { client.Snapshot = &SnapshotServiceHandler{client} client.SSHKey = &SSHKeyServiceHandler{client} client.StartupScript = &StartupScriptServiceHandler{client} + client.SubAccount = &SubAccountServiceHandler{client} client.User = &UserServiceHandler{client} client.VPC = &VPCServiceHandler{client} client.VPC2 = &VPC2ServiceHandler{client} diff --git a/vendor/github.com/vultr/govultr/v3/instance.go b/vendor/github.com/vultr/govultr/v3/instance.go index 524d31bb..52e24062 100644 --- a/vendor/github.com/vultr/govultr/v3/instance.go +++ b/vendor/github.com/vultr/govultr/v3/instance.go @@ -33,13 +33,6 @@ type InstanceService interface { GetBandwidth(ctx context.Context, instanceID string) (*Bandwidth, *http.Response, error) GetNeighbors(ctx context.Context, instanceID string) (*Neighbors, *http.Response, error) - // Deprecated: ListPrivateNetworks should no longer be used. Instead, use ListVPCInfo. - ListPrivateNetworks(ctx context.Context, instanceID string, options *ListOptions) ([]PrivateNetwork, *Meta, *http.Response, error) - // Deprecated: AttachPrivateNetwork should no longer be used. Instead, use AttachVPC. - AttachPrivateNetwork(ctx context.Context, instanceID, networkID string) error - // Deprecated: DetachPrivateNetwork should no longer be used. Instead, use DetachVPC. - DetachPrivateNetwork(ctx context.Context, instanceID, networkID string) error - ListVPCInfo(ctx context.Context, instanceID string, options *ListOptions) ([]VPCInfo, *Meta, *http.Response, error) AttachVPC(ctx context.Context, instanceID, vpcID string) error DetachVPC(ctx context.Context, instanceID, vpcID string) error @@ -79,37 +72,36 @@ type InstanceServiceHandler struct { // Instance represents a VPS type Instance struct { - ID string `json:"id"` - Os string `json:"os"` - RAM int `json:"ram"` - Disk int `json:"disk"` - Plan string `json:"plan"` - MainIP string `json:"main_ip"` - VCPUCount int `json:"vcpu_count"` - Region string `json:"region"` - DefaultPassword string `json:"default_password,omitempty"` - DateCreated string `json:"date_created"` - Status string `json:"status"` - AllowedBandwidth int `json:"allowed_bandwidth"` - NetmaskV4 string `json:"netmask_v4"` - GatewayV4 string `json:"gateway_v4"` - PowerStatus string `json:"power_status"` - ServerStatus string `json:"server_status"` - V6Network string `json:"v6_network"` - V6MainIP string `json:"v6_main_ip"` - V6NetworkSize int `json:"v6_network_size"` - Label string `json:"label"` - InternalIP string `json:"internal_ip"` - KVM string `json:"kvm"` - // Deprecated: Tag should no longer be used. Instead, use Tags. - Tag string `json:"tag"` - OsID int `json:"os_id"` - AppID int `json:"app_id"` - ImageID string `json:"image_id"` - FirewallGroupID string `json:"firewall_group_id"` - Features []string `json:"features"` - Hostname string `json:"hostname"` - Tags []string `json:"tags"` + ID string `json:"id"` + Os string `json:"os"` + RAM int `json:"ram"` + Disk int `json:"disk"` + Plan string `json:"plan"` + MainIP string `json:"main_ip"` + VCPUCount int `json:"vcpu_count"` + Region string `json:"region"` + DefaultPassword string `json:"default_password,omitempty"` + DateCreated string `json:"date_created"` + Status string `json:"status"` + AllowedBandwidth int `json:"allowed_bandwidth"` + NetmaskV4 string `json:"netmask_v4"` + GatewayV4 string `json:"gateway_v4"` + PowerStatus string `json:"power_status"` + ServerStatus string `json:"server_status"` + V6Network string `json:"v6_network"` + V6MainIP string `json:"v6_main_ip"` + V6NetworkSize int `json:"v6_network_size"` + Label string `json:"label"` + InternalIP string `json:"internal_ip"` + KVM string `json:"kvm"` + OsID int `json:"os_id"` + AppID int `json:"app_id"` + ImageID string `json:"image_id"` + FirewallGroupID string `json:"firewall_group_id"` + Features []string `json:"features"` + Hostname string `json:"hostname"` + Tags []string `json:"tags"` + UserScheme string `json:"user_scheme"` } type instanceBase struct { @@ -138,19 +130,6 @@ type Bandwidth struct { } `json:"bandwidth"` } -type privateNetworksBase struct { - PrivateNetworks []PrivateNetwork `json:"private_networks"` - Meta *Meta `json:"meta"` -} - -// PrivateNetwork information for a given instance. -// Deprecated: PrivateNetwork should no longer be used. Instead, use VPCInfo. -type PrivateNetwork struct { - NetworkID string `json:"network_id"` - MacAddress string `json:"mac_address"` - IPAddress string `json:"ip_address"` -} - type vpcInfoBase struct { VPCs []VPCInfo `json:"vpcs"` Meta *Meta `json:"meta"` @@ -253,67 +232,55 @@ type Upgrades struct { // InstanceCreateReq struct used to create an instance. type InstanceCreateReq struct { - Region string `json:"region,omitempty"` - Plan string `json:"plan,omitempty"` - Label string `json:"label,omitempty"` - // Deprecated: Tag should no longer be used. Instead, use Tags. - Tag string `json:"tag,omitempty"` - Tags []string `json:"tags"` - OsID int `json:"os_id,omitempty"` - ISOID string `json:"iso_id,omitempty"` - AppID int `json:"app_id,omitempty"` - ImageID string `json:"image_id,omitempty"` - FirewallGroupID string `json:"firewall_group_id,omitempty"` - Hostname string `json:"hostname,omitempty"` - IPXEChainURL string `json:"ipxe_chain_url,omitempty"` - ScriptID string `json:"script_id,omitempty"` - SnapshotID string `json:"snapshot_id,omitempty"` - EnableIPv6 *bool `json:"enable_ipv6,omitempty"` - DisablePublicIPv4 *bool `json:"disable_public_ipv4,omitempty"` - // Deprecated: EnablePrivateNetwork should no longer be used. Instead, use EnableVPC. - EnablePrivateNetwork *bool `json:"enable_private_network,omitempty"` - // Deprecated: AttachPrivateNetwork should no longer be used. Instead, use AttachVPC. - AttachPrivateNetwork []string `json:"attach_private_network,omitempty"` - EnableVPC *bool `json:"enable_vpc,omitempty"` - AttachVPC []string `json:"attach_vpc,omitempty"` - EnableVPC2 *bool `json:"enable_vpc2,omitempty"` - AttachVPC2 []string `json:"attach_vpc2,omitempty"` - SSHKeys []string `json:"sshkey_id,omitempty"` - Backups string `json:"backups,omitempty"` - DDOSProtection *bool `json:"ddos_protection,omitempty"` - UserData string `json:"user_data,omitempty"` - ReservedIPv4 string `json:"reserved_ipv4,omitempty"` - ActivationEmail *bool `json:"activation_email,omitempty"` - AppVariables map[string]string `json:"app_variables,omitempty"` + Region string `json:"region,omitempty"` + Plan string `json:"plan,omitempty"` + Label string `json:"label,omitempty"` + Tags []string `json:"tags"` + OsID int `json:"os_id,omitempty"` + ISOID string `json:"iso_id,omitempty"` + AppID int `json:"app_id,omitempty"` + ImageID string `json:"image_id,omitempty"` + FirewallGroupID string `json:"firewall_group_id,omitempty"` + Hostname string `json:"hostname,omitempty"` + IPXEChainURL string `json:"ipxe_chain_url,omitempty"` + ScriptID string `json:"script_id,omitempty"` + SnapshotID string `json:"snapshot_id,omitempty"` + EnableIPv6 *bool `json:"enable_ipv6,omitempty"` + DisablePublicIPv4 *bool `json:"disable_public_ipv4,omitempty"` + EnableVPC *bool `json:"enable_vpc,omitempty"` + AttachVPC []string `json:"attach_vpc,omitempty"` + EnableVPC2 *bool `json:"enable_vpc2,omitempty"` + AttachVPC2 []string `json:"attach_vpc2,omitempty"` + SSHKeys []string `json:"sshkey_id,omitempty"` + Backups string `json:"backups,omitempty"` + DDOSProtection *bool `json:"ddos_protection,omitempty"` + UserData string `json:"user_data,omitempty"` + ReservedIPv4 string `json:"reserved_ipv4,omitempty"` + ActivationEmail *bool `json:"activation_email,omitempty"` + UserScheme string `json:"user_scheme,omitempty"` + AppVariables map[string]string `json:"app_variables,omitempty"` } // InstanceUpdateReq struct used to update an instance. type InstanceUpdateReq struct { - Plan string `json:"plan,omitempty"` - Label string `json:"label,omitempty"` - // Deprecated: Tag should no longer be used. Instead, use Tags. - Tag *string `json:"tag,omitempty"` - Tags []string `json:"tags"` - OsID int `json:"os_id,omitempty"` - AppID int `json:"app_id,omitempty"` - ImageID string `json:"image_id,omitempty"` - EnableIPv6 *bool `json:"enable_ipv6,omitempty"` - // Deprecated: EnablePrivateNetwork should no longer be used. Instead, use EnableVPC. - EnablePrivateNetwork *bool `json:"enable_private_network,omitempty"` - // Deprecated: AttachPrivateNetwork should no longer be used. Instead, use AttachVPC. - AttachPrivateNetwork []string `json:"attach_private_network,omitempty"` - // Deprecated: DetachPrivateNetwork should no longer be used. Instead, use DetachVPC. - DetachPrivateNetwork []string `json:"detach_private_network,omitempty"` - EnableVPC *bool `json:"enable_vpc,omitempty"` - AttachVPC []string `json:"attach_vpc,omitempty"` - DetachVPC []string `json:"detach_vpc,omitempty"` - EnableVPC2 *bool `json:"enable_vpc2,omitempty"` - AttachVPC2 []string `json:"attach_vpc2,omitempty"` - DetachVPC2 []string `json:"detach_vpc2,omitempty"` - Backups string `json:"backups,omitempty"` - DDOSProtection *bool `json:"ddos_protection"` - UserData string `json:"user_data,omitempty"` - FirewallGroupID string `json:"firewall_group_id,omitempty"` + Plan string `json:"plan,omitempty"` + Label string `json:"label,omitempty"` + Tags []string `json:"tags"` + OsID int `json:"os_id,omitempty"` + AppID int `json:"app_id,omitempty"` + ImageID string `json:"image_id,omitempty"` + EnableIPv6 *bool `json:"enable_ipv6,omitempty"` + EnableVPC *bool `json:"enable_vpc,omitempty"` + AttachVPC []string `json:"attach_vpc,omitempty"` + DetachVPC []string `json:"detach_vpc,omitempty"` + EnableVPC2 *bool `json:"enable_vpc2,omitempty"` + AttachVPC2 []string `json:"attach_vpc2,omitempty"` + DetachVPC2 []string `json:"detach_vpc2,omitempty"` + Backups string `json:"backups,omitempty"` + DDOSProtection *bool `json:"ddos_protection"` + UserData string `json:"user_data,omitempty"` + FirewallGroupID string `json:"firewall_group_id,omitempty"` + UserScheme string `json:"user_scheme,omitempty"` } // ReinstallReq struct used to allow changes during a reinstall @@ -547,61 +514,6 @@ func (i *InstanceServiceHandler) GetNeighbors(ctx context.Context, instanceID st return neighbors, resp, nil } -// ListPrivateNetworks currently attached to an instance. -// Deprecated: ListPrivateNetworks should no longer be used. Instead, use ListVPCInfo -func (i *InstanceServiceHandler) ListPrivateNetworks(ctx context.Context, instanceID string, options *ListOptions) ([]PrivateNetwork, *Meta, *http.Response, error) { //nolint:lll,dupl - uri := fmt.Sprintf("%s/%s/private-networks", instancePath, instanceID) - req, err := i.client.NewRequest(ctx, http.MethodGet, uri, nil) - if err != nil { - return nil, nil, nil, err - } - - newValues, err := query.Values(options) - if err != nil { - return nil, nil, nil, err - } - - req.URL.RawQuery = newValues.Encode() - - networks := new(privateNetworksBase) - resp, err := i.client.DoWithContext(ctx, req, networks) - if err != nil { - return nil, nil, resp, err - } - - return networks.PrivateNetworks, networks.Meta, resp, nil -} - -// AttachPrivateNetwork to an instance -// Deprecated: AttachPrivateNetwork should no longer be used. Instead, use AttachVPC -func (i *InstanceServiceHandler) AttachPrivateNetwork(ctx context.Context, instanceID, networkID string) error { - uri := fmt.Sprintf("%s/%s/private-networks/attach", instancePath, instanceID) - body := RequestBody{"network_id": networkID} - - req, err := i.client.NewRequest(ctx, http.MethodPost, uri, body) - if err != nil { - return err - } - - _, err = i.client.DoWithContext(ctx, req, nil) - return err -} - -// DetachPrivateNetwork from an instance. -// Deprecated: DetachPrivateNetwork should no longer be used. Instead, use DetachVPC -func (i *InstanceServiceHandler) DetachPrivateNetwork(ctx context.Context, instanceID, networkID string) error { - uri := fmt.Sprintf("%s/%s/private-networks/detach", instancePath, instanceID) - body := RequestBody{"network_id": networkID} - - req, err := i.client.NewRequest(ctx, http.MethodPost, uri, body) - if err != nil { - return err - } - - _, err = i.client.DoWithContext(ctx, req, nil) - return err -} - // ListVPCInfo currently attached to an instance. func (i *InstanceServiceHandler) ListVPCInfo(ctx context.Context, instanceID string, options *ListOptions) ([]VPCInfo, *Meta, *http.Response, error) { //nolint:lll,dupl uri := fmt.Sprintf("%s/%s/vpcs", instancePath, instanceID) diff --git a/vendor/github.com/vultr/govultr/v3/load_balancer.go b/vendor/github.com/vultr/govultr/v3/load_balancer.go index 51357582..37e0ff84 100644 --- a/vendor/github.com/vultr/govultr/v3/load_balancer.go +++ b/vendor/github.com/vultr/govultr/v3/load_balancer.go @@ -45,6 +45,8 @@ type LoadBalancer struct { HealthCheck *HealthCheck `json:"health_check,omitempty"` GenericInfo *GenericInfo `json:"generic_info,omitempty"` SSLInfo *bool `json:"has_ssl,omitempty"` + HTTP2 *bool `json:"http2,omitempty"` + HTTP3 *bool `json:"http3,omitempty"` ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` FirewallRules []LBFirewallRule `json:"firewall_rules,omitempty"` } @@ -60,12 +62,13 @@ type LoadBalancerReq struct { ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` SSL *SSL `json:"ssl,omitempty"` SSLRedirect *bool `json:"ssl_redirect,omitempty"` + HTTP2 *bool `json:"http2,omitempty"` + HTTP3 *bool `json:"http3,omitempty"` ProxyProtocol *bool `json:"proxy_protocol,omitempty"` BalancingAlgorithm string `json:"balancing_algorithm,omitempty"` - FirewallRules []LBFirewallRule `json:"firewall_rules"` - // Deprecated: PrivateNetwork should no longer be used. Instead, use VPC. - PrivateNetwork *string `json:"private_network,omitempty"` - VPC *string `json:"vpc,omitempty"` + FirewallRules []LBFirewallRule `json:"firewall_rules,omitempty"` + Timeout int `json:"timeout,omitempty"` + VPC *string `json:"vpc,omitempty"` } // InstanceList represents instances that are attached to your load balancer @@ -87,12 +90,11 @@ type HealthCheck struct { // GenericInfo represents generic configuration of your load balancer type GenericInfo struct { BalancingAlgorithm string `json:"balancing_algorithm,omitempty"` + Timeout int `json:"timeout,omitempty"` SSLRedirect *bool `json:"ssl_redirect,omitempty"` StickySessions *StickySessions `json:"sticky_sessions,omitempty"` ProxyProtocol *bool `json:"proxy_protocol,omitempty"` - // Deprecated: PrivateNetwork should no longer be used. Instead, use VPC. - PrivateNetwork string `json:"private_network,omitempty"` - VPC string `json:"vpc,omitempty"` + VPC string `json:"vpc,omitempty"` } // StickySessions represents cookie for your load balancer diff --git a/vendor/github.com/vultr/govultr/v3/network.go b/vendor/github.com/vultr/govultr/v3/network.go deleted file mode 100644 index 1b9a146a..00000000 --- a/vendor/github.com/vultr/govultr/v3/network.go +++ /dev/null @@ -1,148 +0,0 @@ -package govultr //nolint:dupl - -import ( - "context" - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -const netPath = "/v2/private-networks" - -// NetworkService is the interface to interact with the network endpoints on the Vultr API -// Link : https://www.vultr.com/api/#tag/private-Networks -// Deprecated: NetworkService should no longer be used. Instead, use VPCService. -type NetworkService interface { - // Deprecated: NetworkService Create should no longer be used. Instead, use VPCService Create. - Create(ctx context.Context, createReq *NetworkReq) (*Network, *http.Response, error) - // Deprecated: NetworkService Get should no longer be used. Instead, use VPCService Get. - Get(ctx context.Context, networkID string) (*Network, *http.Response, error) - // Deprecated: NetworkService Update should no longer be used. Instead, use VPCService Update. - Update(ctx context.Context, networkID string, description string) error - // Deprecated: NetworkService Delete should no longer be used. Instead, use VPCService Delete. - Delete(ctx context.Context, networkID string) error - // Deprecated: NetworkService List should no longer be used. Instead, use VPCService List. - List(ctx context.Context, options *ListOptions) ([]Network, *Meta, *http.Response, error) -} - -// NetworkServiceHandler handles interaction with the network methods for the Vultr API -// Deprecated: NetworkServiceHandler should no longer be used. Instead, use VPCServiceHandler. -type NetworkServiceHandler struct { - client *Client -} - -// Network represents a Vultr private network -// Deprecated: Network should no longer be used. Instead, use VPC. -type Network struct { - NetworkID string `json:"id"` - Region string `json:"region"` - Description string `json:"description"` - V4Subnet string `json:"v4_subnet"` - V4SubnetMask int `json:"v4_subnet_mask"` - DateCreated string `json:"date_created"` -} - -// NetworkReq represents parameters to create or update Network resource -// Deprecated: NetworkReq should no longer be used. Instead, use VPCReq. -type NetworkReq struct { - Region string `json:"region"` - Description string `json:"description"` - V4Subnet string `json:"v4_subnet"` - V4SubnetMask int `json:"v4_subnet_mask"` -} - -type networksBase struct { - Networks []Network `json:"networks"` - Meta *Meta `json:"meta"` -} - -type networkBase struct { - Network *Network `json:"network"` -} - -// Create a new private network. A private network can only be used at the location for which it was created. -// Deprecated: NetworkServiceHandler Create should no longer be used. Instead, use VPCServiceHandler Create. -func (n *NetworkServiceHandler) Create(ctx context.Context, createReq *NetworkReq) (*Network, *http.Response, error) { - req, err := n.client.NewRequest(ctx, http.MethodPost, netPath, createReq) - if err != nil { - return nil, nil, err - } - - network := new(networkBase) - resp, err := n.client.DoWithContext(ctx, req, network) - if err != nil { - return nil, resp, err - } - - return network.Network, resp, nil -} - -// Get gets the private networks of the requested ID -// Deprecated: NetworkServiceHandler Get should no longer be used. Instead use VPCServiceHandler Create. -func (n *NetworkServiceHandler) Get(ctx context.Context, networkID string) (*Network, *http.Response, error) { - uri := fmt.Sprintf("%s/%s", netPath, networkID) - req, err := n.client.NewRequest(ctx, http.MethodGet, uri, nil) - if err != nil { - return nil, nil, err - } - - network := new(networkBase) - resp, err := n.client.DoWithContext(ctx, req, network) - if err != nil { - return nil, resp, err - } - - return network.Network, resp, nil -} - -// Update updates a private network -// Deprecated: NetworkServiceHandler Update should no longer be used. Instead, use VPCServiceHandler Update. -func (n *NetworkServiceHandler) Update(ctx context.Context, networkID, description string) error { - uri := fmt.Sprintf("%s/%s", netPath, networkID) - - netReq := RequestBody{"description": description} - req, err := n.client.NewRequest(ctx, http.MethodPut, uri, netReq) - if err != nil { - return err - } - _, err = n.client.DoWithContext(ctx, req, nil) - return err -} - -// Delete a private network. Before deleting, a network must be disabled from all instances -// Deprecated: NetworkServiceHandler Delete should no longer be used. Instead, use VPCServiceHandler Delete. -func (n *NetworkServiceHandler) Delete(ctx context.Context, networkID string) error { - uri := fmt.Sprintf("%s/%s", netPath, networkID) - req, err := n.client.NewRequest(ctx, http.MethodDelete, uri, nil) - if err != nil { - return err - } - - _, err = n.client.DoWithContext(ctx, req, nil) - return err -} - -// List lists all private networks on the current account -// Deprecated: NetworkServiceHandler List should no longer be used. Instead, use VPCServiceHandler List. -func (n *NetworkServiceHandler) List(ctx context.Context, options *ListOptions) ([]Network, *Meta, *http.Response, error) { //nolint:dupl - req, err := n.client.NewRequest(ctx, http.MethodGet, netPath, nil) - if err != nil { - return nil, nil, nil, err - } - - newValues, err := query.Values(options) - if err != nil { - return nil, nil, nil, err - } - - req.URL.RawQuery = newValues.Encode() - - networks := new(networksBase) - resp, err := n.client.DoWithContext(ctx, req, networks) - if err != nil { - return nil, nil, resp, err - } - - return networks.Networks, networks.Meta, resp, nil -} diff --git a/vendor/github.com/vultr/govultr/v3/subaccount.go b/vendor/github.com/vultr/govultr/v3/subaccount.go new file mode 100644 index 00000000..1097ad57 --- /dev/null +++ b/vendor/github.com/vultr/govultr/v3/subaccount.go @@ -0,0 +1,79 @@ +package govultr + +import ( + "context" + "net/http" +) + +// SubAccountService is the interface to interact with sub-accounts endpoint on the Vultr API +// Link : https://www.vultr.com/api/#tag/subaccount +type SubAccountService interface { + List(ctx context.Context, options *ListOptions) ([]SubAccount, *Meta, *http.Response, error) + Create(ctx context.Context, saReq *SubAccountReq) (*SubAccount, *http.Response, error) +} + +// SubAccountServiceHandler handles interaction with the account methods for the Vultr API +type SubAccountServiceHandler struct { + client *Client +} + +type subAccountsBase struct { + SubAccounts []SubAccount `json:"subaccounts"` + Meta *Meta `json:"meta"` +} + +type subAccountBase struct { + SubAccount *SubAccount `json:"subaccount"` +} + +// SubAccount represents a Vultr sub-account +type SubAccount struct { + ID string `json:"id"` + Email string `json:"email"` + Name string `json:"subaccount_name"` + OtherID string `json:"subaccount_id"` + Activated bool `json:"activated"` + Balance int `json:"balance"` + PendingCharges int `json:"pending_charges"` +} + +// SubAccountReq is the sub-account struct for create calls +type SubAccountReq struct { + Email string `json:"email"` + Name string `json:"subaccount_name,omitempty"` + OtherID string `json:"subaccount_id,omitempty"` +} + +// List all sub-accounts +func (s *SubAccountServiceHandler) List(ctx context.Context, options *ListOptions) ([]SubAccount, *Meta, *http.Response, error) { + uri := "/v2/subaccounts" + req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, nil, nil, err + } + + sas := new(subAccountsBase) + resp, err := s.client.DoWithContext(ctx, req, sas) + if err != nil { + return nil, nil, resp, err + } + + return sas.SubAccounts, sas.Meta, resp, nil +} + +// Create a sub-account +func (s *SubAccountServiceHandler) Create(ctx context.Context, saReq *SubAccountReq) (*SubAccount, *http.Response, error) { + uri := "/v2/subaccounts" + req, err := s.client.NewRequest(ctx, http.MethodPost, uri, saReq) + if err != nil { + return nil, nil, err + } + + sa := new(subAccountBase) + resp, err := s.client.DoWithContext(ctx, req, sa) + if err != nil { + return nil, resp, err + } + + return sa.SubAccount, resp, nil +} diff --git a/vendor/github.com/vultr/govultr/v3/vpc.go b/vendor/github.com/vultr/govultr/v3/vpc.go index 1de69f80..a221d63d 100644 --- a/vendor/github.com/vultr/govultr/v3/vpc.go +++ b/vendor/github.com/vultr/govultr/v3/vpc.go @@ -1,4 +1,4 @@ -package govultr //nolint:dupl +package govultr import ( "context" diff --git a/vendor/modules.txt b/vendor/modules.txt index 3f3ca1cc..a5e097d8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -37,8 +37,8 @@ github.com/opencontainers/runtime-spec/specs-go # github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus -# github.com/vultr/govultr/v3 v3.9.1 -## explicit; go 1.21 +# github.com/vultr/govultr/v3 v3.11.1 +## explicit; go 1.23 github.com/vultr/govultr/v3 # github.com/vultr/metadata v1.1.0 ## explicit; go 1.17