diff --git a/args.go b/args.go index f11b60bda..3be926567 100644 --- a/args.go +++ b/args.go @@ -287,6 +287,8 @@ const ( // ArgOutboundRules is a list of outbound rules for the firewall. ArgOutboundRules = "outbound-rules" + // ArgProjectID is the ID of a project. + ArgProjectID = "project-id" // ArgProjectName is the name of a project. ArgProjectName = "name" // ArgProjectDescription is the description of a project. diff --git a/commands/displayers/reserved_ip.go b/commands/displayers/reserved_ip.go index 241a4980a..1df088dca 100644 --- a/commands/displayers/reserved_ip.go +++ b/commands/displayers/reserved_ip.go @@ -32,13 +32,13 @@ func (rip *ReservedIP) JSON(out io.Writer) error { func (rip *ReservedIP) Cols() []string { return []string{ - "IP", "Region", "DropletID", "DropletName", + "IP", "Region", "DropletID", "DropletName", "ProjectID", } } func (rip *ReservedIP) ColMap() map[string]string { return map[string]string{ - "IP": "IP", "Region": "Region", "DropletID": "Droplet ID", "DropletName": "Droplet Name", + "IP": "IP", "Region": "Region", "DropletID": "Droplet ID", "DropletName": "Droplet Name", "ProjectID": "Project ID", } } @@ -55,6 +55,7 @@ func (rip *ReservedIP) KV() []map[string]interface{} { o := map[string]interface{}{ "IP": f.IP, "Region": f.Region.Slug, "DropletID": dropletID, "DropletName": dropletName, + "ProjectID": f.ProjectID, } out = append(out, o) diff --git a/commands/reserved_ips.go b/commands/reserved_ips.go index f12eb63ab..be7496d63 100644 --- a/commands/reserved_ips.go +++ b/commands/reserved_ips.go @@ -43,6 +43,9 @@ A reserved IP address must be either assigned to a Droplet or reserved to a regi AddStringFlag(cmdReservedIPCreate, doctl.ArgRegionSlug, "", "", fmt.Sprintf("Region where to create the reserved IP address. (mutually exclusive with `--%s`)", doctl.ArgDropletID)) + AddStringFlag(cmdReservedIPCreate, doctl.ArgProjectID, "", "", + fmt.Sprintf("The ID of the project the reserved IP address will be assigned to. When excluded, it will be assigned to the default project. When using the `--%s` flag, it will be assigned to the project containing the Droplet.", + doctl.ArgDropletID)) AddIntFlag(cmdReservedIPCreate, doctl.ArgDropletID, "", 0, fmt.Sprintf("The ID of the Droplet to assign the reserved IP to (mutually exclusive with `--%s`).", doctl.ArgRegionSlug)) @@ -67,18 +70,24 @@ func RunReservedIPCreate(c *CmdConfig) error { // ignore errors since we don't know which one is valid region, _ := c.Doit.GetString(c.NS, doctl.ArgRegionSlug) dropletID, _ := c.Doit.GetInt(c.NS, doctl.ArgDropletID) + projectID, _ := c.Doit.GetString(c.NS, doctl.ArgProjectID) if region == "" && dropletID == 0 { return doctl.NewMissingArgsErr("Region and Droplet ID can't both be blank.") } if region != "" && dropletID != 0 { - return fmt.Errorf("Specify region or Droplet ID when creating a reserved IP address.") + return fmt.Errorf("Only one of `--%s` or `--%s` may be specified when creating a reserved IP address.", doctl.ArgRegionSlug, doctl.ArgDropletID) + } + + if projectID != "" && dropletID != 0 { + return fmt.Errorf("Only one of `--%s` or `--%s` may be specified when creating a reserved IP address.", doctl.ArgProjectID, doctl.ArgDropletID) } req := &godo.ReservedIPCreateRequest{ Region: region, DropletID: dropletID, + ProjectID: projectID, } ip, err := ris.Create(req) diff --git a/go.mod b/go.mod index 0678b3e7b..dbce728bf 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/containerd/continuity v0.3.0 // indirect github.com/creack/pty v1.1.11 - github.com/digitalocean/godo v1.83.0 + github.com/digitalocean/godo v1.84.1 github.com/docker/cli v20.10.17+incompatible github.com/docker/docker v17.12.0-ce-rc1.0.20200531234253-77e06fda0c94+incompatible // indirect github.com/docker/docker-credential-helpers v0.6.4 // indirect @@ -44,7 +44,10 @@ require ( sigs.k8s.io/yaml v1.2.0 ) -require github.com/apache/openwhisk-client-go v0.0.0-20211007130743-38709899040b +require ( + github.com/apache/openwhisk-client-go v0.0.0-20211007130743-38709899040b + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b +) require ( github.com/Microsoft/go-winio v0.5.2 // indirect @@ -86,7 +89,6 @@ require ( google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/klog/v2 v2.30.0 // indirect k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect diff --git a/go.sum b/go.sum index 22499a7d3..e560840a3 100644 --- a/go.sum +++ b/go.sum @@ -259,8 +259,8 @@ github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8l github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.83.0 h1:K9CveJyECNLwrQnGZG+ovgapr7l5OuvQ6xZSKKW9Nz0= -github.com/digitalocean/godo v1.83.0/go.mod h1:BPCqvwbjbGqxuUnIKB4EvS/AX7IDnNmt5fwvIkWo+ew= +github.com/digitalocean/godo v1.84.1 h1:VgPsuxhrO9pUygvij6qOhqXfAkxAsDZYRpmjSDMEaHo= +github.com/digitalocean/godo v1.84.1/go.mod h1:BPCqvwbjbGqxuUnIKB4EvS/AX7IDnNmt5fwvIkWo+ew= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= diff --git a/integration/floating_ip_create_test.go b/integration/floating_ip_create_test.go index 49d079231..5e127d268 100644 --- a/integration/floating_ip_create_test.go +++ b/integration/floating_ip_create_test.go @@ -41,14 +41,16 @@ var _ = suite("compute/floating-ip/create", func(t *testing.T, when spec.G, it s reqBody, err := ioutil.ReadAll(req.Body) expect.NoError(err) + responseJSON := floatingIPCreateResponse matchedRequest := floatingIPCreateRequest if !strings.Contains(string(reqBody), "droplet_id") { matchedRequest = floatingIPRegionCreateRequest + responseJSON = floatingIPCreateRegionResponse } expect.JSONEq(matchedRequest, string(reqBody)) - w.Write([]byte(floatingIPCreateResponse)) + w.Write([]byte(responseJSON)) default: dump, err := httputil.DumpRequest(req, true) if err != nil { @@ -61,7 +63,7 @@ var _ = suite("compute/floating-ip/create", func(t *testing.T, when spec.G, it s }) - when("the minimum flags are provided", func() { + when("the droplet-id flag is provided", func() { it("creates the floating-ip", func() { aliases := []string{"create", "c"} @@ -81,12 +83,38 @@ var _ = suite("compute/floating-ip/create", func(t *testing.T, when spec.G, it s } }) }) + + when("the region and project-id flags are provided", func() { + it("creates the floating-ip", func() { + aliases := []string{"create", "c"} + + for _, alias := range aliases { + cmd = exec.Command(builtBinaryPath, + "-t", "some-magic-token", + "-u", server.URL, + "compute", + "floating-ip", + alias, + "--region", "nyc3", + "--project-id", "c98374fa-35e2-11ed-870f-c7de97c5d5ed", + ) + + output, err := cmd.CombinedOutput() + expect.NoError(err, fmt.Sprintf("received error output: %s", output)) + expect.Equal(strings.TrimSpace(floatingIPCreateRegionOutput), strings.TrimSpace(string(output))) + } + }) + }) }) const ( floatingIPCreateOutput = ` -IP Region Droplet ID Droplet Name -45.55.96.47 nyc3 1212 magic-name +IP Region Droplet ID Droplet Name Project ID +45.55.96.47 nyc3 1212 magic-name c98374fa-35e2-11ed-870f-c7de97c5d5ed +` + floatingIPCreateRegionOutput = ` +IP Region Droplet ID Droplet Name Project ID +45.55.96.47 nyc3 c98374fa-35e2-11ed-870f-c7de97c5d5ed ` floatingIPCreateResponse = ` { @@ -103,7 +131,26 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" + }, + "links": {} +} +` + floatingIPCreateRegionResponse = ` +{ + "reserved_ip": { + "ip": "45.55.96.47", + "droplet": null, + "region": { + "name": "New York 3", + "slug": "nyc3", + "sizes": [ "s-32vcpu-192gb" ], + "features": [ "metadata" ], + "available": true + }, + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" }, "links": {} } @@ -112,6 +159,6 @@ IP Region Droplet ID Droplet Name {"droplet_id":1212} ` floatingIPRegionCreateRequest = ` -{"region":"newark"} +{"region":"nyc3","project_id":"c98374fa-35e2-11ed-870f-c7de97c5d5ed"} ` ) diff --git a/integration/floating_ip_get_test.go b/integration/floating_ip_get_test.go index a4fd70bdb..f3132af36 100644 --- a/integration/floating_ip_get_test.go +++ b/integration/floating_ip_get_test.go @@ -74,8 +74,8 @@ var _ = suite("compute/floating-ip/get", func(t *testing.T, when spec.G, it spec const ( floatingIPGetOutput = ` -IP Region Droplet ID Droplet Name -1.1.1.1 nyc3 +IP Region Droplet ID Droplet Name Project ID +1.1.1.1 nyc3 c98374fa-35e2-11ed-870f-c7de97c5d5ed ` floatingIPGetResponse = ` { @@ -89,7 +89,8 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" } } ` diff --git a/integration/floating_ip_list_test.go b/integration/floating_ip_list_test.go index 0d81fbebe..8da479996 100644 --- a/integration/floating_ip_list_test.go +++ b/integration/floating_ip_list_test.go @@ -73,9 +73,9 @@ var _ = suite("compute/floating-ip/list", func(t *testing.T, when spec.G, it spe const ( floatingIPListOutput = ` -IP Region Droplet ID Droplet Name -8.8.8.8 nyc3 8888 hello -1.1.1.1 nyc3 1111 +IP Region Droplet ID Droplet Name Project ID +8.8.8.8 nyc3 8888 hello c98374fa-35e2-11ed-870f-c7de97c5d5ed +1.1.1.1 nyc3 476dea88-35ea-11ed-8e93-f7eb94d49952 ` floatingIPListResponse = ` { @@ -90,11 +90,12 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" }, { "ip": "1.1.1.1", - "droplet": {"id": 1111}, + "droplet":null, "region": { "name": "New York 3", "slug": "nyc3", @@ -102,7 +103,8 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "476dea88-35ea-11ed-8e93-f7eb94d49952" } ], "links": {}, diff --git a/integration/projects_resources_get_test.go b/integration/projects_resources_get_test.go index 0e03698d3..f01b60f5a 100644 --- a/integration/projects_resources_get_test.go +++ b/integration/projects_resources_get_test.go @@ -209,8 +209,8 @@ ID Name Public IPv4 Private IPv4 Public IPv6 Memor 5555 some-droplet-name 0 0 0 some-region-slug some-distro some-image-name active yes remotes some-volume-id ` projectsResourcesGetFloatingIPOutput = ` -IP Region Droplet ID Droplet Name -45.55.96.47 nyc3 +IP Region Droplet ID Droplet Name Project ID +45.55.96.47 nyc3 c98374fa-35e2-11ed-870f-c7de97c5d5ed ` projectsResourcesGetFloatingIPResponse = ` { @@ -224,7 +224,8 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" } } ` diff --git a/integration/reserved_ip_create_test.go b/integration/reserved_ip_create_test.go index de02d0a74..f44838e69 100644 --- a/integration/reserved_ip_create_test.go +++ b/integration/reserved_ip_create_test.go @@ -41,14 +41,16 @@ var _ = suite("compute/reserved-ip/create", func(t *testing.T, when spec.G, it s reqBody, err := ioutil.ReadAll(req.Body) expect.NoError(err) + responseJSON := reservedIPCreateResponse matchedRequest := reservedIPCreateRequest if !strings.Contains(string(reqBody), "droplet_id") { matchedRequest = reservedIPRegionCreateRequest + responseJSON = reservedIPCreateRegionResponse } expect.JSONEq(matchedRequest, string(reqBody)) - w.Write([]byte(reservedIPCreateResponse)) + w.Write([]byte(responseJSON)) default: dump, err := httputil.DumpRequest(req, true) if err != nil { @@ -61,7 +63,7 @@ var _ = suite("compute/reserved-ip/create", func(t *testing.T, when spec.G, it s }) - when("the minimum flags are provided", func() { + when("the droplet-id flag is provided", func() { it("creates the reserved-ip", func() { aliases := []string{"create", "c"} @@ -81,12 +83,82 @@ var _ = suite("compute/reserved-ip/create", func(t *testing.T, when spec.G, it s } }) }) + + when("the region and project-id flags are provided", func() { + it("creates the reserved-ip", func() { + aliases := []string{"create", "c"} + + for _, alias := range aliases { + cmd = exec.Command(builtBinaryPath, + "-t", "some-magic-token", + "-u", server.URL, + "compute", + "reserved-ip", + alias, + "--region", "nyc3", + "--project-id", "c98374fa-35e2-11ed-870f-c7de97c5d5ed", + ) + + output, err := cmd.CombinedOutput() + expect.NoError(err, fmt.Sprintf("received error output: %s", output)) + expect.Equal(strings.TrimSpace(reservedIPCreateRegionOutput), strings.TrimSpace(string(output))) + } + }) + }) + + when("the region and droplet-id flags are provided", func() { + it("returns the expected error", func() { + aliases := []string{"create", "c"} + + for _, alias := range aliases { + cmd = exec.Command(builtBinaryPath, + "-t", "some-magic-token", + "-u", server.URL, + "compute", + "reserved-ip", + alias, + "--region", "nyc3", + "--droplet-id", "1234", + ) + + output, err := cmd.CombinedOutput() + expect.Error(err) + expect.Equal(strings.TrimSpace("Error: Only one of `--region` or `--droplet-id` may be specified when creating a reserved IP address."), strings.TrimSpace(string(output))) + } + }) + }) + + when("the region and project-id flags are provided", func() { + it("returns the expected error", func() { + aliases := []string{"create", "c"} + + for _, alias := range aliases { + cmd = exec.Command(builtBinaryPath, + "-t", "some-magic-token", + "-u", server.URL, + "compute", + "reserved-ip", + alias, + "--droplet-id", "1234", + "--project-id", "c98374fa-35e2-11ed-870f-c7de97c5d5ed", + ) + + output, err := cmd.CombinedOutput() + expect.Error(err) + expect.Equal(strings.TrimSpace("Error: Only one of `--project-id` or `--droplet-id` may be specified when creating a reserved IP address."), strings.TrimSpace(string(output))) + } + }) + }) }) const ( reservedIPCreateOutput = ` -IP Region Droplet ID Droplet Name -45.55.96.47 nyc3 1212 magic-name +IP Region Droplet ID Droplet Name Project ID +45.55.96.47 nyc3 1212 magic-name c98374fa-35e2-11ed-870f-c7de97c5d5ed +` + reservedIPCreateRegionOutput = ` +IP Region Droplet ID Droplet Name Project ID +45.55.96.47 nyc3 c98374fa-35e2-11ed-870f-c7de97c5d5ed ` reservedIPCreateResponse = ` { @@ -103,7 +175,26 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" + }, + "links": {} +} +` + reservedIPCreateRegionResponse = ` +{ + "reserved_ip": { + "ip": "45.55.96.47", + "droplet": null, + "region": { + "name": "New York 3", + "slug": "nyc3", + "sizes": [ "s-32vcpu-192gb" ], + "features": [ "metadata" ], + "available": true + }, + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" }, "links": {} } @@ -112,6 +203,6 @@ IP Region Droplet ID Droplet Name {"droplet_id":1212} ` reservedIPRegionCreateRequest = ` -{"region":"newark"} +{"region":"nyc3","project_id":"c98374fa-35e2-11ed-870f-c7de97c5d5ed"} ` ) diff --git a/integration/reserved_ip_get_test.go b/integration/reserved_ip_get_test.go index 4980fa151..fb3e3a6e0 100644 --- a/integration/reserved_ip_get_test.go +++ b/integration/reserved_ip_get_test.go @@ -74,8 +74,8 @@ var _ = suite("compute/reserved-ip/get", func(t *testing.T, when spec.G, it spec const ( reservedIPGetOutput = ` -IP Region Droplet ID Droplet Name -1.1.1.1 nyc3 +IP Region Droplet ID Droplet Name Project ID +1.1.1.1 nyc3 c98374fa-35e2-11ed-870f-c7de97c5d5ed ` reservedIPGetResponse = ` { @@ -89,7 +89,8 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" } } ` diff --git a/integration/reserved_ip_list_test.go b/integration/reserved_ip_list_test.go index d97ed4a16..4854320a9 100644 --- a/integration/reserved_ip_list_test.go +++ b/integration/reserved_ip_list_test.go @@ -73,9 +73,9 @@ var _ = suite("compute/reserved-ip/list", func(t *testing.T, when spec.G, it spe const ( reservedIPListOutput = ` -IP Region Droplet ID Droplet Name -8.8.8.8 nyc3 8888 hello -1.1.1.1 nyc3 1111 +IP Region Droplet ID Droplet Name Project ID +8.8.8.8 nyc3 8888 hello c98374fa-35e2-11ed-870f-c7de97c5d5ed +1.1.1.1 nyc3 476dea88-35ea-11ed-8e93-f7eb94d49952 ` reservedIPListResponse = ` { @@ -90,11 +90,12 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "c98374fa-35e2-11ed-870f-c7de97c5d5ed" }, { "ip": "1.1.1.1", - "droplet": {"id": 1111}, + "droplet":null, "region": { "name": "New York 3", "slug": "nyc3", @@ -102,7 +103,8 @@ IP Region Droplet ID Droplet Name "features": [ "metadata" ], "available": true }, - "locked": false + "locked": false, + "project_id": "476dea88-35ea-11ed-8e93-f7eb94d49952" } ], "links": {}, diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md index 5459d60c5..97db48444 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [v1.84.1] - 2022-09-16 + +- #554 - @andrewsomething - reserved IPs: project_id should have omitempty in create req. + +## [v1.84.0] - 2022-09-16 + +- #552 - @andrewsomething - reserved IPs: Expose project_id and locked attributes. +- #549 - @rpmoore - adding the replica id to the database replica model + ## [v1.83.0] - 2022-08-10 - #546 - @DWizGuy58 - Add support for database options diff --git a/vendor/github.com/digitalocean/godo/databases.go b/vendor/github.com/digitalocean/godo/databases.go index ffa452b21..69bd6c9f5 100644 --- a/vendor/github.com/digitalocean/godo/databases.go +++ b/vendor/github.com/digitalocean/godo/databases.go @@ -268,6 +268,7 @@ type DatabaseDB struct { // DatabaseReplica represents a read-only replica of a particular database type DatabaseReplica struct { + ID string `json:"id"` Name string `json:"name"` Connection *DatabaseConnection `json:"connection"` PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"` diff --git a/vendor/github.com/digitalocean/godo/floating_ips.go b/vendor/github.com/digitalocean/godo/floating_ips.go index 0458717a6..5a29c67ee 100644 --- a/vendor/github.com/digitalocean/godo/floating_ips.go +++ b/vendor/github.com/digitalocean/godo/floating_ips.go @@ -28,9 +28,11 @@ var _ FloatingIPsService = &FloatingIPsServiceOp{} // FloatingIP represents a Digital Ocean floating IP. type FloatingIP struct { - Region *Region `json:"region"` - Droplet *Droplet `json:"droplet"` - IP string `json:"ip"` + Region *Region `json:"region"` + Droplet *Droplet `json:"droplet"` + IP string `json:"ip"` + ProjectID string `json:"project_id"` + Locked bool `json:"locked"` } func (f FloatingIP) String() string { @@ -59,6 +61,7 @@ type floatingIPRoot struct { type FloatingIPCreateRequest struct { Region string `json:"region,omitempty"` DropletID int `json:"droplet_id,omitempty"` + ProjectID string `json:"project_id,omitempty"` } // List all floating IPs. diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go index ae2e2238a..ffdfbf65c 100644 --- a/vendor/github.com/digitalocean/godo/godo.go +++ b/vendor/github.com/digitalocean/godo/godo.go @@ -20,7 +20,7 @@ import ( ) const ( - libraryVersion = "1.83.0" + libraryVersion = "1.84.1" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json" diff --git a/vendor/github.com/digitalocean/godo/reserved_ips.go b/vendor/github.com/digitalocean/godo/reserved_ips.go index f767f86c0..5370c14c7 100644 --- a/vendor/github.com/digitalocean/godo/reserved_ips.go +++ b/vendor/github.com/digitalocean/godo/reserved_ips.go @@ -29,9 +29,11 @@ var _ ReservedIPsService = &ReservedIPsServiceOp{} // ReservedIP represents a Digital Ocean reserved IP. type ReservedIP struct { - Region *Region `json:"region"` - Droplet *Droplet `json:"droplet"` - IP string `json:"ip"` + Region *Region `json:"region"` + Droplet *Droplet `json:"droplet"` + IP string `json:"ip"` + ProjectID string `json:"project_id"` + Locked bool `json:"locked"` } func (f ReservedIP) String() string { @@ -60,6 +62,7 @@ type reservedIPRoot struct { type ReservedIPCreateRequest struct { Region string `json:"region,omitempty"` DropletID int `json:"droplet_id,omitempty"` + ProjectID string `json:"project_id,omitempty"` } // List all reserved IPs. diff --git a/vendor/modules.txt b/vendor/modules.txt index eb0571d20..83d60db80 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -27,7 +27,7 @@ github.com/creack/pty # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew -# github.com/digitalocean/godo v1.83.0 +# github.com/digitalocean/godo v1.84.1 ## explicit; go 1.18 github.com/digitalocean/godo github.com/digitalocean/godo/metrics