Skip to content

Commit

Permalink
Merge pull request #581 from betelgeuse-code/mukesh/addSchemas
Browse files Browse the repository at this point in the history
Add new schemas
  • Loading branch information
Yashsharma1911 authored Apr 25, 2024
2 parents 22e281f + 3626f48 commit 1494da3
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/schemas/grafanaCredential/schema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Schema for creating grafana credential;
*/
const grafanaCredentialSchema = {
type: 'object',
title: 'Grafana',
properties: {
credentialName: {
title: 'Credential Name',
type: 'string',
description: 'Name of your credential'
},
secret: {
type: 'object',
title: 'Credential Secret',
description: 'Credential secret for the Grafana instance',
properties: {
grafanaURL: {
type: 'string',
title: 'URL',
description: 'URL of the Grafana instance'
},
grafanaAPIKey: {
type: 'string',
title: 'API Key',
description: 'API Key for the Grafana instance'
}
},
required: ['grafanaURL', 'grafanaAPIKey']
}
},
required: ['credentialName']
};

export default grafanaCredentialSchema;
3 changes: 3 additions & 0 deletions src/schemas/grafanaCredential/uiSchema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const grafanaCredentialUiSchema = {};

export default grafanaCredentialUiSchema;
15 changes: 15 additions & 0 deletions src/schemas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ import importFilterUiSchema from './importFilter/uiSchema';
import publishCatalogItemSchema from './publishCatalogItem/schema';
import publishCatalogItemUiSchema from './publishCatalogItem/uiSchema';

import kubernetesCredentialSchema from './kubernetesCredential/schema';
import kubernetesCredentialUiSchema from './kubernetesCredential/uiSchema';

import prometheusCredentialSchema from './prometheusCredential/schema';
import prometheusCredentialUiSchema from './prometheusCredential/uiSchema';

import grafanaCredentialSchema from './grafanaCredential/schema';
import grafanaCredentialSUiSchema from './grafanaCredential/uiSchema';

export {
createAndEditEnvironmentSchema,
createAndEditEnvironmentUiSchema,
createAndEditWorkspaceSchema,
createAndEditWorkspaceUiSchema,
grafanaCredentialSUiSchema,
grafanaCredentialSchema,
helmConnectionSchema,
helmConnectionUiSchema,
helpAndSupportModalSchema,
Expand All @@ -32,6 +43,10 @@ export {
importDesignUiSchema,
importFilterSchema,
importFilterUiSchema,
kubernetesCredentialSchema,
kubernetesCredentialUiSchema,
prometheusCredentialSchema,
prometheusCredentialUiSchema,
publishCatalogItemSchema,
publishCatalogItemUiSchema
};
74 changes: 74 additions & 0 deletions src/schemas/kubernetesCredential/schema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* Schema for creating grafana credential;
*/
const kubernetesCredentialSchema = {
type: 'object',
title: 'Kubernetes',
properties: {
credentialName: {
title: 'Credential Name',
type: 'string',
description: 'Name of your credential'
},
secret: {
type: 'object',
title: 'Credential Secret',
description: 'Credential secret for the Kubernetes cluster',
properties: {
clusterName: {
type: 'string',
title: 'Cluster Name',
description: 'Name of the Kubernetes cluster'
},
clusterServerURL: {
type: 'string',
title: 'Server URL',
description: 'URL of the Kubernetes cluster'
},
auth: {
type: 'object',
title: 'Auth',
description: 'Kubernetes cluster authentication',
properties: {
clusterUserName: {
type: 'string',
title: 'User Name',
description: 'Name of the Kubernetes cluster user'
},
clusterToken: {
type: 'string',
title: 'Token',
description: 'Token of the Kubernetes cluster user'
},
clusterClientCertificateData: {
type: 'string',
title: 'Client Certificate Data',
description: 'Certificate data of the Kubernetes cluster'
},
clusterClientKeyData: {
type: 'string',
title: 'Client Key Data',
description: 'Client Key data of the Kubernetes cluster'
},
clusterCertificateAuthorityData: {
type: 'string',
title: 'Certificate Authority Data',
description: 'Certificate Authority data of the Kubernetes cluster'
}
},
required: [
'clusterUserName',
'clusterToken',
'clusterClientCertificateData',
'clusterClientKeyData',
'clusterCertificateAuthorityData'
]
}
},
required: ['clusterName', 'clusterServerURL']
}
},
required: ['credentialName']
};

export default kubernetesCredentialSchema;
3 changes: 3 additions & 0 deletions src/schemas/kubernetesCredential/uiSchema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const kubernetesCredentialUiSchema = {};

export default kubernetesCredentialUiSchema;
30 changes: 30 additions & 0 deletions src/schemas/prometheusCredential/schema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Schema for creating prometheus credential;
*/
const prometheusCredentialSchema = {
type: 'object',
title: 'Prometheus',
properties: {
credentialName: {
title: 'Credential Name',
type: 'string',
description: 'Name of your credential'
},
secret: {
type: 'object',
title: 'Credential Secret',
description: 'Credential secret for the Prometheus instance',
properties: {
prometheusURL: {
type: 'string',
title: 'URL',
description: 'URL of the Prometheus instance'
}
},
required: ['prometheusURL']
}
},
required: ['credentialName']
};

export default prometheusCredentialSchema;
3 changes: 3 additions & 0 deletions src/schemas/prometheusCredential/uiSchema.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const prometheusCredentialUiSchema = {};

export default prometheusCredentialUiSchema;

0 comments on commit 1494da3

Please sign in to comment.