portworx

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © 2019 Portworx

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	PXReplCurrSetMid         = "ReplicaSetCurrMid"
	PXReplSetCreateMid       = "ReplicaSetCreateMid"
	PXReplNewNodeMid         = "ReplNewNodeMid"
	PXReplReAddPools         = "PXReplReAddPools"
	PXReplReAddNodeMid       = "PXReplReAddNodeMid"
	PXReplReAddUsedSize      = "PXReplReAddUsedSize"
	PXReplNodePools          = "ReplNodePools"
	PXReplNewNodePools       = "ReplNewNodePools"
	PXReplRemoveMids         = "ReplRemoveMids"
	PXReplRuntimeState       = "RuntimeState"
	RuntimeStateResync       = "resync"
	RuntimeStateResyncFailed = "resync_failed"
)

Variables

This section is empty.

Functions

func BooleanAttributes added in v0.21.3

func BooleanAttributes(v *api.Volume) []string

BoolenaAttributes returns the string representations of all of the boolian attribute flags

func PrettyStatus added in v0.21.3

func PrettyStatus(v *api.Volume) string

PrettyStatus trims out the VOLUME_STATUS_ prefix

func PxAppendCaCertcontext added in v0.21.4

func PxAppendCaCertcontext(pxctx *contextconfig.ClientContext, userCa bool) ([]grpc.DialOption, error)

Append the provided valid CA from the user to the existing systemPool or load the default CA certs used for authentication with the sdk server.

func PxConnectCurrent

func PxConnectCurrent(cfgFile string) (context.Context, *grpc.ClientConn, error)

PxConnect will connect to the default context server using TLS if needed and returns the context setup with any security if any and the grpc client. The context will not have a timeout set, that should be setup by the caller of the gRPC call.

func PxConnectDefault added in v0.21.4

func PxConnectDefault() (context.Context, *grpc.ClientConn, error)

PxConnectDefault returns a Portworx client to the default or named context

func PxConnectNamed

func PxConnectNamed(cfgFile string, name string) (context.Context, *grpc.ClientConn, error)

PxConnectNamed will connect to a specified context server using TLS if needed and returns the context setup with any security if any and the grpc client. The context will not have a timeout set, that should be setup by the caller of the gRPC call.

func SchedSummary added in v0.21.3

func SchedSummary(v *api.Volume) ([]string, error)

SchedSummary returns the formatted string version of the schedule

func SharedString added in v0.21.3

func SharedString(v *api.Volume) string

SharedString returns the string representation of the shared flag of a volume

func TrueOrFalse added in v0.21.4

func TrueOrFalse(b bool) string

TrueOrFalse returns the string representation of bool

func ValidateVolumeSpec added in v0.21.3

func ValidateVolumeSpec(volspec *api.VolumeSpecUpdate) error

ValidateVolumeSpec checks if a volume spec if valid. Currently due to volume driver limitation, only few combination of fields can be set as paramaters in VolumeSpecUpdate. This function will check for the same.

Types

type PxConnectionData added in v0.21.3

type PxConnectionData struct {
	// Context of connection
	Ctx context.Context
	// Connection
	Conn *grpc.ClientConn
}

type PxVolumeOps added in v0.21.3

type PxVolumeOps interface {
	// GetPxVolumeOpsInfo returns the PxVolumeOpsInfo
	GetPxVolumeOpsInfo() *PxVolumeOpsInfo
	// GetCOps returns the COps inerface
	GetCOps() kubernetes.COps
	// GetVolumes returns the array of volume objects
	// filtered by the list of volume names specified
	GetVolumes() ([]*api.SdkVolumeInspectResponse, error)
	// PodsUsingVolume returns the list of pods uing the given volume
	PodsUsingVolume(v *api.Volume) ([]v1.Pod, error)
	// GetAttachedOn returns the node where the specified volume is attached
	GetAttachedOn(v *api.Volume) (*api.StorageNode, error)
	// GetAttachedState returns the attached state of the specified volume
	GetAttachedState(v *api.Volume) (string, error)
	// GetReplicationInfo returns the details of the replicas of the specified volume
	GetReplicationInfo(v *api.Volume) (*ReplicationInfo, error)
	// GetStats returns the stats for the specified volume
	GetStats(v *api.Volume, notCumulative bool) (*api.Stats, error)
	// GetPxPvcs returns the list of PxPvcs
	GetPxPvcs() ([]*kubernetes.PxPvc, error)
	// EnumerateNodes returns list of nodes  ids
	EnumerateNodes() ([]string, error)
	// GetNode returns details of given node
	GetNode(id string) (*api.StorageNode, error)
	// GetAllNodesForVolume will return all nodes that currently has anything to do with the volume
	// nodeNames are filled up and returned
	GetAllNodesForVolume(v *api.Volume, nodeNames map[string]bool) error
	// GetContainerInfoForVolume will return the container info for pods using the volume
	GetContainerInfoForVolume(v *api.Volume) ([]kubernetes.ContainerInfo, error)
}

func NewPxVolumeOps added in v0.21.3

func NewPxVolumeOps(pxVolOpsInfo *PxVolumeOpsInfo) (PxVolumeOps, error)

type PxVolumeOpsInfo added in v0.21.3

type PxVolumeOpsInfo struct {
	// Px connection data
	PxConnectionData
	// K8S connection data
	kubernetes.KubeConnectionData
	// k8s namespace. Using "" means all namespaces
	Namespace string
	// volumeNames. Using
	VolNames []string
	// node ids
	NodeIds []string
	Labels  map[string]string
}

func (*PxVolumeOpsInfo) Close added in v0.21.3

func (p *PxVolumeOpsInfo) Close()

type ReplicationInfo added in v0.21.3

type ReplicationInfo struct {
	Rsi    []*ReplicationSetInfo
	Status string
}

type ReplicationSetInfo added in v0.21.3

type ReplicationSetInfo struct {
	Id         int
	NodeInfo   []string
	HaIncrease string
	ReAddOn    []string
}

Jump to

Keyboard shortcuts

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