rorresources

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterType

type FilterType string
const (
	FilterTypeString FilterType = "string"
	FilterTypeInt    FilterType = "int"
	FilterTypeBool   FilterType = "bool"
)

type Resource

type Resource struct {
	Kind       string `json:"kind,omitempty"`
	ApiVersion string `json:"api_version,omitempty"`

	NamespaceResource                  *rortypes.ResourceNamespace                  `json:"namespace,omitempty"`
	NodeResource                       *rortypes.ResourceNode                       `json:"node,omitempty"`
	PersistentVolumeClaimResource      *rortypes.ResourcePersistentVolumeClaim      `json:"persistentvolumeclaim,omitempty"`
	DeploymentResource                 *rortypes.ResourceDeployment                 `json:"deployment,omitempty"`
	StorageClassResource               *rortypes.ResourceStorageClass               `json:"storageclass,omitempty"`
	PolicyReportResource               *rortypes.ResourcePolicyReport               `json:"policyreport,omitempty"`
	ApplicationResource                *rortypes.ResourceApplication                `json:"application,omitempty"`
	AppProjectResource                 *rortypes.ResourceAppProject                 `json:"appproject,omitempty"`
	CertificateResource                *rortypes.ResourceCertificate                `json:"certificate,omitempty"`
	ServiceResource                    *rortypes.ResourceService                    `json:"service,omitempty"`
	PodResource                        *rortypes.ResourcePod                        `json:"pod,omitempty"`
	ReplicaSetResource                 *rortypes.ResourceReplicaSet                 `json:"replicaset,omitempty"`
	StatefulSetResource                *rortypes.ResourceStatefulSet                `json:"statefulset,omitempty"`
	DaemonSetResource                  *rortypes.ResourceDaemonSet                  `json:"daemonset,omitempty"`
	IngressResource                    *rortypes.ResourceIngress                    `json:"ingress,omitempty"`
	IngressClassResource               *rortypes.ResourceIngressClass               `json:"ingressclass,omitempty"`
	VulnerabilityReportResource        *rortypes.ResourceVulnerabilityReport        `json:"vulnerabilityreport,omitempty"`
	ExposedSecretReportResource        *rortypes.ResourceExposedSecretReport        `json:"exposedsecretreport,omitempty"`
	ConfigAuditReportResource          *rortypes.ResourceConfigAuditReport          `json:"configauditreport,omitempty"`
	RbacAssessmentReportResource       *rortypes.ResourceRbacAssessmentReport       `json:"rbacassessmentreport,omitempty"`
	TanzuKubernetesClusterResource     *rortypes.ResourceTanzuKubernetesCluster     `json:"tanzukubernetescluster,omitempty"`
	TanzuKubernetesReleaseResource     *rortypes.ResourceTanzuKubernetesRelease     `json:"tanzukubernetesrelease,omitempty"`
	VirtualMachineClassResource        *rortypes.ResourceVirtualMachineClass        `json:"virtualmachineclass,omitempty"`
	VirtualMachineClassBindingResource *rortypes.ResourceVirtualMachineClassBinding `json:"virtualmachineclassbinding,omitempty"`
	KubernetesClusterResource          *rortypes.ResourceKubernetesCluster          `json:"kubernetescluster,omitempty"`
	ClusterOrderResource               *rortypes.ResourceClusterOrder               `json:"clusterorder,omitempty"`
	ProjectResource                    *rortypes.ResourceProject                    `json:"project,omitempty"`
	ConfigurationResource              *rortypes.ResourceConfiguration              `json:"configuration,omitempty"`
	ClusterComplianceReportResource    *rortypes.ResourceClusterComplianceReport    `json:"clustercompliancereport,omitempty"`
	ClusterVulnerabilityReportResource *rortypes.ResourceClusterVulnerabilityReport `json:"clustervulnerabilityreport,omitempty"`
	RouteResource                      *rortypes.ResourceRoute                      `json:"route,omitempty"`
	SlackMessageResource               *rortypes.ResourceSlackMessage               `json:"slackmessage,omitempty"`
	NotificationResource               *rortypes.ResourceNotification               `json:"notification,omitempty"`
	// contains filtered or unexported fields
}

The Resource struct represents one resource in ror.

It implement common and resource specific methods by providing interfaces to the underlying resources

func NewRorResource

func NewRorResource(kind string, apiversion string) *Resource

NewRorResource provides a empty resource of a given kind/apiversion

func (*Resource) AppProject

func (r *Resource) AppProject() rortypes.AppProjectinterface

AppProject is a wrapper for the underlying resource, it provides a AppProjectinterface to work with appprojects

func (*Resource) Application

func (r *Resource) Application() rortypes.Applicationinterface

Application is a wrapper for the underlying resource, it provides a Applicationinterface to work with applications

func (*Resource) ApplyInputFilter

func (r *Resource) ApplyInputFilter() error

func (*Resource) Certificate

func (r *Resource) Certificate() rortypes.Certificateinterface

Certificate is a wrapper for the underlying resource, it provides a Certificateinterface to work with certificates

func (*Resource) ClusterComplianceReport

func (r *Resource) ClusterComplianceReport() rortypes.ClusterComplianceReportinterface

ClusterComplianceReport is a wrapper for the underlying resource, it provides a ClusterComplianceReportinterface to work with clustercompliancereports

func (*Resource) ClusterOrder

func (r *Resource) ClusterOrder() rortypes.ClusterOrderinterface

ClusterOrder is a wrapper for the underlying resource, it provides a ClusterOrderinterface to work with clusterorders

func (*Resource) ClusterVulnerabilityReport added in v0.2.3

func (r *Resource) ClusterVulnerabilityReport() rortypes.ClusterVulnerabilityReportinterface

ClusterVulnerabilityReport is a wrapper for the underlying resource, it provides a ClusterVulnerabilityReportinterface to work with clustervulnerabilityreports

func (*Resource) ConfigAuditReport

func (r *Resource) ConfigAuditReport() rortypes.ConfigAuditReportinterface

ConfigAuditReport is a wrapper for the underlying resource, it provides a ConfigAuditReportinterface to work with configauditreports

func (*Resource) Configuration

func (r *Resource) Configuration() rortypes.Configurationinterface

Configuration is a wrapper for the underlying resource, it provides a Configurationinterface to work with configurations

func (*Resource) DaemonSet

func (r *Resource) DaemonSet() rortypes.DaemonSetinterface

DaemonSet is a wrapper for the underlying resource, it provides a DaemonSetinterface to work with daemonsets

func (*Resource) Deployment

func (r *Resource) Deployment() rortypes.Deploymentinterface

Deployment is a wrapper for the underlying resource, it provides a Deploymentinterface to work with deployments

func (*Resource) ExposedSecretReport

func (r *Resource) ExposedSecretReport() rortypes.ExposedSecretReportinterface

ExposedSecretReport is a wrapper for the underlying resource, it provides a ExposedSecretReportinterface to work with exposedsecretreports

func (*Resource) GetAPIVersion

func (r *Resource) GetAPIVersion() string

(r *Resource) GetAPIVersion() returns the APIVersion from the common interface

func (*Resource) GetKind

func (r *Resource) GetKind() string

(r *Resource) GetKind() returns the Kind from the common interface

func (*Resource) GetMetadata

func (r *Resource) GetMetadata() metav1.ObjectMeta

(r *Resource) GetMetadata() returns the Metadata from the common interface

func (*Resource) GetName

func (r *Resource) GetName() string

(r *Resource) GetName() returns the name from the common interface

func (*Resource) GetRorHash

func (r *Resource) GetRorHash() string

(r *Resource) GetRorHash() returns the hash from the common interface

func (*Resource) GetRorMeta

func (r *Resource) GetRorMeta() rortypes.ResourceRorMeta

(r *Resource) GetRorMeta() returns the RorMetadata from the common interface

func (*Resource) GetUID

func (r *Resource) GetUID() string

(r *Resource) GetUID() returns the UID from the common interface

func (*Resource) Ingress

func (r *Resource) Ingress() rortypes.Ingressinterface

Ingress is a wrapper for the underlying resource, it provides a Ingressinterface to work with ingresses

func (*Resource) IngressClass

func (r *Resource) IngressClass() rortypes.IngressClassinterface

IngressClass is a wrapper for the underlying resource, it provides a IngressClassinterface to work with ingressclasses

func (*Resource) KubernetesCluster

func (r *Resource) KubernetesCluster() rortypes.KubernetesClusterinterface

KubernetesCluster is a wrapper for the underlying resource, it provides a KubernetesClusterinterface to work with kubernetesclusters

func (*Resource) Namespace

func (r *Resource) Namespace() rortypes.Namespaceinterface

Namespace is a wrapper for the underlying resource, it provides a Namespaceinterface to work with namespaces

func (*Resource) Node

func (r *Resource) Node() rortypes.Nodeinterface

Node is a wrapper for the underlying resource, it provides a Nodeinterface to work with nodes

func (*Resource) Notification added in v0.2.3

func (r *Resource) Notification() rortypes.Notificationinterface

Notification is a wrapper for the underlying resource, it provides a Notificationinterface to work with notifications

func (*Resource) PersistentVolumeClaim

func (r *Resource) PersistentVolumeClaim() rortypes.PersistentVolumeClaiminterface

PersistentVolumeClaim is a wrapper for the underlying resource, it provides a PersistentVolumeClaiminterface to work with persistentvolumeclaims

func (*Resource) Pod

func (r *Resource) Pod() rortypes.Podinterface

Pod is a wrapper for the underlying resource, it provides a Podinterface to work with pods

func (*Resource) PolicyReport

func (r *Resource) PolicyReport() rortypes.PolicyReportinterface

PolicyReport is a wrapper for the underlying resource, it provides a PolicyReportinterface to work with policyreports

func (*Resource) Project

func (r *Resource) Project() rortypes.Projectinterface

Project is a wrapper for the underlying resource, it provides a Projectinterface to work with projects

func (*Resource) RbacAssessmentReport

func (r *Resource) RbacAssessmentReport() rortypes.RbacAssessmentReportinterface

RbacAssessmentReport is a wrapper for the underlying resource, it provides a RbacAssessmentReportinterface to work with rbacassessmentreports

func (*Resource) ReplicaSet

func (r *Resource) ReplicaSet() rortypes.ReplicaSetinterface

ReplicaSet is a wrapper for the underlying resource, it provides a ReplicaSetinterface to work with replicasets

func (*Resource) Route added in v0.2.3

func (r *Resource) Route() rortypes.Routeinterface

Route is a wrapper for the underlying resource, it provides a Routeinterface to work with routes

func (*Resource) Service

func (r *Resource) Service() rortypes.Serviceinterface

Service is a wrapper for the underlying resource, it provides a Serviceinterface to work with services

func (*Resource) SetAppProject

func (r *Resource) SetAppProject(res *rortypes.ResourceAppProject)

func (*Resource) SetApplication

func (r *Resource) SetApplication(res *rortypes.ResourceApplication)

func (*Resource) SetCertificate

func (r *Resource) SetCertificate(res *rortypes.ResourceCertificate)

func (*Resource) SetClusterComplianceReport

func (r *Resource) SetClusterComplianceReport(res *rortypes.ResourceClusterComplianceReport)

func (*Resource) SetClusterOrder

func (r *Resource) SetClusterOrder(res *rortypes.ResourceClusterOrder)

func (*Resource) SetClusterVulnerabilityReport added in v0.2.3

func (r *Resource) SetClusterVulnerabilityReport(res *rortypes.ResourceClusterVulnerabilityReport)

func (*Resource) SetCommon

func (r *Resource) SetCommon(common rortypes.CommonResourceInterface)

SetCommon sets the common interface of the resource, the common interface implements common methods of the resource

func (*Resource) SetConfigAuditReport

func (r *Resource) SetConfigAuditReport(res *rortypes.ResourceConfigAuditReport)

func (*Resource) SetConfiguration

func (r *Resource) SetConfiguration(res *rortypes.ResourceConfiguration)

func (*Resource) SetDaemonSet

func (r *Resource) SetDaemonSet(res *rortypes.ResourceDaemonSet)

func (*Resource) SetDeployment

func (r *Resource) SetDeployment(res *rortypes.ResourceDeployment)

func (*Resource) SetExposedSecretReport

func (r *Resource) SetExposedSecretReport(res *rortypes.ResourceExposedSecretReport)

func (*Resource) SetIngress

func (r *Resource) SetIngress(res *rortypes.ResourceIngress)

func (*Resource) SetIngressClass

func (r *Resource) SetIngressClass(res *rortypes.ResourceIngressClass)

func (*Resource) SetKubernetesCluster

func (r *Resource) SetKubernetesCluster(res *rortypes.ResourceKubernetesCluster)

func (*Resource) SetNamespace

func (r *Resource) SetNamespace(res *rortypes.ResourceNamespace)

func (*Resource) SetNode

func (r *Resource) SetNode(res *rortypes.ResourceNode)

func (*Resource) SetNotification added in v0.2.3

func (r *Resource) SetNotification(res *rortypes.ResourceNotification)

func (*Resource) SetPersistentVolumeClaim

func (r *Resource) SetPersistentVolumeClaim(res *rortypes.ResourcePersistentVolumeClaim)

func (*Resource) SetPod

func (r *Resource) SetPod(res *rortypes.ResourcePod)

func (*Resource) SetPolicyReport

func (r *Resource) SetPolicyReport(res *rortypes.ResourcePolicyReport)

func (*Resource) SetProject

func (r *Resource) SetProject(res *rortypes.ResourceProject)

func (*Resource) SetRbacAssessmentReport

func (r *Resource) SetRbacAssessmentReport(res *rortypes.ResourceRbacAssessmentReport)

func (*Resource) SetReplicaSet

func (r *Resource) SetReplicaSet(res *rortypes.ResourceReplicaSet)

func (*Resource) SetRorMeta

func (r *Resource) SetRorMeta(input rortypes.ResourceRorMeta) error

(r *Resource) SetRorMeta() returns the RorMetadata from the common interface

func (*Resource) SetRoute added in v0.2.3

func (r *Resource) SetRoute(res *rortypes.ResourceRoute)

func (*Resource) SetService

func (r *Resource) SetService(res *rortypes.ResourceService)

func (*Resource) SetSlackMessage added in v0.2.3

func (r *Resource) SetSlackMessage(res *rortypes.ResourceSlackMessage)

func (*Resource) SetStatefulSet

func (r *Resource) SetStatefulSet(res *rortypes.ResourceStatefulSet)

func (*Resource) SetStorageClass

func (r *Resource) SetStorageClass(res *rortypes.ResourceStorageClass)

func (*Resource) SetTanzuKubernetesCluster

func (r *Resource) SetTanzuKubernetesCluster(res *rortypes.ResourceTanzuKubernetesCluster)

func (*Resource) SetTanzuKubernetesRelease

func (r *Resource) SetTanzuKubernetesRelease(res *rortypes.ResourceTanzuKubernetesRelease)

func (*Resource) SetVirtualMachineClass

func (r *Resource) SetVirtualMachineClass(res *rortypes.ResourceVirtualMachineClass)

func (*Resource) SetVirtualMachineClassBinding

func (r *Resource) SetVirtualMachineClassBinding(res *rortypes.ResourceVirtualMachineClassBinding)

func (*Resource) SetVulnerabilityReport

func (r *Resource) SetVulnerabilityReport(res *rortypes.ResourceVulnerabilityReport)

func (*Resource) SlackMessage added in v0.2.3

func (r *Resource) SlackMessage() rortypes.SlackMessageinterface

SlackMessage is a wrapper for the underlying resource, it provides a SlackMessageinterface to work with slackmessages

func (*Resource) StatefulSet

func (r *Resource) StatefulSet() rortypes.StatefulSetinterface

StatefulSet is a wrapper for the underlying resource, it provides a StatefulSetinterface to work with statefulsets

func (*Resource) StorageClass

func (r *Resource) StorageClass() rortypes.StorageClassinterface

StorageClass is a wrapper for the underlying resource, it provides a StorageClassinterface to work with storageclasses

func (*Resource) TanzuKubernetesCluster

func (r *Resource) TanzuKubernetesCluster() rortypes.TanzuKubernetesClusterinterface

TanzuKubernetesCluster is a wrapper for the underlying resource, it provides a TanzuKubernetesClusterinterface to work with tanzukubernetesclusters

func (*Resource) TanzuKubernetesRelease

func (r *Resource) TanzuKubernetesRelease() rortypes.TanzuKubernetesReleaseinterface

TanzuKubernetesRelease is a wrapper for the underlying resource, it provides a TanzuKubernetesReleaseinterface to work with tanzukubernetesreleases

func (*Resource) VirtualMachineClass

func (r *Resource) VirtualMachineClass() rortypes.VirtualMachineClassinterface

VirtualMachineClass is a wrapper for the underlying resource, it provides a VirtualMachineClassinterface to work with virtualmachineclasses

func (*Resource) VirtualMachineClassBinding

func (r *Resource) VirtualMachineClassBinding() rortypes.VirtualMachineClassBindinginterface

VirtualMachineClassBinding is a wrapper for the underlying resource, it provides a VirtualMachineClassBindinginterface to work with virtualmachineclassbindings

func (*Resource) VulnerabilityReport

func (r *Resource) VulnerabilityReport() rortypes.VulnerabilityReportinterface

VulnerabilityReport is a wrapper for the underlying resource, it provides a VulnerabilityReportinterface to work with vulnerabilityreports

type ResourceQuery

type ResourceQuery struct {
	VersionKind         schema.GroupVersionKind              `json:"version_kind,omitempty"`         // memory
	Uids                []string                             `json:"uids,omitempty"`                 // memory
	OwnerRefs           []rortypes.RorResourceOwnerReference `json:"owner_refs,omitempty"`           // memory
	Fields              []string                             `json:"fields,omitempty"`               // post or db
	Order               map[int]ResourceQueryOrder           `json:"order,omitempty"`                // post or db
	Filters             []ResourceQueryFilter                `json:"filters,omitempty"`              // db
	Offset              int                                  `json:"offset,omitempty"`               // post or db
	Limit               int                                  `json:"limit,omitempty"`                // post or db
	AdditionalResources []schema.GroupVersionKind            `json:"additional_resources,omitempty"` // memory or db
}

type ResourceQueryFilter

type ResourceQueryFilter struct {
	Field    string     `json:"field,omitempty"`
	Value    string     `json:"value,omitempty"`
	Type     FilterType `json:"type,omitempty"`
	Operator string     `json:"operator,omitempty"`
}

type ResourceQueryOrder

type ResourceQueryOrder struct {
	Field      string `json:"field,omitempty"`
	Descending bool   `json:"descending,omitempty"`
}

type ResourceSet

type ResourceSet struct {
	Resources []*Resource `json:"resources,omitempty"`
	// contains filtered or unexported fields
}

ResourceSet is the common way to present one or more resources in ror.

func NewResourceSet

func NewResourceSet() *ResourceSet

func NewResourceSetFromStruct

func NewResourceSetFromStruct(in ResourceSet) *ResourceSet

NewResourceSetFromStruct creates a new ResourceSet from a struct of the type ResourceSet the function restores common methods after transit eg by json.

func (*ResourceSet) Add

func (r *ResourceSet) Add(add *Resource)

Add adds a resource to the ResourceSet If resource already exists it will be replaced.

func (*ResourceSet) DeleteByUid

func (r *ResourceSet) DeleteByUid(search string)

Function to delete resource by uid.

func (*ResourceSet) FilterByAPIVersionKind

func (r *ResourceSet) FilterByAPIVersionKind(apiVersion string, kind string) *ResourceSet

FilterByAPIVersionKind returns a ResourceSet filtered by apiversion and kind.

func (*ResourceSet) FilterByLabels

func (r *ResourceSet) FilterByLabels(search map[string]string) *ResourceSet

FilterByLabels returns a ResourceSet filtered by label.

func (*ResourceSet) FilterByOwnerReference

func (r *ResourceSet) FilterByOwnerReference(ownerRef rortypes.RorResourceOwnerReference) *ResourceSet

FilterByOwnerReference returns a ResourceSet filtered by ownerreference.

func (*ResourceSet) Get

func (r *ResourceSet) Get() *Resource

Get returns the value of the current resource. can be used without moving the pointer in case the resourceset only contains one resource.

func (*ResourceSet) GetAll

func (r *ResourceSet) GetAll() []*Resource

All retuns a slice with all resources

func (*ResourceSet) GetByName

func (r *ResourceSet) GetByName(search string) *Resource

Function to return resource by name.

func (*ResourceSet) GetByUid

func (r *ResourceSet) GetByUid(search string) *Resource

Function to return resource by uid.

func (*ResourceSet) GetQuery added in v0.2.6

func (rs *ResourceSet) GetQuery() *ResourceQuery

func (*ResourceSet) Len

func (r *ResourceSet) Len() int

Len returns the number of resources in the ResourceSetr

func (*ResourceSet) Next

func (r *ResourceSet) Next() bool

Next moves the cursor along, use Get() to fetch the value eg:

    for resourceSet.Next(){
	     stringhelper.PrettyprintStruct(resourceSet.Get())
    }

func (*ResourceSet) SetQuery added in v0.2.6

func (rs *ResourceSet) SetQuery(query *ResourceQuery)

func (*ResourceSet) ToJson

func (r *ResourceSet) ToJson() ([]byte, error)

type ResourceUpdateResult

type ResourceUpdateResult struct {
	Status  int    `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
}

type ResourceUpdateResults

type ResourceUpdateResults struct {
	Results map[string]ResourceUpdateResult `json:"results,omitempty"`
}

func (*ResourceUpdateResults) GetFailedResources

func (r *ResourceUpdateResults) GetFailedResources() map[string]ResourceUpdateResult

FailedResources is a method to return a list of failed resources.

Directories

Path Synopsis
The package provides the models and variables needed to generate code and endpoints for the implemented rorresources
The package provides the models and variables needed to generate code and endpoints for the implemented rorresources
package delivers apicontracts for resources
package delivers apicontracts for resources

Jump to

Keyboard shortcuts

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