Help us shape the future of Go! Take the 2026 Go Developer Survey

subnets

package
v0.9.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package subnets manages VPC subnets through the VPC v1 API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, vpcID, id string) error

Types

type CreateOpts

type CreateOpts struct {
	Name             string         `json:"name" required:"true"`
	Description      string         `json:"description,omitempty"`
	CIDR             string         `json:"cidr" required:"true"`
	GatewayIP        string         `json:"gateway_ip" required:"true"`
	EnableIpv6       *bool          `json:"ipv6_enable,omitempty"`
	EnableDHCP       *bool          `json:"dhcp_enable,omitempty"`
	PrimaryDNS       string         `json:"primary_dns,omitempty"`
	SecondaryDNS     string         `json:"secondary_dns,omitempty"`
	DNSList          []string       `json:"dnsList,omitempty"`
	AvailabilityZone string         `json:"availability_zone,omitempty"`
	VpcID            string         `json:"vpc_id" required:"true"`
	ExtraDHCPOpts    []ExtraDHCPOpt `json:"extra_dhcp_opts,omitempty"`
}

type ExtraDHCPOpt

type ExtraDHCPOpt struct {
	OptName  string `json:"opt_name"`
	OptValue string `json:"opt_value,omitempty"`
}

type ListOpts

type ListOpts struct {
	Marker string `q:"marker,omitempty"`
	Limit  *int   `q:"limit,omitempty"`
	VpcID  string `q:"vpc_id,omitempty"`
}

type Subnet

type Subnet struct {
	ID               string         `json:"id"`
	Name             string         `json:"name"`
	Description      string         `json:"description"`
	CIDR             string         `json:"cidr"`
	GatewayIP        string         `json:"gateway_ip"`
	EnableIpv6       bool           `json:"ipv6_enable"`
	CidrV6           string         `json:"cidr_v6"`
	GatewayIpV6      string         `json:"gateway_ip_v6"`
	EnableDHCP       bool           `json:"dhcp_enable"`
	PrimaryDNS       string         `json:"primary_dns"`
	SecondaryDNS     string         `json:"secondary_dns"`
	DNSList          []string       `json:"dnsList"`
	AvailabilityZone string         `json:"availability_zone"`
	VpcID            string         `json:"vpc_id"`
	Status           string         `json:"status"`
	NetworkID        string         `json:"neutron_network_id"`
	SubnetID         string         `json:"neutron_subnet_id"`
	SubnetIDV6       string         `json:"neutron_subnet_id_v6"`
	ExtraDHCPOpts    []ExtraDHCPOpt `json:"extra_dhcp_opts"`
	Scope            string         `json:"scope"`
	TenantID         string         `json:"tenant_id"`
	CreatedAt        string         `json:"created_at"`
	UpdatedAt        string         `json:"updated_at"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Subnet, error)

func ExtractSubnets

func ExtractSubnets(page pagination.NewPage) ([]Subnet, error)

func Get

func Get(client *golangsdk.ServiceClient, id string) (*Subnet, error)

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Subnet, error)

func Update

func Update(client *golangsdk.ServiceClient, vpcID, id string, opts UpdateOpts) (*Subnet, error)

type SubnetPage

type SubnetPage struct {
	pagination.NewPageResult
}

func (SubnetPage) NewIsEmpty

func (p SubnetPage) NewIsEmpty() (bool, error)

func (SubnetPage) NewNextPageURL

func (p SubnetPage) NewNextPageURL() (string, error)

type UpdateOpts

type UpdateOpts struct {
	Name          string         `json:"name" required:"true"`
	Description   *string        `json:"description,omitempty"`
	EnableIpv6    *bool          `json:"ipv6_enable,omitempty"`
	EnableDHCP    *bool          `json:"dhcp_enable,omitempty"`
	PrimaryDNS    string         `json:"primary_dns,omitempty"`
	SecondaryDNS  string         `json:"secondary_dns,omitempty"`
	DNSList       []string       `json:"dnsList,omitempty"`
	ExtraDHCPOpts []ExtraDHCPOpt `json:"extra_dhcp_opts,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL