Skip to content

Commit 1494da3

Browse files
Merge pull request #581 from betelgeuse-code/mukesh/addSchemas
Add new schemas
2 parents 22e281f + 3626f48 commit 1494da3

File tree

7 files changed

+163
-0
lines changed

7 files changed

+163
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Schema for creating grafana credential;
3+
*/
4+
const grafanaCredentialSchema = {
5+
type: 'object',
6+
title: 'Grafana',
7+
properties: {
8+
credentialName: {
9+
title: 'Credential Name',
10+
type: 'string',
11+
description: 'Name of your credential'
12+
},
13+
secret: {
14+
type: 'object',
15+
title: 'Credential Secret',
16+
description: 'Credential secret for the Grafana instance',
17+
properties: {
18+
grafanaURL: {
19+
type: 'string',
20+
title: 'URL',
21+
description: 'URL of the Grafana instance'
22+
},
23+
grafanaAPIKey: {
24+
type: 'string',
25+
title: 'API Key',
26+
description: 'API Key for the Grafana instance'
27+
}
28+
},
29+
required: ['grafanaURL', 'grafanaAPIKey']
30+
}
31+
},
32+
required: ['credentialName']
33+
};
34+
35+
export default grafanaCredentialSchema;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const grafanaCredentialUiSchema = {};
2+
3+
export default grafanaCredentialUiSchema;

src/schemas/index.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,22 @@ import importFilterUiSchema from './importFilter/uiSchema';
1919
import publishCatalogItemSchema from './publishCatalogItem/schema';
2020
import publishCatalogItemUiSchema from './publishCatalogItem/uiSchema';
2121

22+
import kubernetesCredentialSchema from './kubernetesCredential/schema';
23+
import kubernetesCredentialUiSchema from './kubernetesCredential/uiSchema';
24+
25+
import prometheusCredentialSchema from './prometheusCredential/schema';
26+
import prometheusCredentialUiSchema from './prometheusCredential/uiSchema';
27+
28+
import grafanaCredentialSchema from './grafanaCredential/schema';
29+
import grafanaCredentialSUiSchema from './grafanaCredential/uiSchema';
30+
2231
export {
2332
createAndEditEnvironmentSchema,
2433
createAndEditEnvironmentUiSchema,
2534
createAndEditWorkspaceSchema,
2635
createAndEditWorkspaceUiSchema,
36+
grafanaCredentialSUiSchema,
37+
grafanaCredentialSchema,
2738
helmConnectionSchema,
2839
helmConnectionUiSchema,
2940
helpAndSupportModalSchema,
@@ -32,6 +43,10 @@ export {
3243
importDesignUiSchema,
3344
importFilterSchema,
3445
importFilterUiSchema,
46+
kubernetesCredentialSchema,
47+
kubernetesCredentialUiSchema,
48+
prometheusCredentialSchema,
49+
prometheusCredentialUiSchema,
3550
publishCatalogItemSchema,
3651
publishCatalogItemUiSchema
3752
};
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* Schema for creating grafana credential;
3+
*/
4+
const kubernetesCredentialSchema = {
5+
type: 'object',
6+
title: 'Kubernetes',
7+
properties: {
8+
credentialName: {
9+
title: 'Credential Name',
10+
type: 'string',
11+
description: 'Name of your credential'
12+
},
13+
secret: {
14+
type: 'object',
15+
title: 'Credential Secret',
16+
description: 'Credential secret for the Kubernetes cluster',
17+
properties: {
18+
clusterName: {
19+
type: 'string',
20+
title: 'Cluster Name',
21+
description: 'Name of the Kubernetes cluster'
22+
},
23+
clusterServerURL: {
24+
type: 'string',
25+
title: 'Server URL',
26+
description: 'URL of the Kubernetes cluster'
27+
},
28+
auth: {
29+
type: 'object',
30+
title: 'Auth',
31+
description: 'Kubernetes cluster authentication',
32+
properties: {
33+
clusterUserName: {
34+
type: 'string',
35+
title: 'User Name',
36+
description: 'Name of the Kubernetes cluster user'
37+
},
38+
clusterToken: {
39+
type: 'string',
40+
title: 'Token',
41+
description: 'Token of the Kubernetes cluster user'
42+
},
43+
clusterClientCertificateData: {
44+
type: 'string',
45+
title: 'Client Certificate Data',
46+
description: 'Certificate data of the Kubernetes cluster'
47+
},
48+
clusterClientKeyData: {
49+
type: 'string',
50+
title: 'Client Key Data',
51+
description: 'Client Key data of the Kubernetes cluster'
52+
},
53+
clusterCertificateAuthorityData: {
54+
type: 'string',
55+
title: 'Certificate Authority Data',
56+
description: 'Certificate Authority data of the Kubernetes cluster'
57+
}
58+
},
59+
required: [
60+
'clusterUserName',
61+
'clusterToken',
62+
'clusterClientCertificateData',
63+
'clusterClientKeyData',
64+
'clusterCertificateAuthorityData'
65+
]
66+
}
67+
},
68+
required: ['clusterName', 'clusterServerURL']
69+
}
70+
},
71+
required: ['credentialName']
72+
};
73+
74+
export default kubernetesCredentialSchema;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const kubernetesCredentialUiSchema = {};
2+
3+
export default kubernetesCredentialUiSchema;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Schema for creating prometheus credential;
3+
*/
4+
const prometheusCredentialSchema = {
5+
type: 'object',
6+
title: 'Prometheus',
7+
properties: {
8+
credentialName: {
9+
title: 'Credential Name',
10+
type: 'string',
11+
description: 'Name of your credential'
12+
},
13+
secret: {
14+
type: 'object',
15+
title: 'Credential Secret',
16+
description: 'Credential secret for the Prometheus instance',
17+
properties: {
18+
prometheusURL: {
19+
type: 'string',
20+
title: 'URL',
21+
description: 'URL of the Prometheus instance'
22+
}
23+
},
24+
required: ['prometheusURL']
25+
}
26+
},
27+
required: ['credentialName']
28+
};
29+
30+
export default prometheusCredentialSchema;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const prometheusCredentialUiSchema = {};
2+
3+
export default prometheusCredentialUiSchema;

0 commit comments

Comments
 (0)