networking

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 3 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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"

View Source
const VMMetricUnitBytes = shared.VMMetricUnitBytes

Equals "bytes"

View Source
const VMMetricUnitBytesPerSecond = shared.VMMetricUnitBytesPerSecond

Equals "bytes_per_second"

View Source
const VMMetricUnitCores = shared.VMMetricUnitCores

Equals "cores"

View Source
const VMMetricUnitOperationsPerSecond = shared.VMMetricUnitOperationsPerSecond

Equals "operations_per_second"

View Source
const VMMetricUnitRatio = shared.VMMetricUnitRatio

Equals "ratio"

Variables

This section is empty.

Functions

This section is empty.

Types

type CostQuote

type CostQuote = shared.CostQuote

Cost quote returned by POST /cost. current_summary and updated_summary hold the org billing summary now and with this resource; omitted when the caller cannot view billing.

This is an alias to an internal type.

type CostQuoteUpdate

type CostQuoteUpdate = shared.CostQuoteUpdate

Cost quote returned by PATCH /:id/cost: current-state quote, post-update quote, and signed diff. current_summary and updated_summary omitted when the caller cannot view billing.

This is an alias to an internal type.

type CostQuoteUpdateAfter

type CostQuoteUpdateAfter = shared.CostQuoteUpdateAfter

Quote for the proposed (post-update) resource state.

This is an alias to an internal type.

type CostQuoteUpdateAfterUsageDimension

type CostQuoteUpdateAfterUsageDimension = shared.CostQuoteUpdateAfterUsageDimension

Priced row for a single usage dimension emitted by a resource.

This is an alias to an internal type.

type CostQuoteUpdateBefore

type CostQuoteUpdateBefore = shared.CostQuoteUpdateBefore

Quote for the proposed (post-update) resource state.

This is an alias to an internal type.

type CostQuoteUpdateBeforeUsageDimension

type CostQuoteUpdateBeforeUsageDimension = shared.CostQuoteUpdateBeforeUsageDimension

Priced row for a single usage dimension emitted by a resource.

This is an alias to an internal type.

type CostQuoteUpdateDiff

type CostQuoteUpdateDiff = shared.CostQuoteUpdateDiff

Per-dimension and total deltas: after minus before.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimension

type CostQuoteUpdateDiffUsageDimension = shared.CostQuoteUpdateDiffUsageDimension

Per-dimension diff entry. Both before and after are always present.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimensionAfter

type CostQuoteUpdateDiffUsageDimensionAfter = shared.CostQuoteUpdateDiffUsageDimensionAfter

Priced row after the update. Always present.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimensionBefore

type CostQuoteUpdateDiffUsageDimensionBefore = shared.CostQuoteUpdateDiffUsageDimensionBefore

Priced row after the update. Always present.

This is an alias to an internal type.

type CostQuoteUsageDimension

type CostQuoteUsageDimension = shared.CostQuoteUsageDimension

Priced row for a single usage dimension emitted by a resource.

This is an alias to an internal type.

type Error

type Error = apierror.Error

type FirewallRule

type FirewallRule struct {
	// Unique identifier for the Firewall Rule.
	ID string `json:"id" api:"required"`
	// When the Firewall Rule was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.
	DestinationAddress string `json:"destination_address" api:"required"`
	// Destination ports of the Firewall Rule.
	DestinationPorts []string `json:"destination_ports" api:"required"`
	// What manages the resource, or null when nothing does. A managed resource can be
	// read but not changed.
	ManagedBy FirewallRuleManagedBy `json:"managed_by" api:"required"`
	// Name of the Firewall Rule.
	Name string `json:"name" api:"required"`
	// Protocol of the Firewall Rule.
	//
	// Any of "tcp", "udp".
	Protocol FirewallRuleProtocol `json:"protocol" api:"required"`
	// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
	// of 0.
	SourceAddress string `json:"source_address" api:"required"`
	// Status of the resource.
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
	// "error".
	Status shared.ResourceStatus `json:"status" api:"required"`
	// Tags to attach to the Firewall Rule.
	Tags []string `json:"tags" api:"required"`
	// When the Firewall Rule was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// ID of the VPC the Firewall Rule belongs to.
	VPCID string `json:"vpc_id" api:"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
		ManagedBy          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

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" api:"required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination" api:"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

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

type FirewallRuleListParams struct {
	// Pagination cursor returned by a previous request. Only valid for the same VPC,
	// filters and sort order.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by a case-insensitive substring of the Firewall Rule name
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Comma-separated sort terms in precedence order, each field:asc or field:desc.
	// Fields: created_at, updated_at, name, status, protocol
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Filter by protocol
	//
	// Any of "tcp", "udp".
	Protocol FirewallRuleListParamsProtocol `query:"protocol,omitzero" json:"-"`
	// Filter by Firewall Rule status
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "error".
	Status FirewallRuleListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter by tags. Repeat the parameter to require several tags; a Firewall Rule
	// must carry all of them.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FirewallRuleListParams) URLQuery

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

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

type FirewallRuleListParamsProtocol

type FirewallRuleListParamsProtocol string

Filter by protocol

const (
	FirewallRuleListParamsProtocolTcp FirewallRuleListParamsProtocol = "tcp"
	FirewallRuleListParamsProtocolUdp FirewallRuleListParamsProtocol = "udp"
)

type FirewallRuleListParamsStatus

type FirewallRuleListParamsStatus string

Filter by Firewall Rule status

const (
	FirewallRuleListParamsStatusPending  FirewallRuleListParamsStatus = "pending"
	FirewallRuleListParamsStatusCreating FirewallRuleListParamsStatus = "creating"
	FirewallRuleListParamsStatusUpdating FirewallRuleListParamsStatus = "updating"
	FirewallRuleListParamsStatusReady    FirewallRuleListParamsStatus = "ready"
	FirewallRuleListParamsStatusDeleting FirewallRuleListParamsStatus = "deleting"
	FirewallRuleListParamsStatusError    FirewallRuleListParamsStatus = "error"
)

type FirewallRuleManagedBy added in v2.2.1

type FirewallRuleManagedBy struct {
	// ID of the thing managing the resource.
	ID string `json:"id" api:"required"`
	// Kind of thing managing the resource: a sandbox cluster, or managed_sandboxes for
	// the project that holds an organization's sandbox clusters, identified by the
	// organization ID.
	//
	// Any of "sandbox_cluster", "managed_sandboxes".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What manages the resource, or null when nothing does. A managed resource can be read but not changed.

func (FirewallRuleManagedBy) RawJSON added in v2.2.1

func (r FirewallRuleManagedBy) RawJSON() string

Returns the unmodified JSON received from the API

func (*FirewallRuleManagedBy) UnmarshalJSON added in v2.2.1

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

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" api:"required"`
	// Destination ports of the Firewall Rule.
	DestinationPorts []string `json:"destination_ports,omitzero" api:"required"`
	// Name of the Firewall Rule.
	Name string `json:"name" api:"required"`
	// Protocol of the Firewall Rule.
	//
	// Any of "tcp", "udp".
	Protocol FirewallRuleNewParamsProtocol `json:"protocol,omitzero" api:"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" api:"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

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

type FirewallRuleNewParamsProtocol

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

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

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
}

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 OrganizationBillingSummary

type OrganizationBillingSummary = shared.OrganizationBillingSummary

Forward-looking billing summary for an organization. All costs are run-rate projections from the organization's current active usage ("≈ $X/mo at current usage").

This is an alias to an internal type.

type Pagination

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 SourceIPRuleParam

type SourceIPRuleParam = shared.SourceIPRuleParam

IP filter rules.

This is an alias to an internal type.

type SourceIPRuleResponse

type SourceIPRuleResponse = shared.SourceIPRuleResponse

IP filter rules.

This is an alias to an internal type.

type Subnet

type Subnet struct {
	// Unique identifier for the Subnet.
	ID string `json:"id" api:"required"`
	// CIDR block for the Subnet.
	CIDR string `json:"cidr" api:"required"`
	// When the Subnet was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Name of the Subnet.
	Name string `json:"name" api:"required"`
	// When the Subnet was updated.
	UpdatedAt time.Time `json:"updated_at" api:"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

func (r Subnet) RawJSON() string

Returns the unmodified JSON received from the API

func (*Subnet) UnmarshalJSON

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

type VMMetricUnit

type VMMetricUnit = shared.VMMetricUnit

Unit the values are expressed in.

This is an alias to an internal type.

type VPC

type VPC struct {
	// Unique identifier for the VPC.
	ID string `json:"id" api:"required"`
	// When the VPC was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// IDs of the Firewall Rules associated with the VPC.
	FirewallRuleIDs []string `json:"firewall_rule_ids" api:"required"`
	// What manages the resource, or null when nothing does. A managed resource can be
	// read but not changed.
	ManagedBy VPCManagedBy `json:"managed_by" api:"required"`
	// Name of the VPC.
	Name string `json:"name" api:"required"`
	// Project ID the VPC belongs to.
	ProjectID string `json:"project_id" api:"required"`
	// Region the resource is in.
	//
	// Any of "us-sva-2", "us-wdc-1".
	Region shared.RegionName `json:"region" api:"required"`
	// Status of the resource.
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
	// "error".
	Status shared.ResourceStatus `json:"status" api:"required"`
	// Subnet of the VPC.
	Subnet Subnet `json:"subnet" api:"required"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags" api:"required"`
	// When the VPC was updated.
	UpdatedAt time.Time `json:"updated_at" api:"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
		ManagedBy       respjson.Field
		Name            respjson.Field
		ProjectID       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

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

type VPCAvailabilityNewParams struct {
	// Name of the VPC.
	Name string `json:"name" api:"required"`
	// Project ID the VPC belongs to.
	ProjectID string `json:"project_id" api:"required"`
	// Region the resource is in.
	//
	// Any of "us-sva-2", "us-wdc-1".
	Region shared.RegionName `json:"region,omitzero" api:"required"`
	// Name of the subnet to create.
	SubnetName string `json:"subnet_name" api:"required"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (VPCAvailabilityNewParams) MarshalJSON

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

func (*VPCAvailabilityNewParams) UnmarshalJSON

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

type VPCAvailabilityService

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

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

Check if a VPC can be created

func (*VPCAvailabilityService) Update

Check if a VPC can be updated

type VPCAvailabilityUpdateParams

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

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

func (*VPCAvailabilityUpdateParams) UnmarshalJSON

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

type VPCCostNewParams

type VPCCostNewParams struct {
	// Name of the VPC.
	Name string `json:"name" api:"required"`
	// Project ID the VPC belongs to.
	ProjectID string `json:"project_id" api:"required"`
	// Region the resource is in.
	//
	// Any of "us-sva-2", "us-wdc-1".
	Region shared.RegionName `json:"region,omitzero" api:"required"`
	// Name of the subnet to create.
	SubnetName string `json:"subnet_name" api:"required"`
	// Tags to attach to the VPC.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (VPCCostNewParams) MarshalJSON

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

func (*VPCCostNewParams) UnmarshalJSON

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

type VPCCostService

type VPCCostService struct {
	Options []option.RequestOption
}

VPCCostService 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 NewVPCCostService method instead.

func NewVPCCostService

func NewVPCCostService(opts ...option.RequestOption) (r VPCCostService)

NewVPCCostService 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 (*VPCCostService) New

func (r *VPCCostService) New(ctx context.Context, body VPCCostNewParams, opts ...option.RequestOption) (res *shared.CostQuote, err error)

Return a priced cost quote for the proposed VPC.

func (*VPCCostService) Update

func (r *VPCCostService) Update(ctx context.Context, vpcID string, body VPCCostUpdateParams, opts ...option.RequestOption) (res *shared.CostQuoteUpdate, err error)

Return a priced cost quote for the proposed VPC update plus a diff against the current state.

type VPCCostUpdateParams

type VPCCostUpdateParams 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 (VPCCostUpdateParams) MarshalJSON

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

func (*VPCCostUpdateParams) UnmarshalJSON

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

type VPCList

type VPCList struct {
	Items []VPC `json:"items" api:"required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination" api:"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

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

type VPCListParams struct {
	// Project ID of resources to request
	ProjectID string `query:"project_id" api:"required" json:"-"`
	// Pagination cursor returned by a previous request. Only valid for the same
	// filters and sort order.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by a case-insensitive substring of the VPC name
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Filter by region
	Region param.Opt[string] `query:"region,omitzero" json:"-"`
	// Comma-separated sort terms in precedence order, each field:asc or field:desc.
	// Fields: created_at, updated_at, name, status
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Filter by VPC status
	//
	// Any of "pending", "creating", "updating", "ready", "deleting", "error".
	Status VPCListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter by tags. Repeat the parameter to require several tags; a VPC must carry
	// all of them.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (VPCListParams) URLQuery

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

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

type VPCListParamsStatus

type VPCListParamsStatus string

Filter by VPC status

const (
	VPCListParamsStatusPending  VPCListParamsStatus = "pending"
	VPCListParamsStatusCreating VPCListParamsStatus = "creating"
	VPCListParamsStatusUpdating VPCListParamsStatus = "updating"
	VPCListParamsStatusReady    VPCListParamsStatus = "ready"
	VPCListParamsStatusDeleting VPCListParamsStatus = "deleting"
	VPCListParamsStatusError    VPCListParamsStatus = "error"
)

type VPCManagedBy added in v2.2.1

type VPCManagedBy struct {
	// ID of the thing managing the resource.
	ID string `json:"id" api:"required"`
	// Kind of thing managing the resource: a sandbox cluster, or managed_sandboxes for
	// the project that holds an organization's sandbox clusters, identified by the
	// organization ID.
	//
	// Any of "sandbox_cluster", "managed_sandboxes".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What manages the resource, or null when nothing does. A managed resource can be read but not changed.

func (VPCManagedBy) RawJSON added in v2.2.1

func (r VPCManagedBy) RawJSON() string

Returns the unmodified JSON received from the API

func (*VPCManagedBy) UnmarshalJSON added in v2.2.1

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

type VPCNewParams

type VPCNewParams struct {
	// Name of the VPC.
	Name string `json:"name" api:"required"`
	// Project ID the VPC belongs to.
	ProjectID string `json:"project_id" api:"required"`
	// Region the resource is in.
	//
	// Any of "us-sva-2", "us-wdc-1".
	Region shared.RegionName `json:"region,omitzero" api:"required"`
	// Name of the subnet to create.
	SubnetName string `json:"subnet_name" api:"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

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

type VPCService

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

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

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

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