models

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Package models ...

Index

Constants

View Source
const (
	// APIVersion is the target RIaaS API spec version
	APIVersion = "2019-07-02"

	// APIGeneration ...
	APIGeneration = 1

	// UserAgent identifies IKS to the RIaaS API
	UserAgent = "IBM-Kubernetes-Service"

	// GTypeClassic ...
	GTypeClassic = "gc"

	// GTypeClassicDevicePrefix ...
	GTypeClassicDevicePrefix = "/dev/"

	// GTypeG2 ...
	GTypeG2 = "g2"

	// GTypeG2DevicePrefix ...
	GTypeG2DevicePrefix = "/dev/disk/by-id/virtio-"

	// GTypeG2DeviceIDLength ...
	GTypeG2DeviceIDLength = 20

	// VolumeAttached ...
	VolumeAttached = "attached"
)
View Source
const (
	//ClusterIDTagName ...
	ClusterIDTagName = "clusterid"
	//VolumeStatus ...
	VolumeStatus = "status"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupPolicyPlan

type BackupPolicyPlan struct {
	ID           string   `json:"id,omitempty"`
	Href         string   `json:"href,omitempty"`
	Name         string   `json:"name,omitempty"`
	Deleted      *Deleted `json:"deleted,omitempty"`
	ResourceType string   `json:"resource_type,omitempty"`
}

BackupPolicyPlan ...

type Clone

type Clone struct {
	Available string     `json:"available,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	Zone      *Zone      `json:"zone,omitempty"`
}

Clone ...

type Deleted

type Deleted struct {
	MoreInfo string `json:"more_info,omitempty"`
}

Deleted ...

type Device

type Device struct {
	ID string `json:"id"`
}

Device ...

type Error

type Error struct {
	Errors []ErrorItem `json:"errors"`
	Trace  string      `json:"trace,omitempty"`
}

Error ...

func (Error) Error

func (e Error) Error() string

Error ...

type ErrorCode

type ErrorCode string

ErrorCode ...

const (
	ErrorCodeInvalidState ErrorCode = "invalid_state"
	ErrorCodeNotFound     ErrorCode = "not_found"
	ErrorCodeTokenInvalid ErrorCode = "token_invalid"
)

Error codes

func (ErrorCode) String

func (ec ErrorCode) String() string

type ErrorItem

type ErrorItem struct {
	Code     ErrorCode    `json:"code,omitempty"`
	Message  string       `json:"message,omitempty"`
	MoreInfo string       `json:"more_info,omitempty"`
	Target   *ErrorTarget `json:"reqID,omitempty"`
}

ErrorItem ...

func (ErrorItem) Error

func (ei ErrorItem) Error() string

Error ...

type ErrorTarget

type ErrorTarget struct {
	Name string    `json:"name,omitempty"`
	Type ErrorType `json:"type,omitempty"`
}

ErrorTarget ...

type ErrorType

type ErrorType string

ErrorType ...

const (
	ErrorTypeField     ErrorType = "field"
	ErrorTypeParameter ErrorType = "parameter"
	ErrorTypeHeader    ErrorType = "header"
)

Error types

func (ErrorType) String

func (et ErrorType) String() string

type GenerationType

type GenerationType string

GenerationType ...

func (GenerationType) String

func (i GenerationType) String() string

String ...

type HReference

type HReference struct {
	Href string `json:"href,omitempty"`
}

HReference ...

type IksError

type IksError struct {
	ReqID       string    `json:"incidentID" binding:"required"`
	Code        string    `json:"code" binding:"required"`
	Err         string    `json:"description" binding:"required"`
	Type        ErrorType `json:"type" binding:"required"`
	RecoveryCLI string    `json:"recoveryCLI,omitempty"`
	RecoveryUI  string    `json:"recoveryUI,omitempty"`
	RC          int       `json:"rc,omitempty"`
}

IksError ...

func (IksError) Error

func (ikserr IksError) Error() string

Error ...

type LisSnapshotFilters

type LisSnapshotFilters struct {
	ResourceGroupID string `json:"resource_group.id,omitempty"`
	Name            string `json:"name,omitempty"`
	SourceVolumeID  string `json:"source_volume.id,omitempty"`
}

LisSnapshotFilters ...

type ListVolumeFilters

type ListVolumeFilters struct {
	ResourceGroupID string `json:"resource_group.id,omitempty"`
	Tag             string `json:"tag,omitempty"`
	ZoneName        string `json:"zone.name,omitempty"`
	VolumeName      string `json:"name,omitempty"`
}

ListVolumeFilters ...

type OperatingSystem

type OperatingSystem struct {
	Href              string `json:"href,omitempty"`
	Version           string `json:"version,omitempty"`
	Vendor            string `json:"vendor,omitempty"`
	Name              string `json:"name,omitempty"`
	Family            string `json:"family,omitempty"`
	DisplayName       string `json:"display_name,omitempty"`
	Architecture      string `json:"architecture,omitempty"`
	DedicatedHostOnly bool   `json:"dedicated_host_only,omitempty"`
}

OperatingSystem ...

type Profile

type Profile struct {
	CRN  string `json:"crn,omitempty"`
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
}

Profile ...

type ResourceGroup

type ResourceGroup struct {
	Href string `json:"href,omitempty"`
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

ResourceGroup ...

type Snapshot

type Snapshot struct {
	Href            string           `json:"href,omitempty"`
	ID              string           `json:"id,omitempty"`
	Name            string           `json:"name,omitempty"`
	MinimumCapacity int64            `json:"minimum_capacity,omitempty"`
	ResourceGroup   *ResourceGroup   `json:"resource_group,omitempty"`
	OperatingSystem *OperatingSystem `json:"operating_system,omitempty"`
	CreatedAt       *time.Time       `json:"created_at,omitempty"`
	Status          string           `json:"status,omitempty"`
	Encryption      string           `json:"encryption,omitempty"`
	ResourceType    string           `json:"resource_type,omitempty"`
	Size            int64            `json:"size,omitempty"`
	Bootable        bool             `json:"bootable,omitempty"`
	LifecycleState  string           `json:"lifecycle_state,omitempty"`
	SourceVolume    *SourceVolume    `json:"source_volume,omitempty"`
	UserTags        []string         `json:"user_tags,omitempty"`
	ServiceTags     []string         `json:"service_tags,omitempty"`
	CapturedAt      *time.Time       `json:"captured_at,omitempty"`

	SourceImage      *SourceImage         `json:"source_image,omitempty"`
	CRN              string               `json:"crn,omitempty"`
	Clones           *[]Clone             `json:"clones,omitempty"`
	BackupPolicyPlan *BackupPolicyPlan    `json:"backup_policy_plan,omitempty"`
	EncryptionKey    *VolumeEncryptionKey `json:"encryption_key,omitempty"`
}

Snapshot ...

type SnapshotList

type SnapshotList struct {
	First      *HReference `json:"first,omitempty"`
	Next       *HReference `json:"next,omitempty"`
	Snapshots  []*Snapshot `json:"snapshots"`
	Limit      int         `json:"limit,omitempty"`
	TotalCount int         `json:"total_count,omitempty"`
}

SnapshotList ...

type SourceImage

type SourceImage struct {
	ID      string   `json:"id,omitempty"`
	Href    string   `json:"href,omitempty"`
	Name    string   `json:"name,omitempty"`
	CRN     string   `json:"crn,omitempty"`
	Deleted *Deleted `json:"deleted,omitempty"`
}

SourceImage ...

type SourceVolume

type SourceVolume struct {
	ID      string   `json:"id,omitempty"`
	Href    string   `json:"href,omitempty"`
	Name    string   `json:"name,omitempty"`
	CRN     string   `json:"crn,omitempty"`
	Deleted *Deleted `json:"deleted,omitempty"`
}

SourceVolume ...

type StatusType

type StatusType string

StatusType ...

type Volume

type Volume struct {
	Href                string               `json:"href,omitempty"`
	ID                  string               `json:"id,omitempty"`
	Name                string               `json:"name,omitempty"`
	Capacity            int64                `json:"capacity,omitempty"`
	Iops                int64                `json:"iops,omitempty"`
	VolumeEncryptionKey *VolumeEncryptionKey `json:"encryption_key,omitempty"`
	ResourceGroup       *ResourceGroup       `json:"resource_group,omitempty"`
	Tags                []string             `json:"tags,omitempty"` //We need to validate and remove this if not required.
	UserTags            []string             `json:"user_tags,omitempty"`
	Profile             *Profile             `json:"profile,omitempty"`
	SourceSnapshot      *Snapshot            `json:"source_snapshot,omitempty"`
	CreatedAt           *time.Time           `json:"created_at,omitempty"`
	Status              StatusType           `json:"status,omitempty"`
	VolumeAttachments   *[]VolumeAttachment  `json:"volume_attachments,omitempty"`

	Zone          *Zone                 `json:"zone,omitempty"`
	CRN           string                `json:"crn,omitempty"`
	Cluster       string                `json:"cluster,omitempty"`
	Provider      string                `json:"provider,omitempty"`
	VolumeType    string                `json:"volume_type,omitempty"`
	HealthState   string                `json:"health_state,omitempty"`
	HealthReasons *[]VolumeHealthReason `json:"health_reasons,omitempty"`
}

Volume ...

func NewVolume

func NewVolume(volumeRequest provider.Volume) Volume

NewVolume created model volume from provider volume

type VolumeAttachment

type VolumeAttachment struct {
	ID   string `json:"id,omitempty"`
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
	// Status of volume attachment named - attaching , attached, detaching
	Status string `json:"status,omitempty"`
	Type   string `json:"type,omitempty"` //boot, data
	// InstanceID this volume is attached to
	InstanceID *string    `json:"-"`
	ClusterID  *string    `json:"clusterID,omitempty"`
	Device     *Device    `json:"device,omitempty"`
	Volume     *Volume    `json:"volume,omitempty"`
	CreatedAt  *time.Time `json:"created_at,omitempty"`
	// If set to true, when deleting the instance the volume will also be deleted
	DeleteVolumeOnInstanceDelete bool `json:"delete_volume_on_instance_delete,omitempty"`
}

VolumeAttachment for riaas client

func NewVolumeAttachment

func NewVolumeAttachment(volumeAttachmentRequest provider.VolumeAttachmentRequest) VolumeAttachment

NewVolumeAttachment creates VolumeAttachment from VolumeAttachmentRequest

func (*VolumeAttachment) ToVolumeAttachmentResponse

func (va *VolumeAttachment) ToVolumeAttachmentResponse(providerType string) *provider.VolumeAttachmentResponse

ToVolumeAttachmentResponse converts VolumeAttachment VolumeAttachmentResponse

type VolumeAttachmentList

type VolumeAttachmentList struct {
	VolumeAttachments []VolumeAttachment `json:"volume_attachments,omitempty"`
}

VolumeAttachmentList ...

type VolumeEncryptionKey

type VolumeEncryptionKey struct {
	CRN string `json:"crn,omitempty"`
}

VolumeEncryptionKey ...

type VolumeHealthReason

type VolumeHealthReason struct {
	Code     string `json:"code,omitempty"`
	Message  string `json:"message,omitempty"`
	MoreInfo string `json:"more_info,omitempty"`
}

type VolumeList

type VolumeList struct {
	First      *HReference `json:"first,omitempty"`
	Next       *HReference `json:"next,omitempty"`
	Volumes    []*Volume   `json:"volumes"`
	Limit      int         `json:"limit,omitempty"`
	TotalCount int         `json:"total_count,omitempty"`
}

VolumeList ...

type Zone

type Zone struct {
	Name string `json:"name,omitempty"`
	Href string `json:"href,omitempty"`
}

Zone ...

Jump to

Keyboard shortcuts

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