data

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2017 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	// Name of the container specified as a DNS_LABEL.
	// Each container in a pod must have a unique name (DNS_LABEL).
	// Cannot be updated.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
	// Pod volumes to mount into the container's filesystem.
	// Cannot be updated.
	// +optional
	VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"`
}

A single application container that you want to run within a pod.

type GlusterBrick

type GlusterBrick struct {
	Text string `xml:",chardata" json:",omitempty"`
}

type GlusterBricks

type GlusterBricks struct {
	Brick []*GlusterBrick `xml:" brick,omitempty" json:"brick,omitempty"`
}

type GlusterClient

type GlusterClient interface {
	ListVolumes() (*GlusterVolumeInfoCliOutput, error)
	GetQuota(volume string) (*GlusterVolumeQuotaCliOutput, error)
}

type GlusterVolume

type GlusterVolume struct {
	BrickCount   uint           `xml:" brickCount,omitempty" json:"brickCount,omitempty"`
	Bricks       *GlusterBricks `xml:" bricks,omitempty" json:"bricks,omitempty"`
	DistCount    uint           `xml:" distCount,omitempty" json:"distCount,omitempty"`
	Name         string         `xml:" name,omitempty" json:"name,omitempty"`
	ReplicaCount uint           `xml:" replicaCount,omitempty" json:"replicaCount,omitempty"`
}

type GlusterVolumeInfo

type GlusterVolumeInfo struct {
	Volumes *GlusterVolumes `xml:" volumes,omitempty" json:"volumes,omitempty"`
}

type GlusterVolumeInfoCliOutput

type GlusterVolumeInfoCliOutput struct {
	VolumeInfo *GlusterVolumeInfo `xml:" volInfo,omitempty" json:"volInfo,omitempty"`
}

gluster volume info all --xml ==============================================================================

func UnmarshalVolumeData

func UnmarshalVolumeData(raw string) (*GlusterVolumeInfoCliOutput, error)

type GlusterVolumeLimit

type GlusterVolumeLimit struct {
	AvailSpace       float64 `xml:" avail_space,omitempty" json:"avail_space,omitempty"`
	HardLimit        float64 `xml:" hard_limit,omitempty" json:"hard_limit,omitempty"`
	HlExceeded       string  `xml:" hl_exceeded,omitempty" json:"hl_exceeded,omitempty"`
	SlExceeded       string  `xml:" sl_exceeded,omitempty" json:"sl_exceeded,omitempty"`
	SoftLimitPercent string  `xml:" soft_limit_percent,omitempty" json:"soft_limit_percent,omitempty"`
	SoftLimitValue   float64 `xml:" soft_limit_value,omitempty" json:"soft_limit_value,omitempty"`
	UsedSpace        float64 `xml:" used_space,omitempty" json:"used_space,omitempty"`
}

type GlusterVolumeQuota

type GlusterVolumeQuota struct {
	Limit *GlusterVolumeLimit `xml:" limit,omitempty" json:"limit,omitempty"`
}

type GlusterVolumeQuotaCliOutput

type GlusterVolumeQuotaCliOutput struct {
	VolumeQuota *GlusterVolumeQuota `xml:" volQuota,omitempty" json:"volQuota,omitempty"`
}

gluster volume quota $VOLUME list --xml ==============================================================================

func UnmarshalVolumeQuota

func UnmarshalVolumeQuota(raw string) (*GlusterVolumeQuotaCliOutput, error)

type GlusterVolumes

type GlusterVolumes struct {
	Count  uint             `xml:" count,omitempty" json:"count,omitempty"`
	Volume []*GlusterVolume `xml:" volume,omitempty" json:"volume,omitempty"`
}

type KubernetesClient

type KubernetesClient interface {
	PodLister
	PVLister
}

type ListMeta

type ListMeta struct {
	// SelfLink is a URL representing this object.
	// Populated by the system.
	// Read-only.
	// +optional
	SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"`

	// String that identifies the server's internal version of this object that
	// can be used by clients to determine when objects have changed.
	// Value must be treated as opaque by clients and passed unmodified back to the server.
	// Populated by the system.
	// Read-only.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
	// +optional
	ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`
}

ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.

type ObjectMeta

type ObjectMeta struct {
	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	// More info: http://kubernetes.io/docs/user-guide/annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"`

	// Name must be unique within a namespace. Is required when creating resources, although
	// some resources may allow a client to request the generation of an appropriate name
	// automatically. Name is primarily intended for creation idempotence and configuration
	// definition.
	// Cannot be updated.
	// More info: http://kubernetes.io/docs/user-guide/identifiers#names
	// +optional
	Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`

	// Namespace defines the space within each name must be unique. An empty namespace is
	// equivalent to the "default" namespace, but "default" is the canonical representation.
	// Not all objects are required to be scoped to a namespace - the value of this field for
	// those objects will be empty.
	//
	// Must be a DNS_LABEL.
	// Cannot be updated.
	// More info: http://kubernetes.io/docs/user-guide/namespaces
	// +optional
	Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`

	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects. May match selectors of replication controllers
	// and services.
	// More info: http://kubernetes.io/docs/user-guide/labels
	// +optional
	Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`
}

type ObjectReference

type ObjectReference struct {
	// Namespace of the referent.
	// More info: http://kubernetes.io/docs/user-guide/namespaces
	// +optional
	Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
	// Name of the referent.
	// More info: http://kubernetes.io/docs/user-guide/identifiers#names
	// +optional
	Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"`
}

ObjectReference contains enough information to let you inspect or modify the referred object.

type PVLister

type PVLister interface {
	ListPersistentVolumes() (*PersistentVolumeList, error)
}

type PersistentVolume

type PersistentVolume struct {
	TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	// +optional
	ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Spec defines a specification of a persistent volume owned by the cluster.
	// Provisioned by an administrator.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes
	// +optional
	Spec PersistentVolumeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`

	// Status represents the current information/status for the persistent volume.
	// Populated by the system.
	// Read-only.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes
	// +optional
	Status PersistentVolumeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: http://kubernetes.io/docs/user-guide/persistent-volumes

type PersistentVolumeClaimVolumeSource

type PersistentVolumeClaimVolumeSource struct {
	// ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims
	ClaimName string `json:"claimName" protobuf:"bytes,1,opt,name=claimName"`
	// Will force the ReadOnly setting in VolumeMounts.
	// Default false.
	// +optional
	ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"`
}

PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).

type PersistentVolumeList

type PersistentVolumeList struct {
	TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
	// +optional
	ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	// List of persistent volumes.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes
	Items []PersistentVolume `json:"items" protobuf:"bytes,2,rep,name=items"`
}

PersistentVolumeList is a list of PersistentVolume items.

func UnmarshalPVs

func UnmarshalPVs(raw string) (*PersistentVolumeList, error)

type PersistentVolumePhase

type PersistentVolumePhase string

type PersistentVolumeSpec

type PersistentVolumeSpec struct {
	// ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
	// Expected to be non-nil when bound.
	// claim.VolumeName is the authoritative bind between PV and PVC.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#binding
	// +optional
	ClaimRef *ObjectReference `json:"claimRef,omitempty" protobuf:"bytes,4,opt,name=claimRef"`
}

PersistentVolumeSpec is the specification of a persistent volume.

type PersistentVolumeStatus

type PersistentVolumeStatus struct {
	// Phase indicates if a volume is available, bound to a claim, or released by a claim.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#phase
	// +optional
	Phase PersistentVolumePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumePhase"`
}

PersistentVolumeStatus is the current status of a persistent volume.

type Pod

type Pod struct {
	// Standard object's metadata.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	// +optional
	ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	// Specification of the desired behavior of the pod.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
	// +optional
	Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}

type PodList

type PodList struct {
	Items []Pod `json:"items" protobuf:"bytes,2,rep,name=items"`
}

func UnmarshalPods

func UnmarshalPods(raw string) (*PodList, error)

type PodLister

type PodLister interface {
	ListPods() (*PodList, error)
}

type PodSpec

type PodSpec struct {
	// List of volumes that can be mounted by containers belonging to the pod.
	// More info: http://kubernetes.io/docs/user-guide/volumes
	// +optional
	Volumes []Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"`
	// List of containers belonging to the pod.
	// Containers cannot currently be added or removed.
	// There must be at least one container in a Pod.
	// Cannot be updated.
	// More info: http://kubernetes.io/docs/user-guide/containers
	Containers []Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"`
}

PodSpec is a description of a pod.

type RemoteGlusterCLI

type RemoteGlusterCLI struct {
	SSHClient ssh.Client
}

func (RemoteGlusterCLI) GetQuota

GetQuota returns gluster volume quota data using gluster command on the first sotrage node

func (RemoteGlusterCLI) ListVolumes

ListVolumes returns gluster volume data using gluster command on the first sotrage node

type RemoteKubectl

type RemoteKubectl struct {
	SSHClient ssh.Client
}

RemoteKubectl

func (RemoteKubectl) ListPersistentVolumes

func (k RemoteKubectl) ListPersistentVolumes() (*PersistentVolumeList, error)

ListPersistentVolumes returns PersistentVolume data

func (RemoteKubectl) ListPods

func (k RemoteKubectl) ListPods() (*PodList, error)

ListPods returns Pods data with --all-namespaces=true flag

type TypeMeta

type TypeMeta struct {
	// Kind is a string value representing the REST resource this object represents.
	// Servers may infer this from the endpoint the client submits requests to.
	// Cannot be updated.
	// In CamelCase.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
	// +optional
	Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`

	// APIVersion defines the versioned schema of this representation of an object.
	// Servers should convert recognized schemas to the latest internal value, and
	// may reject unrecognized values.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources
	// +optional
	APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
}

TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.

type Volume

type Volume struct {
	// Volume's name.
	// Must be a DNS_LABEL and unique within the pod.
	// More info: http://kubernetes.io/docs/user-guide/identifiers#names
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
	// VolumeSource represents the location and type of the mounted volume.
	// If not specified, the Volume is implied to be an EmptyDir.
	// This implied behavior is deprecated and will be removed in a future version.
	VolumeSource `json:",inline" protobuf:"bytes,2,opt,name=volumeSource"`
}

Volume represents a named volume in a pod that may be accessed by any container in the pod.

type VolumeMount

type VolumeMount struct {
	// This must match the Name of a Volume.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
	// Mounted read-only if true, read-write otherwise (false or unspecified).
	// Defaults to false.
	// +optional
	ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"`
	// Path within the container at which the volume should be mounted.  Must
	// not contain ':'.
	MountPath string `json:"mountPath" protobuf:"bytes,3,opt,name=mountPath"`
	// Path within the volume from which the container's volume should be mounted.
	// Defaults to "" (volume's root).
	// +optional
	SubPath string `json:"subPath,omitempty" protobuf:"bytes,4,opt,name=subPath"`
}

VolumeMount describes a mounting of a Volume within a container.

type VolumeSource

type VolumeSource struct {
	// PersistentVolumeClaimVolumeSource represents a reference to a
	// PersistentVolumeClaim in the same namespace.
	// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims
	// +optional
	PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" protobuf:"bytes,10,opt,name=persistentVolumeClaim"`
}

Represents the source of a volume to mount. Only one of its members may be specified.

Jump to

Keyboard shortcuts

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