Skip to main content
PATCH
/
elastic_ips
/
{elastic_ip_id}
Go (SDK)
package main

import(
	"context"
	"os"
	latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
	"github.com/latitudesh/latitudesh-go-sdk/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := latitudeshgosdk.New(
        latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
    )

    res, err := s.ElasticIPs.UpdateElasticIP(ctx, "eip_KeQbB4BoO6x10", components.UpdateElasticIP{
        Data: components.UpdateElasticIPData{
            Type: components.UpdateElasticIPTypeElasticIps,
            Attributes: components.UpdateElasticIPAttributes{
                ServerID: "sv_oDEBlwBGRO2me",
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.ElasticIP != nil {
        // handle response
    }
}
{
  "data": {
    "id": "eip_KeQbB4BoO6x10",
    "type": "elastic_ips",
    "attributes": {
      "address": "177.54.156.7",
      "family": "IPv4",
      "prefix_length": 32,
      "mode": "routed",
      "status": "active",
      "created_at": "2026-02-24T17:06:28.108Z",
      "server": {
        "id": "sv_oDEBlwBGRO2me",
        "hostname": "new-server",
        "primary_ipv4": "177.54.157.180"
      },
      "project": {
        "id": "proj_AoW6vRnwkvLn0",
        "name": "My Project",
        "slug": "my-project"
      },
      "region": {
        "city": "São Paulo",
        "site": {
          "slug": "SAO"
        }
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Path Parameters

elastic_ip_id
string
required

The Elastic IP ID

Body

data
object
required

Response

Success

data
object
meta
object