operations

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: 2 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 Operation

type Operation struct {
	// Unique identifier for the Operation.
	ID string `json:"id" api:"required"`
	// When the Operation was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Structured details about what an operation is changing.
	Details OperationDetails `json:"details" api:"required"`
	// Kind of Operation.
	//
	// Any of "vm", "volume", "vpc", "firewall_rule", "nks_cluster", "nks_node_pool",
	// "sandbox_cluster", "bucket".
	Kind OperationKind `json:"kind" api:"required"`
	// Project ID the Operation belongs to.
	ProjectID string `json:"project_id" api:"required"`
	// ID of the resource that the Operation is acting on.
	ResourceID string `json:"resource_id" api:"required"`
	// Status of the Operation.
	//
	// Any of "pending", "running", "done", "failed", "unknown".
	Status OperationStatus `json:"status" api:"required"`
	// Type of Operation.
	//
	// Any of "create", "update", "delete", "restart".
	Type OperationType `json:"type" api:"required"`
	// When the Operation 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
		Details     respjson.Field
		Kind        respjson.Field
		ProjectID   respjson.Field
		ResourceID  respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Operation details.

func (Operation) RawJSON

func (r Operation) RawJSON() string

Returns the unmodified JSON received from the API

func (*Operation) UnmarshalJSON

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

type OperationChanges

type OperationChanges map[string]OperationFieldDiff

type OperationDetails

type OperationDetails struct {
	// Map of changed field names to their from/to diffs. Keys depend on the parent
	// operation's kind+type.
	Changes OperationChanges `json:"changes" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Changes     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured details about what an operation is changing.

func (OperationDetails) RawJSON

func (r OperationDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationDetails) UnmarshalJSON

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

type OperationFieldDiff

type OperationFieldDiff struct {
	// Previous value.
	From OperationFieldDiffFromUnion `json:"from" api:"required"`
	// New value.
	To OperationFieldDiffToUnion `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single field's before/after pair on an operation. Values are scalars (string, number, boolean) or string arrays.

func (OperationFieldDiff) RawJSON

func (r OperationFieldDiff) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationFieldDiff) UnmarshalJSON

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

type OperationFieldDiffFromUnion

type OperationFieldDiffFromUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfFloat       respjson.Field
		OfBool        respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OperationFieldDiffFromUnion contains all possible properties and values from [string], [float64], [bool], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfFloat OfBool OfStringArray]

func (OperationFieldDiffFromUnion) AsBool

func (u OperationFieldDiffFromUnion) AsBool() (v bool)

func (OperationFieldDiffFromUnion) AsFloat

func (u OperationFieldDiffFromUnion) AsFloat() (v float64)

func (OperationFieldDiffFromUnion) AsString

func (u OperationFieldDiffFromUnion) AsString() (v string)

func (OperationFieldDiffFromUnion) AsStringArray

func (u OperationFieldDiffFromUnion) AsStringArray() (v []string)

func (OperationFieldDiffFromUnion) RawJSON

func (u OperationFieldDiffFromUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationFieldDiffFromUnion) UnmarshalJSON

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

type OperationFieldDiffToUnion

type OperationFieldDiffToUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfFloat       respjson.Field
		OfBool        respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OperationFieldDiffToUnion contains all possible properties and values from [string], [float64], [bool], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfFloat OfBool OfStringArray]

func (OperationFieldDiffToUnion) AsBool

func (u OperationFieldDiffToUnion) AsBool() (v bool)

func (OperationFieldDiffToUnion) AsFloat

func (u OperationFieldDiffToUnion) AsFloat() (v float64)

func (OperationFieldDiffToUnion) AsString

func (u OperationFieldDiffToUnion) AsString() (v string)

func (OperationFieldDiffToUnion) AsStringArray

func (u OperationFieldDiffToUnion) AsStringArray() (v []string)

func (OperationFieldDiffToUnion) RawJSON

func (u OperationFieldDiffToUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationFieldDiffToUnion) UnmarshalJSON

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

type OperationKind

type OperationKind string

Kind of Operation.

const (
	OperationKindVM             OperationKind = "vm"
	OperationKindVolume         OperationKind = "volume"
	OperationKindVPC            OperationKind = "vpc"
	OperationKindFirewallRule   OperationKind = "firewall_rule"
	OperationKindNKSCluster     OperationKind = "nks_cluster"
	OperationKindNKSNodePool    OperationKind = "nks_node_pool"
	OperationKindSandboxCluster OperationKind = "sandbox_cluster"
	OperationKindBucket         OperationKind = "bucket"
)

type OperationList

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

func (r OperationList) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationList) UnmarshalJSON

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

type OperationListParams

type OperationListParams struct {
	// Project ID of resources to request
	ProjectID string `query:"project_id" api:"required" json:"-"`
	// Only operations started at or before this RFC 3339 instant
	CreatedAtMax param.Opt[time.Time] `query:"created_at_max,omitzero" format:"date-time" json:"-"`
	// Only operations started at or after this RFC 3339 instant
	CreatedAtMin param.Opt[time.Time] `query:"created_at_min,omitzero" format:"date-time" 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 the resource the operation acts on
	ResourceID param.Opt[string] `query:"resource_id,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 the kind of resource the operation acts on
	//
	// Any of "vm", "volume", "vpc", "firewall_rule", "connect_connection",
	// "nks_cluster", "nks_node_pool", "nks_load_balancer", "nks_node",
	// "sandbox_cluster", "bucket".
	Kind OperationListParamsKind `query:"kind,omitzero" json:"-"`
	// Filter by operation status
	//
	// Any of "pending", "running", "done", "failed", "unknown".
	Status OperationListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter by operation type
	//
	// Any of "create", "update", "delete", "restart".
	Type OperationListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OperationListParams) URLQuery

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

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

type OperationListParamsKind

type OperationListParamsKind string

Filter by the kind of resource the operation acts on

const (
	OperationListParamsKindVM                OperationListParamsKind = "vm"
	OperationListParamsKindVolume            OperationListParamsKind = "volume"
	OperationListParamsKindVPC               OperationListParamsKind = "vpc"
	OperationListParamsKindFirewallRule      OperationListParamsKind = "firewall_rule"
	OperationListParamsKindConnectConnection OperationListParamsKind = "connect_connection"
	OperationListParamsKindNKSCluster        OperationListParamsKind = "nks_cluster"
	OperationListParamsKindNKSNodePool       OperationListParamsKind = "nks_node_pool"
	OperationListParamsKindNKSLoadBalancer   OperationListParamsKind = "nks_load_balancer"
	OperationListParamsKindNKSNode           OperationListParamsKind = "nks_node"
	OperationListParamsKindSandboxCluster    OperationListParamsKind = "sandbox_cluster"
	OperationListParamsKindBucket            OperationListParamsKind = "bucket"
)

type OperationListParamsStatus

type OperationListParamsStatus string

Filter by operation status

const (
	OperationListParamsStatusPending OperationListParamsStatus = "pending"
	OperationListParamsStatusRunning OperationListParamsStatus = "running"
	OperationListParamsStatusDone    OperationListParamsStatus = "done"
	OperationListParamsStatusFailed  OperationListParamsStatus = "failed"
	OperationListParamsStatusUnknown OperationListParamsStatus = "unknown"
)

type OperationListParamsType

type OperationListParamsType string

Filter by operation type

const (
	OperationListParamsTypeCreate  OperationListParamsType = "create"
	OperationListParamsTypeUpdate  OperationListParamsType = "update"
	OperationListParamsTypeDelete  OperationListParamsType = "delete"
	OperationListParamsTypeRestart OperationListParamsType = "restart"
)

type OperationService

type OperationService struct {
	Options []option.RequestOption
}

OperationService 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 NewOperationService method instead.

func NewOperationService

func NewOperationService(opts ...option.RequestOption) (r OperationService)

NewOperationService 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 (*OperationService) Get

func (r *OperationService) Get(ctx context.Context, operationID string, opts ...option.RequestOption) (res *Operation, err error)

Get details about a specific operation

func (*OperationService) List

List all operations

func (*OperationService) ListAutoPaging

List all operations

type OperationStatus

type OperationStatus string

Status of the Operation.

const (
	OperationStatusPending OperationStatus = "pending"
	OperationStatusRunning OperationStatus = "running"
	OperationStatusDone    OperationStatus = "done"
	OperationStatusFailed  OperationStatus = "failed"
	OperationStatusUnknown OperationStatus = "unknown"
)

type OperationType

type OperationType string

Type of Operation.

const (
	OperationTypeCreate  OperationType = "create"
	OperationTypeUpdate  OperationType = "update"
	OperationTypeDelete  OperationType = "delete"
	OperationTypeRestart OperationType = "restart"
)

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 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