etcd

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LIMIT = 50
View Source
var OFFSET = 0
View Source
var SORTDIR = "desc"
View Source
var SORTKEY = "ID"

Functions

func AuthorizeProjectContext

func AuthorizeProjectContext(ctx *c.Context) bool

func Init

func Init(edps []string) *client

Init

func IsAdminContext

func IsAdminContext(ctx *c.Context) bool

Types

type Client

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

Client

func NewClient

func NewClient(edps []string) *Client

NewClient

func (*Client) AddExtraProperty

func (c *Client) AddExtraProperty(ctx *c.Context, prfID string, ext model.ExtraSpec) (*model.ExtraSpec, error)

AddExtraProperty

func (*Client) CreateDock

func (c *Client) CreateDock(ctx *c.Context, dck *model.DockSpec) (*model.DockSpec, error)

CreateDock

func (*Client) CreatePool

func (c *Client) CreatePool(ctx *c.Context, pol *model.StoragePoolSpec) (*model.StoragePoolSpec, error)

CreatePool

func (*Client) CreateProfile

func (c *Client) CreateProfile(ctx *c.Context, prf *model.ProfileSpec) (*model.ProfileSpec, error)

CreateProfile

func (*Client) CreateVolume

func (c *Client) CreateVolume(ctx *c.Context, vol *model.VolumeSpec) (*model.VolumeSpec, error)

CreateVolume

func (*Client) CreateVolumeAttachment

func (c *Client) CreateVolumeAttachment(ctx *c.Context, attachment *model.VolumeAttachmentSpec) (*model.VolumeAttachmentSpec, error)

CreateVolumeAttachment

func (*Client) CreateVolumeSnapshot

func (c *Client) CreateVolumeSnapshot(ctx *c.Context, snp *model.VolumeSnapshotSpec) (*model.VolumeSnapshotSpec, error)

CreateVolumeSnapshot

func (*Client) DeleteDock

func (c *Client) DeleteDock(ctx *c.Context, dckID string) error

DeleteDock

func (*Client) DeletePool

func (c *Client) DeletePool(ctx *c.Context, polID string) error

DeletePool

func (*Client) DeleteProfile

func (c *Client) DeleteProfile(ctx *c.Context, prfID string) error

DeleteProfile

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(ctx *c.Context, volID string) error

DeleteVolume

func (*Client) DeleteVolumeAttachment

func (c *Client) DeleteVolumeAttachment(ctx *c.Context, attachmentId string) error

DeleteVolumeAttachment

func (*Client) DeleteVolumeSnapshot

func (c *Client) DeleteVolumeSnapshot(ctx *c.Context, snpID string) error

DeleteVolumeSnapshot

func (*Client) ExtendVolume

func (c *Client) ExtendVolume(ctx *c.Context, vol *model.VolumeSpec) (*model.VolumeSpec, error)

ExtendVolume ...

func (*Client) FindAttachmentValue

func (c *Client) FindAttachmentValue(k string, p *model.VolumeAttachmentSpec) string

func (*Client) FindDockValue

func (c *Client) FindDockValue(k string, d *model.DockSpec) string

func (*Client) FindPoolValue

func (c *Client) FindPoolValue(k string, p *model.StoragePoolSpec) string

func (*Client) FindProfileValue

func (c *Client) FindProfileValue(k string, p *model.ProfileSpec) string

func (*Client) FindSnapshotsValue

func (c *Client) FindSnapshotsValue(k string, p *model.VolumeSnapshotSpec) string

func (*Client) FindVolumeValue

func (c *Client) FindVolumeValue(k string, p *model.VolumeSpec) string

func (*Client) GetDefaultProfile

func (c *Client) GetDefaultProfile(ctx *c.Context) (*model.ProfileSpec, error)

GetDefaultProfile

func (*Client) GetDock

func (c *Client) GetDock(ctx *c.Context, dckID string) (*model.DockSpec, error)

GetDock

func (*Client) GetDockByPoolId

func (c *Client) GetDockByPoolId(ctx *c.Context, poolId string) (*model.DockSpec, error)

GetDockByPoolId

func (*Client) GetLimit

func (c *Client) GetLimit(m map[string][]string) int

Get parameter limit

func (*Client) GetOffset

func (c *Client) GetOffset(m map[string][]string, size int) int

Get parameter offset

func (*Client) GetPool

func (c *Client) GetPool(ctx *c.Context, polID string) (*model.StoragePoolSpec, error)

GetPool

func (*Client) GetProfile

func (c *Client) GetProfile(ctx *c.Context, prfID string) (*model.ProfileSpec, error)

GetProfile

func (*Client) GetSortDir

func (c *Client) GetSortDir(m map[string][]string) string

Get parameter sortDir

func (*Client) GetSortKey

func (c *Client) GetSortKey(m map[string][]string, sort_keys []string) string

Get parameter sortKey

func (*Client) GetVolume

func (c *Client) GetVolume(ctx *c.Context, volID string) (*model.VolumeSpec, error)

GetVolume

func (*Client) GetVolumeAttachment

func (c *Client) GetVolumeAttachment(ctx *c.Context, attachmentId string) (*model.VolumeAttachmentSpec, error)

func (*Client) GetVolumeSnapshot

func (c *Client) GetVolumeSnapshot(ctx *c.Context, snpID string) (*model.VolumeSnapshotSpec, error)

func (*Client) IsInArray

func (c *Client) IsInArray(e string, s []string) bool

IsInArray

func (*Client) ListDocks

func (c *Client) ListDocks(ctx *c.Context) ([]*model.DockSpec, error)

ListDocks

func (*Client) ListDocksWithFilter

func (c *Client) ListDocksWithFilter(ctx *c.Context, m map[string][]string) ([]*model.DockSpec, error)

func (*Client) ListExtraProperties

func (c *Client) ListExtraProperties(ctx *c.Context, prfID string) (*model.ExtraSpec, error)

ListExtraProperties

func (*Client) ListPools

func (c *Client) ListPools(ctx *c.Context) ([]*model.StoragePoolSpec, error)

ListPools

func (*Client) ListPoolsWithFilter

func (c *Client) ListPoolsWithFilter(ctx *c.Context, m map[string][]string) ([]*model.StoragePoolSpec, error)

func (*Client) ListProfiles

func (c *Client) ListProfiles(ctx *c.Context) ([]*model.ProfileSpec, error)

ListProfiles

func (*Client) ListProfilesWithFilter

func (c *Client) ListProfilesWithFilter(ctx *c.Context, m map[string][]string) ([]*model.ProfileSpec, error)

func (*Client) ListVolumeAttachments

func (c *Client) ListVolumeAttachments(ctx *c.Context, volumeId string) ([]*model.VolumeAttachmentSpec, error)

ListVolumeAttachments

func (*Client) ListVolumeAttachmentsWithFilter

func (c *Client) ListVolumeAttachmentsWithFilter(ctx *c.Context, m map[string][]string) ([]*model.VolumeAttachmentSpec, error)

func (*Client) ListVolumeSnapshots

func (c *Client) ListVolumeSnapshots(ctx *c.Context) ([]*model.VolumeSnapshotSpec, error)

ListVolumeSnapshots

func (*Client) ListVolumeSnapshotsWithFilter

func (c *Client) ListVolumeSnapshotsWithFilter(ctx *c.Context, m map[string][]string) ([]*model.VolumeSnapshotSpec, error)

func (*Client) ListVolumes

func (c *Client) ListVolumes(ctx *c.Context) ([]*model.VolumeSpec, error)

ListVolumes

func (*Client) ListVolumesWithFilter

func (c *Client) ListVolumesWithFilter(ctx *c.Context, m map[string][]string) ([]*model.VolumeSpec, error)

func (*Client) ParameterFilter

func (c *Client) ParameterFilter(m map[string][]string, size int, sort_keys []string) *Parameter

ParameterFilter

func (*Client) RemoveExtraProperty

func (c *Client) RemoveExtraProperty(ctx *c.Context, prfID, extraKey string) error

RemoveExtraProperty

func (*Client) SelectDocks

func (c *Client) SelectDocks(m map[string][]string, docks []*model.DockSpec) []*model.DockSpec

func (*Client) SelectOrNot

func (c *Client) SelectOrNot(m map[string][]string) bool

func (*Client) SelectPools

func (c *Client) SelectPools(m map[string][]string, pools []*model.StoragePoolSpec) []*model.StoragePoolSpec

func (*Client) SelectProfiles

func (c *Client) SelectProfiles(m map[string][]string, profiles []*model.ProfileSpec) []*model.ProfileSpec

func (*Client) SelectSnapshots

func (c *Client) SelectSnapshots(m map[string][]string, snapshots []*model.VolumeSnapshotSpec) []*model.VolumeSnapshotSpec

func (*Client) SelectVolumeAttachments

func (c *Client) SelectVolumeAttachments(m map[string][]string, attachments []*model.VolumeAttachmentSpec) []*model.VolumeAttachmentSpec

func (*Client) SelectVolumes

func (c *Client) SelectVolumes(m map[string][]string, volumes []*model.VolumeSpec) []*model.VolumeSpec

func (*Client) SortDocks

func (c *Client) SortDocks(dcks []*model.DockSpec, p *Parameter) []*model.DockSpec

func (*Client) SortPools

func (c *Client) SortPools(pools []*model.StoragePoolSpec, p *Parameter) []*model.StoragePoolSpec

func (*Client) SortProfiles

func (c *Client) SortProfiles(profiles []*model.ProfileSpec, p *Parameter) []*model.ProfileSpec

func (*Client) SortSnapshots

func (c *Client) SortSnapshots(snapshots []*model.VolumeSnapshotSpec, p *Parameter) []*model.VolumeSnapshotSpec

func (*Client) SortVolumeAttachments

func (c *Client) SortVolumeAttachments(attachments []*model.VolumeAttachmentSpec, p *Parameter) []*model.VolumeAttachmentSpec

func (*Client) SortVolumes

func (c *Client) SortVolumes(volumes []*model.VolumeSpec, p *Parameter) []*model.VolumeSpec

func (*Client) UpdateDock

func (c *Client) UpdateDock(ctx *c.Context, dckID, name, desp string) (*model.DockSpec, error)

UpdateDock

func (*Client) UpdatePool

func (c *Client) UpdatePool(ctx *c.Context, polID, name, desp string, usedCapacity int64, used bool) (*model.StoragePoolSpec, error)

UpdatePool

func (*Client) UpdateProfile

func (c *Client) UpdateProfile(ctx *c.Context, prfID string, input *model.ProfileSpec) (*model.ProfileSpec, error)

UpdateProfile

func (*Client) UpdateVolume

func (c *Client) UpdateVolume(ctx *c.Context, vol *model.VolumeSpec) (*model.VolumeSpec, error)

UpdateVolume ...

func (*Client) UpdateVolumeAttachment

func (c *Client) UpdateVolumeAttachment(ctx *c.Context, attachmentId string, attachment *model.VolumeAttachmentSpec) (*model.VolumeAttachmentSpec, error)

UpdateVolumeAttachment

func (*Client) UpdateVolumeSnapshot

func (c *Client) UpdateVolumeSnapshot(ctx *c.Context, snpID string, snp *model.VolumeSnapshotSpec) (*model.VolumeSnapshotSpec, error)

UpdateVolumeSnapshot

type DockSlice

type DockSlice []*model.DockSpec

func (DockSlice) Len

func (dock DockSlice) Len() int

func (DockSlice) Less

func (dock DockSlice) Less(i, j int) bool

func (DockSlice) Swap

func (dock DockSlice) Swap(i, j int)

type Parameter

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

Parameter

type ProfileSlice

type ProfileSlice []*model.ProfileSpec

func (ProfileSlice) Len

func (profile ProfileSlice) Len() int

func (ProfileSlice) Less

func (profile ProfileSlice) Less(i, j int) bool

func (ProfileSlice) Swap

func (profile ProfileSlice) Swap(i, j int)

type Request

type Request struct {
	Url        string `json:"url"`
	Content    string `json:"content"`
	NewContent string `json:"newContent"`
}

Request

type Response

type Response struct {
	Status  string   `json:"status"`
	Message []string `json:"message"`
	Error   string   `json:"error"`
}

Response

type StoragePoolSlice

type StoragePoolSlice []*model.StoragePoolSpec

func (StoragePoolSlice) Len

func (pool StoragePoolSlice) Len() int

func (StoragePoolSlice) Less

func (pool StoragePoolSlice) Less(i, j int) bool

func (StoragePoolSlice) Swap

func (pool StoragePoolSlice) Swap(i, j int)

type VolumeAttachmentSlice

type VolumeAttachmentSlice []*model.VolumeAttachmentSpec

func (VolumeAttachmentSlice) Len

func (volumeAttachment VolumeAttachmentSlice) Len() int

func (VolumeAttachmentSlice) Less

func (volumeAttachment VolumeAttachmentSlice) Less(i, j int) bool

func (VolumeAttachmentSlice) Swap

func (volumeAttachment VolumeAttachmentSlice) Swap(i, j int)

type VolumeSlice

type VolumeSlice []*model.VolumeSpec

func (VolumeSlice) Len

func (volume VolumeSlice) Len() int

func (VolumeSlice) Less

func (volume VolumeSlice) Less(i, j int) bool

func (VolumeSlice) Swap

func (volume VolumeSlice) Swap(i, j int)

type VolumeSnapshotSlice

type VolumeSnapshotSlice []*model.VolumeSnapshotSpec

func (VolumeSnapshotSlice) Len

func (volumeSnapshot VolumeSnapshotSlice) Len() int

func (VolumeSnapshotSlice) Less

func (volumeSnapshot VolumeSnapshotSlice) Less(i, j int) bool

func (VolumeSnapshotSlice) Swap

func (volumeSnapshot VolumeSnapshotSlice) Swap(i, j int)

Source Files

  • client.go
  • etcd.go

Jump to

Keyboard shortcuts

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