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 OrganizationBillingSummary
- type Pagination
- type Project
- type ProjectBlockchainResources
- type ProjectCloudResources
- type ProjectList
- type ProjectListParams
- type ProjectManagedBy
- type ProjectNewParams
- type ProjectResources
- type ProjectService
- func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (err error)
- func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *pagination.Cursor[Project], err error)
- func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Project]
- func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, ...) (res *Project, err error)
- type ProjectUpdateParams
- type RegionName
- type ResourceStatus
- 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 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 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 Project ¶
type Project struct {
// Project ID.
ID string `json:"id" api:"required"`
// When the Project was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// What manages the resource, or null when nothing does. A managed resource can be
// read but not changed.
ManagedBy ProjectManagedBy `json:"managed_by" api:"required"`
// Project name.
Name string `json:"name" api:"required"`
// Resource counts for the project.
Resources ProjectResources `json:"resources" api:"required"`
// Tags attached to the Project.
Tags []string `json:"tags" api:"required"`
// When the Project 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
ManagedBy respjson.Field
Name respjson.Field
Resources respjson.Field
Tags respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Project response.
func (*Project) UnmarshalJSON ¶
type ProjectBlockchainResources ¶
type ProjectBlockchainResources struct {
// Number of dedicated RPC nodes in the project.
RPCNodesDedicated int64 `json:"rpc_nodes_dedicated" api:"required"`
// Number of flex RPC nodes in the project.
RPCNodesFlex int64 `json:"rpc_nodes_flex" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
RPCNodesDedicated respjson.Field
RPCNodesFlex respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Blockchain resources.
func (ProjectBlockchainResources) RawJSON ¶
func (r ProjectBlockchainResources) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectBlockchainResources) UnmarshalJSON ¶
func (r *ProjectBlockchainResources) UnmarshalJSON(data []byte) error
type ProjectCloudResources ¶
type ProjectCloudResources struct {
// Number of NKS clusters in the project.
NKSClusters int64 `json:"nks_clusters" api:"required"`
// Number of NKS node pools in the project.
NKSNodePools int64 `json:"nks_node_pools" api:"required"`
// Number of VMs in the project.
VMs int64 `json:"vms" api:"required"`
// Number of volumes in the project.
Volumes int64 `json:"volumes" api:"required"`
// Number of VPCs in the project.
VPCs int64 `json:"vpcs" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
NKSClusters respjson.Field
NKSNodePools respjson.Field
VMs respjson.Field
Volumes respjson.Field
VPCs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cloud infrastructure resources.
func (ProjectCloudResources) RawJSON ¶
func (r ProjectCloudResources) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectCloudResources) UnmarshalJSON ¶
func (r *ProjectCloudResources) UnmarshalJSON(data []byte) error
type ProjectList ¶
type ProjectList struct {
Items []Project `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 (ProjectList) RawJSON ¶
func (r ProjectList) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectList) UnmarshalJSON ¶
func (r *ProjectList) UnmarshalJSON(data []byte) error
type ProjectListParams ¶
type ProjectListParams struct {
// 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 Project 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
Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
// Filter by tags. Repeat the parameter to require several tags; a Project must
// carry all of them.
Tags []string `query:"tags,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ProjectListParams) URLQuery ¶
func (r ProjectListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectListParams's query parameters as `url.Values`.
type ProjectManagedBy ¶ added in v2.2.1
type ProjectManagedBy 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 (ProjectManagedBy) RawJSON ¶ added in v2.2.1
func (r ProjectManagedBy) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectManagedBy) UnmarshalJSON ¶ added in v2.2.1
func (r *ProjectManagedBy) UnmarshalJSON(data []byte) error
type ProjectNewParams ¶
type ProjectNewParams struct {
// Project name.
Name string `json:"name" api:"required"`
// Tags to attach to the Project.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (ProjectNewParams) MarshalJSON ¶
func (r ProjectNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectNewParams) UnmarshalJSON ¶
func (r *ProjectNewParams) UnmarshalJSON(data []byte) error
type ProjectResources ¶
type ProjectResources struct {
// Blockchain resources.
Blockchain ProjectBlockchainResources `json:"blockchain" api:"required"`
// Cloud infrastructure resources.
Cloud ProjectCloudResources `json:"cloud" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Blockchain respjson.Field
Cloud respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Resource counts for the project.
func (ProjectResources) RawJSON ¶
func (r ProjectResources) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectResources) UnmarshalJSON ¶
func (r *ProjectResources) UnmarshalJSON(data []byte) error
type ProjectService ¶
type ProjectService struct {
Options []option.RequestOption
}
ProjectService 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 NewProjectService method instead.
func NewProjectService ¶
func NewProjectService(opts ...option.RequestOption) (r ProjectService)
NewProjectService 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 (*ProjectService) Delete ¶
func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (err error)
Delete a project
func (*ProjectService) Get ¶
func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *Project, err error)
Get details about a project
func (*ProjectService) List ¶
func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *pagination.Cursor[Project], err error)
List all projects
func (*ProjectService) ListAutoPaging ¶
func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Project]
List all projects
func (*ProjectService) New ¶
func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
Create a new project
func (*ProjectService) Update ¶
func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, opts ...option.RequestOption) (res *Project, err error)
Update an existing project
type ProjectUpdateParams ¶
type ProjectUpdateParams struct {
// Project name.
Name param.Opt[string] `json:"name,omitzero"`
// Tags to attach to the Project.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (ProjectUpdateParams) MarshalJSON ¶
func (r ProjectUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProjectUpdateParams) UnmarshalJSON ¶
func (r *ProjectUpdateParams) UnmarshalJSON(data []byte) error
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 VMMetricUnit ¶
type VMMetricUnit = shared.VMMetricUnit
Unit the values are expressed in.
This is an alias to an internal type.