networking

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RegionNameApSeo1 = shared.RegionNameApSeo1

Equals "ap-seo-1"

View Source
const RegionNameApSin1 = shared.RegionNameApSin1

Equals "ap-sin-1"

View Source
const RegionNameApTyo1 = shared.RegionNameApTyo1

Equals "ap-tyo-1"

View Source
const RegionNameEuFrk1 = shared.RegionNameEuFrk1

Equals "eu-frk-1"

View Source
const RegionNameUsChi1 = shared.RegionNameUsChi1

Equals "us-chi-1"

View Source
const RegionNameUsSea1 = shared.RegionNameUsSea1

Equals "us-sea-1"

View Source
const RegionNameUsSva1 = shared.RegionNameUsSva1

Equals "us-sva-1"

View Source
const RegionNameUsSva2 = shared.RegionNameUsSva2

Equals "us-sva-2"

View Source
const RegionNameUsWdc1 = shared.RegionNameUsWdc1

Equals "us-wdc-1"

View Source
const ResourceStatusCreating = shared.ResourceStatusCreating

Equals "creating"

View Source
const ResourceStatusDeleted = shared.ResourceStatusDeleted

Equals "deleted"

View Source
const ResourceStatusDeleting = shared.ResourceStatusDeleting

Equals "deleting"

View Source
const ResourceStatusError = shared.ResourceStatusError

Equals "error"

View Source
const ResourceStatusPending = shared.ResourceStatusPending

Equals "pending"

View Source
const ResourceStatusReady = shared.ResourceStatusReady

Equals "ready"

View Source
const ResourceStatusUpdating = shared.ResourceStatusUpdating

Equals "updating"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectBandwidthMbps added in v1.20.0

type ConnectBandwidthMbps int64

Connect Connection speed in Mbps

const (
	ConnectBandwidthMbps50   ConnectBandwidthMbps = 50
	ConnectBandwidthMbps200  ConnectBandwidthMbps = 200
	ConnectBandwidthMbps500  ConnectBandwidthMbps = 500
	ConnectBandwidthMbps1000 ConnectBandwidthMbps = 1000
	ConnectBandwidthMbps2000 ConnectBandwidthMbps = 2000
)

type ConnectConnection added in v1.20.0

type ConnectConnection struct {
	// Unique identifier for the Connect Connection
	ID string `json:"id,required"`
	// ASN
	ASN int64 `json:"asn,required"`
	// AWS provider configuration
	AWS ConnectConnectionAWSConfig `json:"aws,required"`
	// Connect Connection speed in Mbps
	//
	// Any of 50, 200, 500, 1000, 2000.
	BandwidthMbps int64 `json:"bandwidth_mbps,required"`
	// CIDRs for the Connect Connection
	CIDRs []string `json:"cidrs,required"`
	// When the Connect Connection was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Name of the Connect Connection
	Name string `json:"name,required"`
	// Provider ASN
	ProviderASN int64 `json:"provider_asn,required"`
	// Provider CIDRs for the Connect Connection
	ProviderCIDRs []string `json:"provider_cidrs,required"`
	// Provider Router IP for the Connect Connection
	ProviderRouterIP string `json:"provider_router_ip,required"`
	// Region the resource is in.
	//
	// Any of "us-sea-1", "us-sva-1", "us-sva-2", "us-chi-1", "us-wdc-1", "eu-frk-1",
	// "ap-sin-1", "ap-seo-1", "ap-tyo-1".
	Region shared.RegionName `json:"region,required"`
	// Router IP
	RouterIP string `json:"router_ip,required"`
	// Status of the resource.
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
	// "error".
	Status shared.ResourceStatus `json:"status,required"`
	// Tags to attach to the Connect Connection
	Tags []string `json:"tags,required"`
	// When the Connect Connection was updated
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		ASN              respjson.Field
		AWS              respjson.Field
		BandwidthMbps    respjson.Field
		CIDRs            respjson.Field
		CreatedAt        respjson.Field
		Name             respjson.Field
		ProviderASN      respjson.Field
		ProviderCIDRs    respjson.Field
		ProviderRouterIP respjson.Field
		Region           respjson.Field
		RouterIP         respjson.Field
		Status           respjson.Field
		Tags             respjson.Field
		UpdatedAt        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Connect Connection details.

func (ConnectConnection) RawJSON added in v1.20.0

func (r ConnectConnection) RawJSON() string

Returns the unmodified JSON received from the API

func (*ConnectConnection) UnmarshalJSON added in v1.20.0

func (r *ConnectConnection) UnmarshalJSON(data []byte) error

type ConnectConnectionAWSConfig added in v1.20.0

type ConnectConnectionAWSConfig struct {
	// AWS region where the connection is established
	Region string `json:"region,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Region      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AWS provider configuration

func (ConnectConnectionAWSConfig) RawJSON added in v1.20.0

func (r ConnectConnectionAWSConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ConnectConnectionAWSConfig) UnmarshalJSON added in v1.20.0

func (r *ConnectConnectionAWSConfig) UnmarshalJSON(data []byte) error

type ConnectConnectionAWSConfigRequestParam added in v1.20.0

type ConnectConnectionAWSConfigRequestParam struct {
	// AWS account id
	AccountID string `json:"account_id,required"`
	// AWS region where the connection will be established
	Region string `json:"region,required"`
	// contains filtered or unexported fields
}

AWS provider configuration

The properties AccountID, Region are required.

func (ConnectConnectionAWSConfigRequestParam) MarshalJSON added in v1.20.0

func (r ConnectConnectionAWSConfigRequestParam) MarshalJSON() (data []byte, err error)

func (*ConnectConnectionAWSConfigRequestParam) UnmarshalJSON added in v1.20.0

func (r *ConnectConnectionAWSConfigRequestParam) UnmarshalJSON(data []byte) error

type ConnectConnectionList added in v1.20.0

type ConnectConnectionList struct {
	Items []ConnectConnection `json:"items,required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ConnectConnectionList) RawJSON added in v1.20.0

func (r ConnectConnectionList) RawJSON() string

Returns the unmodified JSON received from the API

func (*ConnectConnectionList) UnmarshalJSON added in v1.20.0

func (r *ConnectConnectionList) UnmarshalJSON(data []byte) error

type ConnectConnectionListParams added in v1.21.0

type ConnectConnectionListParams struct {
	// Pagination cursor returned by a previous request
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ConnectConnectionListParams) URLQuery added in v1.21.0

func (r ConnectConnectionListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ConnectConnectionListParams's query parameters as `url.Values`.

type ConnectConnectionNewParams added in v1.20.0

type ConnectConnectionNewParams struct {
	// Connect Connection speed in Mbps
	//
	// Any of 50, 200, 500, 1000, 2000.
	BandwidthMbps int64 `json:"bandwidth_mbps,omitzero,required"`
	// CIDRs for the Connect Connection. Must be in network-aligned/canonical form.
	CIDRs []string `json:"cidrs,omitzero,required"`
	// Name of the Connect Connection
	Name string `json:"name,required"`
	// Provider CIDRs. Must be in network-aligned/canonical form.
	ProviderCIDRs []string `json:"provider_cidrs,omitzero,required"`
	// Region the resource is in.
	//
	// Any of "us-sea-1", "us-sva-1", "us-sva-2", "us-chi-1", "us-wdc-1", "eu-frk-1",
	// "ap-sin-1", "ap-seo-1", "ap-tyo-1".
	Region shared.RegionName `json:"region,omitzero,required"`
	// AWS provider configuration
	AWS ConnectConnectionAWSConfigRequestParam `json:"aws,omitzero"`
	// Tags to attach to the Connect Connection
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (ConnectConnectionNewParams) MarshalJSON added in v1.20.0

func (r ConnectConnectionNewParams) MarshalJSON() (data []byte, err error)

func (*ConnectConnectionNewParams) UnmarshalJSON added in v1.20.0

func (r *ConnectConnectionNewParams) UnmarshalJSON(data []byte) error

type ConnectConnectionService added in v1.20.0

type ConnectConnectionService struct {
	Options []option.RequestOption
}

ConnectConnectionService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConnectConnectionService method instead.

func NewConnectConnectionService added in v1.20.0

func NewConnectConnectionService(opts ...option.RequestOption) (r ConnectConnectionService)

NewConnectConnectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ConnectConnectionService) Delete added in v1.20.0

func (r *ConnectConnectionService) Delete(ctx context.Context, connectionID string, opts ...option.RequestOption) (res *operations.Operation, err error)

Delete Connect Connection

func (*ConnectConnectionService) Get added in v1.20.0

func (r *ConnectConnectionService) Get(ctx context.Context, connectionID string, opts ...option.RequestOption) (res *ConnectConnection, err error)

Get Connect Connection details

func (*ConnectConnectionService) List added in v1.20.0

List all Connect Connections

func (*ConnectConnectionService) ListAutoPaging added in v1.21.0

List all Connect Connections

func (*ConnectConnectionService) New added in v1.20.0

Create a Connect Connection

func (*ConnectConnectionService) Update added in v1.20.0

Update Connect Connection details

type ConnectConnectionUpdateParams added in v1.20.0

type ConnectConnectionUpdateParams struct {
	// Name of the Connect Connection.
	Name param.Opt[string] `json:"name,omitzero"`
	// Tags to attach to the Connect Connection
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (ConnectConnectionUpdateParams) MarshalJSON added in v1.20.0

func (r ConnectConnectionUpdateParams) MarshalJSON() (data []byte, err error)

func (*ConnectConnectionUpdateParams) UnmarshalJSON added in v1.20.0

func (r *ConnectConnectionUpdateParams) UnmarshalJSON(data []byte) error

type ConnectRoute added in v1.20.0

type ConnectRoute struct {
	// Region the resource is in.
	//
	// Any of "us-sea-1", "us-sva-1", "us-sva-2", "us-chi-1", "us-wdc-1", "eu-frk-1",
	// "ap-sin-1", "ap-seo-1", "ap-tyo-1".
	NirvanaRegion shared.RegionName `json:"nirvana_region,required"`
	// Provider name.
	Provider string `json:"provider,required"`
	// Provider region name.
	ProviderRegion string `json:"provider_region,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		NirvanaRegion  respjson.Field
		Provider       respjson.Field
		ProviderRegion respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Routes supported for Connect.

func (ConnectRoute) RawJSON added in v1.20.0

func (r ConnectRoute) RawJSON() string

Returns the unmodified JSON received from the API

func (*ConnectRoute) UnmarshalJSON added in v1.20.0

func (r *ConnectRoute) UnmarshalJSON(data []byte) error

type ConnectRouteList added in v1.20.0

type ConnectRouteList struct {
	Items []ConnectRoute `json:"items,required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ConnectRouteList) RawJSON added in v1.20.0

func (r ConnectRouteList) RawJSON() string

Returns the unmodified JSON received from the API

func (*ConnectRouteList) UnmarshalJSON added in v1.20.0

func (r *ConnectRouteList) UnmarshalJSON(data []byte) error

type ConnectRouteListParams added in v1.21.0

type ConnectRouteListParams struct {
	// Pagination cursor returned by a previous request
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ConnectRouteListParams) URLQuery added in v1.21.0

func (r ConnectRouteListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ConnectRouteListParams's query parameters as `url.Values`.

type ConnectRouteService added in v1.20.0

type ConnectRouteService struct {
	Options []option.RequestOption
}

ConnectRouteService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConnectRouteService method instead.

func NewConnectRouteService added in v1.20.0

func NewConnectRouteService(opts ...option.RequestOption) (r ConnectRouteService)

NewConnectRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ConnectRouteService) List added in v1.20.0

List all supported routes with regions for Connect.

func (*ConnectRouteService) ListAutoPaging added in v1.21.0

List all supported routes with regions for Connect.

type ConnectService added in v1.20.0

type ConnectService struct {
	Options     []option.RequestOption
	Connections ConnectConnectionService
	Routes      ConnectRouteService
}

ConnectService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConnectService method instead.

func NewConnectService added in v1.20.0

func NewConnectService(opts ...option.RequestOption) (r ConnectService)

NewConnectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Error

type Error = apierror.Error

type FirewallRule

type FirewallRule struct {
	// Unique identifier for the Firewall Rule.
	ID string `json:"id,required"`
	// When the Firewall Rule was created.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.
	DestinationAddress string `json:"destination_address,required"`
	// Destination ports of the Firewall Rule.
	DestinationPorts []string `json:"destination_ports,required"`
	// Name of the Firewall Rule.
	Name string `json:"name,required"`
	// Protocol of the Firewall Rule.
	//
	// Any of "tcp", "udp".
	Protocol FirewallRuleProtocol `json:"protocol,required"`
	// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
	// of 0.
	SourceAddress string `json:"source_address,required"`
	// Status of the resource.
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
	// "error".
	Status shared.ResourceStatus `json:"status,required"`
	// Tags to attach to the Firewall Rule.
	Tags []string `json:"tags,required"`
	// When the Firewall Rule was updated.
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// ID of the VPC the Firewall Rule belongs to.
	VPCID string `json:"vpc_id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		CreatedAt          respjson.Field
		DestinationAddress respjson.Field
		DestinationPorts   respjson.Field
		Name               respjson.Field
		Protocol           respjson.Field
		SourceAddress      respjson.Field
		Status             respjson.Field
		Tags               respjson.Field
		UpdatedAt          respjson.Field
		VPCID              respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Firewall rule details.

func (FirewallRule) RawJSON added in v1.1.0

func (r FirewallRule) RawJSON() string

Returns the unmodified JSON received from the API

func (*FirewallRule) UnmarshalJSON

func (r *FirewallRule) UnmarshalJSON(data []byte) error

type FirewallRuleList

type FirewallRuleList struct {
	Items []FirewallRule `json:"items,required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FirewallRuleList) RawJSON added in v1.1.0

func (r FirewallRuleList) RawJSON() string

Returns the unmodified JSON received from the API

func (*FirewallRuleList) UnmarshalJSON

func (r *FirewallRuleList) UnmarshalJSON(data []byte) error

type FirewallRuleListParams added in v1.21.0

type FirewallRuleListParams struct {
	// Pagination cursor returned by a previous request
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FirewallRuleListParams) URLQuery added in v1.21.0

func (r FirewallRuleListParams) URLQuery() (v url.Values, err error)

URLQuery serializes FirewallRuleListParams's query parameters as `url.Values`.

type FirewallRuleNewParams

type FirewallRuleNewParams struct {
	// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC. Must be
	// in network-aligned/canonical form.
	DestinationAddress string `json:"destination_address,required"`
	// Destination ports of the Firewall Rule.
	DestinationPorts []string `json:"destination_ports,omitzero,required"`
	// Name of the Firewall Rule.
	Name string `json:"name,required"`
	// Protocol of the Firewall Rule.
	//
	// Any of "tcp", "udp".
	Protocol FirewallRuleNewParamsProtocol `json:"protocol,omitzero,required"`
	// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
	// of 0. Must be in network-aligned/canonical form.
	SourceAddress string `json:"source_address,required"`
	// Tags to attach to the Firewall Rule.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (FirewallRuleNewParams) MarshalJSON

func (r FirewallRuleNewParams) MarshalJSON() (data []byte, err error)

func (*FirewallRuleNewParams) UnmarshalJSON added in v1.1.0

func (r *FirewallRuleNewParams) UnmarshalJSON(data []byte) error

type FirewallRuleNewParamsProtocol added in v1.7.0

type FirewallRuleNewParamsProtocol string

Protocol of the Firewall Rule.

const (
	FirewallRuleNewParamsProtocolTcp FirewallRuleNewParamsProtocol = "tcp"
	FirewallRuleNewParamsProtocolUdp FirewallRuleNewParamsProtocol = "udp"
)

type FirewallRuleProtocol

type FirewallRuleProtocol string

Protocol of the Firewall Rule.

const (
	FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"
	FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"
)

type FirewallRuleService

type FirewallRuleService struct {
	Options []option.RequestOption
}

FirewallRuleService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFirewallRuleService method instead.

func NewFirewallRuleService

func NewFirewallRuleService(opts ...option.RequestOption) (r FirewallRuleService)

NewFirewallRuleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FirewallRuleService) Delete

func (r *FirewallRuleService) Delete(ctx context.Context, vpcID string, firewallRuleID string, opts ...option.RequestOption) (res *operations.Operation, err error)

Delete a firewall rule

func (*FirewallRuleService) Get

func (r *FirewallRuleService) Get(ctx context.Context, vpcID string, firewallRuleID string, opts ...option.RequestOption) (res *FirewallRule, err error)

Get details about a firewall rule

func (*FirewallRuleService) List

List all firewall rules

func (*FirewallRuleService) ListAutoPaging added in v1.21.0

List all firewall rules

func (*FirewallRuleService) New

Create a firewall rule

func (*FirewallRuleService) Update

func (r *FirewallRuleService) Update(ctx context.Context, vpcID string, firewallRuleID string, body FirewallRuleUpdateParams, opts ...option.RequestOption) (res *operations.Operation, err error)

Update a firewall rule

type FirewallRuleUpdateParams

type FirewallRuleUpdateParams struct {
	// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC. Must be
	// in network-aligned/canonical form.
	DestinationAddress param.Opt[string] `json:"destination_address,omitzero"`
	// Name of the Firewall Rule.
	Name param.Opt[string] `json:"name,omitzero"`
	// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
	// of 0. Must be in network-aligned/canonical form.
	SourceAddress param.Opt[string] `json:"source_address,omitzero"`
	// Destination ports of the Firewall Rule.
	DestinationPorts []string `json:"destination_ports,omitzero"`
	// Protocol of the Firewall Rule.
	//
	// Any of "tcp", "udp".
	Protocol FirewallRuleUpdateParamsProtocol `json:"protocol,omitzero"`
	// Tags to attach to the Firewall Rule.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (FirewallRuleUpdateParams) MarshalJSON

func (r FirewallRuleUpdateParams) MarshalJSON() (data []byte, err error)

func (*FirewallRuleUpdateParams) UnmarshalJSON added in v1.1.0

func (r *FirewallRuleUpdateParams) UnmarshalJSON(data []byte) error

type FirewallRuleUpdateParamsProtocol

type FirewallRuleUpdateParamsProtocol string

Protocol of the Firewall Rule.

const (
	FirewallRuleUpdateParamsProtocolTcp FirewallRuleUpdateParamsProtocol = "tcp"
	FirewallRuleUpdateParamsProtocolUdp FirewallRuleUpdateParamsProtocol = "udp"
)

type NetworkingService

type NetworkingService struct {
	Options       []option.RequestOption
	VPCs          VPCService
	FirewallRules FirewallRuleService
	Connect       ConnectService
}

NetworkingService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkingService method instead.

func NewNetworkingService

func NewNetworkingService(opts ...option.RequestOption) (r NetworkingService)

NewNetworkingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Pagination added in v1.21.0

type Pagination = shared.Pagination

Pagination response details.

This is an alias to an internal type.

type RegionName

type RegionName = shared.RegionName

Region the resource is in.

This is an alias to an internal type.

type ResourceStatus

type ResourceStatus = shared.ResourceStatus

Status of the resource.

This is an alias to an internal type.

type Subnet

type Subnet struct {
	// Unique identifier for the Subnet.
	ID string `json:"id,required"`
	// CIDR block for the Subnet.
	CIDR string `json:"cidr,required"`
	// When the Subnet was created.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Name of the Subnet.
	Name string `json:"name,required"`
	// When the Subnet was updated.
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CIDR        respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Subnet of the VPC.

func (Subnet) RawJSON added in v1.1.0

func (r Subnet) RawJSON() string

Returns the unmodified JSON received from the API

func (*Subnet) UnmarshalJSON

func (r *Subnet) UnmarshalJSON(data []byte) error

type VPC

type VPC struct {
	// Unique identifier for the VPC.
	ID string `json:"id,required"`
	// When the VPC was created.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// IDs of the Firewall Rules associated with the VPC.
	FirewallRuleIDs []string `json:"firewall_rule_ids,required"`
	// Name of the VPC.
	Name string `json:"name,required"`
	// Region the resource is in.
	//
	// Any of "us-sea-1", "us-sva-1", "us-sva-2", "us-chi-1", "us-wdc-1", "eu-frk-1",
	// "ap-sin-1", "ap-seo-1", "ap-tyo-1".
	Region shared.RegionName `json:"region,required"`
	// Status of the resource.
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
	// "error".
	Status shared.ResourceStatus `json:"status,required"`
	// Subnet of the VPC.
	Subnet Subnet `json:"subnet,required"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,required"`
	// When the VPC was updated.
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CreatedAt       respjson.Field
		FirewallRuleIDs respjson.Field
		Name            respjson.Field
		Region          respjson.Field
		Status          respjson.Field
		Subnet          respjson.Field
		Tags            respjson.Field
		UpdatedAt       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

VPC details.

func (VPC) RawJSON added in v1.1.0

func (r VPC) RawJSON() string

Returns the unmodified JSON received from the API

func (*VPC) UnmarshalJSON

func (r *VPC) UnmarshalJSON(data []byte) error

type VPCAvailabilityNewParams added in v1.3.0

type VPCAvailabilityNewParams struct {
	// Name of the VPC.
	Name string `json:"name,required"`
	// Region the resource is in.
	//
	// Any of "us-sea-1", "us-sva-1", "us-sva-2", "us-chi-1", "us-wdc-1", "eu-frk-1",
	// "ap-sin-1", "ap-seo-1", "ap-tyo-1".
	Region shared.RegionName `json:"region,omitzero,required"`
	// Name of the subnet to create.
	SubnetName string `json:"subnet_name,required"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (VPCAvailabilityNewParams) MarshalJSON added in v1.3.0

func (r VPCAvailabilityNewParams) MarshalJSON() (data []byte, err error)

func (*VPCAvailabilityNewParams) UnmarshalJSON added in v1.3.0

func (r *VPCAvailabilityNewParams) UnmarshalJSON(data []byte) error

type VPCAvailabilityService added in v1.3.0

type VPCAvailabilityService struct {
	Options []option.RequestOption
}

VPCAvailabilityService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVPCAvailabilityService method instead.

func NewVPCAvailabilityService added in v1.3.0

func NewVPCAvailabilityService(opts ...option.RequestOption) (r VPCAvailabilityService)

NewVPCAvailabilityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VPCAvailabilityService) New added in v1.3.0

Check if a VPC can be created

func (*VPCAvailabilityService) Update added in v1.3.0

func (r *VPCAvailabilityService) Update(ctx context.Context, vpcID string, body VPCAvailabilityUpdateParams, opts ...option.RequestOption) (res *string, err error)

Check if a VPC can be updated

type VPCAvailabilityUpdateParams added in v1.3.0

type VPCAvailabilityUpdateParams struct {
	// Name of the VPC.
	Name param.Opt[string] `json:"name,omitzero"`
	// Name of the subnet to create.
	SubnetName param.Opt[string] `json:"subnet_name,omitzero"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (VPCAvailabilityUpdateParams) MarshalJSON added in v1.3.0

func (r VPCAvailabilityUpdateParams) MarshalJSON() (data []byte, err error)

func (*VPCAvailabilityUpdateParams) UnmarshalJSON added in v1.3.0

func (r *VPCAvailabilityUpdateParams) UnmarshalJSON(data []byte) error

type VPCList

type VPCList struct {
	Items []VPC `json:"items,required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (VPCList) RawJSON added in v1.1.0

func (r VPCList) RawJSON() string

Returns the unmodified JSON received from the API

func (*VPCList) UnmarshalJSON

func (r *VPCList) UnmarshalJSON(data []byte) error

type VPCListParams added in v1.21.0

type VPCListParams struct {
	// Pagination cursor returned by a previous request
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (VPCListParams) URLQuery added in v1.21.0

func (r VPCListParams) URLQuery() (v url.Values, err error)

URLQuery serializes VPCListParams's query parameters as `url.Values`.

type VPCNewParams

type VPCNewParams struct {
	// Name of the VPC.
	Name string `json:"name,required"`
	// Region the resource is in.
	//
	// Any of "us-sea-1", "us-sva-1", "us-sva-2", "us-chi-1", "us-wdc-1", "eu-frk-1",
	// "ap-sin-1", "ap-seo-1", "ap-tyo-1".
	Region shared.RegionName `json:"region,omitzero,required"`
	// Name of the subnet to create.
	SubnetName string `json:"subnet_name,required"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (VPCNewParams) MarshalJSON

func (r VPCNewParams) MarshalJSON() (data []byte, err error)

func (*VPCNewParams) UnmarshalJSON added in v1.1.0

func (r *VPCNewParams) UnmarshalJSON(data []byte) error

type VPCService

type VPCService struct {
	Options      []option.RequestOption
	Availability VPCAvailabilityService
}

VPCService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVPCService method instead.

func NewVPCService

func NewVPCService(opts ...option.RequestOption) (r VPCService)

NewVPCService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VPCService) Delete

func (r *VPCService) Delete(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *operations.Operation, err error)

Delete a VPC

func (*VPCService) Get

func (r *VPCService) Get(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *VPC, err error)

Get details about a VPC

func (*VPCService) List

func (r *VPCService) List(ctx context.Context, query VPCListParams, opts ...option.RequestOption) (res *pagination.Cursor[VPC], err error)

List all VPCs

func (*VPCService) ListAutoPaging added in v1.21.0

func (r *VPCService) ListAutoPaging(ctx context.Context, query VPCListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[VPC]

List all VPCs

func (*VPCService) New

func (r *VPCService) New(ctx context.Context, body VPCNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)

Create a VPC

func (*VPCService) Update

func (r *VPCService) Update(ctx context.Context, vpcID string, body VPCUpdateParams, opts ...option.RequestOption) (res *operations.Operation, err error)

Update a VPC

type VPCUpdateParams

type VPCUpdateParams struct {
	// Name of the VPC.
	Name param.Opt[string] `json:"name,omitzero"`
	// Name of the subnet to create.
	SubnetName param.Opt[string] `json:"subnet_name,omitzero"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (VPCUpdateParams) MarshalJSON

func (r VPCUpdateParams) MarshalJSON() (data []byte, err error)

func (*VPCUpdateParams) UnmarshalJSON added in v1.1.0

func (r *VPCUpdateParams) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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