add gen files
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type MetaClient struct {
|
||||
client *resource.TypedClient[*Meta, *MetaList]
|
||||
}
|
||||
|
||||
func NewMetaClient(client resource.Client) *MetaClient {
|
||||
return &MetaClient{
|
||||
client: resource.NewTypedClient[*Meta, *MetaList](client, MetaKind()),
|
||||
}
|
||||
}
|
||||
|
||||
func NewMetaClientFromGenerator(generator resource.ClientGenerator) (*MetaClient, error) {
|
||||
c, err := generator.ClientFor(MetaKind())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewMetaClient(c), nil
|
||||
}
|
||||
|
||||
func (c *MetaClient) Get(ctx context.Context, identifier resource.Identifier) (*Meta, error) {
|
||||
return c.client.Get(ctx, identifier)
|
||||
}
|
||||
|
||||
func (c *MetaClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*MetaList, error) {
|
||||
return c.client.List(ctx, namespace, opts)
|
||||
}
|
||||
|
||||
func (c *MetaClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*MetaList, error) {
|
||||
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Limit: opts.Limit,
|
||||
LabelFilters: opts.LabelFilters,
|
||||
FieldSelectors: opts.FieldSelectors,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for resp.GetContinue() != "" {
|
||||
page, err := c.client.List(ctx, namespace, resource.ListOptions{
|
||||
Continue: resp.GetContinue(),
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Limit: opts.Limit,
|
||||
LabelFilters: opts.LabelFilters,
|
||||
FieldSelectors: opts.FieldSelectors,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.SetContinue(page.GetContinue())
|
||||
resp.SetResourceVersion(page.GetResourceVersion())
|
||||
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (c *MetaClient) Create(ctx context.Context, obj *Meta, opts resource.CreateOptions) (*Meta, error) {
|
||||
// Make sure apiVersion and kind are set
|
||||
obj.APIVersion = GroupVersion.Identifier()
|
||||
obj.Kind = MetaKind().Kind()
|
||||
return c.client.Create(ctx, obj, opts)
|
||||
}
|
||||
|
||||
func (c *MetaClient) Update(ctx context.Context, obj *Meta, opts resource.UpdateOptions) (*Meta, error) {
|
||||
return c.client.Update(ctx, obj, opts)
|
||||
}
|
||||
|
||||
func (c *MetaClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Meta, error) {
|
||||
return c.client.Patch(ctx, identifier, req, opts)
|
||||
}
|
||||
|
||||
func (c *MetaClient) UpdateStatus(ctx context.Context, identifier resource.Identifier, newStatus MetaStatus, opts resource.UpdateOptions) (*Meta, error) {
|
||||
return c.client.Update(ctx, &Meta{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: MetaKind().Kind(),
|
||||
APIVersion: GroupVersion.Identifier(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Namespace: identifier.Namespace,
|
||||
Name: identifier.Name,
|
||||
},
|
||||
Status: newStatus,
|
||||
}, resource.UpdateOptions{
|
||||
Subresource: "status",
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
})
|
||||
}
|
||||
|
||||
func (c *MetaClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
|
||||
return c.client.Delete(ctx, identifier, opts)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
)
|
||||
|
||||
// MetaJSONCodec is an implementation of resource.Codec for kubernetes JSON encoding
|
||||
type MetaJSONCodec struct{}
|
||||
|
||||
// Read reads JSON-encoded bytes from `reader` and unmarshals them into `into`
|
||||
func (*MetaJSONCodec) Read(reader io.Reader, into resource.Object) error {
|
||||
return json.NewDecoder(reader).Decode(into)
|
||||
}
|
||||
|
||||
// Write writes JSON-encoded bytes into `writer` marshaled from `from`
|
||||
func (*MetaJSONCodec) Write(writer io.Writer, from resource.Object) error {
|
||||
return json.NewEncoder(writer).Encode(from)
|
||||
}
|
||||
|
||||
// Interface compliance checks
|
||||
var _ resource.Codec = &MetaJSONCodec{}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
)
|
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type MetaMetadata struct {
|
||||
UpdateTimestamp time.Time `json:"updateTimestamp"`
|
||||
CreatedBy string `json:"createdBy"`
|
||||
Uid string `json:"uid"`
|
||||
CreationTimestamp time.Time `json:"creationTimestamp"`
|
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
|
||||
Finalizers []string `json:"finalizers"`
|
||||
ResourceVersion string `json:"resourceVersion"`
|
||||
Generation int64 `json:"generation"`
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
}
|
||||
|
||||
// NewMetaMetadata creates a new MetaMetadata object.
|
||||
func NewMetaMetadata() *MetaMetadata {
|
||||
return &MetaMetadata{
|
||||
Finalizers: []string{},
|
||||
Labels: map[string]string{},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Meta struct {
|
||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata" yaml:"metadata"`
|
||||
|
||||
// Spec is the spec of the Meta
|
||||
Spec MetaSpec `json:"spec" yaml:"spec"`
|
||||
|
||||
Status MetaStatus `json:"status" yaml:"status"`
|
||||
}
|
||||
|
||||
func NewMeta() *Meta {
|
||||
return &Meta{
|
||||
Spec: *NewMetaSpec(),
|
||||
Status: *NewMetaStatus(),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) GetSpec() any {
|
||||
return o.Spec
|
||||
}
|
||||
|
||||
func (o *Meta) SetSpec(spec any) error {
|
||||
cast, ok := spec.(MetaSpec)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot set spec type %#v, not of type Spec", spec)
|
||||
}
|
||||
o.Spec = cast
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Meta) GetSubresources() map[string]any {
|
||||
return map[string]any{
|
||||
"status": o.Status,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) GetSubresource(name string) (any, bool) {
|
||||
switch name {
|
||||
case "status":
|
||||
return o.Status, true
|
||||
default:
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) SetSubresource(name string, value any) error {
|
||||
switch name {
|
||||
case "status":
|
||||
cast, ok := value.(MetaStatus)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot set status type %#v, not of type MetaStatus", value)
|
||||
}
|
||||
o.Status = cast
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("subresource '%s' does not exist", name)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) GetStaticMetadata() resource.StaticMetadata {
|
||||
gvk := o.GroupVersionKind()
|
||||
return resource.StaticMetadata{
|
||||
Name: o.ObjectMeta.Name,
|
||||
Namespace: o.ObjectMeta.Namespace,
|
||||
Group: gvk.Group,
|
||||
Version: gvk.Version,
|
||||
Kind: gvk.Kind,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) SetStaticMetadata(metadata resource.StaticMetadata) {
|
||||
o.Name = metadata.Name
|
||||
o.Namespace = metadata.Namespace
|
||||
o.SetGroupVersionKind(schema.GroupVersionKind{
|
||||
Group: metadata.Group,
|
||||
Version: metadata.Version,
|
||||
Kind: metadata.Kind,
|
||||
})
|
||||
}
|
||||
|
||||
func (o *Meta) GetCommonMetadata() resource.CommonMetadata {
|
||||
dt := o.DeletionTimestamp
|
||||
var deletionTimestamp *time.Time
|
||||
if dt != nil {
|
||||
deletionTimestamp = &dt.Time
|
||||
}
|
||||
// Legacy ExtraFields support
|
||||
extraFields := make(map[string]any)
|
||||
if o.Annotations != nil {
|
||||
extraFields["annotations"] = o.Annotations
|
||||
}
|
||||
if o.ManagedFields != nil {
|
||||
extraFields["managedFields"] = o.ManagedFields
|
||||
}
|
||||
if o.OwnerReferences != nil {
|
||||
extraFields["ownerReferences"] = o.OwnerReferences
|
||||
}
|
||||
return resource.CommonMetadata{
|
||||
UID: string(o.UID),
|
||||
ResourceVersion: o.ResourceVersion,
|
||||
Generation: o.Generation,
|
||||
Labels: o.Labels,
|
||||
CreationTimestamp: o.CreationTimestamp.Time,
|
||||
DeletionTimestamp: deletionTimestamp,
|
||||
Finalizers: o.Finalizers,
|
||||
UpdateTimestamp: o.GetUpdateTimestamp(),
|
||||
CreatedBy: o.GetCreatedBy(),
|
||||
UpdatedBy: o.GetUpdatedBy(),
|
||||
ExtraFields: extraFields,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) SetCommonMetadata(metadata resource.CommonMetadata) {
|
||||
o.UID = types.UID(metadata.UID)
|
||||
o.ResourceVersion = metadata.ResourceVersion
|
||||
o.Generation = metadata.Generation
|
||||
o.Labels = metadata.Labels
|
||||
o.CreationTimestamp = metav1.NewTime(metadata.CreationTimestamp)
|
||||
if metadata.DeletionTimestamp != nil {
|
||||
dt := metav1.NewTime(*metadata.DeletionTimestamp)
|
||||
o.DeletionTimestamp = &dt
|
||||
} else {
|
||||
o.DeletionTimestamp = nil
|
||||
}
|
||||
o.Finalizers = metadata.Finalizers
|
||||
if o.Annotations == nil {
|
||||
o.Annotations = make(map[string]string)
|
||||
}
|
||||
if !metadata.UpdateTimestamp.IsZero() {
|
||||
o.SetUpdateTimestamp(metadata.UpdateTimestamp)
|
||||
}
|
||||
if metadata.CreatedBy != "" {
|
||||
o.SetCreatedBy(metadata.CreatedBy)
|
||||
}
|
||||
if metadata.UpdatedBy != "" {
|
||||
o.SetUpdatedBy(metadata.UpdatedBy)
|
||||
}
|
||||
// Legacy support for setting Annotations, ManagedFields, and OwnerReferences via ExtraFields
|
||||
if metadata.ExtraFields != nil {
|
||||
if annotations, ok := metadata.ExtraFields["annotations"]; ok {
|
||||
if cast, ok := annotations.(map[string]string); ok {
|
||||
o.Annotations = cast
|
||||
}
|
||||
}
|
||||
if managedFields, ok := metadata.ExtraFields["managedFields"]; ok {
|
||||
if cast, ok := managedFields.([]metav1.ManagedFieldsEntry); ok {
|
||||
o.ManagedFields = cast
|
||||
}
|
||||
}
|
||||
if ownerReferences, ok := metadata.ExtraFields["ownerReferences"]; ok {
|
||||
if cast, ok := ownerReferences.([]metav1.OwnerReference); ok {
|
||||
o.OwnerReferences = cast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Meta) GetCreatedBy() string {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
return o.ObjectMeta.Annotations["grafana.com/createdBy"]
|
||||
}
|
||||
|
||||
func (o *Meta) SetCreatedBy(createdBy string) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/createdBy"] = createdBy
|
||||
}
|
||||
|
||||
func (o *Meta) GetUpdateTimestamp() time.Time {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
parsed, _ := time.Parse(time.RFC3339, o.ObjectMeta.Annotations["grafana.com/updateTimestamp"])
|
||||
return parsed
|
||||
}
|
||||
|
||||
func (o *Meta) SetUpdateTimestamp(updateTimestamp time.Time) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/updateTimestamp"] = updateTimestamp.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
func (o *Meta) GetUpdatedBy() string {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
return o.ObjectMeta.Annotations["grafana.com/updatedBy"]
|
||||
}
|
||||
|
||||
func (o *Meta) SetUpdatedBy(updatedBy string) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/updatedBy"] = updatedBy
|
||||
}
|
||||
|
||||
func (o *Meta) Copy() resource.Object {
|
||||
return resource.CopyObject(o)
|
||||
}
|
||||
|
||||
func (o *Meta) DeepCopyObject() runtime.Object {
|
||||
return o.Copy()
|
||||
}
|
||||
|
||||
func (o *Meta) DeepCopy() *Meta {
|
||||
cpy := &Meta{}
|
||||
o.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *Meta) DeepCopyInto(dst *Meta) {
|
||||
dst.TypeMeta.APIVersion = o.TypeMeta.APIVersion
|
||||
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
|
||||
o.Spec.DeepCopyInto(&dst.Spec)
|
||||
o.Status.DeepCopyInto(&dst.Status)
|
||||
}
|
||||
|
||||
// Interface compliance compile-time check
|
||||
var _ resource.Object = &Meta{}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaList struct {
|
||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||
metav1.ListMeta `json:"metadata" yaml:"metadata"`
|
||||
Items []Meta `json:"items" yaml:"items"`
|
||||
}
|
||||
|
||||
func (o *MetaList) DeepCopyObject() runtime.Object {
|
||||
return o.Copy()
|
||||
}
|
||||
|
||||
func (o *MetaList) Copy() resource.ListObject {
|
||||
cpy := &MetaList{
|
||||
TypeMeta: o.TypeMeta,
|
||||
Items: make([]Meta, len(o.Items)),
|
||||
}
|
||||
o.ListMeta.DeepCopyInto(&cpy.ListMeta)
|
||||
for i := 0; i < len(o.Items); i++ {
|
||||
if item, ok := o.Items[i].Copy().(*Meta); ok {
|
||||
cpy.Items[i] = *item
|
||||
}
|
||||
}
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *MetaList) GetItems() []resource.Object {
|
||||
items := make([]resource.Object, len(o.Items))
|
||||
for i := 0; i < len(o.Items); i++ {
|
||||
items[i] = &o.Items[i]
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
func (o *MetaList) SetItems(items []resource.Object) {
|
||||
o.Items = make([]Meta, len(items))
|
||||
for i := 0; i < len(items); i++ {
|
||||
o.Items[i] = *items[i].(*Meta)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *MetaList) DeepCopy() *MetaList {
|
||||
cpy := &MetaList{}
|
||||
o.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *MetaList) DeepCopyInto(dst *MetaList) {
|
||||
resource.CopyObjectInto(dst, o)
|
||||
}
|
||||
|
||||
// Interface compliance compile-time check
|
||||
var _ resource.ListObject = &MetaList{}
|
||||
|
||||
// Copy methods for all subresource types
|
||||
|
||||
// DeepCopy creates a full deep copy of Spec
|
||||
func (s *MetaSpec) DeepCopy() *MetaSpec {
|
||||
cpy := &MetaSpec{}
|
||||
s.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
// DeepCopyInto deep copies Spec into another Spec object
|
||||
func (s *MetaSpec) DeepCopyInto(dst *MetaSpec) {
|
||||
resource.CopyObjectInto(dst, s)
|
||||
}
|
||||
|
||||
// DeepCopy creates a full deep copy of MetaStatus
|
||||
func (s *MetaStatus) DeepCopy() *MetaStatus {
|
||||
cpy := &MetaStatus{}
|
||||
s.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
// DeepCopyInto deep copies MetaStatus into another MetaStatus object
|
||||
func (s *MetaStatus) DeepCopyInto(dst *MetaStatus) {
|
||||
resource.CopyObjectInto(dst, s)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
)
|
||||
|
||||
// schema is unexported to prevent accidental overwrites
|
||||
var (
|
||||
schemaMeta = resource.NewSimpleSchema("plugins.grafana.app", "v0alpha1", NewMeta(), &MetaList{}, resource.WithKind("Meta"),
|
||||
resource.WithPlural("metas"), resource.WithScope(resource.NamespacedScope))
|
||||
kindMeta = resource.Kind{
|
||||
Schema: schemaMeta,
|
||||
Codecs: map[resource.KindEncoding]resource.Codec{
|
||||
resource.KindEncodingJSON: &MetaJSONCodec{},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// Kind returns a resource.Kind for this Schema with a JSON codec
|
||||
func MetaKind() resource.Kind {
|
||||
return kindMeta
|
||||
}
|
||||
|
||||
// Schema returns a resource.SimpleSchema representation of Meta
|
||||
func MetaSchema() *resource.SimpleSchema {
|
||||
return schemaMeta
|
||||
}
|
||||
|
||||
// Interface compliance checks
|
||||
var _ resource.Schema = kindMeta
|
||||
+545
@@ -0,0 +1,545 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// JSON configuration schema for Grafana plugins
|
||||
// Converted from: https://github.com/grafana/grafana/blob/main/docs/sources/developers/plugins/plugin.schema.json
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaJSONData struct {
|
||||
// Unique name of the plugin
|
||||
Id string `json:"id"`
|
||||
// Plugin type
|
||||
Type MetaJSONDataType `json:"type"`
|
||||
// Human-readable name of the plugin
|
||||
Name string `json:"name"`
|
||||
// Metadata for the plugin
|
||||
Info MetaInfo `json:"info"`
|
||||
// Dependency information
|
||||
Dependencies MetaDependencies `json:"dependencies"`
|
||||
// Optional fields
|
||||
Alerting *bool `json:"alerting,omitempty"`
|
||||
Annotations *bool `json:"annotations,omitempty"`
|
||||
AutoEnabled *bool `json:"autoEnabled,omitempty"`
|
||||
Backend *bool `json:"backend,omitempty"`
|
||||
BuildMode *string `json:"buildMode,omitempty"`
|
||||
BuiltIn *bool `json:"builtIn,omitempty"`
|
||||
Category *MetaJSONDataCategory `json:"category,omitempty"`
|
||||
EnterpriseFeatures *MetaEnterpriseFeatures `json:"enterpriseFeatures,omitempty"`
|
||||
Executable *string `json:"executable,omitempty"`
|
||||
HideFromList *bool `json:"hideFromList,omitempty"`
|
||||
// +listType=atomic
|
||||
Includes []MetaInclude `json:"includes,omitempty"`
|
||||
Logs *bool `json:"logs,omitempty"`
|
||||
Metrics *bool `json:"metrics,omitempty"`
|
||||
MultiValueFilterOperators *bool `json:"multiValueFilterOperators,omitempty"`
|
||||
PascalName *string `json:"pascalName,omitempty"`
|
||||
Preload *bool `json:"preload,omitempty"`
|
||||
QueryOptions *MetaQueryOptions `json:"queryOptions,omitempty"`
|
||||
// +listType=atomic
|
||||
Routes []MetaRoute `json:"routes,omitempty"`
|
||||
SkipDataQuery *bool `json:"skipDataQuery,omitempty"`
|
||||
State *MetaJSONDataState `json:"state,omitempty"`
|
||||
Streaming *bool `json:"streaming,omitempty"`
|
||||
Suggestions *bool `json:"suggestions,omitempty"`
|
||||
Tracing *bool `json:"tracing,omitempty"`
|
||||
Iam *MetaIAM `json:"iam,omitempty"`
|
||||
// +listType=atomic
|
||||
Roles []MetaRole `json:"roles,omitempty"`
|
||||
Extensions *MetaExtensions `json:"extensions,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaJSONData creates a new MetaJSONData object.
|
||||
func NewMetaJSONData() *MetaJSONData {
|
||||
return &MetaJSONData{
|
||||
Info: *NewMetaInfo(),
|
||||
Dependencies: *NewMetaDependencies(),
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaInfo struct {
|
||||
// Required fields
|
||||
// +listType=set
|
||||
Keywords []string `json:"keywords"`
|
||||
Logos MetaV0alpha1InfoLogos `json:"logos"`
|
||||
Updated string `json:"updated"`
|
||||
Version string `json:"version"`
|
||||
// Optional fields
|
||||
Author *MetaV0alpha1InfoAuthor `json:"author,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
// +listType=atomic
|
||||
Links []MetaV0alpha1InfoLinks `json:"links,omitempty"`
|
||||
// +listType=atomic
|
||||
Screenshots []MetaV0alpha1InfoScreenshots `json:"screenshots,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaInfo creates a new MetaInfo object.
|
||||
func NewMetaInfo() *MetaInfo {
|
||||
return &MetaInfo{
|
||||
Keywords: []string{},
|
||||
Logos: *NewMetaV0alpha1InfoLogos(),
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaDependencies struct {
|
||||
// Required field
|
||||
GrafanaDependency string `json:"grafanaDependency"`
|
||||
// Optional fields
|
||||
GrafanaVersion *string `json:"grafanaVersion,omitempty"`
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
Plugins []MetaV0alpha1DependenciesPlugins `json:"plugins,omitempty"`
|
||||
Extensions *MetaV0alpha1DependenciesExtensions `json:"extensions,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaDependencies creates a new MetaDependencies object.
|
||||
func NewMetaDependencies() *MetaDependencies {
|
||||
return &MetaDependencies{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaEnterpriseFeatures struct {
|
||||
// Allow additional properties
|
||||
HealthDiagnosticsErrors *bool `json:"healthDiagnosticsErrors,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaEnterpriseFeatures creates a new MetaEnterpriseFeatures object.
|
||||
func NewMetaEnterpriseFeatures() *MetaEnterpriseFeatures {
|
||||
return &MetaEnterpriseFeatures{
|
||||
HealthDiagnosticsErrors: (func(input bool) *bool { return &input })(false),
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaInclude struct {
|
||||
Uid *string `json:"uid,omitempty"`
|
||||
Type *MetaIncludeType `json:"type,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Component *string `json:"component,omitempty"`
|
||||
Role *MetaIncludeRole `json:"role,omitempty"`
|
||||
Action *string `json:"action,omitempty"`
|
||||
Path *string `json:"path,omitempty"`
|
||||
AddToNav *bool `json:"addToNav,omitempty"`
|
||||
DefaultNav *bool `json:"defaultNav,omitempty"`
|
||||
Icon *string `json:"icon,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaInclude creates a new MetaInclude object.
|
||||
func NewMetaInclude() *MetaInclude {
|
||||
return &MetaInclude{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaQueryOptions struct {
|
||||
MaxDataPoints *bool `json:"maxDataPoints,omitempty"`
|
||||
MinInterval *bool `json:"minInterval,omitempty"`
|
||||
CacheTimeout *bool `json:"cacheTimeout,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaQueryOptions creates a new MetaQueryOptions object.
|
||||
func NewMetaQueryOptions() *MetaQueryOptions {
|
||||
return &MetaQueryOptions{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaRoute struct {
|
||||
Path *string `json:"path,omitempty"`
|
||||
Method *string `json:"method,omitempty"`
|
||||
Url *string `json:"url,omitempty"`
|
||||
ReqSignedIn *bool `json:"reqSignedIn,omitempty"`
|
||||
ReqRole *string `json:"reqRole,omitempty"`
|
||||
ReqAction *string `json:"reqAction,omitempty"`
|
||||
// +listType=atomic
|
||||
Headers []string `json:"headers,omitempty"`
|
||||
Body map[string]interface{} `json:"body,omitempty"`
|
||||
TokenAuth *MetaV0alpha1RouteTokenAuth `json:"tokenAuth,omitempty"`
|
||||
JwtTokenAuth *MetaV0alpha1RouteJwtTokenAuth `json:"jwtTokenAuth,omitempty"`
|
||||
// +listType=atomic
|
||||
UrlParams []MetaV0alpha1RouteUrlParams `json:"urlParams,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaRoute creates a new MetaRoute object.
|
||||
func NewMetaRoute() *MetaRoute {
|
||||
return &MetaRoute{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaIAM struct {
|
||||
// +listType=atomic
|
||||
Permissions []MetaV0alpha1IAMPermissions `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaIAM creates a new MetaIAM object.
|
||||
func NewMetaIAM() *MetaIAM {
|
||||
return &MetaIAM{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaRole struct {
|
||||
Role *MetaV0alpha1RoleRole `json:"role,omitempty"`
|
||||
// +listType=set
|
||||
Grants []string `json:"grants,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaRole creates a new MetaRole object.
|
||||
func NewMetaRole() *MetaRole {
|
||||
return &MetaRole{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaExtensions struct {
|
||||
// +listType=atomic
|
||||
AddedComponents []MetaV0alpha1ExtensionsAddedComponents `json:"addedComponents,omitempty"`
|
||||
// +listType=atomic
|
||||
AddedLinks []MetaV0alpha1ExtensionsAddedLinks `json:"addedLinks,omitempty"`
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
ExposedComponents []MetaV0alpha1ExtensionsExposedComponents `json:"exposedComponents,omitempty"`
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
ExtensionPoints []MetaV0alpha1ExtensionsExtensionPoints `json:"extensionPoints,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaExtensions creates a new MetaExtensions object.
|
||||
func NewMetaExtensions() *MetaExtensions {
|
||||
return &MetaExtensions{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaSpec struct {
|
||||
PluginJson MetaJSONData `json:"pluginJson"`
|
||||
Module *MetaV0alpha1SpecModule `json:"module,omitempty"`
|
||||
BaseURL *string `json:"baseURL,omitempty"`
|
||||
Signature *MetaV0alpha1SpecSignature `json:"signature,omitempty"`
|
||||
Angular *MetaV0alpha1SpecAngular `json:"angular,omitempty"`
|
||||
Translations map[string]string `json:"translations,omitempty"`
|
||||
// +listType=atomic
|
||||
Children []string `json:"children,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaSpec creates a new MetaSpec object.
|
||||
func NewMetaSpec() *MetaSpec {
|
||||
return &MetaSpec{
|
||||
PluginJson: *NewMetaJSONData(),
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1InfoLogos struct {
|
||||
Small string `json:"small"`
|
||||
Large string `json:"large"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1InfoLogos creates a new MetaV0alpha1InfoLogos object.
|
||||
func NewMetaV0alpha1InfoLogos() *MetaV0alpha1InfoLogos {
|
||||
return &MetaV0alpha1InfoLogos{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1InfoAuthor struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
Url *string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1InfoAuthor creates a new MetaV0alpha1InfoAuthor object.
|
||||
func NewMetaV0alpha1InfoAuthor() *MetaV0alpha1InfoAuthor {
|
||||
return &MetaV0alpha1InfoAuthor{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1InfoLinks struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Url *string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1InfoLinks creates a new MetaV0alpha1InfoLinks object.
|
||||
func NewMetaV0alpha1InfoLinks() *MetaV0alpha1InfoLinks {
|
||||
return &MetaV0alpha1InfoLinks{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1InfoScreenshots struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Path *string `json:"path,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1InfoScreenshots creates a new MetaV0alpha1InfoScreenshots object.
|
||||
func NewMetaV0alpha1InfoScreenshots() *MetaV0alpha1InfoScreenshots {
|
||||
return &MetaV0alpha1InfoScreenshots{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1DependenciesPlugins struct {
|
||||
Id string `json:"id"`
|
||||
Type MetaV0alpha1DependenciesPluginsType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1DependenciesPlugins creates a new MetaV0alpha1DependenciesPlugins object.
|
||||
func NewMetaV0alpha1DependenciesPlugins() *MetaV0alpha1DependenciesPlugins {
|
||||
return &MetaV0alpha1DependenciesPlugins{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1DependenciesExtensions struct {
|
||||
// +listType=set
|
||||
ExposedComponents []string `json:"exposedComponents,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1DependenciesExtensions creates a new MetaV0alpha1DependenciesExtensions object.
|
||||
func NewMetaV0alpha1DependenciesExtensions() *MetaV0alpha1DependenciesExtensions {
|
||||
return &MetaV0alpha1DependenciesExtensions{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1RouteTokenAuth struct {
|
||||
Url *string `json:"url,omitempty"`
|
||||
// +listType=set
|
||||
Scopes []string `json:"scopes,omitempty"`
|
||||
Params map[string]interface{} `json:"params,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1RouteTokenAuth creates a new MetaV0alpha1RouteTokenAuth object.
|
||||
func NewMetaV0alpha1RouteTokenAuth() *MetaV0alpha1RouteTokenAuth {
|
||||
return &MetaV0alpha1RouteTokenAuth{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1RouteJwtTokenAuth struct {
|
||||
Url *string `json:"url,omitempty"`
|
||||
// +listType=set
|
||||
Scopes []string `json:"scopes,omitempty"`
|
||||
Params map[string]interface{} `json:"params,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1RouteJwtTokenAuth creates a new MetaV0alpha1RouteJwtTokenAuth object.
|
||||
func NewMetaV0alpha1RouteJwtTokenAuth() *MetaV0alpha1RouteJwtTokenAuth {
|
||||
return &MetaV0alpha1RouteJwtTokenAuth{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1RouteUrlParams struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Content *string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1RouteUrlParams creates a new MetaV0alpha1RouteUrlParams object.
|
||||
func NewMetaV0alpha1RouteUrlParams() *MetaV0alpha1RouteUrlParams {
|
||||
return &MetaV0alpha1RouteUrlParams{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1IAMPermissions struct {
|
||||
Action *string `json:"action,omitempty"`
|
||||
Scope *string `json:"scope,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1IAMPermissions creates a new MetaV0alpha1IAMPermissions object.
|
||||
func NewMetaV0alpha1IAMPermissions() *MetaV0alpha1IAMPermissions {
|
||||
return &MetaV0alpha1IAMPermissions{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1RoleRolePermissions struct {
|
||||
Action *string `json:"action,omitempty"`
|
||||
Scope *string `json:"scope,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1RoleRolePermissions creates a new MetaV0alpha1RoleRolePermissions object.
|
||||
func NewMetaV0alpha1RoleRolePermissions() *MetaV0alpha1RoleRolePermissions {
|
||||
return &MetaV0alpha1RoleRolePermissions{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1RoleRole struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
// +listType=atomic
|
||||
Permissions []MetaV0alpha1RoleRolePermissions `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1RoleRole creates a new MetaV0alpha1RoleRole object.
|
||||
func NewMetaV0alpha1RoleRole() *MetaV0alpha1RoleRole {
|
||||
return &MetaV0alpha1RoleRole{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1ExtensionsAddedComponents struct {
|
||||
// +listType=set
|
||||
Targets []string `json:"targets"`
|
||||
Title string `json:"title"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1ExtensionsAddedComponents creates a new MetaV0alpha1ExtensionsAddedComponents object.
|
||||
func NewMetaV0alpha1ExtensionsAddedComponents() *MetaV0alpha1ExtensionsAddedComponents {
|
||||
return &MetaV0alpha1ExtensionsAddedComponents{
|
||||
Targets: []string{},
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1ExtensionsAddedLinks struct {
|
||||
// +listType=set
|
||||
Targets []string `json:"targets"`
|
||||
Title string `json:"title"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1ExtensionsAddedLinks creates a new MetaV0alpha1ExtensionsAddedLinks object.
|
||||
func NewMetaV0alpha1ExtensionsAddedLinks() *MetaV0alpha1ExtensionsAddedLinks {
|
||||
return &MetaV0alpha1ExtensionsAddedLinks{
|
||||
Targets: []string{},
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1ExtensionsExposedComponents struct {
|
||||
Id string `json:"id"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1ExtensionsExposedComponents creates a new MetaV0alpha1ExtensionsExposedComponents object.
|
||||
func NewMetaV0alpha1ExtensionsExposedComponents() *MetaV0alpha1ExtensionsExposedComponents {
|
||||
return &MetaV0alpha1ExtensionsExposedComponents{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1ExtensionsExtensionPoints struct {
|
||||
Id string `json:"id"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1ExtensionsExtensionPoints creates a new MetaV0alpha1ExtensionsExtensionPoints object.
|
||||
func NewMetaV0alpha1ExtensionsExtensionPoints() *MetaV0alpha1ExtensionsExtensionPoints {
|
||||
return &MetaV0alpha1ExtensionsExtensionPoints{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1SpecModule struct {
|
||||
Path string `json:"path"`
|
||||
Hash *string `json:"hash,omitempty"`
|
||||
LoadingStrategy *MetaV0alpha1SpecModuleLoadingStrategy `json:"loadingStrategy,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1SpecModule creates a new MetaV0alpha1SpecModule object.
|
||||
func NewMetaV0alpha1SpecModule() *MetaV0alpha1SpecModule {
|
||||
return &MetaV0alpha1SpecModule{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1SpecSignature struct {
|
||||
Status MetaV0alpha1SpecSignatureStatus `json:"status"`
|
||||
Type *MetaV0alpha1SpecSignatureType `json:"type,omitempty"`
|
||||
Org *string `json:"org,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1SpecSignature creates a new MetaV0alpha1SpecSignature object.
|
||||
func NewMetaV0alpha1SpecSignature() *MetaV0alpha1SpecSignature {
|
||||
return &MetaV0alpha1SpecSignature{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1SpecAngular struct {
|
||||
Detected bool `json:"detected"`
|
||||
}
|
||||
|
||||
// NewMetaV0alpha1SpecAngular creates a new MetaV0alpha1SpecAngular object.
|
||||
func NewMetaV0alpha1SpecAngular() *MetaV0alpha1SpecAngular {
|
||||
return &MetaV0alpha1SpecAngular{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaJSONDataType string
|
||||
|
||||
const (
|
||||
MetaJSONDataTypeApp MetaJSONDataType = "app"
|
||||
MetaJSONDataTypeDatasource MetaJSONDataType = "datasource"
|
||||
MetaJSONDataTypePanel MetaJSONDataType = "panel"
|
||||
MetaJSONDataTypeRenderer MetaJSONDataType = "renderer"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaJSONDataCategory string
|
||||
|
||||
const (
|
||||
MetaJSONDataCategoryTsdb MetaJSONDataCategory = "tsdb"
|
||||
MetaJSONDataCategoryLogging MetaJSONDataCategory = "logging"
|
||||
MetaJSONDataCategoryCloud MetaJSONDataCategory = "cloud"
|
||||
MetaJSONDataCategoryTracing MetaJSONDataCategory = "tracing"
|
||||
MetaJSONDataCategoryProfiling MetaJSONDataCategory = "profiling"
|
||||
MetaJSONDataCategorySql MetaJSONDataCategory = "sql"
|
||||
MetaJSONDataCategoryEnterprise MetaJSONDataCategory = "enterprise"
|
||||
MetaJSONDataCategoryIot MetaJSONDataCategory = "iot"
|
||||
MetaJSONDataCategoryOther MetaJSONDataCategory = "other"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaJSONDataState string
|
||||
|
||||
const (
|
||||
MetaJSONDataStateAlpha MetaJSONDataState = "alpha"
|
||||
MetaJSONDataStateBeta MetaJSONDataState = "beta"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaIncludeType string
|
||||
|
||||
const (
|
||||
MetaIncludeTypeDashboard MetaIncludeType = "dashboard"
|
||||
MetaIncludeTypePage MetaIncludeType = "page"
|
||||
MetaIncludeTypePanel MetaIncludeType = "panel"
|
||||
MetaIncludeTypeDatasource MetaIncludeType = "datasource"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaIncludeRole string
|
||||
|
||||
const (
|
||||
MetaIncludeRoleAdmin MetaIncludeRole = "Admin"
|
||||
MetaIncludeRoleEditor MetaIncludeRole = "Editor"
|
||||
MetaIncludeRoleViewer MetaIncludeRole = "Viewer"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1DependenciesPluginsType string
|
||||
|
||||
const (
|
||||
MetaV0alpha1DependenciesPluginsTypeApp MetaV0alpha1DependenciesPluginsType = "app"
|
||||
MetaV0alpha1DependenciesPluginsTypeDatasource MetaV0alpha1DependenciesPluginsType = "datasource"
|
||||
MetaV0alpha1DependenciesPluginsTypePanel MetaV0alpha1DependenciesPluginsType = "panel"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1SpecModuleLoadingStrategy string
|
||||
|
||||
const (
|
||||
MetaV0alpha1SpecModuleLoadingStrategyFetch MetaV0alpha1SpecModuleLoadingStrategy = "fetch"
|
||||
MetaV0alpha1SpecModuleLoadingStrategyScript MetaV0alpha1SpecModuleLoadingStrategy = "script"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1SpecSignatureStatus string
|
||||
|
||||
const (
|
||||
MetaV0alpha1SpecSignatureStatusInternal MetaV0alpha1SpecSignatureStatus = "internal"
|
||||
MetaV0alpha1SpecSignatureStatusValid MetaV0alpha1SpecSignatureStatus = "valid"
|
||||
MetaV0alpha1SpecSignatureStatusInvalid MetaV0alpha1SpecSignatureStatus = "invalid"
|
||||
MetaV0alpha1SpecSignatureStatusModified MetaV0alpha1SpecSignatureStatus = "modified"
|
||||
MetaV0alpha1SpecSignatureStatusUnsigned MetaV0alpha1SpecSignatureStatus = "unsigned"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaV0alpha1SpecSignatureType string
|
||||
|
||||
const (
|
||||
MetaV0alpha1SpecSignatureTypeGrafana MetaV0alpha1SpecSignatureType = "grafana"
|
||||
MetaV0alpha1SpecSignatureTypeCommercial MetaV0alpha1SpecSignatureType = "commercial"
|
||||
MetaV0alpha1SpecSignatureTypeCommunity MetaV0alpha1SpecSignatureType = "community"
|
||||
MetaV0alpha1SpecSignatureTypePrivate MetaV0alpha1SpecSignatureType = "private"
|
||||
MetaV0alpha1SpecSignatureTypePrivateGlob MetaV0alpha1SpecSignatureType = "private-glob"
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetastatusOperatorState struct {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"`
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State MetaStatusOperatorStateState `json:"state"`
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"`
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetastatusOperatorState creates a new MetastatusOperatorState object.
|
||||
func NewMetastatusOperatorState() *MetastatusOperatorState {
|
||||
return &MetastatusOperatorState{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaStatus struct {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]MetastatusOperatorState `json:"operatorStates,omitempty"`
|
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
|
||||
}
|
||||
|
||||
// NewMetaStatus creates a new MetaStatus object.
|
||||
func NewMetaStatus() *MetaStatus {
|
||||
return &MetaStatus{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type MetaStatusOperatorStateState string
|
||||
|
||||
const (
|
||||
MetaStatusOperatorStateStateSuccess MetaStatusOperatorStateState = "success"
|
||||
MetaStatusOperatorStateStateInProgress MetaStatusOperatorStateState = "in_progress"
|
||||
MetaStatusOperatorStateStateFailed MetaStatusOperatorStateState = "failed"
|
||||
)
|
||||
@@ -0,0 +1,99 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type PluginClient struct {
|
||||
client *resource.TypedClient[*Plugin, *PluginList]
|
||||
}
|
||||
|
||||
func NewPluginClient(client resource.Client) *PluginClient {
|
||||
return &PluginClient{
|
||||
client: resource.NewTypedClient[*Plugin, *PluginList](client, PluginKind()),
|
||||
}
|
||||
}
|
||||
|
||||
func NewPluginClientFromGenerator(generator resource.ClientGenerator) (*PluginClient, error) {
|
||||
c, err := generator.ClientFor(PluginKind())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewPluginClient(c), nil
|
||||
}
|
||||
|
||||
func (c *PluginClient) Get(ctx context.Context, identifier resource.Identifier) (*Plugin, error) {
|
||||
return c.client.Get(ctx, identifier)
|
||||
}
|
||||
|
||||
func (c *PluginClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*PluginList, error) {
|
||||
return c.client.List(ctx, namespace, opts)
|
||||
}
|
||||
|
||||
func (c *PluginClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*PluginList, error) {
|
||||
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Limit: opts.Limit,
|
||||
LabelFilters: opts.LabelFilters,
|
||||
FieldSelectors: opts.FieldSelectors,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for resp.GetContinue() != "" {
|
||||
page, err := c.client.List(ctx, namespace, resource.ListOptions{
|
||||
Continue: resp.GetContinue(),
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Limit: opts.Limit,
|
||||
LabelFilters: opts.LabelFilters,
|
||||
FieldSelectors: opts.FieldSelectors,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.SetContinue(page.GetContinue())
|
||||
resp.SetResourceVersion(page.GetResourceVersion())
|
||||
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (c *PluginClient) Create(ctx context.Context, obj *Plugin, opts resource.CreateOptions) (*Plugin, error) {
|
||||
// Make sure apiVersion and kind are set
|
||||
obj.APIVersion = GroupVersion.Identifier()
|
||||
obj.Kind = PluginKind().Kind()
|
||||
return c.client.Create(ctx, obj, opts)
|
||||
}
|
||||
|
||||
func (c *PluginClient) Update(ctx context.Context, obj *Plugin, opts resource.UpdateOptions) (*Plugin, error) {
|
||||
return c.client.Update(ctx, obj, opts)
|
||||
}
|
||||
|
||||
func (c *PluginClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Plugin, error) {
|
||||
return c.client.Patch(ctx, identifier, req, opts)
|
||||
}
|
||||
|
||||
func (c *PluginClient) UpdateStatus(ctx context.Context, identifier resource.Identifier, newStatus PluginStatus, opts resource.UpdateOptions) (*Plugin, error) {
|
||||
return c.client.Update(ctx, &Plugin{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: PluginKind().Kind(),
|
||||
APIVersion: GroupVersion.Identifier(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Namespace: identifier.Namespace,
|
||||
Name: identifier.Name,
|
||||
},
|
||||
Status: newStatus,
|
||||
}, resource.UpdateOptions{
|
||||
Subresource: "status",
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
})
|
||||
}
|
||||
|
||||
func (c *PluginClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
|
||||
return c.client.Delete(ctx, identifier, opts)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
)
|
||||
|
||||
// PluginJSONCodec is an implementation of resource.Codec for kubernetes JSON encoding
|
||||
type PluginJSONCodec struct{}
|
||||
|
||||
// Read reads JSON-encoded bytes from `reader` and unmarshals them into `into`
|
||||
func (*PluginJSONCodec) Read(reader io.Reader, into resource.Object) error {
|
||||
return json.NewDecoder(reader).Decode(into)
|
||||
}
|
||||
|
||||
// Write writes JSON-encoded bytes into `writer` marshaled from `from`
|
||||
func (*PluginJSONCodec) Write(writer io.Writer, from resource.Object) error {
|
||||
return json.NewEncoder(writer).Encode(from)
|
||||
}
|
||||
|
||||
// Interface compliance checks
|
||||
var _ resource.Codec = &PluginJSONCodec{}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
)
|
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type PluginMetadata struct {
|
||||
UpdateTimestamp time.Time `json:"updateTimestamp"`
|
||||
CreatedBy string `json:"createdBy"`
|
||||
Uid string `json:"uid"`
|
||||
CreationTimestamp time.Time `json:"creationTimestamp"`
|
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
|
||||
Finalizers []string `json:"finalizers"`
|
||||
ResourceVersion string `json:"resourceVersion"`
|
||||
Generation int64 `json:"generation"`
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
}
|
||||
|
||||
// NewPluginMetadata creates a new PluginMetadata object.
|
||||
func NewPluginMetadata() *PluginMetadata {
|
||||
return &PluginMetadata{
|
||||
Finalizers: []string{},
|
||||
Labels: map[string]string{},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Plugin struct {
|
||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata" yaml:"metadata"`
|
||||
|
||||
// Spec is the spec of the Plugin
|
||||
Spec PluginSpec `json:"spec" yaml:"spec"`
|
||||
|
||||
Status PluginStatus `json:"status" yaml:"status"`
|
||||
}
|
||||
|
||||
func NewPlugin() *Plugin {
|
||||
return &Plugin{
|
||||
Spec: *NewPluginSpec(),
|
||||
Status: *NewPluginStatus(),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) GetSpec() any {
|
||||
return o.Spec
|
||||
}
|
||||
|
||||
func (o *Plugin) SetSpec(spec any) error {
|
||||
cast, ok := spec.(PluginSpec)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot set spec type %#v, not of type Spec", spec)
|
||||
}
|
||||
o.Spec = cast
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Plugin) GetSubresources() map[string]any {
|
||||
return map[string]any{
|
||||
"status": o.Status,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) GetSubresource(name string) (any, bool) {
|
||||
switch name {
|
||||
case "status":
|
||||
return o.Status, true
|
||||
default:
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) SetSubresource(name string, value any) error {
|
||||
switch name {
|
||||
case "status":
|
||||
cast, ok := value.(PluginStatus)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot set status type %#v, not of type PluginStatus", value)
|
||||
}
|
||||
o.Status = cast
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("subresource '%s' does not exist", name)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) GetStaticMetadata() resource.StaticMetadata {
|
||||
gvk := o.GroupVersionKind()
|
||||
return resource.StaticMetadata{
|
||||
Name: o.ObjectMeta.Name,
|
||||
Namespace: o.ObjectMeta.Namespace,
|
||||
Group: gvk.Group,
|
||||
Version: gvk.Version,
|
||||
Kind: gvk.Kind,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) SetStaticMetadata(metadata resource.StaticMetadata) {
|
||||
o.Name = metadata.Name
|
||||
o.Namespace = metadata.Namespace
|
||||
o.SetGroupVersionKind(schema.GroupVersionKind{
|
||||
Group: metadata.Group,
|
||||
Version: metadata.Version,
|
||||
Kind: metadata.Kind,
|
||||
})
|
||||
}
|
||||
|
||||
func (o *Plugin) GetCommonMetadata() resource.CommonMetadata {
|
||||
dt := o.DeletionTimestamp
|
||||
var deletionTimestamp *time.Time
|
||||
if dt != nil {
|
||||
deletionTimestamp = &dt.Time
|
||||
}
|
||||
// Legacy ExtraFields support
|
||||
extraFields := make(map[string]any)
|
||||
if o.Annotations != nil {
|
||||
extraFields["annotations"] = o.Annotations
|
||||
}
|
||||
if o.ManagedFields != nil {
|
||||
extraFields["managedFields"] = o.ManagedFields
|
||||
}
|
||||
if o.OwnerReferences != nil {
|
||||
extraFields["ownerReferences"] = o.OwnerReferences
|
||||
}
|
||||
return resource.CommonMetadata{
|
||||
UID: string(o.UID),
|
||||
ResourceVersion: o.ResourceVersion,
|
||||
Generation: o.Generation,
|
||||
Labels: o.Labels,
|
||||
CreationTimestamp: o.CreationTimestamp.Time,
|
||||
DeletionTimestamp: deletionTimestamp,
|
||||
Finalizers: o.Finalizers,
|
||||
UpdateTimestamp: o.GetUpdateTimestamp(),
|
||||
CreatedBy: o.GetCreatedBy(),
|
||||
UpdatedBy: o.GetUpdatedBy(),
|
||||
ExtraFields: extraFields,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) SetCommonMetadata(metadata resource.CommonMetadata) {
|
||||
o.UID = types.UID(metadata.UID)
|
||||
o.ResourceVersion = metadata.ResourceVersion
|
||||
o.Generation = metadata.Generation
|
||||
o.Labels = metadata.Labels
|
||||
o.CreationTimestamp = metav1.NewTime(metadata.CreationTimestamp)
|
||||
if metadata.DeletionTimestamp != nil {
|
||||
dt := metav1.NewTime(*metadata.DeletionTimestamp)
|
||||
o.DeletionTimestamp = &dt
|
||||
} else {
|
||||
o.DeletionTimestamp = nil
|
||||
}
|
||||
o.Finalizers = metadata.Finalizers
|
||||
if o.Annotations == nil {
|
||||
o.Annotations = make(map[string]string)
|
||||
}
|
||||
if !metadata.UpdateTimestamp.IsZero() {
|
||||
o.SetUpdateTimestamp(metadata.UpdateTimestamp)
|
||||
}
|
||||
if metadata.CreatedBy != "" {
|
||||
o.SetCreatedBy(metadata.CreatedBy)
|
||||
}
|
||||
if metadata.UpdatedBy != "" {
|
||||
o.SetUpdatedBy(metadata.UpdatedBy)
|
||||
}
|
||||
// Legacy support for setting Annotations, ManagedFields, and OwnerReferences via ExtraFields
|
||||
if metadata.ExtraFields != nil {
|
||||
if annotations, ok := metadata.ExtraFields["annotations"]; ok {
|
||||
if cast, ok := annotations.(map[string]string); ok {
|
||||
o.Annotations = cast
|
||||
}
|
||||
}
|
||||
if managedFields, ok := metadata.ExtraFields["managedFields"]; ok {
|
||||
if cast, ok := managedFields.([]metav1.ManagedFieldsEntry); ok {
|
||||
o.ManagedFields = cast
|
||||
}
|
||||
}
|
||||
if ownerReferences, ok := metadata.ExtraFields["ownerReferences"]; ok {
|
||||
if cast, ok := ownerReferences.([]metav1.OwnerReference); ok {
|
||||
o.OwnerReferences = cast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Plugin) GetCreatedBy() string {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
return o.ObjectMeta.Annotations["grafana.com/createdBy"]
|
||||
}
|
||||
|
||||
func (o *Plugin) SetCreatedBy(createdBy string) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/createdBy"] = createdBy
|
||||
}
|
||||
|
||||
func (o *Plugin) GetUpdateTimestamp() time.Time {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
parsed, _ := time.Parse(time.RFC3339, o.ObjectMeta.Annotations["grafana.com/updateTimestamp"])
|
||||
return parsed
|
||||
}
|
||||
|
||||
func (o *Plugin) SetUpdateTimestamp(updateTimestamp time.Time) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/updateTimestamp"] = updateTimestamp.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
func (o *Plugin) GetUpdatedBy() string {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
return o.ObjectMeta.Annotations["grafana.com/updatedBy"]
|
||||
}
|
||||
|
||||
func (o *Plugin) SetUpdatedBy(updatedBy string) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/updatedBy"] = updatedBy
|
||||
}
|
||||
|
||||
func (o *Plugin) Copy() resource.Object {
|
||||
return resource.CopyObject(o)
|
||||
}
|
||||
|
||||
func (o *Plugin) DeepCopyObject() runtime.Object {
|
||||
return o.Copy()
|
||||
}
|
||||
|
||||
func (o *Plugin) DeepCopy() *Plugin {
|
||||
cpy := &Plugin{}
|
||||
o.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *Plugin) DeepCopyInto(dst *Plugin) {
|
||||
dst.TypeMeta.APIVersion = o.TypeMeta.APIVersion
|
||||
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
|
||||
o.Spec.DeepCopyInto(&dst.Spec)
|
||||
o.Status.DeepCopyInto(&dst.Status)
|
||||
}
|
||||
|
||||
// Interface compliance compile-time check
|
||||
var _ resource.Object = &Plugin{}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type PluginList struct {
|
||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||
metav1.ListMeta `json:"metadata" yaml:"metadata"`
|
||||
Items []Plugin `json:"items" yaml:"items"`
|
||||
}
|
||||
|
||||
func (o *PluginList) DeepCopyObject() runtime.Object {
|
||||
return o.Copy()
|
||||
}
|
||||
|
||||
func (o *PluginList) Copy() resource.ListObject {
|
||||
cpy := &PluginList{
|
||||
TypeMeta: o.TypeMeta,
|
||||
Items: make([]Plugin, len(o.Items)),
|
||||
}
|
||||
o.ListMeta.DeepCopyInto(&cpy.ListMeta)
|
||||
for i := 0; i < len(o.Items); i++ {
|
||||
if item, ok := o.Items[i].Copy().(*Plugin); ok {
|
||||
cpy.Items[i] = *item
|
||||
}
|
||||
}
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *PluginList) GetItems() []resource.Object {
|
||||
items := make([]resource.Object, len(o.Items))
|
||||
for i := 0; i < len(o.Items); i++ {
|
||||
items[i] = &o.Items[i]
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
func (o *PluginList) SetItems(items []resource.Object) {
|
||||
o.Items = make([]Plugin, len(items))
|
||||
for i := 0; i < len(items); i++ {
|
||||
o.Items[i] = *items[i].(*Plugin)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *PluginList) DeepCopy() *PluginList {
|
||||
cpy := &PluginList{}
|
||||
o.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *PluginList) DeepCopyInto(dst *PluginList) {
|
||||
resource.CopyObjectInto(dst, o)
|
||||
}
|
||||
|
||||
// Interface compliance compile-time check
|
||||
var _ resource.ListObject = &PluginList{}
|
||||
|
||||
// Copy methods for all subresource types
|
||||
|
||||
// DeepCopy creates a full deep copy of Spec
|
||||
func (s *PluginSpec) DeepCopy() *PluginSpec {
|
||||
cpy := &PluginSpec{}
|
||||
s.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
// DeepCopyInto deep copies Spec into another Spec object
|
||||
func (s *PluginSpec) DeepCopyInto(dst *PluginSpec) {
|
||||
resource.CopyObjectInto(dst, s)
|
||||
}
|
||||
|
||||
// DeepCopy creates a full deep copy of PluginStatus
|
||||
func (s *PluginStatus) DeepCopy() *PluginStatus {
|
||||
cpy := &PluginStatus{}
|
||||
s.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
// DeepCopyInto deep copies PluginStatus into another PluginStatus object
|
||||
func (s *PluginStatus) DeepCopyInto(dst *PluginStatus) {
|
||||
resource.CopyObjectInto(dst, s)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
)
|
||||
|
||||
// schema is unexported to prevent accidental overwrites
|
||||
var (
|
||||
schemaPlugin = resource.NewSimpleSchema("plugins.grafana.app", "v0alpha1", NewPlugin(), &PluginList{}, resource.WithKind("Plugin"),
|
||||
resource.WithPlural("plugins"), resource.WithScope(resource.NamespacedScope))
|
||||
kindPlugin = resource.Kind{
|
||||
Schema: schemaPlugin,
|
||||
Codecs: map[resource.KindEncoding]resource.Codec{
|
||||
resource.KindEncodingJSON: &PluginJSONCodec{},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// Kind returns a resource.Kind for this Schema with a JSON codec
|
||||
func PluginKind() resource.Kind {
|
||||
return kindPlugin
|
||||
}
|
||||
|
||||
// Schema returns a resource.SimpleSchema representation of Plugin
|
||||
func PluginSchema() *resource.SimpleSchema {
|
||||
return schemaPlugin
|
||||
}
|
||||
|
||||
// Interface compliance checks
|
||||
var _ resource.Schema = kindPlugin
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type PluginSpec struct {
|
||||
Id string `json:"id"`
|
||||
Version string `json:"version"`
|
||||
Url *string `json:"url,omitempty"`
|
||||
Class PluginSpecClass `json:"class"`
|
||||
}
|
||||
|
||||
// NewPluginSpec creates a new PluginSpec object.
|
||||
func NewPluginSpec() *PluginSpec {
|
||||
return &PluginSpec{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type PluginSpecClass string
|
||||
|
||||
const (
|
||||
PluginSpecClassCore PluginSpecClass = "core"
|
||||
PluginSpecClassExternal PluginSpecClass = "external"
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type PluginstatusOperatorState struct {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"`
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State PluginStatusOperatorStateState `json:"state"`
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"`
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// NewPluginstatusOperatorState creates a new PluginstatusOperatorState object.
|
||||
func NewPluginstatusOperatorState() *PluginstatusOperatorState {
|
||||
return &PluginstatusOperatorState{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type PluginStatus struct {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]PluginstatusOperatorState `json:"operatorStates,omitempty"`
|
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
|
||||
}
|
||||
|
||||
// NewPluginStatus creates a new PluginStatus object.
|
||||
func NewPluginStatus() *PluginStatus {
|
||||
return &PluginStatus{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type PluginStatusOperatorStateState string
|
||||
|
||||
const (
|
||||
PluginStatusOperatorStateStateSuccess PluginStatusOperatorStateState = "success"
|
||||
PluginStatusOperatorStateStateInProgress PluginStatusOperatorStateState = "in_progress"
|
||||
PluginStatusOperatorStateStateFailed PluginStatusOperatorStateState = "failed"
|
||||
)
|
||||
Reference in New Issue
Block a user