Skip to main content
PATCH
/
virtual_networks
/
{vlan_id}
Go (SDK)
package main

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

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

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

    res, err := s.PrivateNetworks.Update(ctx, "vlan_VaNmodjeObE8W", operations.UpdateVirtualNetworkPrivateNetworksRequestBody{
        Data: operations.UpdateVirtualNetworkPrivateNetworksData{
            ID: "vlan_VaNmodjeObE8W",
            Type: operations.UpdateVirtualNetworkPrivateNetworksTypeVirtualNetworks,
            Attributes: &operations.UpdateVirtualNetworkPrivateNetworksAttributes{
                Tags: []string{
                    "tag_Mjb3aoBkXRi5nR0gBQ5EhV30voRx",
                    "tag_QnkPzo8Wj1iWWzg24P5bhXAzrxmm",
                },
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.VirtualNetwork != nil {
        // handle response
    }
}
{
  "data": {
    "id": "vlan_VaNmodjeObE8W",
    "type": "virtual_networks",
    "attributes": {
      "tags": [
        {
          "id": "tag_Mjb3aoBkXRi5nR0gBQ5EhV30voRx",
          "name": "Arantar",
          "description": "Qui rerum nihil eum.",
          "color": "#a7f6f6"
        },
        {
          "id": "tag_QnkPzo8Wj1iWWzg24P5bhXAzrxmm",
          "name": "Meneldor",
          "description": "Et voluptate quibusdam non.",
          "color": "#9ecccc"
        }
      ],
      "vid": 2040,
      "name": "illo",
      "description": "Eum voluptatem nisi et.",
      "site": "SAO",
      "created_at": null
    }
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Path Parameters

vlan_id
string
required

The Virtual Network ID

Body

data
object
required

Response

200 - application/vnd.api+json

Success

data
object
meta
object