v1alpha1

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package v1alpha1 contains types required for v1alpha1 +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=o11y.prism.oam.dev

Index

Constants

View Source
const (
	// Group the group for the apiextensions
	Group = "o11y.prism.oam.dev"
	// Version the version for the v1alpha1 apiextensions
	Version = "v1alpha1"
)

Variables

View Source
var (
	// GrafanaResource resource name for Grafana
	GrafanaResource = "grafanas"
	// GrafanaKind kind name for Grafana
	GrafanaKind = "Grafana"
	// GrafanaGroupResource GroupResource for Grafana
	GrafanaGroupResource = schema.GroupResource{Group: Group, Resource: GrafanaResource}
	// GrafanaGroupVersionKind GroupVersionKind for Grafana
	GrafanaGroupVersionKind = GroupVersion.WithKind(GrafanaKind)
)
View Source
var AddToScheme = func(scheme *runtime.Scheme) error {
	metav1.AddToGroupVersion(scheme, GroupVersion)

	scheme.AddKnownTypes(GroupVersion,
		&Grafana{},
		&GrafanaList{},
	)
	return nil
}

AddToScheme add virtual cluster scheme

GroupVersion the apiextensions v1alpha1 group version

Functions

func NewEmptyCredentialGrafanaSecretError

func NewEmptyCredentialGrafanaSecretError() error

NewEmptyCredentialGrafanaSecretError create an invalid grafana secret error due to no credential found

func NewEmptyEndpointGrafanaSecretError

func NewEmptyEndpointGrafanaSecretError() error

NewEmptyEndpointGrafanaSecretError create an invalid grafana secret error due to no endpoint found

func NewInvalidGrafanaSecretNameError

func NewInvalidGrafanaSecretNameError() error

NewInvalidGrafanaSecretNameError create an invalid grafana secret error due to invalid name

Types

type AccessCredential

type AccessCredential struct {
	*BasicAuth `json:",inline,omitempty"`
	Token      *string `json:"token,omitempty"`
}

AccessCredential defines the access credential for the grafana api

func (*AccessCredential) DeepCopy

func (in *AccessCredential) DeepCopy() *AccessCredential

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessCredential.

func (*AccessCredential) DeepCopyInto

func (in *AccessCredential) DeepCopyInto(out *AccessCredential)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BasicAuth

type BasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

BasicAuth defines the basic auth credential

func (*BasicAuth) DeepCopy

func (in *BasicAuth) DeepCopy() *BasicAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.

func (*BasicAuth) DeepCopyInto

func (in *BasicAuth) DeepCopyInto(out *BasicAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Grafana

type Grafana struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec GrafanaSpec `json:"spec,omitempty"`
}

Grafana defines the instance of grafana +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func NewGrafanaFromSecret

func NewGrafanaFromSecret(secret *corev1.Secret) (*Grafana, error)

NewGrafanaFromSecret create grafana from secret

func (*Grafana) ConvertToTable

func (in *Grafana) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)

ConvertToTable convert resource to table

func (*Grafana) Create

func (in *Grafana) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)

Create creates a new version of a resource.

func (*Grafana) DeepCopy

func (in *Grafana) DeepCopy() *Grafana

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Grafana.

func (*Grafana) DeepCopyInto

func (in *Grafana) DeepCopyInto(out *Grafana)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Grafana) DeepCopyObject

func (in *Grafana) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Grafana) Delete

func (in *Grafana) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (obj runtime.Object, _ bool, err error)

Delete finds a resource in the storage and deletes it.

func (*Grafana) Destroy added in v1.7.0

func (in *Grafana) Destroy()

Destroy .

func (*Grafana) DoRequest

func (in *Grafana) DoRequest(ctx context.Context, method string, path string, body io.Reader) ([]byte, int, error)

DoRequest do request for the current grafana

func (*Grafana) Get

func (in *Grafana) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get finds a resource in the storage by name and returns it.

func (*Grafana) GetCredentialType

func (in *Grafana) GetCredentialType() GrafanaCredentialType

GetCredentialType .

func (*Grafana) GetGroupVersionResource

func (in *Grafana) GetGroupVersionResource() schema.GroupVersionResource

GetGroupVersionResource returns the GroupVersionResource for this resource.

func (*Grafana) GetObjectMeta

func (in *Grafana) GetObjectMeta() *metav1.ObjectMeta

GetObjectMeta returns the object meta reference.

func (*Grafana) IsStorageVersion

func (in *Grafana) IsStorageVersion() bool

IsStorageVersion returns true if the object is also the internal version

func (*Grafana) List

List selects resources in the storage which match to the selector. 'options' can be nil.

func (*Grafana) NamespaceScoped

func (in *Grafana) NamespaceScoped() bool

NamespaceScoped returns if the object must be in a namespace.

func (*Grafana) New

func (in *Grafana) New() runtime.Object

New returns a new instance of the resource

func (*Grafana) NewList

func (in *Grafana) NewList() runtime.Object

NewList return a new list instance of the resource

func (*Grafana) ShortNames

func (in *Grafana) ShortNames() []string

ShortNames delivers a list of short names for a resource.

func (*Grafana) ToSecret

func (in *Grafana) ToSecret() *corev1.Secret

ToSecret convert grafana instance to underlying secret

func (*Grafana) Update

func (in *Grafana) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (obj runtime.Object, _ bool, err error)

Update finds a resource in the storage and updates it.

type GrafanaClient

type GrafanaClient interface {
	Get(ctx context.Context, name string) (*Grafana, error)
	List(ctx context.Context, options ...client.ListOption) (*GrafanaList, error)
	Create(ctx context.Context, grafana *Grafana) error
	Update(ctx context.Context, grafana *Grafana) error
	Delete(ctx context.Context, grafana *Grafana) error
}

GrafanaClient client for operate grafana +kubebuilder:object:generate=false

func NewGrafanaClient

func NewGrafanaClient(cli client.Client) GrafanaClient

NewGrafanaClient create a client for accessing grafana

type GrafanaCredentialType

type GrafanaCredentialType string

GrafanaCredentialType defines the credential type for grafana

const (
	// GrafanaCredentialTypeNotAvailable not available
	GrafanaCredentialTypeNotAvailable GrafanaCredentialType = "NA"
	// GrafanaCredentialTypeBasicAuth basic auth
	GrafanaCredentialTypeBasicAuth GrafanaCredentialType = "BasicAuth"
	// GrafanaCredentialTypeBearerToken bearer token
	GrafanaCredentialTypeBearerToken GrafanaCredentialType = "BearerToken"
)

type GrafanaList

type GrafanaList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Grafana `json:"items"`
}

GrafanaList list for Grafana +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*GrafanaList) DeepCopy

func (in *GrafanaList) DeepCopy() *GrafanaList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaList.

func (*GrafanaList) DeepCopyInto

func (in *GrafanaList) DeepCopyInto(out *GrafanaList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GrafanaList) DeepCopyObject

func (in *GrafanaList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GrafanaSpec

type GrafanaSpec struct {
	Endpoint string           `json:"endpoint"`
	Access   AccessCredential `json:"access"`
}

GrafanaSpec defines the spec for grafana instance

func (*GrafanaSpec) DeepCopy

func (in *GrafanaSpec) DeepCopy() *GrafanaSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaSpec.

func (*GrafanaSpec) DeepCopyInto

func (in *GrafanaSpec) DeepCopyInto(out *GrafanaSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GrafanaSubResourceRequest

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

GrafanaSubResourceRequest request for grafana subresources +kubebuilder:object:generate=false

func NewGrafanaSubResourceRequest

func NewGrafanaSubResourceRequest(subResource resource.Object, name string) *GrafanaSubResourceRequest

NewGrafanaSubResourceRequest create request for grafana subresource

func (*GrafanaSubResourceRequest) Do

func (*GrafanaSubResourceRequest) WithBodyFunc

func (in *GrafanaSubResourceRequest) WithBodyFunc(bodyFunc func() ([]byte, error)) *GrafanaSubResourceRequest

func (*GrafanaSubResourceRequest) WithMethod

func (*GrafanaSubResourceRequest) WithOnSuccess

func (in *GrafanaSubResourceRequest) WithOnSuccess(onSuccess func(respBody []byte) error) *GrafanaSubResourceRequest

func (*GrafanaSubResourceRequest) WithPathFunc

func (in *GrafanaSubResourceRequest) WithPathFunc(pathFunc func() (string, error)) *GrafanaSubResourceRequest

Jump to

Keyboard shortcuts

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