dockerops

package
v0.0.0-...-96d2ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Name of the Samba share used to expose a volume
	FileShareName = "vfileshare"
	// Path of the Samba share inside the server
	FileSharePath = "/vfilepath"
	// Default username for all accessing Samba server mounts
	SambaUsername = "vfile"
	// Default password for all accessing Samba server mounts
	SambaPassword = "vfile"
)

Variables

This section is empty.

Functions

func GetServiceStartTimeout

func GetServiceStartTimeout() time.Duration

get service start timeout

Types

type DockerOps

type DockerOps struct {
	Dockerd *dockerClient.Client
}

DockerOps is the interface for docker host related operations

func NewDockerOps

func NewDockerOps() *DockerOps

func (*DockerOps) CheckDockerVersion

func (d *DockerOps) CheckDockerVersion(requiredVersion string) (bool, error)

CheckDockerVersion - Return the version of docker on current node

func (*DockerOps) DeleteInternalVolume

func (d *DockerOps) DeleteInternalVolume(volName string)

DeleteVolume - delete the internal volume

func (*DockerOps) GetSwarmInfo

func (d *DockerOps) GetSwarmInfo() (nodeID string, addr string, isManager bool, err error)

GetSwarmInfo - returns the node ID and node IP address in swarm cluster also returns if this node is a manager or not

func (*DockerOps) GetSwarmLeader

func (d *DockerOps) GetSwarmLeader() (string, error)

GetSwarmLeader - return the IP address of the swarm leader this function can only be executed successfully on a swarm manager node

func (*DockerOps) GetSwarmManagers

func (d *DockerOps) GetSwarmManagers() ([]swarm.Peer, error)

GetSwarmManagers - return all the managers according to local docker info

func (*DockerOps) IsSwarmLeader

func (d *DockerOps) IsSwarmLeader(nodeID string) (bool, error)

IsSwarmLeader - check if nodeID is a swarm leader or not this function can only be executed successfully on a swarm manager node

func (*DockerOps) ListVolumesFromInternalVol

func (d *DockerOps) ListVolumesFromInternalVol() ([]string, error)

ListVolumesFromInternalVol - List vFile volumes according to current internal volumes

func (*DockerOps) ListVolumesFromServices

func (d *DockerOps) ListVolumesFromServices() ([]string, error)

ListVolumesFromServices - List vFile volumes according to current docker services

func (*DockerOps) LoadFileServerImage

func (d *DockerOps) LoadFileServerImage()

loadFileServerImage - Load the file server image present in the plugin to Docker images

func (*DockerOps) StartSMBServer

func (d *DockerOps) StartSMBServer(volName string) (int, string, bool)

StartSMBServer - Start SMB server Input - Name of the volume for which SMB has to be started Output

int:     The overlay network port number on which the
         newly created SMB server listens. This port
         is opened on every host VM in the swarm.
string:  Name of the SMB service started
bool:    Indicated success/failure of the function. If
         false, ignore other output values.

func (*DockerOps) StopSMBServer

func (d *DockerOps) StopSMBServer(volName string) (int, string, bool)

StopSMBServer - Stop SMB server The return values are just to maintain parity with StartSMBServer() as both these functions are passed to a nested function as args. Input

volName: Name of the volume for which the SMB service has to
         be stopped.

Output

int:     Port number on which the SMB server is listening.
         Set this to 0 as cleanup.
string:  Name of the SMB service. Set to empty.
bool:    The result of the operation. True if the service was
         successfully stopped.

func (*DockerOps) VolumeCreate

func (d *DockerOps) VolumeCreate(volumeDriver string, volName string, options map[string]string) error

VolumeCreate - create volume from docker host with specific volume driver

func (*DockerOps) VolumeInspect

func (d *DockerOps) VolumeInspect(volName string) error

VolumeInspect - inspect volume from docker host, if failed, return error

func (*DockerOps) VolumeRemove

func (d *DockerOps) VolumeRemove(volName string) error

VolumeCreate - remove volume from docker host with specific volume driver

Jump to

Keyboard shortcuts

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