operations

package
v1.88.6 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RegionNameUsSva2 = shared.RegionNameUsSva2

Equals "us-sva-2"

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"

Variables

This section is empty.

Functions

This section is empty.

Types

type CostQuote added in v1.88.6

type CostQuote = shared.CostQuote

Cost quote returned by POST /cost.

This is an alias to an internal type.

type CostQuoteUpdate added in v1.88.6

type CostQuoteUpdate = shared.CostQuoteUpdate

Cost quote returned by PATCH /:id/cost: the current-state quote, the post-update quote, and the signed diff.

This is an alias to an internal type.

type CostQuoteUpdateAfter added in v1.88.6

type CostQuoteUpdateAfter = shared.CostQuoteUpdateAfter

Quote for the proposed (post-update) resource state.

This is an alias to an internal type.

type CostQuoteUpdateAfterUsageDimension added in v1.88.6

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 added in v1.88.6

type CostQuoteUpdateBefore = shared.CostQuoteUpdateBefore

Quote for the proposed (post-update) resource state.

This is an alias to an internal type.

type CostQuoteUpdateBeforeUsageDimension added in v1.88.6

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 added in v1.88.6

type CostQuoteUpdateDiff = shared.CostQuoteUpdateDiff

Per-dimension and total deltas: after minus before.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimension added in v1.88.6

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 added in v1.88.6

type CostQuoteUpdateDiffUsageDimensionAfter = shared.CostQuoteUpdateDiffUsageDimensionAfter

Priced row after the update. Always present.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimensionBefore added in v1.88.6

type CostQuoteUpdateDiffUsageDimensionBefore = shared.CostQuoteUpdateDiffUsageDimensionBefore

Priced row after the update. Always present.

This is an alias to an internal type.

type CostQuoteUsageDimension added in v1.88.6

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".
	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 added in v1.1.0

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 added in v1.84.0

type OperationChanges map[string]OperationFieldDiff

type OperationDetails added in v1.84.0

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 added in v1.84.0

func (r OperationDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationDetails) UnmarshalJSON added in v1.84.0

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

type OperationFieldDiff added in v1.84.0

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 added in v1.84.0

func (r OperationFieldDiff) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationFieldDiff) UnmarshalJSON added in v1.84.0

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

type OperationFieldDiffFromUnion added in v1.84.0

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 added in v1.84.0

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

func (OperationFieldDiffFromUnion) AsFloat added in v1.84.0

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

func (OperationFieldDiffFromUnion) AsString added in v1.84.0

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

func (OperationFieldDiffFromUnion) AsStringArray added in v1.84.0

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

func (OperationFieldDiffFromUnion) RawJSON added in v1.84.0

func (u OperationFieldDiffFromUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationFieldDiffFromUnion) UnmarshalJSON added in v1.84.0

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

type OperationFieldDiffToUnion added in v1.84.0

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 added in v1.84.0

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

func (OperationFieldDiffToUnion) AsFloat added in v1.84.0

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

func (OperationFieldDiffToUnion) AsString added in v1.84.0

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

func (OperationFieldDiffToUnion) AsStringArray added in v1.84.0

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

func (OperationFieldDiffToUnion) RawJSON added in v1.84.0

func (u OperationFieldDiffToUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*OperationFieldDiffToUnion) UnmarshalJSON added in v1.84.0

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

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 added in v1.1.0

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 added in v1.21.0

type OperationListParams struct {
	// Project ID of resources to request
	ProjectID string `query:"project_id" api:"required" json:"-"`
	// Pagination cursor returned by a previous request
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OperationListParams) URLQuery added in v1.21.0

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

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

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 added in v1.21.0

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 Pagination added in v1.21.0

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 added in v1.35.0

type SourceIPRuleParam = shared.SourceIPRuleParam

IP filter rules.

This is an alias to an internal type.

type SourceIPRuleResponse added in v1.54.0

type SourceIPRuleResponse = shared.SourceIPRuleResponse

IP filter rules.

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