Documentation ¶
Overview ¶
Package v1 is extracted from k8s.io/apimachinery/pkg/api/resource/math.go
Package v1 extracted from k8s.io/apimachinery/pkg/apis/meta/v1/types.go
This is extracted from k8s.io/apimachinery/pkg/api/resource/quantity.go
Package v1 is extracted from k8s.io/apimachinery/pkg/api/resource/suffix.go
Package v1 - Description provided at doc.go ¶
NOTE:
There are references to Kubernetes (K8s) types & links. This reflects the
similarity of OpenEBS design principles with K8s. These may not be a one-to-one mapping though.
We have not imported the K8s namespaces as-is, as OpenEBS will change
these to suit its requirements.
NOTE:
A volume in OpenEBS has the same design as a pod in K8s. Alternatively,
a volume in OpenEBS can be considered as a StoragePod.
Index ¶
- Constants
- Variables
- func DivideFloat64(value float64, base float64) (float64, bool)
- func DivideInt64(value int64, base int64) (int64, bool)
- func NewQuantityFlagValue(q *Quantity) flag.Value
- func SubstractFloat64(a float64, b float64) (float64, bool)
- func SubstractInt64(a int64, b int64) (int64, bool)
- type Annotation
- type CanonicalValue
- type CauseType
- type Format
- type Initializer
- type Initializers
- type K8sKind
- type K8sVolumeLabels
- type LabelSelector
- type LabelSelectorOperator
- type LabelSelectorRequirement
- type Labels
- type ListMeta
- type ObjectFieldSelector
- type ObjectMeta
- type ObjectReference
- type OldVolumeLabels
- type OpenEBS
- type OrchProvider
- type OwnerReference
- type Quantity
- func MustParse(str string) Quantity
- func NewMilliQuantity(value int64, format Format) *Quantity
- func NewQuantity(value int64, format Format) *Quantity
- func NewScaledQuantity(value int64, scale Scale) *Quantity
- func ParseQuantity(str string) (Quantity, error)
- func QuantityFlag(flagName, defaultValue, description string) *Quantity
- func (q *Quantity) Add(y Quantity)
- func (q *Quantity) AsCanonicalBytes(out []byte) (result []byte, exponent int32)
- func (q *Quantity) AsDec() *inf.Dec
- func (q *Quantity) AsInt64() (int64, bool)
- func (q *Quantity) AsScale(scale Scale) (CanonicalValue, bool)
- func (q *Quantity) CanonicalizeBytes(out []byte) (result, suffix []byte)
- func (q *Quantity) Cmp(y Quantity) int
- func (q *Quantity) CmpInt64(y int64) int
- func (q *Quantity) Copy() *Quantity
- func (q Quantity) DeepCopy() Quantity
- func (q *Quantity) IsZero() bool
- func (q Quantity) MarshalJSON() ([]byte, error)
- func (q *Quantity) MilliValue() int64
- func (q *Quantity) Neg()
- func (q *Quantity) RoundUp(scale Scale) bool
- func (q *Quantity) ScaledValue(scale Scale) int64
- func (q *Quantity) Set(value int64)
- func (q *Quantity) SetMilli(value int64)
- func (q *Quantity) SetScaled(value int64, scale Scale)
- func (q *Quantity) Sign() int
- func (q *Quantity) String() string
- func (q *Quantity) Sub(y Quantity)
- func (q *Quantity) ToDec() *Quantity
- func (q *Quantity) UnmarshalJSON(value []byte) error
- func (q *Quantity) Value() int64
- type Replica
- type ReplicaMode
- type Resource
- type ResourceList
- type ResourceName
- type ResourceRequirements
- type Scale
- type SnapshotAPISpec
- type Status
- type StatusCause
- type StatusDetails
- type StatusReason
- type Time
- func (t Time) Before(u Time) bool
- func (t Time) DeepCopy() Time
- func (t Time) Equal(u Time) bool
- func (t *Time) Fuzz(c fuzz.Continue)
- func (t *Time) IsZero() bool
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) MarshalQueryParameter() (string, error)
- func (t Time) Rfc3339Copy() Time
- func (t Time) String() string
- func (t *Time) UnmarshalJSON(b []byte) error
- func (t *Time) UnmarshalQueryParameter(str string) error
- type TypeMeta
- type VolStatus
- type Volume
- type VolumeAPISpec
- type VolumeAccessMode
- type VolumeClone
- type VolumeContext
- type VolumeKey
- type VolumeLabels
- type VolumeList
- type VolumeMetrics
- type VolumePhase
- type VolumeSnapshot
- type VolumeSnapshotCondition
- type VolumeSnapshotConditionType
- type VolumeSnapshotList
- type VolumeSnapshotSpec
- type VolumeSnapshotStatus
- type VolumeSource
- type VolumeSpec
- type VolumeStats
- type VolumeStatus
- type VolumeType
- type VolumeValue
Constants ¶
const ( // BytesToGB used to convert bytes to GB BytesToGB = 1073741824 // BytesToMB used to convert bytes to MB BytesToMB = 1048567 // BytesToKB used to convert bytes to KB BytesToKB = 1024 // MicSec used to convert to microsec to second MicSec = 1000000 // MinWidth used in tabwriter MinWidth = 0 // MaxWidth used in tabwriter MaxWidth = 0 // Padding used in tabwriter Padding = 4 // ControllerPort : Jiva volume controller listens on this for various api // requests. ControllerPort string = ":9501" // InfoAPI is the api for getting the volume access modes. InfoAPI string = "/replicas" // ReplicaPort : Jiva volume replica listens on this for various api // requests ReplicaPort string = ":9502" // StatsAPI is api to query about the volume stats from both replica and // controller. StatsAPI string = "/stats" )
const ( DecimalExponent = Format("DecimalExponent") // e.g., 12e6 BinarySI = Format("BinarySI") // e.g., 12Mi (12 * 2^20) DecimalSI = Format("DecimalSI") // e.g., 12M (12 * 10^6) )
The possible quantity formattings.
Variables ¶
var ( ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'") ErrNumeric = errors.New("unable to parse numeric part of quantity") ErrSuffix = errors.New("unable to parse quantity's suffix") )
Errors that could happen while parsing a string.
var ( // MaxMilliValue represents the maximum value we can represent milli-units for. // Compare with the return value of Quantity.Value() to // see if it's safe to use Quantity.MilliValue(). MaxMilliValue = int64(((1 << 63) - 1) / 1000) )
var (
// Zero is an empty int64Amount
Zero = int64Amount{}
)
Functions ¶
func DivideFloat64 ¶
DivideFloat64 returns the value of value divided by base. divide by zero case handled before calling.
func DivideInt64 ¶
DivideInt64 returns the value of value divided by base. divide by zero case handled before calling.
func NewQuantityFlagValue ¶
NewQuantityFlagValue returns an object that can be used to back a flag, pointing at the given Quantity variable.
func SubstractFloat64 ¶
SubstractFloat64 returns a - b , where a > b.
Types ¶
type Annotation ¶
type Annotation struct { IQN string `json:"Iqn"` Volume string `json:"Volume"` Portal string `json:"Portal"` Size string `json:"Size"` }
Annotation stores information about an iSCSI volume.
type CanonicalValue ¶
type CanonicalValue interface { // AsCanonicalBytes returns a byte array representing the string representation // of the value mantissa and an int32 representing its exponent in base-10. Callers may // pass a byte slice to the method to avoid allocations. AsCanonicalBytes(out []byte) ([]byte, int32) // AsCanonicalBase1024Bytes returns a byte array representing the string representation // of the value mantissa and an int32 representing its exponent in base-1024. Callers // may pass a byte slice to the method to avoid allocations. AsCanonicalBase1024Bytes(out []byte) ([]byte, int32) }
CanonicalValue allows a quantity amount to be converted to a string.
type CauseType ¶
type CauseType string
CauseType is a machine readable value providing more detail about what occurred in a status response. An operation may have multiple causes for a status (whether Failure or Success).
const ( // CauseTypeFieldValueNotFound is used to report failure to find a requested value // (e.g. looking up an ID). CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound" // CauseTypeFieldValueRequired is used to report required values that are not // provided (e.g. empty strings, null values, or empty arrays). CauseTypeFieldValueRequired CauseType = "FieldValueRequired" // CauseTypeFieldValueDuplicate is used to report collisions of values that must be // unique (e.g. unique IDs). CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate" // CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex // match). CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid" // CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules) // values that can not be handled (e.g. an enumerated string). CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported" // CauseTypeUnexpectedServerResponse is used to report when the server responded to the client // without the expected return type. The presence of this cause indicates the error may be // due to an intervening proxy or the server software malfunctioning. CauseTypeUnexpectedServerResponse CauseType = "UnexpectedServerResponse" )
type Initializer ¶
type Initializer struct { // name of the process that is responsible for initializing this object. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` }
Initializer is information about an initializer that has not yet completed.
type Initializers ¶
type Initializers struct { // Pending is a list of initializers that must execute in order before this object is visible. // When the last pending initializer is removed, and no failing result is set, the initializers // struct will be set to nil and the object is considered as initialized and visible to all // clients. Pending []Initializer `json:"pending" protobuf:"bytes,1,rep,name=pending"` // If result is set with the Failure field, the object will be persisted to storage and then deleted, // ensuring that other clients can observe the deletion. Result *Status `json:"result,omitempty" protobuf:"bytes,2,opt,name=result"` }
Initializers tracks the progress of initialization.
type K8sKind ¶
type K8sKind string
K8sKind defines the various K8s Kinds that are understood by Maya
const ( // DeploymentKK is a K8s Deployment Kind. DeploymentKK K8sKind = "deployment" )
type K8sVolumeLabels ¶
type K8sVolumeLabels struct { // K8sStorageClassEnabled flags if fetching policy from K8s storage // class is enabled. A value of true implies fetching of volume // policies from K8s storage class must be undertaken. // // NOTE: // This is an optional setting K8sStorageClassEnabled bool `json:"k8s.io/storage-class-enabled,omitempty" protobuf:"varint,4,opt,name=k8s.io/storage-class-enabled"` // K8sStorageClass contains the name of the K8s storage class // which will be used during volume operations. A K8s storage // class will typically have various volume policies set in it. K8sStorageClass string `json:"k8s.io/storage-class,omitempty" protobuf:"bytes,1,opt,name=k8s.io/storage-class"` // K8sOutCluster contains the external K8s cluster information // where the volume operations will be executed K8sOutCluster string `json:"k8s.io/out-cluster,omitempty" protobuf:"bytes,1,opt,name=k8s.io/out-cluster"` // K8sNamespace contains the K8s namespace where volume operations // will be executed K8sNamespace string `json:"k8s.io/namespace,omitempty" protobuf:"bytes,1,opt,name=k8s.io/namespace"` // K8sPersistentVolumeClaim is the pvc used to create this volume K8sPersistentVolumeClaim string `json:"k8s.io/pvc,omitempty" protobuf:"bytes,1,opt,name=k8s.io/pvc"` }
K8sVolumeLabels is a typed structure that consists of various K8s related info. These are typically used during the **registration** phase of volume provisioning (using K8s as its orchestration provider).
type LabelSelector ¶
type LabelSelector struct { // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels // map is equivalent to an element of matchExpressions, whose key field is "key", the // operator is "In", and the values array contains only "value". The requirements are ANDed. // +optional MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"` // matchExpressions is a list of label selector requirements. The requirements are ANDed. // +optional MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"` }
LabelSelector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
type LabelSelectorOperator ¶
type LabelSelectorOperator string
LabelSelectorOperator is the set of operators that can be used in a selector requirement.
const ( // LabelSelectorOpIn : LabelSelectorOperator for In LabelSelectorOpIn LabelSelectorOperator = "In" // LabelSelectorOpNotIn : LabelSelectorOperator for NotIn LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" // LabelSelectorOpExists : LabelSelectorOperator for Exists LabelSelectorOpExists LabelSelectorOperator = "Exists" // LabelSelectorOpDoesNotExist : LabelSelectorOperator for DoesNotExist LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" )
type LabelSelectorRequirement ¶
type LabelSelectorRequirement struct { // key is the label key that the selector applies to. // +patchMergeKey=key // +patchStrategy=merge Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` // operator represents a key's relationship to a set of values. // Valid operators ard In, NotIn, Exists and DoesNotExist. Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"` // values is an array of string values. If the operator is In or NotIn, // the values array must be non-empty. If the operator is Exists or DoesNotExist, // the values array must be empty. This array is replaced during a strategic // merge patch. // +optional Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` }
LabelSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.
type Labels ¶
type Labels struct { // OldVolumeLabels contains all the volume policy keys that ensures // backward compatibility OldVolumeLabels // K8sVolumeLabels contains all the K8s related volume policy keys K8sVolumeLabels // VolumeLabels contains all the volume policy keys VolumeLabels }
Labels are key/value pairs related to k8s objects identifying unique, relevant attributes attached to such objects
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: https://git.k8s.io/community/contributors/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 ObjectFieldSelector ¶
type ObjectFieldSelector struct { // Version of the schema the FieldPath is written in terms of, defaults to "v1". // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"` // Path of the field to select in the specified API version. FieldPath string `json:"fieldPath" protobuf:"bytes,2,opt,name=fieldPath"` }
ObjectFieldSelector selects an APIVersioned field of an object.
type ObjectMeta ¶
type ObjectMeta struct { // 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"` // GenerateName is an optional prefix, used by the server, to generate a unique // name ONLY IF the Name field has not been provided. // If this field is used, the name returned to the client will be different // than the name passed. This value will also be combined with a unique suffix. // The provided value has the same validation rules as the Name field, // and may be truncated by the length of the suffix required to make the value // unique on the server. // // If this field is specified and the generated name exists, the server will // NOT return a 409 - instead, it will either return 201 Created or 500 with Reason // ServerTimeout indicating a unique name could not be found in the time allotted, and the client // should retry (optionally after the time indicated in the Retry-After header). // // Applied only if Name is not specified. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency // +optional GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` // 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"` // SelfLink is a URL representing this object. // Populated by the system. // Read-only. // +optional SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,4,opt,name=selfLink"` // UID is the unique in time and space value for this object. It is typically generated by // the server on successful creation of a resource and is not allowed to change on PUT // operations. // // Populated by the system. // Read-only. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids // +optional UID string `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid"` // An opaque value that represents the internal version of this object that can // be used by clients to determine when objects have changed. May be used for optimistic // concurrency, change detection, and the watch operation on a resource or set of resources. // Clients must treat these values as opaque and passed unmodified back to the server. // They may only be valid for a particular resource or set of resources. // // Populated by the system. // Read-only. // Value must be treated as opaque by clients and . // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency // +optional ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` // A sequence number representing a specific generation of the desired state. // Populated by the system. Read-only. // +optional Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"` // CreationTimestamp is a timestamp representing the server time when this object was // created. It is not guaranteed to be set in happens-before order across separate operations. // Clients may not set this value. It is represented in RFC3339 form and is in UTC. // // Populated by the system. // Read-only. // Null for lists. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional CreationTimestamp Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"` // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This // field is set by the server when a graceful deletion is requested by the user, and is not // directly settable by a client. The resource is expected to be deleted (no longer visible // from resource lists, and not reachable by name) after the time in this field. Once set, // this value may not be unset or be set further into the future, although it may be shortened // or the resource may be deleted prior to this time. For example, a user may request that // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination // signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard // termination signal (SIGKILL) to the container and after cleanup, remove the pod from the // API. In the presence of network partitions, this object may still exist after this // timestamp, until an administrator or automated process can determine the resource is // fully terminated. // If not set, graceful deletion of the object has not been requested. // // Populated by the system when a graceful deletion is requested. // Read-only. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional DeletionTimestamp *Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"` // Number of seconds allowed for this object to gracefully terminate before // it will be removed from the system. Only set when deletionTimestamp is also set. // May only be shortened. // Read-only. // +optional DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"` // 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"` Labels Labels `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` // 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"` // List of objects depended by this object. If ALL objects in the list have // been deleted, this object will be garbage collected. If this object is managed by a controller, // then an entry in this list will point to this controller, with the controller field set to true. // There cannot be more than one managing controller. // +optional // +patchMergeKey=uid // +patchStrategy=merge OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` // An initializer is a controller which enforces some system invariant at object creation time. // This field is a list of initializers that have not yet acted on this object. If nil or empty, // this object has been completely initialized. Otherwise, the object is considered uninitialized // and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to // observe uninitialized objects. // // When an object is created, the system will populate this list with the current set of initializers. // Only privileged users may set or modify this list. Once it is empty, it may not be modified further // by any user. Initializers *Initializers `json:"initializers,omitempty" protobuf:"bytes,16,opt,name=initializers"` // Must be empty before the object is deleted from the registry. Each entry // is an identifier for the responsible component that will remove the entry // from the list. If the deletionTimestamp of the object is non-nil, entries // in this list can only be removed. // +optional // +patchStrategy=merge Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"` // The name of the cluster which the object belongs to. // This is used to distinguish resources with same name and namespace in different clusters. // This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. // +optional ClusterName string `json:"clusterName,omitempty" protobuf:"bytes,15,opt,name=clusterName"` }
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
type ObjectReference ¶
type ObjectReference struct { // +optional Kind string // +optional Namespace string // +optional Name string // +optional UID string // +optional APIVersion string // +optional ResourceVersion string // Optional. If referring to a piece of an object instead of an entire object, this string // should contain information to identify the sub-object. For example, if the object // reference is to a container within a pod, this would take on a value like: // "spec.containers{name}" (where "name" refers to the name of the container that triggered // the event) or if no container name is specified "spec.containers[2]" (container with // index 2 in this pod). This syntax is chosen only to have some well-defined way of // referencing a part of an object. // TODO: this design is not final and this field is subject to change in the future. // +optional FieldPath string }
ObjectReference contains enough information to let you inspect or modify the referred object.
type OldVolumeLabels ¶
type OldVolumeLabels struct { // CapacityOld contains the volume capacity value CapacityOld string `` /* 138-byte string literal not displayed */ // ReplicaImageOld contains the jiva replica image ReplicaImageOld string `` /* 140-byte string literal not displayed */ // ControllerImageOld contains the jiva controller image ControllerImageOld string `` /* 146-byte string literal not displayed */ // ReplicasOld contains the replica count // + optional ReplicasOld *int32 `` /* 141-byte string literal not displayed */ // ControllersOld contains the controller count ControllersOld *int32 `` /* 147-byte string literal not displayed */ // ApplicationOld contains the application label associated with volume ApplicationOld string `` /* 136-byte string literal not displayed */ // ReplicaTopologyKeyDomainOld contains the domain that needs to be specified for Replica Deployment PodAntiAffinity Topology Key ReplicaTopologyKeyDomainOld string `` /* 168-byte string literal not displayed */ // ReplicaTopologyKeyTypeOld contains the type that needs to be specified for Replica Deployment PodAntiAffinity Topology Key ReplicaTopologyKeyTypeOld string `` /* 164-byte string literal not displayed */ }
OldVolumeLabels is a set of labels set against the volume structure This is specifically for backward compatibility
type OpenEBS ¶
type OpenEBS struct { // Unique ID of the persistent disk resource in OpenEBS. // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` // Filesystem type of the volume that you want to mount. // Tip: Ensure that the filesystem type is supported by the host operating system. // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore // TODO: how do we prevent errors in the filesystem from compromising the machine // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` // The partition in the volume that you want to mount. // If omitted, the default is to mount by volume name. // Examples: For volume /dev/sda1, you specify the partition as "1". // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). // +optional Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". // If omitted, the default is "false". // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` }
OpenEBS - Represents a Persistent Disk resource in OpenEBS.
An OpenEBS disk must exist before mounting to a container. An OpenEBS disk can only be mounted as read/write once. OpenEBS volumes support ownership management and SELinux relabeling.
type OrchProvider ¶
type OrchProvider string
OrchProvider defines the container orchestrators that will orchestrate the OpenEBS volumes
const ( // K8sOrchProvider represents Kubernetes orchestrator K8sOrchProvider OrchProvider = "kubernetes" )
type OwnerReference ¶
type OwnerReference struct { // API version of the referent. APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // Name of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#names Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // UID of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids UID string `json:"uid" protobuf:"bytes,4,opt,name=uid"` // If true, this reference points to the managing controller. // +optional Controller *bool `json:"controller,omitempty" protobuf:"varint,6,opt,name=controller"` // If true, AND if the owner has the "foregroundDeletion" finalizer, then // the owner cannot be deleted from the key-value store until this // reference is removed. // Defaults to false. // To set this field, a user needs "delete" permission of the owner, // otherwise 422 (Unprocessable Entity) will be returned. // +optional BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"` }
OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.
type Quantity ¶
type Quantity struct { // Change Format at will. See the comment for Canonicalize for // more details. Format // contains filtered or unexported fields }
Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and Int64() accessors.
The serialization format is:
<quantity> ::= <signedNumber><suffix>
(Note that <suffix> may be empty, from the "" case in <decimalSI>.)
<digit> ::= 0 | 1 | ... | 9 <digits> ::= <digit> | <digit><digits> <number> ::= <digits> | <digits>.<digits> | <digits>. | .<digits> <sign> ::= "+" | "-" <signedNumber> ::= <number> | <sign><number> <suffix> ::= <binarySI> | <decimalExponent> | <decimalSI> <binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei
(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)
<decimalSI> ::= m | "" | k | M | G | T | P | E
(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)
<decimalExponent> ::= "e" <signedNumber> | "E" <signedNumber>
No matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.
When a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.
Before serializing, Quantity will be put in "canonical form". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:
a. No precision is lost b. No fractional digits will be emitted c. The exponent (or suffix) is as large as possible.
The sign will be omitted unless the number is negative.
Examples:
1.5 will be serialized as "1500m" 1.5Gi will be serialized as "1536Mi"
NOTE: We reserve the right to amend this canonical format, perhaps to
allow 1.5 to be canonical.
TODO: Remove above disclaimer after all bikeshedding about format is over,
or after March 2015.
Note that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.
Non-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)
This format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.
+protobuf=true +protobuf.embed=string +protobuf.options.marshal=false +protobuf.options.(gogoproto.goproto_stringer)=false +k8s:openapi-gen=true
func MustParse ¶
MustParse turns the given string into a quantity or panics; for tests or others cases where you know the string is valid.
func NewMilliQuantity ¶
NewMilliQuantity returns a new Quantity representing the given value * 1/1000 in the given format. Note that BinarySI formatting will round fractional values, and will be changed to DecimalSI for values x where (-1 < x < 1) && (x != 0).
func NewQuantity ¶
NewQuantity returns a new Quantity representing the given value in the given format.
func NewScaledQuantity ¶
NewScaledQuantity returns a new Quantity representing the given value * 10^scale in DecimalSI format.
func ParseQuantity ¶
ParseQuantity turns str into a Quantity, or returns an error.
func QuantityFlag ¶
QuantityFlag is a helper that makes a quantity flag (using standard flag package). Will panic if defaultValue is not a valid quantity.
func (*Quantity) Add ¶
Add adds the provide y quantity to the current value. If the current value is zero, the format of the quantity will be updated to the format of y.
func (*Quantity) AsCanonicalBytes ¶
AsCanonicalBytes returns the canonical byte representation of this quantity as a mantissa and base 10 exponent. The out byte slice may be passed to the method to avoid an extra allocation.
func (*Quantity) AsInt64 ¶
AsInt64 returns a representation of the current value as an int64 if a fast conversion is possible. If false is returned, callers must use the inf.Dec form of this quantity.
func (*Quantity) AsScale ¶
func (q *Quantity) AsScale(scale Scale) (CanonicalValue, bool)
AsScale returns the current value, rounded up to the provided scale, and returns false if the scale resulted in a loss of precision.
func (*Quantity) CanonicalizeBytes ¶
CanonicalizeBytes returns the canonical form of q and its suffix (see comment on Quantity).
Note about BinarySI:
- If q.Format is set to BinarySI and q.Amount represents a non-zero value between -1 and +1, it will be emitted as if q.Format were DecimalSI.
- Otherwise, if q.Format is set to BinarySI, frational parts of q.Amount will be rounded up. (1.1i becomes 2i.)
func (*Quantity) Cmp ¶
Cmp returns 0 if the quantity is equal to y, -1 if the quantity is less than y, or 1 if the quantity is greater than y.
func (*Quantity) CmpInt64 ¶
CmpInt64 returns 0 if the quantity is equal to y, -1 if the quantity is less than y, or 1 if the quantity is greater than y.
func (*Quantity) Copy ¶
Copy is a convenience function that makes a deep copy for you. Non-deep copies of quantities share pointers and you will regret that.
func (Quantity) DeepCopy ¶
DeepCopy returns a deep-copy of the Quantity value. Note that the method receiver is a value, so we can mutate it in-place and return it.
func (Quantity) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (*Quantity) MilliValue ¶
MilliValue returns the value of ceil(q * 1000); this could overflow an int64; if that's a concern, call Value() first to verify the number is small enough.
func (*Quantity) Neg ¶
func (q *Quantity) Neg()
Neg sets quantity to be the negative value of itself.
func (*Quantity) RoundUp ¶
RoundUp updates the quantity to the provided scale, ensuring that the value is at least 1. False is returned if the rounding operation resulted in a loss of precision. Negative numbers are rounded away from zero (-9 scale 1 rounds to -10).
func (*Quantity) ScaledValue ¶
ScaledValue returns the value of ceil(q * 10^scale); this could overflow an int64. To detect overflow, call Value() first and verify the expected magnitude.
func (*Quantity) Sign ¶
Sign returns 0 if the quantity is zero, -1 if the quantity is less than zero, or 1 if the quantity is greater than zero.
func (*Quantity) String ¶
String formats the Quantity as a string, caching the result if not calculated. String is an expensive operation and caching this result significantly reduces the cost of normal parse / marshal operations on Quantity.
func (*Quantity) Sub ¶
Sub subtracts the provided quantity from the current value in place. If the current value is zero, the format of the quantity will be updated to the format of y.
func (*Quantity) ToDec ¶
ToDec promotes the quantity in place to use an inf.Dec representation and returns itself.
func (*Quantity) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface. TODO: Remove support for leading/trailing whitespace
type Replica ¶
type Replica struct { // Address is the address of the replica Address string `json:"Address"` // Mode is the mode of replica. Mode ReplicaMode `json:"Mode"` }
Replica is used to store the info about the replicas connected to the target.
type ReplicaMode ¶
type ReplicaMode string
ReplicaMode is the mode of replica.In jiva it can be either RO or RW and HEALTHY or DEGRADED for cstor respectively
type Resource ¶
type Resource struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` Links map[string]string `json:"links"` Actions map[string]string `json:"actions"` }
Resource stores information about a resources.
type ResourceList ¶
type ResourceList map[ResourceName]Quantity
ResourceList is a set of (resource name, quantity) pairs.
type ResourceName ¶
type ResourceName string
ResourceName is the name identifying various resources in a ResourceList.
type ResourceRequirements ¶
type ResourceRequirements struct { // Limits describes the maximum amount of compute resources allowed. // +optional Limits ResourceList // Requests describes the minimum amount of compute resources required. // If Request is omitted for a container, it defaults to Limits if that is explicitly specified, // otherwise to an implementation-defined value // +optional Requests ResourceList }
ResourceRequirements describes the compute resource requirements.
type Scale ¶
type Scale int32
Scale is used for getting and setting the base-10 scaled value. Base-2 scales are omitted for mathematical simplicity. See Quantity.ScaledValue for more details.
const ( // Nano is 10^-9 Nano Scale = -9 // Micro is 10^-6 Micro Scale = -6 // Milli is 10^-3 Milli Scale = -3 // Kilo is 10^3 Kilo Scale = 3 // Mega is 10^6 Mega Scale = 6 // Giga is 10^9 Giga Scale = 9 // Tera is 10^12 Tera Scale = 12 // Peta is 10^15 Peta Scale = 15 // Exa is 10^18 Exa Scale = 18 )
type SnapshotAPISpec ¶
type SnapshotAPISpec struct { Kind string `yaml:"kind"` APIVersion string `yaml:"apiVersion"` Metadata struct { Name string `yaml:"name"` } `yaml:"metadata"` Spec struct { VolumeName string `yaml:"volumeName"` } `yaml:"spec"` }
SnapshotAPISpec hsolds the config for creating asnapshot of volume
type Status ¶
type Status struct { TypeMeta `json:",inline"` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds // +optional ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Status of the operation. // One of: "Success" or "Failure". // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status // +optional Status string `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // A human-readable description of the status of this operation. // +optional Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` // A machine-readable description of why this operation is in the // "Failure" status. If this value is empty there // is no information available. A Reason clarifies an HTTP status // code but does not override it. // +optional Reason StatusReason `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason,casttype=StatusReason"` // Extended data associated with the reason. Each reason may define its // own extended details. This field is optional and the data returned // is not guaranteed to conform to any schema except that defined by // the reason type. // +optional Details *StatusDetails `json:"details,omitempty" protobuf:"bytes,5,opt,name=details"` // Suggested HTTP return code for this status, 0 if not set. // +optional Code int32 `json:"code,omitempty" protobuf:"varint,6,opt,name=code"` }
Status is a return value for calls that don't return other objects.
type StatusCause ¶
type StatusCause struct { // A machine-readable description of the cause of the error. If this value is // empty there is no information available. // +optional Type CauseType `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason,casttype=CauseType"` // A human-readable description of the cause of the error. This field may be // presented as-is to a reader. // +optional Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` // The field of the resource that has caused this error, as named by its JSON // serialization. May include dot and postfix notation for nested attributes. // Arrays are zero-indexed. Fields may appear more than once in an array of // causes due to fields having multiple errors. // Optional. // // Examples: // "name" - the field "name" on the current resource // "items[0].name" - the field "name" on the first array entry in "items" // +optional Field string `json:"field,omitempty" protobuf:"bytes,3,opt,name=field"` }
StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.
type StatusDetails ¶
type StatusDetails struct { // The name attribute of the resource associated with the status StatusReason // (when there is a single name which can be described). // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // The group attribute of the resource associated with the status StatusReason. // +optional Group string `json:"group,omitempty" protobuf:"bytes,2,opt,name=group"` // The kind attribute of the resource associated with the status StatusReason. // On some operations may differ from the requested resource Kind. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds // +optional Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"` // UID of the resource. // (when there is a single resource which can be described). // More info: http://kubernetes.io/docs/user-guide/identifiers#uids // +optional UID string `json:"uid,omitempty" protobuf:"bytes,6,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` // The Causes array includes more details associated with the StatusReason // failure. Not all StatusReasons may provide detailed causes. // +optional Causes []StatusCause `json:"causes,omitempty" protobuf:"bytes,4,rep,name=causes"` // If specified, the time in seconds before the operation should be retried. // +optional RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty" protobuf:"varint,5,opt,name=retryAfterSeconds"` }
StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.
type StatusReason ¶
type StatusReason string
StatusReason is an enumeration of possible failure causes. Each StatusReason must map to a single HTTP status code, but multiple reasons may map to the same HTTP status code. TODO: move to apiserver
const ( // StatusReasonUnknown means the server has declined to indicate a specific reason. // The details field may contain other information about this error. // Status code 500. StatusReasonUnknown StatusReason = "" // the user to present appropriate authorization credentials (identified by the WWW-Authenticate header) // in order for the action to be completed. If the user has specified credentials on the request, the // server considers them insufficient. // Status code 401 StatusReasonUnauthorized StatusReason = "Unauthorized" // StatusReasonForbidden means the server can be reached and understood the request, but refuses // to take any further action. It is the result of the server being configured to deny access for some reason // to the requested resource by the client. // Details (optional): // "kind" string - the kind attribute of the forbidden resource // on some operations may differ from the requested // resource. // "id" string - the identifier of the forbidden resource // Status code 403 StatusReasonForbidden StatusReason = "Forbidden" // StatusReasonNotFound means one or more resources required for this operation // could not be found. // Details (optional): // "kind" string - the kind attribute of the missing resource // on some operations may differ from the requested // resource. // "id" string - the identifier of the missing resource // Status code 404 StatusReasonNotFound StatusReason = "NotFound" // StatusReasonAlreadyExists means the resource you are creating already exists. // Details (optional): // "kind" string - the kind attribute of the conflicting resource // "id" string - the identifier of the conflicting resource // Status code 409 StatusReasonAlreadyExists StatusReason = "AlreadyExists" // StatusReasonConflict means the requested operation cannot be completed // due to a conflict in the operation. The client may need to alter the // request. Each resource may define custom details that indicate the // nature of the conflict. // Status code 409 StatusReasonConflict StatusReason = "Conflict" // StatusReasonGone means the item is no longer available at the server and no // forwarding address is known. // Status code 410 StatusReasonGone StatusReason = "Gone" // StatusReasonInvalid means the requested create or update operation cannot be // completed due to invalid data provided as part of the request. The client may // need to alter the request. When set, the client may use the StatusDetails // message field as a summary of the issues encountered. // Details (optional): // "kind" string - the kind attribute of the invalid resource // "id" string - the identifier of the invalid resource // "causes" - one or more StatusCause entries indicating the data in the // provided resource that was invalid. The code, message, and // field attributes will be set. // Status code 422 StatusReasonInvalid StatusReason = "Invalid" // StatusReasonServerTimeout means the server can be reached and understood the request, // but cannot complete the action in a reasonable time. The client should retry the request. // This is may be due to temporary server load or a transient communication issue with // another server. Status code 500 is used because the HTTP spec provides no suitable // server-requested client retry and the 5xx class represents actionable errors. // Details (optional): // "kind" string - the kind attribute of the resource being acted on. // "id" string - the operation that is being attempted. // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried // Status code 500 StatusReasonServerTimeout StatusReason = "ServerTimeout" // StatusReasonTimeout means that the request could not be completed within the given time. // Clients can get this response only when they specified a timeout param in the request, // or if the server cannot complete the operation within a reasonable amount of time. // The request might succeed with an increased value of timeout param. The client *should* // wait at least the number of seconds specified by the retryAfterSeconds field. // Details (optional): // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried // Status code 504 StatusReasonTimeout StatusReason = "Timeout" // StatusReasonBadRequest means that the request itself was invalid, because the request // doesn't make any sense, for example deleting a read-only object. This is different than // StatusReasonInvalid above which indicates that the API call could possibly succeed, but the // data was invalid. API calls that return BadRequest can never succeed. StatusReasonBadRequest StatusReason = "BadRequest" // StatusReasonMethodNotAllowed means that the action the client attempted to perform on the // resource was not supported by the code - for instance, attempting to delete a resource that // can only be created. API calls that return MethodNotAllowed can never succeed. StatusReasonMethodNotAllowed StatusReason = "MethodNotAllowed" // StatusReasonInternalError indicates that an internal error occurred, it is unexpected // and the outcome of the call is unknown. // Details (optional): // "causes" - The original error // Status code 500 StatusReasonInternalError StatusReason = "InternalError" // StatusReasonExpired indicates that the request is invalid because the content you are requesting // has expired and is no longer available. It is typically associated with watches that can't be // serviced. // Status code 410 (gone) StatusReasonExpired StatusReason = "Expired" // but the requested service is unavailable at this time. // Retrying the request after some time might succeed. // Status code 503 StatusReasonServiceUnavailable StatusReason = "ServiceUnavailable" )
type Time ¶
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
+protobuf.options.marshal=false +protobuf.as=Timestamp +protobuf.options.(gogoproto.goproto_stringer)=false
func (Time) DeepCopy ¶
DeepCopy returns a deep-copy of the Time value. The underlying time.Time type is effectively immutable in the time API, so it is safe to copy-by-assign, despite the presence of (unexported) Pointer fields.
func (Time) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (Time) MarshalQueryParameter ¶
MarshalQueryParameter converts to a URL query parameter value
func (Time) Rfc3339Copy ¶
Rfc3339Copy returns a copy of the Time at second-level precision.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
func (*Time) UnmarshalQueryParameter ¶
UnmarshalQueryParameter converts from a URL query parameter value to an object
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: https://git.k8s.io/community/contributors/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: https://git.k8s.io/community/contributors/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 VolStatus ¶
type VolStatus struct { Resource Resource ReplicaCounter int64 `json:"replicacounter"` RevisionCounter string `json:"revisioncounter"` }
VolStatus stores the status of a volume.
type Volume ¶
type Volume struct { TypeMeta `json:",inline"` // Standard object's metadata ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // VolumeType holds the type of this volume // e.g. Jiva volume type or CStor volume type, etc VolumeType VolumeType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=VolumeType"` // OrchProvider holds the container orchestrator that will // orchestrate OpenEBS volume for its provisioning & other // requirements OrchProvider OrchProvider `json:"orchestrator,omitempty" protobuf:"bytes,1,opt,name=orchestrator,casttype=OrchProvider"` // Namespace will hold the namespace where this Volume will exist Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"` // Capacity will hold the capacity of this Volume Capacity string `json:"capacity,omitempty" protobuf:"bytes,1,opt,name=capacity"` // StoragePool is the name of the StoragePool where this volume // data will be stored. StoragePool will have the necessary storage // related properties. // +optional StoragePool string `json:"storagepool,omitempty" protobuf:"bytes,1,opt,name=storagepool"` // HostPath is directory where this volume data will be stored. // +optional HostPath string `json:"hostpath,omitempty" protobuf:"bytes,1,opt,name=hostpath"` // Monitor flags as well provides values for monitoring the volume // e.g. a value of: // - `false` or empty value indicates monitoring is not required // - `image: openebs/m-exporter:ci` indicates monitoring is enabled // and should use the provided image // - `true` indicates monitoring is required & should use the defaults Monitor string `json:"monitor,omitempty" protobuf:"bytes,1,opt,name=monitor"` // VolumeClone is the specifications for vlone volume request. VolumeClone `json:"volumeClone,omitempty" protobuf:"bytes,4,opt,name=volumeClone"` // Specs contains the desired specifications the volume should have. // +optional Specs []VolumeSpec `json:"specs,omitempty" protobuf:"bytes,2,rep,name=specs"` // Status represents the current information/status of a volume Status VolumeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` }
Volume is a user's Request for a OpenEBS volume
type VolumeAPISpec ¶
type VolumeAPISpec struct { Kind string `yaml:"kind"` APIVersion string `yaml:"apiVersion"` Metadata struct { Name string `yaml:"name"` Labels struct { Storage string `yaml:"volumeprovisioner.mapi.openebs.io/storage-size"` } } `yaml:"metadata"` }
VolumeAPISpec holds the config for creating a Volume
type VolumeAccessMode ¶
type VolumeAccessMode string
VolumeAccessMode defines different modes of volume access
const ( // ReadWriteOnce - can be mounted read/write mode to exactly 1 host ReadWriteOnce VolumeAccessMode = "ReadWriteOnce" // ReadOnlyMany - can be mounted in read-only mode to many hosts ReadOnlyMany VolumeAccessMode = "ReadOnlyMany" // ReadWriteMany - can be mounted in read/write mode to many hosts ReadWriteMany VolumeAccessMode = "ReadWriteMany" )
type VolumeClone ¶
type VolumeClone struct { // Defaults to false, true will enable the volume to be created as a clone Clone bool `json:"clone,omitempty"` // SourceVolume is snapshotted volume, required for extracting the clone // specific information, like storageclass, source-controller IP. SourceVolume string `json:"sourceVolume,omitempty"` // CloneIP is the source controller IP which will be used to make a sync and rebuild // request from the new clone replica. CloneIP string `json:"cloneIP,omitempty"` // SnapshotName is name of snapshot which is getting promoted as persistent // volume. Snapshot will be sync and rebuild to new replica volume. SnapshotName string `json:"snapshotName,omitempty"` }
VolumeClone is the specifications for clone volume request.
type VolumeContext ¶
type VolumeContext string
VolumeContext defines context of a volume
const ( // ReplicaVolumeContext represents a volume w.r.t // replica context ReplicaVolumeContext VolumeContext = "replica" // ControllerVolumeContext represents a volume w.r.t // controller context ControllerVolumeContext VolumeContext = "controller" )
type VolumeKey ¶
type VolumeKey string
VolumeKey is a typed string used to represent openebs volume related policy keys. These keys along with their values will be fetched from various K8s Kinds
const ( // CASTemplateVK is the key to fetch name of CASTemplate custom resource // to create a cas volume CASTemplateVK VolumeKey = "cas.openebs.io/template" // CASTemplateForReadVK is the key to fetch name of CASTemplate custom // resource to read a cas volume CASTemplateForReadVK VolumeKey = "cas.openebs.io/read-template" // CASTemplateForDeleteVK is the key to fetch name of CASTemplate custom // resource to delete a cas volume CASTemplateForDeleteVK VolumeKey = "cas.openebs.io/delete-template" // CASTemplateForListVK is the key to fetch name of CASTemplate custom // resource to list cas volumes CASTemplateForListVK VolumeKey = "cas.openebs.io/list-template" // CASConfigVK is the key to fetch configurations w.r.t a CAS volume CASConfigVK VolumeKey = "cas.openebs.io/config" // CapacityVK is the key to fetch volume capacity CapacityVK VolumeKey = "openebs.io/capacity" // JivaIQNVK is the key to fetch volume iqn JivaIQNVK VolumeKey = "openebs.io/jiva-iqn" // IsK8sServiceVK is the key to fetch a boolean indicating // if a K8s service is required during volume provisioning IsK8sServiceVK VolumeKey = "openebs.io/is-k8s-service" // K8sTargetKindVK is the key to fetch K8s Kind value. // It suggests the K8s Kind object a volume is supposed to // be transformed to. K8sTargetKindVK VolumeKey = "openebs.io/k8s-target-kind" // JivaReplicaImageVK is the key to fetch the jiva replica image JivaReplicaImageVK VolumeKey = "openebs.io/jiva-replica-image" // JivaControllerImageVK is the key to fetch the jiva controller image JivaControllerImageVK VolumeKey = "openebs.io/jiva-controller-image" // JivaReplicasVK is the key to fetch jiva replica count JivaReplicasVK VolumeKey = "openebs.io/jiva-replica-count" // JivaControllersVK is the key to fetch jiva controller count JivaControllersVK VolumeKey = "openebs.io/jiva-controller-count" // JivaReplicaIPsVK is the key to fetch jiva replica IP Addresses JivaReplicaIPsVK VolumeKey = "openebs.io/jiva-replica-ips" // JivaControllerIPsVK is the key to fetch jiva controller IP Addresses JivaControllerIPsVK VolumeKey = "openebs.io/jiva-controller-ips" // JivaReplicaStatusVK is the key to fetch jiva replica status(-es) JivaReplicaStatusVK VolumeKey = "openebs.io/jiva-replica-status" // JivaControllerStatusVK is the key to fetch jiva controller status(-es) JivaControllerStatusVK VolumeKey = "openebs.io/jiva-controller-status" // JivaControllerClusterIPVK is the key to fetch jiva controller cluster ip JivaControllerClusterIPVK VolumeKey = "openebs.io/jiva-controller-cluster-ip" // JivaTargetPortalVK is the key to fetch jiva target portal address JivaTargetPortalVK VolumeKey = "openebs.io/jiva-target-portal" // StoragePoolVK is the key to fetch the name of storage pool StoragePoolVK VolumeKey = "openebs.io/storage-pool" // MonitorVK is the key to fetch the monitoring details MonitorVK VolumeKey = "openebs.io/volume-monitor" // VolumeTypeVK is the key to fetch the volume type VolumeTypeVK VolumeKey = "openebs.io/volume-type" // ControllerContainerStatusVK is the key to fetch the status of // controller containers in a pod ControllerContainerStatusVK VolumeKey = "openebs.io/controller-container-status" // ReplicaContainerStatusVK is the key to fetch the status of // replica containers in a pod ReplicaContainerStatusVK VolumeKey = "openebs.io/replica-container-status" // VolumeStorageClassVK is the key to fetch the storage class of openebs // volume VolumeStorageClassVK VolumeKey = "openebs.io/storage-class" )
type VolumeLabels ¶
type VolumeLabels struct { // VolumeType contains the openebs volume type VolumeType VolumeType `json:"openebs.io/volume-type,omitempty" protobuf:"bytes,3,opt,name=openebs.io/volume-type,casttype=VolumeType"` }
VolumeLabels is a typed structure that consists of various openebs volume related info. These are typically used during the **registration** phase of volume provisioning
type VolumeList ¶
type VolumeList struct { TypeMeta `json:",inline"` // Standard list metadata. // +optional ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // List of openebs volumes. Items []Volume `json:"items" protobuf:"bytes,2,rep,name=items"` }
VolumeList is a list of OpenEBS Volume items.
type VolumeMetrics ¶
type VolumeMetrics struct { Resource Resource RevisionCounter int64 `json:"RevisionCounter"` ReplicaCounter int64 `json:"ReplicaCounter"` SCSIIOCount map[int]int64 `json:"SCSIIOCount"` ReadIOPS string `json:"ReadIOPS"` TotalReadTime string `json:"TotalReadTime"` TotalReadBlockCount string `json:"TotalReadBlockCount"` WriteIOPS string `json:"WriteIOPS"` TotalWriteTime string `json:"TotalWriteTime"` TotalWriteBlockCount string `json:"TotalWriteBlockCount"` UsedLogicalBlocks string `json:"UsedLogicalBlocks"` UsedBlocks string `json:"UsedBlocks"` SectorSize string `json:"SectorSize"` Size string `json:"Size"` UpTime float64 `json:"UpTime"` Name string `json:"Name"` }
VolumeMetrics is used to store the collected metrics all the stats exposed by jiva stored into OpenEBSVolumeMetrics fields This structure is depricated. Use VolumeStats instead of this one
type VolumePhase ¶
type VolumePhase string
VolumePhase defines phase of a volume
const ( // VolumePending - used for Volumes that are not available VolumePending VolumePhase = "Pending" // VolumeAvailable - used for Volumes that are not yet bound VolumeAvailable VolumePhase = "Available" // VolumeBound is used for Volumes that are bound VolumeBound VolumePhase = "Bound" // VolumeReleased - used for Volumes where the bound PersistentVol:syntime onumeClaim was deleted // released volumes must be recycled before becoming available again // this phase is used by the volume claim binder to signal to another process to reclaim the resource VolumeReleased VolumePhase = "Released" // VolumeFailed - used for Volumes that failed to be correctly recycled or deleted after being released from a claim VolumeFailed VolumePhase = "Failed" )
type VolumeSnapshot ¶
type VolumeSnapshot struct { TypeMeta `json:",inline"` Metadata ObjectMeta `json:"metadata"` // Spec represents the desired state of the snapshot // +optional Spec VolumeSnapshotSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // SnapshotName represents the name of the snapshot SnapshotName string `json:"snapshotName" protobuf:"bytes,1,opt,name=snapshotName"` // Status represents the latest observer state of the snapshot // +optional Status VolumeSnapshotStatus `json:"status" protobuf:"bytes,3,opt,name=status"` }
VolumeSnapshot is volume snapshot object accessible to the user. Upon successful creation of the actual snapshot by the volume provider it is bound to the corresponding VolumeSnapshotData through the VolumeSnapshotSpec
type VolumeSnapshotCondition ¶
type VolumeSnapshotCondition struct { // Type of replication controller condition. Type VolumeSnapshotConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=VolumeSnapshotConditionType"` // Status of the condition, one of True, False, Unknown. //Status core_v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` // The last time the condition transitioned from one status to another. // +optional LastTransitionTime Time `json:"lastTransitionTime" protobuf:"bytes,3,opt,name=lastTransitionTime"` // The reason for the condition's last transition. // +optional Reason string `json:"reason" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. // +optional Message string `json:"message" protobuf:"bytes,5,opt,name=message"` }
VolumeSnapshotCondition describes the state of a volume snapshot at a certain point.
type VolumeSnapshotConditionType ¶
type VolumeSnapshotConditionType string
VolumeSnapshotConditionType - data type of volume snapshot condition
const ( // VolumeSnapshotReady is added when the snapshot has been successfully created and is ready to be used. VolumeSnapshotConditionReady VolumeSnapshotConditionType = "Ready" )
These are valid conditions of a volume snapshot.
type VolumeSnapshotList ¶
type VolumeSnapshotList struct { TypeMeta `json:",inline"` Metadata ListMeta `json:"metadata"` Items []VolumeSnapshot `json:"items"` }
VolumeSnapshotList - list of volume snapshots
type VolumeSnapshotSpec ¶
type VolumeSnapshotSpec struct { // PersistentVolumeClaimName is the name of the PVC being snapshotted // +optional VolumeName string `json:"volumeName" protobuf:"bytes,1,opt,name=persistentVolumeClaimName"` // SnapshotDataName binds the VolumeSnapshot object with the VolumeSnapshotData // +optional SnapshotDataName string `json:"snapshotDataName" protobuf:"bytes,2,opt,name=snapshotDataName"` }
VolumeSnapshotSpec - The desired state of the volume snapshot
type VolumeSnapshotStatus ¶
type VolumeSnapshotStatus struct { // The time the snapshot was successfully created // +optional CreationTimestamp Time `json:"creationTimestamp" protobuf:"bytes,1,opt,name=creationTimestamp"` // Represents the latest available observations about the volume snapshot Conditions []VolumeSnapshotCondition `json:"conditions" protobuf:"bytes,2,rep,name=conditions"` }
VolumeSnapshotStatus defines the status of a Volume Snapshot
type VolumeSource ¶
type VolumeSource struct { // OpenEBS represents an OpenEBS disk // +optional OpenEBS OpenEBS }
VolumeSource represents the source type of the Openebs volume. NOTE:
Exactly one of its members must be set. Currently OpenEBS is the only
member.
type VolumeSpec ¶
type VolumeSpec struct { // The context of this volume specification. // Examples: "controller", "replica". Implicitly inferred to be "replica" // if unspecified. // +optional Context VolumeContext `json:"context,omitempty" protobuf:"bytes,1,opt,name=context,casttype=VolumeContext"` // Number of desired replicas. This is a pointer to distinguish between explicit // zero and not specified. Defaults to 1. // +optional Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` // Image represents the container image of this volume Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` }
VolumeSpec provides various characteristics of a volume that can be mounted, used, etc.
NOTE:
Only one of its members may be specified. Currently OpenEBS is the only
member. There may be other members in future.
type VolumeStats ¶
type VolumeStats struct { Got bool // Iqn is unique iSCSI qualified name, it is used to // configure iscsi initiator and target. Iqn string `json:"iqn"` // Reads is the total no of read io's that's been // read from the volume. Reads json.Number `json:"ReadIOPS"` // TotalReadTime is the total time taken to read from // the device. TotalReadTime json.Number `json:"TotalReadTime"` // TotalReadBlockCount is total no of block that has been // read from the volume. TotalReadBlockCount json.Number `json:"TotalReadBlockCount"` // TotalReadBytes is the total size of the read io's in byte. TotalReadBytes json.Number `json:"TotalReadBytes"` // Writes is the total no of write io's that's been // written to the volume. Writes json.Number `json:"WriteIOPS"` // TotalWriteTime is the total time taken to write to // the volume. TotalWriteTime json.Number `json:"TotalWriteTime"` // TotalWriteBlockCount is total no of block that has been // written to the volume. TotalWriteBlockCount json.Number `json:"TotalWriteBlockCount"` // TotalWriteBytes is the total size of the write io's // in byte. TotalWriteBytes json.Number `json:"TotalWriteBytes"` // UsedLogicalBlocks is the no of logical blocks that is // used by volume. UsedLogicalBlocks json.Number `json:"UsedLogicalBlocks"` // UsedBlocks is the no of physical blocks used by volume. // (each block is a physical sector) UsedBlocks json.Number `json:"UsedBlocks"` // SectorSize minimum storage unit of a hard drive. // Most disk partitioning schemes are designed to have // files occupy an integral number of sectors regardless // of the file's actual size. Files that do not fill a whole // sector will have the remainder of their last sector filled // with zeroes. In practice, operating systems typically // operate on blocks of data, which may span multiple sectors. // (source: https://en.wikipedia.org/wiki/Disk_sector) SectorSize json.Number `json:"SectorSize"` // Size is the size of the volume created. Size json.Number `json:"Size"` // RevisionCounter is the no of times io's have been done // on volume. RevisionCounter json.Number `json:"RevisionCounter"` // ReplicaCounter is the no of replicas connected to target // or controller (istgt or jiva controller) ReplicaCounter json.Number `json:"ReplicaCounter"` // Uptime is the time since target is up. UpTime json.Number `json:"UpTime"` // Name is the name of the volume given while creation Name string `json:"Name"` // Replicas keeps the details about the replicas connected // to the target. Replicas []Replica `json:"Replicas"` // Target status is the status of the target (RW/RO) TargetStatus string `json:"Status"` }
VolumeStats is used to store the collected metrics TODO: Make this generic, so that it can be used by mayactl and other components of maya.
type VolumeStatus ¶
type VolumeStatus struct { // Phase indicates if a volume is available, bound to a claim, or released by a claim // +optional Phase VolumePhase // A human-readable message indicating details about why the volume is in this state. // +optional Message string // Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI // +optional Reason string }
VolumeStatus provides status of a volume
type VolumeType ¶
type VolumeType string
VolumeType defines the OpenEBS volume types that are supported by Maya
const ( // JivaVolumeType represents a jiva volume JivaVolumeType VolumeType = "jiva" // CStorVolumeType represents a cstor volume CStorVolumeType VolumeType = "cstor" )
type VolumeValue ¶
type VolumeValue string
VolumeValue is a typed string used to represent openebs volume related policy values.
const ( // NilVV is the value that represents is Nil i.e. null value // for any storage policy key. This can be a representation of // blank, empty or in-progress status of a storage policy. NilVV VolumeValue = "nil" // ContainerWaitingVV represents container waiting state ContainerWaitingVV VolumeValue = "Waiting" // ContainerTerminatedVV represents container terminated state ContainerTerminatedVV VolumeValue = "Terminated" // ContainerRunningVV represents container running state ContainerRunningVV VolumeValue = "Running" // ContainerNotRunningVV represents container not-running state ContainerNotRunningVV VolumeValue = "NotRunning" // VolumeRunningVV represents container running state VolumeRunningVV VolumeValue = "Running" // VolumeNotRunningVV represents container not-running state VolumeNotRunningVV VolumeValue = "NotRunning" )