Documentation
¶
Index ¶
- Constants
- type CostNewParams
- type CostQuote
- type CostQuoteUpdate
- type CostQuoteUpdateAfter
- type CostQuoteUpdateAfterUsageDimension
- type CostQuoteUpdateBefore
- type CostQuoteUpdateBeforeUsageDimension
- type CostQuoteUpdateDiff
- type CostQuoteUpdateDiffUsageDimension
- type CostQuoteUpdateDiffUsageDimensionAfter
- type CostQuoteUpdateDiffUsageDimensionBefore
- type CostQuoteUsageDimension
- type CostService
- type Error
- type OrganizationBillingSummary
- type Pagination
- type RegionName
- type ResourceStatus
- type SandboxCluster
- type SandboxClusterList
- type SandboxClusterListParams
- type SandboxClusterNewParams
- type SandboxClusterService
- func (r *SandboxClusterService) Delete(ctx context.Context, sandboxClusterID string, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *SandboxClusterService) Get(ctx context.Context, sandboxClusterID string, opts ...option.RequestOption) (res *SandboxCluster, err error)
- func (r *SandboxClusterService) List(ctx context.Context, query SandboxClusterListParams, ...) (res *pagination.Cursor[SandboxCluster], err error)
- func (r *SandboxClusterService) ListAutoPaging(ctx context.Context, query SandboxClusterListParams, ...) *pagination.CursorAutoPager[SandboxCluster]
- func (r *SandboxClusterService) New(ctx context.Context, body SandboxClusterNewParams, ...) (res *operations.Operation, err error)
- func (r *SandboxClusterService) Update(ctx context.Context, sandboxClusterID string, body SandboxClusterUpdateParams, ...) (res *SandboxCluster, err error)
- type SandboxClusterUpdateParams
- type SourceIPRuleParam
- type SourceIPRuleResponse
- type VMMetricUnit
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 ResourceStatusSuspended = shared.ResourceStatusSuspended
Equals "suspended"
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 CostNewParams ¶ added in v3.1.0
type CostNewParams struct {
// Instance type of the nodes the sandboxes run on.
InstanceType string `json:"instance_type" api:"required"`
// Name of the Sandbox Cluster. Unique within its project.
Name string `json:"name" api:"required"`
// Number of nodes the sandboxes run on.
NodeCount int64 `json:"node_count" api:"required"`
// ID of the project to create the Sandbox Cluster in.
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"`
// Tags to attach to the Sandbox Cluster.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (CostNewParams) MarshalJSON ¶ added in v3.1.0
func (r CostNewParams) MarshalJSON() (data []byte, err error)
func (*CostNewParams) UnmarshalJSON ¶ added in v3.1.0
func (r *CostNewParams) UnmarshalJSON(data []byte) error
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 CostService ¶ added in v3.1.0
type CostService struct {
Options []option.RequestOption
}
CostService 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 NewCostService method instead.
func NewCostService ¶ added in v3.1.0
func NewCostService(opts ...option.RequestOption) (r CostService)
NewCostService 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 (*CostService) New ¶ added in v3.1.0
func (r *CostService) New(ctx context.Context, body CostNewParams, opts ...option.RequestOption) (res *shared.CostQuote, err error)
Return a priced cost quote for the proposed Sandbox Cluster.
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 SandboxCluster ¶
type SandboxCluster struct {
// Unique identifier for the Sandbox Cluster.
ID string `json:"id" api:"required"`
// When the Sandbox Cluster was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Hostname sandboxes' endpoints are served on over HTTPS, to allow in outbound
// firewalls. Null until assigned; a recreated Sandbox Cluster gets a new one.
GatewayHostname string `json:"gateway_hostname" api:"required"`
// Instance type of the nodes the sandboxes run on.
InstanceType string `json:"instance_type" api:"required"`
// Name of the Sandbox Cluster.
Name string `json:"name" api:"required"`
// Number of nodes the sandboxes run on.
NodeCount int64 `json:"node_count" api:"required"`
// ID of the project the Sandbox Cluster is in.
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", "suspended".
Status shared.ResourceStatus `json:"status" api:"required"`
// Tags attached to the Sandbox Cluster.
Tags []string `json:"tags" api:"required"`
// When the Sandbox Cluster was last 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
GatewayHostname respjson.Field
InstanceType respjson.Field
Name respjson.Field
NodeCount respjson.Field
ProjectID respjson.Field
Region respjson.Field
Status respjson.Field
Tags respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A cluster sandboxes run on, in one region.
func (SandboxCluster) RawJSON ¶
func (r SandboxCluster) RawJSON() string
Returns the unmodified JSON received from the API
func (*SandboxCluster) UnmarshalJSON ¶
func (r *SandboxCluster) UnmarshalJSON(data []byte) error
type SandboxClusterList ¶
type SandboxClusterList struct {
Items []SandboxCluster `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 (SandboxClusterList) RawJSON ¶
func (r SandboxClusterList) RawJSON() string
Returns the unmodified JSON received from the API
func (*SandboxClusterList) UnmarshalJSON ¶
func (r *SandboxClusterList) UnmarshalJSON(data []byte) error
type SandboxClusterListParams ¶
type SandboxClusterListParams 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 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 Sandbox Cluster 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
Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
// Filter by tags. Repeat the parameter to require several tags; a Sandbox Cluster
// must carry all of them.
Tags []string `query:"tags,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SandboxClusterListParams) URLQuery ¶
func (r SandboxClusterListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SandboxClusterListParams's query parameters as `url.Values`.
type SandboxClusterNewParams ¶
type SandboxClusterNewParams struct {
// Instance type of the nodes the sandboxes run on.
InstanceType string `json:"instance_type" api:"required"`
// Name of the Sandbox Cluster. Unique within its project.
Name string `json:"name" api:"required"`
// Number of nodes the sandboxes run on.
NodeCount int64 `json:"node_count" api:"required"`
// ID of the project to create the Sandbox Cluster in.
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"`
// Tags to attach to the Sandbox Cluster.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (SandboxClusterNewParams) MarshalJSON ¶
func (r SandboxClusterNewParams) MarshalJSON() (data []byte, err error)
func (*SandboxClusterNewParams) UnmarshalJSON ¶
func (r *SandboxClusterNewParams) UnmarshalJSON(data []byte) error
type SandboxClusterService ¶
type SandboxClusterService struct {
Options []option.RequestOption
Cost CostService
}
SandboxClusterService 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 NewSandboxClusterService method instead.
func NewSandboxClusterService ¶
func NewSandboxClusterService(opts ...option.RequestOption) (r SandboxClusterService)
NewSandboxClusterService 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 (*SandboxClusterService) Delete ¶
func (r *SandboxClusterService) Delete(ctx context.Context, sandboxClusterID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Delete a Sandbox Cluster, with its sandboxes and the infrastructure they run on.
func (*SandboxClusterService) Get ¶
func (r *SandboxClusterService) Get(ctx context.Context, sandboxClusterID string, opts ...option.RequestOption) (res *SandboxCluster, err error)
Get a Sandbox Cluster
func (*SandboxClusterService) List ¶
func (r *SandboxClusterService) List(ctx context.Context, query SandboxClusterListParams, opts ...option.RequestOption) (res *pagination.Cursor[SandboxCluster], err error)
List the Sandbox Clusters in a project
func (*SandboxClusterService) ListAutoPaging ¶
func (r *SandboxClusterService) ListAutoPaging(ctx context.Context, query SandboxClusterListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[SandboxCluster]
List the Sandbox Clusters in a project
func (*SandboxClusterService) New ¶
func (r *SandboxClusterService) New(ctx context.Context, body SandboxClusterNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Create a Sandbox Cluster to run sandboxes on. The infrastructure it runs on is provisioned in a project the platform manages.
func (*SandboxClusterService) Update ¶
func (r *SandboxClusterService) Update(ctx context.Context, sandboxClusterID string, body SandboxClusterUpdateParams, opts ...option.RequestOption) (res *SandboxCluster, err error)
Update a Sandbox Cluster's name and tags
type SandboxClusterUpdateParams ¶
type SandboxClusterUpdateParams struct {
// Name of the Sandbox Cluster. Unique within its project.
Name param.Opt[string] `json:"name,omitzero"`
// Tags to attach to the Sandbox Cluster.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (SandboxClusterUpdateParams) MarshalJSON ¶
func (r SandboxClusterUpdateParams) MarshalJSON() (data []byte, err error)
func (*SandboxClusterUpdateParams) UnmarshalJSON ¶
func (r *SandboxClusterUpdateParams) UnmarshalJSON(data []byte) error
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 VMMetricUnit ¶
type VMMetricUnit = shared.VMMetricUnit
Unit the values are expressed in.
This is an alias to an internal type.