Documentation
¶
Index ¶
- Constants
- type Error
- type Pagination
- type Region
- type RegionAvailability
- type RegionCompute
- type RegionList
- type RegionListParams
- type RegionNKS
- type RegionName
- type RegionNetworking
- type RegionService
- func (r *RegionService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *Region, err error)
- func (r *RegionService) List(ctx context.Context, query RegionListParams, opts ...option.RequestOption) (res *pagination.Cursor[Region], err error)
- func (r *RegionService) ListAutoPaging(ctx context.Context, query RegionListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Region]
- type RegionStorage
- type ResourceStatus
- type SourceIPRuleParam
- type SourceIPRuleResponse
Constants ¶
const RegionNameUsChi1 = shared.RegionNameUsChi1
Equals "us-chi-1"
const RegionNameUsSva1 = shared.RegionNameUsSva1
Equals "us-sva-1"
const RegionNameUsSva2 = shared.RegionNameUsSva2
Equals "us-sva-2"
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"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pagination ¶
type Pagination = shared.Pagination
Pagination response details.
This is an alias to an internal type.
type Region ¶
type Region struct {
// Availability status of the region.
//
// Any of "live", "preview", "maintenance", "sunset".
Availability RegionAvailability `json:"availability" api:"required"`
// Compute products available in this region.
Compute RegionCompute `json:"compute" api:"required"`
// Name of the region.
Name string `json:"name" api:"required"`
// Networking products available in this region.
Networking RegionNetworking `json:"networking" api:"required"`
// NKS products available in this region.
NKS RegionNKS `json:"nks" api:"required"`
// Storage products available in this region.
Storage RegionStorage `json:"storage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Availability respjson.Field
Compute respjson.Field
Name respjson.Field
Networking respjson.Field
NKS respjson.Field
Storage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Region response with product availability.
func (*Region) UnmarshalJSON ¶
type RegionAvailability ¶
type RegionAvailability string
Availability status of the region.
const ( RegionAvailabilityLive RegionAvailability = "live" RegionAvailabilityPreview RegionAvailability = "preview" RegionAvailabilityMaintenance RegionAvailability = "maintenance" RegionAvailabilitySunset RegionAvailability = "sunset" )
type RegionCompute ¶
type RegionCompute struct {
// VMs indicates if Virtual Machines are available.
VMs bool `json:"vms" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
VMs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compute products available in this region.
func (RegionCompute) RawJSON ¶
func (r RegionCompute) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegionCompute) UnmarshalJSON ¶
func (r *RegionCompute) UnmarshalJSON(data []byte) error
type RegionList ¶
type RegionList struct {
Items []Region `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 (RegionList) RawJSON ¶
func (r RegionList) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegionList) UnmarshalJSON ¶
func (r *RegionList) UnmarshalJSON(data []byte) error
type RegionListParams ¶
type RegionListParams struct {
// 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 (RegionListParams) URLQuery ¶
func (r RegionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RegionListParams's query parameters as `url.Values`.
type RegionNKS ¶ added in v1.53.0
type RegionNKS struct {
// Clusters indicates if NKS managed Kubernetes clusters are available.
Clusters bool `json:"clusters" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Clusters respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
NKS products available in this region.
func (*RegionNKS) UnmarshalJSON ¶ added in v1.53.0
type RegionName ¶
type RegionName = shared.RegionName
Region the resource is in.
This is an alias to an internal type.
type RegionNetworking ¶
type RegionNetworking struct {
// Connect indicates if Nirvana Connect is available.
Connect bool `json:"connect" api:"required"`
// VPCs indicates if Virtual Private Clouds are available.
VPCs bool `json:"vpcs" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Connect respjson.Field
VPCs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Networking products available in this region.
func (RegionNetworking) RawJSON ¶
func (r RegionNetworking) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegionNetworking) UnmarshalJSON ¶
func (r *RegionNetworking) UnmarshalJSON(data []byte) error
type RegionService ¶
type RegionService struct {
Options []option.RequestOption
}
RegionService 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 NewRegionService method instead.
func NewRegionService ¶
func NewRegionService(opts ...option.RequestOption) (r RegionService)
NewRegionService 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 (*RegionService) Get ¶
func (r *RegionService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *Region, err error)
Get a region by name
func (*RegionService) List ¶
func (r *RegionService) List(ctx context.Context, query RegionListParams, opts ...option.RequestOption) (res *pagination.Cursor[Region], err error)
List all regions
func (*RegionService) ListAutoPaging ¶
func (r *RegionService) ListAutoPaging(ctx context.Context, query RegionListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Region]
List all regions
type RegionStorage ¶
type RegionStorage struct {
// ABS indicates if Accelerated Block Storage is available.
ABS bool `json:"abs" api:"required"`
// LocalNVMe indicates if locally-attached NVMe storage is available.
LocalNvme bool `json:"local_nvme" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ABS respjson.Field
LocalNvme respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Storage products available in this region.
func (RegionStorage) RawJSON ¶
func (r RegionStorage) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegionStorage) UnmarshalJSON ¶
func (r *RegionStorage) UnmarshalJSON(data []byte) error
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.