persistentvolumeclaims

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List is a method to obtain an array of the persistent volume claims for specifies namespace.

Types

type Annotations

type Annotations struct {
	// The type of the file system.
	// The valid values are ext4 (EVS disk), obs (OBS bucket) and nfs (SFS or SFS Turbo).
	FsType string `json:"fsType" required:"true"`
	// ID of the volume
	VolumeID string `json:"volumeID" required:"true"`
	// The Shared path of the SFS and the SFS Turbo.
	DeviceMountPath string `json:"deviceMountPath,omitempty"`
}

type ClaimRef

type ClaimRef struct {
	// Kind of the referent.
	Kind string `json:"kind"`
	// Namespace of the referent.
	Namespace string `json:"namespace"`
	// Name of the referent.
	Name string `json:"name"`
	// UID of the referent.
	UID string `json:"uid"`
	// API version of the referent.
	AapiVersion string `json:"apiVersion"`
	// Specifies resource version to which this reference is made, If any.
	ResourceVersion string `json:"resourceVersion"`
}

type CreateOpts

type CreateOpts struct {
	// The version of the persistent API, valid value is 'v1'.
	ApiVersion string `json:"apiVersion" required:"true"`
	// Kind is a string value representing the REST resource this object represents.
	// Servers may infer this from the endpoint the client submits requests to.
	Kind string `json:"kind" required:"true"`
	// Standard object's metadata.
	Metadata Metadata `json:"metadata" required:"true"`
	// The desired characteristics of a volume.
	Spec Spec `json:"spec" required:"true"`
}

func (CreateOpts) ToPVCCreateMap

func (opts CreateOpts) ToPVCCreateMap() (map[string]interface{}, error)

ToPVCCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPVCCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder, ns string) (r CreateResult)

Create accepts a CreateOpts struct and uses the namespace name to import a volume into the namespace.

func (CreateResult) Extract

func (r CreateResult) Extract() (*PersistentVolumeClaim, error)

type DeleteResult

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

func Delete

func Delete(client *golangsdk.ServiceClient, ns, name string) (r DeleteResult)

Delete accepts to delete the specifies persistent volume claim form the namespace.

func (DeleteResult) Extract

func (r DeleteResult) Extract() ([]PersistentVolumeClaim, error)

type FlexVolume

type FlexVolume struct {
	Driver  string  `json:"driver"`
	FsType  string  `json:"fsType"`
	Options Options `json:"options"`
}

type ListOpts

type ListOpts struct {
	// Type of the storage, valid values are bs, obs, nfs and efs.
	StorageType string `q:"storage_type"`
}

func (ListOpts) ToPVCListQuery

func (opts ListOpts) ToPVCListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToPVCListQuery() (string, error)
}

type ListResp

type ListResp struct {
	PersistentVolumeClaim PersistentVolumeClaim `json:"persistentVolumeClaim"`
	PersistentVolume      PersistentVolumeClaim `json:"persistentVolume"`
}

func ExtractPersistentVolumeClaims

func ExtractPersistentVolumeClaims(r pagination.Page) ([]ListResp, error)

type MetaResp

type MetaResp struct {
	// The name of the Persistent Volume Claim.
	Name string `json:"name"`
	// The namespace where the Persistent Volume Claim is located.
	Namespace string `json:"namespace"`
	// An unstructured key value map stored with a resource that may be set by external tools to store and retrieve
	// arbitrary metadata.
	Annotations map[string]string `json:"annotations"`
	// ID of the Persistent Volume Claim in UUID format.
	UID string `json:"uid"`
	// String that identifies the server's internal version of this object that can be used by clients to determine
	// when objects have changed.
	ResourceVersion string `json:"resourceVersion"`
	// A timestamp representing the server time when this object was created.
	CreationTimestamp string `json:"creationTimestamp"`
	// SelfLink is a URL representing this object.
	SelfLink string `json:"selfLink"`
	// Map of string keys and values that can be used to organize and categorize (scope and select) objects.
	Labels map[string]string `json:"labels"`
	// Each finalizer string of array is an identifier for the responsible component that will remove the entry form
	// the list.
	Finalizers []string `json:"finalizers"`
	// Enable identify whether the resource is available.
	Enable bool `json:"enable"`
}

type Metadata

type Metadata struct {
	// The name of the persistent volume claim, must be unique within a namespace. Cannot be updated.
	Name string `json:"name" required:"true"`
	// 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.
	Namespace string `json:"namespace,omitempty"`
	// An unstructured key value map stored with a resource that may be set by external tools to store and retrieve
	// arbitrary metadata.
	Annotations *Annotations `json:"annotations,omitempty"`
}

type Options

type Options struct {
	// The type of the file system.
	FsType string `json:"fsType"`
	// ID of the volume.
	VolumeID string `json:"volumeID"`
	// The Shared path of the SFS and the SFS Turbo.
	DeviceMountPath string `json:"deviceMountPath"`
}

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	Kind       string   `json:"kind"`
	ApiVersion string   `json:"apiVersion"`
	Metadata   MetaResp `json:"metadata"`
	Spec       SpecResp `json:"spec"`
	Status     Status   `json:"status"`
}

type PersistentVolumeClaimPage

type PersistentVolumeClaimPage struct {
	pagination.SinglePageBase
}

type ResourceName

type ResourceName struct {
	// Volume size, in GB format: 'xGi'.
	Storage string `json:"storage,omitempty"`
}

type ResourceRequirement

type ResourceRequirement struct {
	// Minimum amount of compute resources required.
	// If requests is omitted for a container, it defaults to Limits if that is explicitly specified,
	// otherwise to an implementation-defined value.
	Requests *ResourceName `json:"requests,omitempty"`
}

type Spec

type Spec struct {
	// Resources represents the minimum resources the volume should have.
	Resources ResourceRequirement `json:"resources" required:"true"`
	// Name of the storage class required by the claim.
	// The following fields are supported:
	//     EVS: sas, ssd and sata
	//     SFS: nfs-rw
	//     SFS Turbo: efs-performance and efs-standard
	//     OBS: obs
	StorageClassName string `json:"storageClassName" required:"true"`
	// AccessModes contains the actual access modes the volume backing the PVC has.
	//     ReadWriteOnce: can be mount read/write mode to exactly 1 host.
	//     ReadOnlyMany: can be mount in read-only mode to many hosts.
	//     ReadWriteMany: can be mount in read/write mode to many hosts.
	AccessModes []string `json:"accessModes,omitempty"`
}

type SpecResp

type SpecResp struct {
	// The name of the volume.
	VolumeName string `json:"volumeName"`
	// AccessModes contains the actual access modes the volume backing the PVC has.
	AccessModes []string `json:"accessModes"`
	// Resources represents the minimum resources the volume should have.
	Resources ResourceRequirement `json:"resources"`
	// Name of the storage class required by the claim.
	StorageClassName string `json:"storageClassName"`
	// Mode of the volume.
	VolumeMode string `json:"volumeMode"`
	// The capacity of the storage.
	Capacity ResourceName `json:"capacity"`
	// PersistentVolumeClaim.
	FlexVolume FlexVolume `json:"flexVolume"`
	// Part of a bi-directional binding between persistentVolume and persistentVolumeClaim.
	ClaimRef ClaimRef `json:"claimRef"`
	// Specifies what happens to a persistent volume when released form its claim.
	PersistentVolumeReclaimPolicy string `json:"persistentVolumeReclaimPolicy"`
}

The extra response of Persistent Volume are Capacity, FlexVolume, ClaimRef and PersistentVolumeReclaimPolicy.

type Status

type Status struct {
	// Phase represents the current phase of persistentVolumeClaim.
	//     pending: used for PersistentVolumeClaims that are not yet bound.
	//     Bound: used for PersistentVolumeClaims that are bound.
	//     Lost: used for PersistentVolumeClaims that lost their underlying.
	Phase string `json:"phase"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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