Documentation
¶
Index ¶
- Constants
- type Error
- type Pagination
- type Region
- type RegionAvailability
- type RegionCompute
- type RegionList
- type RegionListParams
- type RegionName
- type RegionNetworking
- type RegionService
- func (r *RegionService) Get(ctx context.Context, regionName 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
Constants ¶
const RegionNameApSeo1 = shared.RegionNameApSeo1
Equals "ap-seo-1"
const RegionNameApSin1 = shared.RegionNameApSin1
Equals "ap-sin-1"
const RegionNameApTyo1 = shared.RegionNameApTyo1
Equals "ap-tyo-1"
const RegionNameEuFrk1 = shared.RegionNameEuFrk1
Equals "eu-frk-1"
const RegionNameUsChi1 = shared.RegionNameUsChi1
Equals "us-chi-1"
const RegionNameUsSea1 = shared.RegionNameUsSea1
Equals "us-sea-1"
const RegionNameUsSva1 = shared.RegionNameUsSva1
Equals "us-sva-1"
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"
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,required"`
// Compute products available in this region.
Compute RegionCompute `json:"compute,required"`
// Name of the region.
Name string `json:"name,required"`
// Networking products available in this region.
Networking RegionNetworking `json:"networking,required"`
// Storage products available in this region.
Storage RegionStorage `json:"storage,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
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,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,required"`
// Pagination response details.
Pagination shared.Pagination `json:"pagination,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 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,required"`
// VPCs indicates if Virtual Private Clouds are available.
VPCs bool `json:"vpcs,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, regionName 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,required"`
// LocalNVMe indicates if locally-attached NVMe storage is available.
LocalNvme bool `json:"local_nvme,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.