Documentation
¶
Index ¶
- Constants
- type CostQuote
- type CostQuoteUpdate
- type CostQuoteUpdateAfter
- type CostQuoteUpdateAfterUsageDimension
- type CostQuoteUpdateBefore
- type CostQuoteUpdateBeforeUsageDimension
- type CostQuoteUpdateDiff
- type CostQuoteUpdateDiffUsageDimension
- type CostQuoteUpdateDiffUsageDimensionAfter
- type CostQuoteUpdateDiffUsageDimensionBefore
- type CostQuoteUsageDimension
- type Error
- type FirewallRule
- type FirewallRuleList
- type FirewallRuleListParams
- type FirewallRuleListParamsProtocol
- type FirewallRuleListParamsStatus
- type FirewallRuleManagedBy
- type FirewallRuleNewParams
- type FirewallRuleNewParamsProtocol
- type FirewallRuleProtocol
- type FirewallRuleService
- func (r *FirewallRuleService) Delete(ctx context.Context, vpcID string, firewallRuleID string, ...) (res *operations.Operation, err error)
- func (r *FirewallRuleService) Get(ctx context.Context, vpcID string, firewallRuleID string, ...) (res *FirewallRule, err error)
- func (r *FirewallRuleService) List(ctx context.Context, vpcID string, query FirewallRuleListParams, ...) (res *pagination.Cursor[FirewallRule], err error)
- func (r *FirewallRuleService) ListAutoPaging(ctx context.Context, vpcID string, query FirewallRuleListParams, ...) *pagination.CursorAutoPager[FirewallRule]
- func (r *FirewallRuleService) New(ctx context.Context, vpcID string, body FirewallRuleNewParams, ...) (res *operations.Operation, err error)
- func (r *FirewallRuleService) Update(ctx context.Context, vpcID string, firewallRuleID string, ...) (res *operations.Operation, err error)
- type FirewallRuleUpdateParams
- type FirewallRuleUpdateParamsProtocol
- type NetworkingService
- type OrganizationBillingSummary
- type Pagination
- type RegionName
- type ResourceStatus
- type SourceIPRuleParam
- type SourceIPRuleResponse
- type Subnet
- type VMMetricUnit
- type VPC
- type VPCAvailabilityNewParams
- type VPCAvailabilityService
- type VPCAvailabilityUpdateParams
- type VPCCostNewParams
- type VPCCostService
- type VPCCostUpdateParams
- type VPCList
- type VPCListParams
- type VPCListParamsStatus
- type VPCManagedBy
- type VPCNewParams
- type VPCService
- func (r *VPCService) Delete(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VPCService) Get(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *VPC, err error)
- func (r *VPCService) List(ctx context.Context, query VPCListParams, opts ...option.RequestOption) (res *pagination.Cursor[VPC], err error)
- func (r *VPCService) ListAutoPaging(ctx context.Context, query VPCListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[VPC]
- func (r *VPCService) New(ctx context.Context, body VPCNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VPCService) Update(ctx context.Context, vpcID string, body VPCUpdateParams, ...) (res *operations.Operation, err error)
- type VPCUpdateParams
Constants ¶
const RegionNameUsSva2 = shared.RegionNameUsSva2
Equals "us-sva-2"
const RegionNameUsWdc1 = shared.RegionNameUsWdc1
Equals "us-wdc-1"
const ResourceStatusCreating = shared.ResourceStatusCreating
Equals "creating"
const ResourceStatusDeleted = shared.ResourceStatusDeleted
Equals "deleted"
const ResourceStatusDeleting = shared.ResourceStatusDeleting
Equals "deleting"
const ResourceStatusError = shared.ResourceStatusError
Equals "error"
const ResourceStatusPending = shared.ResourceStatusPending
Equals "pending"
const ResourceStatusReady = shared.ResourceStatusReady
Equals "ready"
const ResourceStatusUpdating = shared.ResourceStatusUpdating
Equals "updating"
const VMMetricUnitBytes = shared.VMMetricUnitBytes
Equals "bytes"
const VMMetricUnitBytesPerSecond = shared.VMMetricUnitBytesPerSecond
Equals "bytes_per_second"
const VMMetricUnitCores = shared.VMMetricUnitCores
Equals "cores"
const VMMetricUnitOperationsPerSecond = shared.VMMetricUnitOperationsPerSecond
Equals "operations_per_second"
const VMMetricUnitRatio = shared.VMMetricUnitRatio
Equals "ratio"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type 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 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 ¶
func (r *FirewallRuleService) List(ctx context.Context, vpcID string, query FirewallRuleListParams, opts ...option.RequestOption) (res *pagination.Cursor[FirewallRule], err error)
List all firewall rules
func (*FirewallRuleService) ListAutoPaging ¶
func (r *FirewallRuleService) ListAutoPaging(ctx context.Context, vpcID string, query FirewallRuleListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[FirewallRule]
List all firewall rules
func (*FirewallRuleService) New ¶
func (r *FirewallRuleService) New(ctx context.Context, vpcID string, body FirewallRuleNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
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) UnmarshalJSON ¶
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) UnmarshalJSON ¶
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 ¶
func (r *VPCAvailabilityService) New(ctx context.Context, body VPCAvailabilityNewParams, opts ...option.RequestOption) (err error)
Check if a VPC can be created
func (*VPCAvailabilityService) Update ¶
func (r *VPCAvailabilityService) Update(ctx context.Context, vpcID string, body VPCAvailabilityUpdateParams, opts ...option.RequestOption) (err error)
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) UnmarshalJSON ¶
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