Documentation
¶
Index ¶
- Constants
- type API
- func (a *API) CreatePVC(pvcRequestConfig PVCRequestConfig) error
- func (a *API) CreatePVCAsyncHandler() gin.HandlerFunc
- func (a *API) CreatePVCHandler() gin.HandlerFunc
- func (a *API) Delete(pvcRequestConfig PVCRequestConfig) error
- func (a *API) DeleteHandler() gin.HandlerFunc
- func (a *API) GetSize(pvcRequestConfig PVCRequestConfig) (int64, int64, error)
- func (a *API) GetSizeHandler() gin.HandlerFunc
- func (a *API) GetStatus(pvcRequestConfig PVCRequestConfig) (StatusReport, error)
- func (a *API) GetStatusHandler() gin.HandlerFunc
- func (a *API) OkHandler(version string, mode string, service string) gin.HandlerFunc
- type Config
- type PVCRequestConfig
- type PatchOperation
- type PatchOperations
- type S3Config
- type StatusReport
- type VolConfig
Constants ¶
const JobAttemptInterval = 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v0.3.1
type API struct { *Config LogErrors prometheus.Counter }
API is primary object implementing the core API methods and HTTP handlers
func NewApi ¶
NewApi constructs an API object and populates it with configuration along with setting defaults where required.
func (*API) CreatePVC ¶ added in v0.3.1
func (a *API) CreatePVC(pvcRequestConfig PVCRequestConfig) error
CreatePVC is the core purpose of PVCI, to create PVCs and inject them with files. CreatePVC takes a PVCRequestConfig object and creates a Kubernetes PVC, followed by a Kubernetes Job used to populate it.
func (*API) CreatePVCAsyncHandler ¶ added in v0.4.0
func (a *API) CreatePVCAsyncHandler() gin.HandlerFunc
func (*API) CreatePVCHandler ¶ added in v0.3.1
func (a *API) CreatePVCHandler() gin.HandlerFunc
CreatePVCHandler used by the HTTP POST /create endpoint. CreatePVCHandler is the core purpose of PVCI, to create PVCs and inject them with files. This handler expects a JSON object representing a PVCRequestConfig.
func (*API) Delete ¶ added in v0.3.1
func (a *API) Delete(pvcRequestConfig PVCRequestConfig) error
Delete a PVC. @TODO limit to pvc created by PCI by looking at labels
func (*API) DeleteHandler ¶ added in v0.3.1
func (a *API) DeleteHandler() gin.HandlerFunc
DeleteHandler used for the /delete HTTP endpoint to delete a PVC
func (*API) GetSize ¶ added in v0.3.1
func (a *API) GetSize(pvcRequestConfig PVCRequestConfig) (int64, int64, error)
GetSize gets the size of a list of S3/MinIO objects (files) based on bucket and prefix specified in a PVCRequestConfig object.
func (*API) GetSizeHandler ¶ added in v0.3.1
func (a *API) GetSizeHandler() gin.HandlerFunc
GetSizeHandler used by the HTTP POST endpoint /size to get the size of a list of S3/MinIO objects (files) based on bucket and prefix.
func (*API) GetStatus ¶ added in v0.3.1
func (a *API) GetStatus(pvcRequestConfig PVCRequestConfig) (StatusReport, error)
GetStatus returns a StatusReport representing the state of PVCI created Jobs and PVCs.
func (*API) GetStatusHandler ¶ added in v0.3.1
func (a *API) GetStatusHandler() gin.HandlerFunc
GetStatusHandler is used by the HTTP POST /status endpoint and returns a StatusReport object as JSON.
type Config ¶
type Config struct { Service string Version string VolumeOveragePercent int AvgMPS int MCImage string Log *zap.Logger Cs *kubernetes.Clientset }
Config configures the API
type PVCRequestConfig ¶
PVCRequestConfig is the primary configuration structure for describing the S3/MinIO cluster to pull objects from and kubernetes pvc to create and place the objects in.
type PatchOperation ¶
type PatchOperation struct { Op string `json:"op"` Path string `json:"path"` Value interface{} `json:"value,omitempty"` }
PatchOperation see: http://jsonpatch.com/
type PatchOperations ¶
type PatchOperations []PatchOperation
type S3Config ¶
type S3Config struct { S3Endpoint string `json:"s3_endpoint"` S3SSL bool `json:"s3_ssl"` S3Bucket string `json:"s3_bucket"` S3Prefix string `json:"s3_prefix"` S3Key string `json:"s3_key"` S3Secret string `json:"s3_secret"` }
S3Config structures authentication, bucket and prefix configuration used to pull objects from an S3/MinIO object cluster.
type StatusReport ¶
type StatusReport struct { InjectorHasError bool InjectorError string InjectorState string PVCHasError bool PVCError string PVCStatus coreV1.PersistentVolumeClaimStatus }
StatusReport structures data returned by the /status endpoint using the GetStatusHandler() and implementing the GetStatus() method in this package.
type VolConfig ¶
type VolConfig struct { Namespace string `json:"namespace"` Name string `json:"name"` StorageClass string `json:"storage_class"` }
VolConfig is part of the PVCRequestConfig and used to specify the name of the volume to create the the Kubernetes storage class. run `kubectl get StorageClass` to see a list of available storage classed for a cluster.