api_keys

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 16 Imported by: ? 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 ResourceStatusSuspended = shared.ResourceStatusSuspended

Equals "suspended"

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 APIKey

type APIKey struct {
	// API Key ID.
	ID string `json:"id" api:"required"`
	// When the API Key was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// When the API Key expires and is no longer valid.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Whether this API key is system-managed.
	Managed bool `json:"managed" api:"required"`
	// API Key name.
	Name string `json:"name" api:"required"`
	// Scoped permissions for this API key.
	Permissions []APIKeyPermission `json:"permissions" api:"required"`
	// Project IDs this API key is scoped to.
	ProjectIDs []string `json:"project_ids" api:"required"`
	// IP filter rules.
	SourceIPRule shared.SourceIPRuleResponse `json:"source_ip_rule" api:"required"`
	// Status of the API Key.
	//
	// Any of "active", "inactive", "expired".
	Status APIKeyStatus `json:"status" api:"required"`
	// Tags to attach to the API Key.
	Tags []string `json:"tags" api:"required"`
	// When the API Key was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// API Key. Only returned on creation.
	Key string `json:"key"`
	// When the API Key starts to be valid.
	StartsAt time.Time `json:"starts_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		CreatedAt    respjson.Field
		ExpiresAt    respjson.Field
		Managed      respjson.Field
		Name         respjson.Field
		Permissions  respjson.Field
		ProjectIDs   respjson.Field
		SourceIPRule respjson.Field
		Status       respjson.Field
		Tags         respjson.Field
		UpdatedAt    respjson.Field
		Key          respjson.Field
		StartsAt     respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API Key response.

func (APIKey) RawJSON

func (r APIKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIKey) UnmarshalJSON

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

type APIKeyList

type APIKeyList struct {
	Items []APIKey `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 (APIKeyList) RawJSON

func (r APIKeyList) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIKeyList) UnmarshalJSON

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

type APIKeyListParams

type APIKeyListParams 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 API key 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, expires_at
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Filter by API key status, read against the current instant
	//
	// Any of "active", "inactive", "expired".
	Status APIKeyListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter by tags. Repeat the parameter to require several tags; an API key must
	// carry all of them.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (APIKeyListParams) URLQuery

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

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

type APIKeyListParamsStatus

type APIKeyListParamsStatus string

Filter by API key status, read against the current instant

const (
	APIKeyListParamsStatusActive   APIKeyListParamsStatus = "active"
	APIKeyListParamsStatusInactive APIKeyListParamsStatus = "inactive"
	APIKeyListParamsStatusExpired  APIKeyListParamsStatus = "expired"
)

type APIKeyNewParams

type APIKeyNewParams struct {
	// When the API Key expires and is no longer valid.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// API Key name.
	Name string `json:"name" api:"required"`
	// Scoped permissions for this API key. At least one is required.
	Permissions []APIKeyNewParamsPermission `json:"permissions,omitzero" api:"required"`
	// Project IDs this API key is scoped to. At least one is required.
	ProjectIDs []string `json:"project_ids,omitzero" api:"required"`
	// When the API Key starts to be valid.
	StartsAt param.Opt[time.Time] `json:"starts_at,omitzero" format:"date-time"`
	// IP filter rules.
	SourceIPRule shared.SourceIPRuleParam `json:"source_ip_rule,omitzero"`
	// Tags to attach to the API Key.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (APIKeyNewParams) MarshalJSON

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

func (*APIKeyNewParams) UnmarshalJSON

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

type APIKeyNewParamsPermission

type APIKeyNewParamsPermission struct {
	// Permission level: "read" or "edit".
	//
	// Any of "read", "edit".
	Permission APIPermissionLevel `json:"permission,omitzero" api:"required"`
	// Resource type this permission applies to.
	//
	// Any of "vm", "vpc", "volume", "bucket", "object_storage_key",
	// "rpc_node_dedicated", "rpc_node_flex", "nks_cluster", "nks_node_pool",
	// "project", "api_key", "organization", "audit_log", "usage", "billing",
	// "billing_x402", "sandbox_cluster", "sandbox_vm", "sandbox".
	ResourceType APIPermissionResourceType `json:"resource_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

API Key permission request.

The properties Permission, ResourceType are required.

func (APIKeyNewParamsPermission) MarshalJSON

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

func (*APIKeyNewParamsPermission) UnmarshalJSON

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

type APIKeyPermission

type APIKeyPermission struct {
	// Permission level: "read" or "edit".
	//
	// Any of "read", "edit".
	Permission APIPermissionLevel `json:"permission" api:"required"`
	// Resource type this permission applies to.
	//
	// Any of "vm", "vpc", "volume", "bucket", "object_storage_key",
	// "rpc_node_dedicated", "rpc_node_flex", "nks_cluster", "nks_node_pool",
	// "project", "api_key", "organization", "audit_log", "usage", "billing",
	// "billing_x402", "sandbox_cluster", "sandbox_vm", "sandbox".
	ResourceType APIPermissionResourceType `json:"resource_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Permission   respjson.Field
		ResourceType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API Key permission.

func (APIKeyPermission) RawJSON

func (r APIKeyPermission) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIKeyPermission) UnmarshalJSON

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

type APIKeyService

type APIKeyService struct {
	Options []option.RequestOption
}

APIKeyService 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 NewAPIKeyService method instead.

func NewAPIKeyService

func NewAPIKeyService(opts ...option.RequestOption) (r APIKeyService)

NewAPIKeyService 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 (*APIKeyService) Delete

func (r *APIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (err error)

Delete an API key

func (*APIKeyService) Get

func (r *APIKeyService) Get(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *APIKey, err error)

Get details about an API key

func (*APIKeyService) List

func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *pagination.Cursor[APIKey], err error)

List all API keys

func (*APIKeyService) ListAutoPaging

List all API keys

func (*APIKeyService) New

func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKey, err error)

Create a new API key

func (*APIKeyService) Update

func (r *APIKeyService) Update(ctx context.Context, apiKeyID string, body APIKeyUpdateParams, opts ...option.RequestOption) (res *APIKey, err error)

Update an existing API key

type APIKeyStatus

type APIKeyStatus string

Status of the API Key.

const (
	APIKeyStatusActive   APIKeyStatus = "active"
	APIKeyStatusInactive APIKeyStatus = "inactive"
	APIKeyStatusExpired  APIKeyStatus = "expired"
)

type APIKeyUpdateParams

type APIKeyUpdateParams struct {
	// API Key name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Scoped permissions for this API key. When provided, replaces the entire set. At
	// least one is required.
	Permissions []APIKeyUpdateParamsPermission `json:"permissions,omitzero"`
	// Project IDs this API key is scoped to. When provided, replaces the entire set.
	// At least one is required.
	ProjectIDs []string `json:"project_ids,omitzero"`
	// IP filter rules.
	SourceIPRule shared.SourceIPRuleParam `json:"source_ip_rule,omitzero"`
	// Tags to attach to the API Key.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (APIKeyUpdateParams) MarshalJSON

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

func (*APIKeyUpdateParams) UnmarshalJSON

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

type APIKeyUpdateParamsPermission

type APIKeyUpdateParamsPermission struct {
	// Permission level: "read" or "edit".
	//
	// Any of "read", "edit".
	Permission APIPermissionLevel `json:"permission,omitzero" api:"required"`
	// Resource type this permission applies to.
	//
	// Any of "vm", "vpc", "volume", "bucket", "object_storage_key",
	// "rpc_node_dedicated", "rpc_node_flex", "nks_cluster", "nks_node_pool",
	// "project", "api_key", "organization", "audit_log", "usage", "billing",
	// "billing_x402", "sandbox_cluster", "sandbox_vm", "sandbox".
	ResourceType APIPermissionResourceType `json:"resource_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

API Key permission request.

The properties Permission, ResourceType are required.

func (APIKeyUpdateParamsPermission) MarshalJSON

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

func (*APIKeyUpdateParamsPermission) UnmarshalJSON

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

type APIPermissionLevel

type APIPermissionLevel string

Permission level: "read" or "edit".

const (
	APIPermissionLevelRead APIPermissionLevel = "read"
	APIPermissionLevelEdit APIPermissionLevel = "edit"
)

type APIPermissionResourceType

type APIPermissionResourceType string

Resource type this permission applies to.

const (
	APIPermissionResourceTypeVM               APIPermissionResourceType = "vm"
	APIPermissionResourceTypeVPC              APIPermissionResourceType = "vpc"
	APIPermissionResourceTypeVolume           APIPermissionResourceType = "volume"
	APIPermissionResourceTypeBucket           APIPermissionResourceType = "bucket"
	APIPermissionResourceTypeObjectStorageKey APIPermissionResourceType = "object_storage_key"
	APIPermissionResourceTypeRPCNodeDedicated APIPermissionResourceType = "rpc_node_dedicated"
	APIPermissionResourceTypeRPCNodeFlex      APIPermissionResourceType = "rpc_node_flex"
	APIPermissionResourceTypeNKSCluster       APIPermissionResourceType = "nks_cluster"
	APIPermissionResourceTypeNKSNodePool      APIPermissionResourceType = "nks_node_pool"
	APIPermissionResourceTypeProject          APIPermissionResourceType = "project"
	APIPermissionResourceTypeAPIKey           APIPermissionResourceType = "api_key"
	APIPermissionResourceTypeOrganization     APIPermissionResourceType = "organization"
	APIPermissionResourceTypeAuditLog         APIPermissionResourceType = "audit_log"
	APIPermissionResourceTypeUsage            APIPermissionResourceType = "usage"
	APIPermissionResourceTypeBilling          APIPermissionResourceType = "billing"
	APIPermissionResourceTypeBillingX402      APIPermissionResourceType = "billing_x402"
	APIPermissionResourceTypeSandboxCluster   APIPermissionResourceType = "sandbox_cluster"
	APIPermissionResourceTypeSandboxVM        APIPermissionResourceType = "sandbox_vm"
	APIPermissionResourceTypeSandbox          APIPermissionResourceType = "sandbox"
)

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 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 OrganizationBillingSummaryPromotionalCredit added in v3.2.3

type OrganizationBillingSummaryPromotionalCredit = shared.OrganizationBillingSummaryPromotionalCredit

Where an organization stands on one credit it can earn automatically.

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 VMMetricUnit

type VMMetricUnit = shared.VMMetricUnit

Unit the values are expressed in.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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