rsc

package
v0.0.0-...-b4a789c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HEADERS map[string]string = map[string]string{
	"Accept":            "application/json",
	"Content-Type":      "application/json",
	"Accept_Language":   "en_US",
	"X-EMC-REST-CLIENT": "true",
	"User-Agent":        "gounity",
}

Functions

func DeleteHostById

func DeleteHostById(conn *Connection, id string) error

func DeleteInitiatorById

func DeleteInitiatorById(conn *Connection, id string) error

func DeleteLunById

func DeleteLunById(conn *Connection, id string) error

func GbToByte

func GbToByte(gb uint64) uint64

func StorageRscDo

func StorageRscDo(conn *Connection, action string, body map[string]interface{}) (string, error)

func StorageRscInstDo

func StorageRscInstDo(conn *Connection, id, action string, body map[string]interface{}) (string, error)

Types

type Attributes

type Attributes struct {
	Name         string
	Type         string
	Description  string
	DisplayValue string
}

type BlockHostAccess

type BlockHostAccess struct {
	Host       Host
	AccessMask HostLUNAccessEnum
}

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(ip, username, password string) *Connection

func NewMockConnection

func NewMockConnection(ip, username, password string) *Connection

func (*Connection) Delete

func (conn *Connection) Delete(url, body string) (string, error)

func (*Connection) DeleteRscInst

func (conn *Connection) DeleteRscInst(rsc, id, body string) (string, error)

func (*Connection) Get

func (conn *Connection) Get(url string) (string, error)

func (*Connection) GetRscAll

func (conn *Connection) GetRscAll(rsc, filter string) (string, error)

func (*Connection) GetRscInst

func (conn *Connection) GetRscInst(rsc, id string) (string, error)

func (*Connection) GetRscMeta

func (conn *Connection) GetRscMeta(rsc string) (string, error)

func (*Connection) Post

func (conn *Connection) Post(url string, body string) (string, error)

func (*Connection) PostInstance

func (conn *Connection) PostInstance(rsc, body string) (string, error)

type ErrorMessage

type ErrorMessage struct {
	EnUs string `json:"en-US"`
}

type EthernetPort

type EthernetPort struct {
	Rsc
	Health           Health
	StorageProcessor StorageProcessor
	Name             string
	PortNumber       uint32
	Bond             bool
	IsLinkUp         bool
	MacAddress       string
	IsRDMACapable    bool
}

type FcPort

type FcPort struct {
	Rsc
	Health           Health
	SlotNumber       uint32
	Wwn              string
	StorageProcessor StorageProcessor
	NPortId          uint32
	// contains filtered or unexported fields
}

type Health

type Health struct {
	Value          int
	DescriptionIds []string
	Descriptions   []string
}

type Host

type Host struct {
	Rsc
	Name                string
	Health              Health
	Description         string
	OsType              string
	Type                HostTypeEnum
	HostUUID            string
	HostPushedUUID      string
	HostPolledUUID      string
	FcHostInitiators    []HostInitiator
	IscsiHostInitiators []HostInitiator
	HostIPPorts         []HostIPPort
	StorageResources    []StorageResource
	HostLUNs            []HostLUN
	Tenant              Tenant
}

func CreateHost

func CreateHost(conn *Connection, name string) (*Host, error)

func GetHostById

func GetHostById(conn *Connection, id string) *Host

func GetHostByName

func GetHostByName(conn *Connection, name string) *Host

func (*Host) AddInitiator

func (host *Host) AddInitiator(uid string) (*HostInitiator, error)

func (*Host) Attach

func (host *Host) Attach(lun *Lun) (*HostLUN, error)

func (*Host) Delete

func (host *Host) Delete() error

func (*Host) Detach

func (host *Host) Detach(lun *Lun) error

type HostIPPort

type HostIPPort struct {
	Rsc
	Name           string
	Type           HostPortTypeEnum
	Address        string
	Netmask        string
	V6PrefixLength uint32
	IsIgnored      bool
	Host           Host
}

type HostInitiator

type HostInitiator struct {
	Rsc
	Health      Health
	Type        HostInitiatorType
	InitiatorId string
	IsIgnored   bool
	NodeWWN     string
	PortWWN     string
	ParentHost  Host
	Paths       []HostInitiatorPath
	IsBound     bool
}

func CreateInitiator

func CreateInitiator(conn *Connection, host *Host, uid string) (*HostInitiator, error)

func GetInitiatorById

func GetInitiatorById(conn *Connection, id string) *HostInitiator

func GetInitiatorByUid

func GetInitiatorByUid(conn *Connection, uid string) *HostInitiator

func (*HostInitiator) Delete

func (initiator *HostInitiator) Delete() error

type HostInitiatorList

type HostInitiatorList struct {
	RscList
}

type HostInitiatorListCtor

type HostInitiatorListCtor struct {
	// contains filtered or unexported fields
}

type HostInitiatorPath

type HostInitiatorPath struct {
	Rsc
	RegistrationType HostInitiatorPathTypeEnum
	IsLoggedIn       bool
	HostPushName     string
	SessionIds       []string
	Initiator        HostInitiator
	FcPort           FcPort
	IscsiPortal      IscsiPortal
}

type HostInitiatorPathTypeEnum

type HostInitiatorPathTypeEnum int
const (
	Manual HostInitiatorPathTypeEnum = iota
	ESX_Auto
	Other_Auto
)

type HostInitiatorType

type HostInitiatorType int
const (
	UNKNOWN HostInitiatorType = iota
	FC
	ISCSI
)

type HostLUN

type HostLUN struct {
	Rsc
	Host Host
	Type HostLUNTypeEnum
	Hlu  uint16
	Lun  Lun
	// todo: snap
	//Snap Snap
	IsReadOnly    bool
	IsDefaultSnap bool
}

func GetHostLUN

func GetHostLUN(conn *Connection, host *Host, lun *Lun) *HostLUN

type HostLUNAccessEnum

type HostLUNAccessEnum int
const (
	NO_ACCESS HostLUNAccessEnum = iota
	PRODUCTION
	SNAPSHOT
	BOTH
	MIXED
)

type HostLUNList

type HostLUNList struct {
	RscList
}

type HostLUNTypeEnum

type HostLUNTypeEnum int
const (
	HostLUNType_UNKNOWN HostLUNTypeEnum = iota
	HostLUNType_LUN
	HostLUNType_Snap
)

type HostList

type HostList struct {
	RscList
}

func GetHostList

func GetHostList(conn *Connection) *HostList

type HostListCtor

type HostListCtor struct {
	// contains filtered or unexported fields
}

type HostLunListCtor

type HostLunListCtor struct {
	// contains filtered or unexported fields
}

type HostPortTypeEnum

type HostPortTypeEnum int
const (
	HostPortType_IPv4 HostPortTypeEnum = iota
	HostPortType_IPv6
	HostPortType_NetworkName
)

type HostTypeEnum

type HostTypeEnum int
const (
	Unknown HostTypeEnum = iota
	HostManual
	Subnet
	NetGroup
	RPA
	HostAuto
	VNXSanCopy HostTypeEnum = 255
)

type IpProtocolVersionEnum

type IpProtocolVersionEnum int
const (
	IPv4 IpProtocolVersionEnum = 4
	IPv6 IpProtocolVersionEnum = 6
)

type IscsiNode

type IscsiNode struct {
	Rsc
	Name         string
	EthernetPort EthernetPort
	Alias        string
}

type IscsiPortal

type IscsiPortal struct {
	Rsc
	EthernetPort      EthernetPort
	IscsiNode         IscsiNode
	IpAddress         string
	Netmask           string
	V6PrefixLength    uint32
	Gateway           string
	VlanId            uint32
	IpProtocolVersion IpProtocolVersionEnum
}

type Lun

type Lun struct {
	Rsc
	Name                  string
	Health                Health
	Description           string
	SizeTotal             uint64
	SizeUsed              uint64
	SizeAllocated         uint64
	IsThinEnabled         bool
	Wwn                   string
	MetaDataSize          uint64
	MetadataSizeAllocated uint64
	SnapWwn               string
	SnapsSize             uint64
	SnapsSizeAllocated    uint64
	SnapCount             uint32
	Pool                  Pool
	HostAccess            []BlockHostAccess
}

func CreateLun

func CreateLun(conn *Connection, pool *Pool, name string, sizeGb uint64) (*Lun, error)

func GetLunById

func GetLunById(conn *Connection, id string) *Lun

func GetLunByName

func GetLunByName(conn *Connection, name string) *Lun

func (*Lun) AttachHost

func (lun *Lun) AttachHost(host *Host) (*HostLUN, error)

func (*Lun) Delete

func (lun *Lun) Delete() error

func (*Lun) DetachHost

func (lun *Lun) DetachHost(host *Host) error

type LunList

type LunList struct {
	RscList
}

func GetLunList

func GetLunList(conn *Connection) *LunList

type LunListCtor

type LunListCtor struct {
	// contains filtered or unexported fields
}

type Pool

type Pool struct {
	Rsc
	Name        string
	Health      Health
	Description string
	SizeFree    uint64
	SizeTotal   uint64
	SizeUsed    uint64
}

func GetPoolById

func GetPoolById(conn *Connection, id string) *Pool

func GetPoolByName

func GetPoolByName(conn *Connection, name string) *Pool

func (*Pool) CreateLun

func (pool *Pool) CreateLun(name string, sizeGb uint32) (*Lun, error)

func (*Pool) GetLunList

func (pool *Pool) GetLunList() *LunList

type PoolList

type PoolList struct {
	RscList
}

func GetPoolList

func GetPoolList(conn *Connection) *PoolList

type PoolListCtor

type PoolListCtor struct {
	// contains filtered or unexported fields
}

type RestError

type RestError struct {
	ErrorCode      uint64
	HttpStatusCode int
	Messages       []ErrorMessage
	Created        string
}

func (*RestError) Error

func (err *RestError) Error() string

type Rsc

type Rsc struct {
	Id string
	// contains filtered or unexported fields
}

func (*Rsc) GetConn

func (r *Rsc) GetConn() *Connection

func (*Rsc) GetId

func (r *Rsc) GetId() string

func (*Rsc) GetType

func (r *Rsc) GetType() string

func (*Rsc) JsonId

func (r *Rsc) JsonId() string

type RscList

type RscList struct {
	// contains filtered or unexported fields
}

func (*RscList) GetConn

func (rl *RscList) GetConn() *Connection

func (*RscList) GetFilter

func (rl *RscList) GetFilter() string

func (*RscList) Iterator

func (rl *RscList) Iterator() *RscListIterator

func (*RscList) Size

func (rl *RscList) Size() int

type RscListCtor

type RscListCtor interface {
	// contains filtered or unexported methods
}

type RscListIterator

type RscListIterator struct {
	// contains filtered or unexported fields
}

func (*RscListIterator) Next

func (it *RscListIterator) Next() bool

func (*RscListIterator) NextIndex

func (it *RscListIterator) NextIndex() int

func (*RscListIterator) Value

func (it *RscListIterator) Value() Rscer

type RscLister

type RscLister interface {
	GetConn() *Connection
	GetFilter() string
	Iterator() *RscListIterator
	Size() int
	// contains filtered or unexported methods
}

func UpdateList

func UpdateList(lister RscLister) RscLister

type Rscer

type Rscer interface {
	GetType() string
	GetId() string
	GetConn() *Connection
	JsonId() string
}

func Update

func Update(r Rscer) Rscer

type SPModelNameEnum

type SPModelNameEnum int
const (
	SP300 SPModelNameEnum = 1 + iota
	SP400
	SP500
	SP600
)

type StorageProcessor

type StorageProcessor struct {
	Rsc
	Health       Health
	IsRescueMode bool
	Model        string

	Name                 string
	EmcPartNumber        string
	EmcSerialNumber      string
	Manufacturer         string
	VendorPartNumber     string
	VendorSerialNumber   string
	SasExpanderVersion   string
	BiosFirmwareRevision string
	PostFirmwareRevision string
	MemorySize           uint32
	ModelName            SPModelNameEnum
	// contains filtered or unexported fields
}

type StorageResource

type StorageResource struct {
	Rsc
	Health                Health
	Name                  string
	Description           string
	SizeTotal             uint64
	SizeUsed              uint64
	SizeAllocated         uint64
	MetadataSize          uint64
	MetadataSizeAllocated uint64
	SnapsSizeTotal        uint64
	SnapsSizeAllocated    uint64
	SnapCount             uint32
	Pools                 []Pool
	Luns                  []Lun
}

type StorageResourceIdResp

type StorageResourceIdResp struct {
	StorageResource Rsc
}

type StorageResourceTypeEnum

type StorageResourceTypeEnum int
const (
	SRType_Filesystem StorageResourceTypeEnum = 1 + iota
	SRType_ConsistencyGroup
	SRType_VmwareFs
	SRType_VmwareIscsi
)
const (
	SRType_Lun StorageResourceTypeEnum = 8 + iota
	SRType_VVolDataStoreFs
	SRType_VVolDataStoreIscsi
)

type Tenant

type Tenant struct {
	Rsc
	Name  string
	Uuid  string
	Vlans []uint32
	Host  []Host
}

type Type

type Type struct {
	Name          string
	Description   string
	Documentation string
	Attributes    []Attributes
}

func (*Type) AllFieldString

func (t *Type) AllFieldString() string

type Unity

type Unity struct {
	Rsc
	Name                  string
	Model                 string
	Health                Health
	SerialNumber          string
	Platform              string
	MacAddress            string
	IsEULAAccepted        bool
	IsUpgradeComplete     bool
	IsAutoFailbackEnabled bool
	CurrentPower          int
	AvgPower              int
}

func NewUnity

func NewUnity(ip, username, password string) *Unity

func NewUnityByConn

func NewUnityByConn(conn *Connection) *Unity

func (*Unity) CreateHost

func (unity *Unity) CreateHost(name string) (*Host, error)

func (*Unity) GetHostById

func (unity *Unity) GetHostById(id string) *Host

func (*Unity) GetHostByName

func (unity *Unity) GetHostByName(name string) *Host

func (*Unity) GetHostList

func (unity *Unity) GetHostList() *HostList

func (*Unity) GetLunById

func (unity *Unity) GetLunById(id string) *Lun

func (*Unity) GetLunByName

func (unity *Unity) GetLunByName(name string) *Lun

func (*Unity) GetLunList

func (unity *Unity) GetLunList() *LunList

func (*Unity) GetPoolById

func (unity *Unity) GetPoolById(id string) *Pool

func (*Unity) GetPoolByName

func (unity *Unity) GetPoolByName(name string) *Pool

func (*Unity) GetPoolList

func (unity *Unity) GetPoolList() *PoolList

func (*Unity) Ip

func (unity *Unity) Ip() string

func (*Unity) Username

func (unity *Unity) Username() string

Jump to

Keyboard shortcuts

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