Links

National Dashboard Ingest

Overview

The objectives of the national dashboard-ingest service are listed below.
  1. 1.
    To provide a one-stop framework for ingesting data regardless of a data source based on configuration.
  2. 2.
    To create provision for ingest based on module-wise requirements which directly or indirectly require aggregated data ingestion functionality.

Pre-requisites

  1. 1.
    Prior knowledge of Java/J2EE.
  2. 2.
    Prior knowledge of SpringBoot.
  3. 3.
    Prior knowledge of PostgreSQL.
  4. 4.
    Prior knowledge of REST APIs and related concepts like path parameters, headers, JSON etc.
  5. 5.
    Prior knowledge of ElasticSearch.

Setup & Key Functionalities

Setup

  1. 1.
    Step 1: Define the index name for the module as per your requirement in module.index.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps .
  2. 2.
    Step 2: Define the allowed metrics for the module as per your requirement in module.fields.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps
  3. 3.
    Step 3: Define the allowed group-by fields for the module as per your requirement in module.allowed.groupby.fields.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps
  4. 4.
    Step 4: Define the master data index name as per your requirement in master.data.index key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps
  5. 5.
    Step 5: Define the allowed metrics for the master data index as per your requirement in master.module.fields.mapping key present in the configuration here - https://github.com/egovernments/DIGIT-DevOps/blob/master/deploy-as-code/helm/environments/qa.yaml#L367
  6. 6.
    Step 6: Create Kafka connectors for all the modules that have been configured. A sample request for creating a trade license national dashboard Kafka connector is as follows -
1
curl --location --request POST 'http://kafka-connect.kafka-cluster:8083/connectors/' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"name": "cms-case-es-sink9128",
5
"config": {
6
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
7
"connection.url": "http://elasticsearch-data-v1.es-cluster:9200/",
8
"type.name": "nss",
9
"topics": "tl-national-dashboard",
10
"key.ignore": true,
11
"schemas.enable": false,
12
"schema.ignore": true,
13
"value.converter.schemas.enable": false,
14
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
15
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
16
"batch.size": 10,
17
"max.buffered.records": 500,
18
"flush.timeout.ms": 600000,
19
"retry.backoff.ms": 5000,
20
"read.timout.ms": 10000,
21
"linger.ms": 100,
22
"max.in.flight.requests": 2,
23
"errors.log.enable": true,
24
"errors.deadletterqueue.topic.name": "nss-es-failed",
25
"tasks.max": 1
26
}
27
}'
7. Step 7: Run the national-dashboard-ingest application along with the national-dashboard-ingest-kafka-pipeline.

Definitions

  1. 1.
    Config file - A YAML (xyz.yml) file which contains configuration for running national dashboard ingest.
  2. 2.
    API - A REST endpoint to post data based on the configuration.

Functionalities

  1. 1.
    When the national dashboard ingests metrics API is hit, all the data payload lookup keys are first checked against the db to determine whether they already exist or not. The db table currently being used for storing lookup keys is nss-ingest-data.
  2. 2.
    If the record for a given date and area details is not present, the payload is then flattened and pushed to nss-ingest-keydata topic.
  3. 3.
    National dashboard ingest Kafka pipeline consumer listens on nss-ingest-keydata topic and according to the module to which the data belongs, pushes it to the respective topic defined in the module.index.mapping key.
  4. 4.
    Once the national dashboard ingests the Kafka pipeline and pushes data to the respective topic, a Kafka connector then takes the flattened records from that topic and ingests into ElasticSearch.

Deployment Details

  1. 1.
    Add configs for different modules required for National Dashboard Ingest Service and National Dashboard Kafka Pipeline service.
  2. 2.
    Deploy the latest version of National Dashboard Ingest and National dashboard Kafka pipeline service.
  3. 3.
    Add role-action mapping for APIs.

Integration Details

Integration Scope

The national dashboard service is used to push aggregated data present in systems and persisting them onto elasticsearch on top of which dashboards can be built for visualizing and analyzing data.

Integration Benefits

  • Can perform service-specific business logic without impacting the other module.
  • In the future, if we want to expose the application to citizens then it can be done easily.

Integration Steps

  1. 1.
    To integrate, the host of the national-dashboard-ingest-service module should be overwritten in the helm chart.
  2. 2.
    national-dashboard/metric/_ingest should be added as the search endpoint for the config added.
  3. 3.
    national-dashboard/masterdata/_ingest should be added as the search endpoint for the config added.

API Details

URI: The format of the ingest API to be used to ingest data using national-dashboard-ingest is as follows: national-dashboard/metric/_ingest
Body: The body consists of 2 parts: RequestInfo and Data. Data is where the aggregated data to be ingested resides. The keys given under the metrics object here are metrics provided in module.fields.mapping present in the configuration here -
DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps
Example ingest request body -
1
{
2
    "RequestInfo": {
3
        "apiId": "asset-services",
4
        "ver": null,
5
        "ts": null,
6
        "action": null,
7
        "did": null,
8
        "key": null,
9
        "msgId": "search with from and to values",
10
        "authToken": "82c7da0d-da73-4c35-8ea7-5b231369b4cd",
11
        "userInfo": {
12
        "id": 41737,
13
        "uuid": "9a81233f-e212-4035-a831-320b70e93b82",
14
        "userName": "NDSS1",
15
        "name": "National Dashboard Viewer",
16
        "mobileNumber": "7777888813",
17
        "emailId": null,
18
        "locale": null,
19
        "type": "EMPLOYEE",
20
        "roles": [
21
            {
22
                "name": "Employee",
23
                "code": "SUPERUSER",
24
                "tenantId": "pb.amritsar"
25
            },
26
            {
27
                "name": "National Dashboard Admin",
28
                "code": "NATADMIN",
29
                "tenantId": "pb.amritsar"
30
            },
31
            {
32
                "name": "FSM Employee Dashboard Viewer",
33
                "code": "FSM_DASHBOARD_VIEWER",
34
                "tenantId": "pb.amritsar"
35
            },
36
            {
37
                "name": "National Dashboard Admin",
38
                "code": "NATADMIN",
39
                "tenantId": "pb"
40
            }
41
        ],
42
        "active": true,
43
        "tenantId": "pb.amritsar",
44
        "permanentCity": null
45
    }
46
    },
47
    "Data": [
48
        {
49
        "date": "14-01-2017",
50
        "module": "MCOLLECT",
51
        "ward": "GODOWN AREA (BHABAT) - B14-SECTOR-13 - A1",
52
        "ulb": "pb.amritsar",
53
        "region": "Amritsar-MC",
54
        "state": "Punjab",
55
        "metrics": {
56
            "numberOfCategories": 240,
57
            "todaysCollection": [
58
                {
59
                    "groupBy": "paymentMode",
60
                    "buckets": [
61
                        {
62
                            "name": "UPI",
63
                            "value": 70
64
                        },
65
                        {
66
                            "name": "CASH",
67
                            "value": 45
68
                        },
69
                        {
70
                            "name": "DEBIT_CARD",
71
                            "value": 20
72
                        }
73
                    ]
74
                },
75
                {
76
                    "groupBy": "status",
77
                    "buckets": [
78
                        {
79
                            "name": "NEW",
80
                            "value": 70
81
                        },
82
                        {
83
                            "name": "DEPOSITED",
84
                            "value": 20
85
                        },
86
                        {
87
                            "name": "DISHONOURED",
88
                            "value": 45
89
                        }
90
                    ]
91
                },
92
                {
93
                    "groupBy": "category",
94
                    "buckets": [
95
                        {
96
                            "name": "COMMON_MASTERS_HOARDING",
97
                            "value": 50
98
                        },
99
                        {
100
                            "name": "COMMON_MASTERS_ROAD_SHOW",
101
                            "value": 20
102
                        },
103
                        {
104
                            "name": "COMMON_MASTERS_UNIPOLLS",
105
                            "value": 5
106
                        },
107
                        {
108
                            "name": "COMMON_MASTERS_AUCTION_FEE",
109
                            "value": 25
110
                        },
111
                        {
112
                            "name": "COMMON_MASTERS_USER_FEES",
113
                            "value": 35
114
                        }
115
                    ]
116
                }
117
            ],
118
            "numberOfReceipts": [
119
                {
120
                    "groupBy": "status",
121
                    "buckets": [
122
                        {
123
                            "name": "NEW",
124
                            "value": 70
125
                        },
126
                        {
127
                            "name": "DEPOSITED",
128
                            "value": 105
129
                        },
130
                        {
131
                            "name": "DISHONOURED",
132
                            "value": 50
133
                        }
134
                    ]
135
                },
136
                {
137
                    "groupBy": "paymentMode",
138
                    "buckets": [
139
                        {
140
                            "name": "CASH",
141
                            "value": 70
142
                        },
143
                        {
144
                            "name": "CHEQUE",
145
                            "value": 105
146
                        },
147
                        {
148
                            "name": "DEBIT_CARD",
149
                            "value": 35
150
                        },
151
                        {
152
                            "name": "ONLINE",
153
                            "value": 15
154
                        }
155
                    ]
156
                },
157
                {
158
                    "groupBy": "category",
159
                    "buckets": [
160
                        {
161
                            "name": "COMMON_MASTERS_HOARDING",
162
                            "value": 50
163
                        },
164
                        {
165
                            "name": "COMMON_MASTERS_ROAD_SHOW",
166
                            "value": 40
167
                        },
168
                        {
169
                            "name": "COMMON_MASTERS_UNIPOLLS",
170
                            "value": 45
171
                        },
172
                        {
173
                            "name": "COMMON_MASTERS_AUCTION_FEE",
174
                            "value": 55
175
                        },
176
                        {
177
                            "name": "COMMON_MASTERS_USER_FEES",
178
                            "value": 35
179
                        }
180
                    ]
181
                }
182
            ],
183
            "numberOfChallans": [
184
                {
185
                    "groupBy": "challanStatus",
186
                    "buckets": [
187
                        {
188
                            "name": "PAID",
189
                            "value": 50
190
                        },
191
                        {
192
                            "name": "CANCELLED",
193
                            "value": 105
194
                        },
195
                        {
196
                            "name": "ACTIVE",
197
                            "value": 35
198
                        }
199
                    ]
200
                },
201
                {
202
                    "groupBy": "category",
203
                    "buckets": [
204
                        {
205
                            "name": "COMMON_MASTERS_HOARDING",
206
                            "value": 50
207
                        },
208
                        {
209
                            "name": "COMMON_MASTERS_ROAD_SHOW",
210
                            "value": 40
211
                        },
212
                        {
213
                            "name": "COMMON_MASTERS_UNIPOLLS",
214
                            "value": 45
215
                        },
216
                        {
217
                            "name": "COMMON_MASTERS_AUCTION_FEE",
218
                            "value": 20
219
                        },
220
                        {
221
                            "name": "COMMON_MASTERS_USER_FEES",
222
                            "value": 35
223
                        }
224
                    ]
225
                }
226
            ]
227
        }
228
    }]
229
}

Module-wise Index Properties & Ingest Curls

The steps required for the creation of the index and adding the index mapping for the same can be found here - National Dashboard: Steps for Index Creation.
The following section contains module-wise index names, index mapping and ingest curls for ingesting data to national dashboard indexes.

1. Property Tax -

a. Index - pt-national-dashboard
b. Index mapping -
1
"properties" : {
2
"assessedPropertiesForUsageCategory" : {
3
"type" : "long"
4
},
5
"assessments" : {
6
"type" : "long"
7
},
8
"cessForUsageCategory" : {
9
"type" : "long"
10
},
11
"createdBy" : {
12
"type" : "text",
13
"fields" : {
14
"keyword" : {
15
"type" : "keyword",
16
"ignore_above" : 256
17
}
18
}
19
},
20
"createdTime" : {
21
"type" : "long"
22
},
23
"date" : {
24
"type" : "date",
25
"format" : "dd-MM-yyyy HH:mm:ss||dd-MM-yyyy||epoch_millis||dd-MM-yyyy'T'HH:mm:ss.SSSZ"
26
},
27
"financialYear" : {
28
"type" : "text",
29
"fields" : {
30
"keyword" : {
31
"type" : "keyword",
32
"ignore_above" : 256
33
}
34
}
35
},
36
"interestForUsageCategory" : {
37
"type" : "long"
38
},
39
"lastModifiedBy" : {
40
"type" : "text",
41
"fields" : {
42
"keyword" : {
43
"type" : "keyword",
44
"ignore_above" : 256
45
}
46
}
47
},
48
"lastModifiedTime" : {
49
"type" : "long"
50
},
51
"module" : {
52
"type" : "text",
53
"fields" : {
54
"keyword" : {
55
"type" : "keyword",
56
"ignore_above" : 256
57
}
58
}
59
},
60
"penaltyForUsageCategory" : {
61
"type" : "long"
62
},
63
"propertiesRegisteredForFinancialYear" : {
64
"type" : "long"
65
},
66
"propertyTaxForUsageCategory" : {
67
"type" : "long"
68
},
69
"rebateForUsageCategory" : {
70
"type" : "long"
71
},
72
"region" : {
73
"type" : "text",
74
"fields" : {
75
"keyword" : {
76
"type" : "keyword",
77
"ignore_above" : 256
78
}
79
}
80
},
81
"state" : {
82
"type" : "text",
83
"fields" : {
84
"keyword" : {
85
"type" : "keyword",
86
"ignore_above" : 256
87
}
88
}
89
},
90
"todaysClosedApplications" : {
91
"type" : "long"
92
},
93
"noOfPropertiesPaidToday" : {
94
"type" : "long"
95
},
96
"todaysCollectionForUsageCategory" : {
97
"type" : "long"
98
},
99
"todaysTotalApplications" : {
100
"type" : "long"
101
},
102
"transactionsForUsageCategory" : {
103
"type" : "long"
104
},
105
"ulb" : {
106
"type" : "text",
107
"fields" : {
108
"keyword" : {
109
"type" : "keyword",
110
"ignore_above" : 256
111
}
112
}
113
},
114
"usageCategory" : {
115
"type" : "text",
116
"fields" : {
117
"keyword" : {
118
"type" : "keyword",
119
"ignore_above" : 256
120
}
121
}
122
},
123
"ward" : {
124
"type" : "text",
125
"fields" : {
126
"keyword" : {
127
"type" : "keyword",
128
"ignore_above" : 256
129
}
130
}
131
}
132
}
c. Ingest curl -
1
curl --location --request POST 'https://qa.digit.org/national-dashboard/metric/_ingest' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"RequestInfo": {
5
"apiId": "asset-services",
6
"ver": null,
7
"ts": null,
8
"action": null,
9
"did": null,
10
"key": null,
11
"msgId": "search with from and to values",
12
"authToken": "null",
13
"userInfo": {
14
"id": 11131,
15
"uuid": "0a8ef1d4-ef5c-4061-aea5-0ac4a410b87f",
16
"userName": "NDSS",
17
"name": "Lata",
18
"mobileNumber": "7897807878",
19
"emailId": null,
20
"locale": null,
21
"type": "EMPLOYEE",
22
"roles": [
23
{
24
"name": "National Dashboard Admin",
25
"code": "NATADMIN",
26
"tenantId": "pg"
27
}
28
],
29
"active": true,
30
"tenantId": "uk.rishikesh",
31
"permanentCity": null
32
}
33
},
34
"Data": [
35
{
36
"date": "23-03-2022",
37
"module": "PT",
38
"ward": "Block 1",
39
"ulb": "uk.rishikesh",
40
"region": "Rishikesh-MC",
41
"state": "Uttarakhand",
42
"metrics": {
43
"assessments": 29,
44
"todaysTotalApplications": 62,
45
"todaysClosedApplications": 21,
46
"propertiesRegistered": [
47
{
48
"groupBy": "financialYear",
49
"buckets": [
50
{
51
"name": "2018-19",
52
"value": 12
53
},
54
{
55
"name": "2019-20",
56
"value": 18
57
},
58
{
59
"name": "2020-21",
60
"value": 21
61
}
62
]
63
}
64
],
65
"assessedProperties": [
66
{
67
"groupBy": "usageCategory",
68
"buckets": [
69
{
70
"name": "RESIDENTIAL",
71
"value": 21
72
},
73
{
74
"name": "COMMERCIAL",
75
"value": 11
76
},
77
{
78
"name": "INDUSTRIAL",
79
"value": 13
80
}
81
]
82
}
83
],
84
"transactions": [
85
{
86
"groupBy": "usageCategory",
87
"buckets": [
88
{
89
"name": "RESIDENTIAL",
90
"value": 19
91
},
92
{
93
"name": "COMMERCIAL",
94
"value": 13
95
},
96
{
97
"name": "INDUSTRIAL",
98
"value": 13
99
}
100
]
101
}
102
],
103
"todaysCollection": [
104
{
105
"groupBy": "usageCategory",
106
"buckets": [
107
{
108
"name": "RESIDENTIAL",
109
"value": 16000
110
},
111
{
112
"name": "COMMERCIAL",
113
"value": 22500
114
},
115
{
116
"name": "INDUSTRIAL",
117
"value": 26000
118
}
119
]
120
}
121
],
122
"propertyTax": [
123
{
124
"groupBy": "usageCategory",
125
"buckets": [
126
{
127
"name": "RESIDENTIAL",
128
"value": 1200
129
},
130
{
131
"name": "COMMERCIAL",
132
"value": 2100
133
},
134
{
135
"name": "INDUSTRIAL",
136
"value": 100
137
}
138
]
139
}
140
],
141
"cess": [
142
{
143
"groupBy": "usageCategory",
144
"buckets": [
145
{
146
"name": "RESIDENTIAL",
147
"value": 1300
148
},
149
{
150
"name": "COMMERCIAL",
151
"value": 1900
152
},
153
{
154
"name": "INDUSTRIAL",
155
"value": 1000
156
}
157
]
158
}
159
],
160
"rebate": [
161
{
162
"groupBy": "usageCategory",
163
"buckets": [
164
{
165
"name": "RESIDENTIAL",
166
"value": -500
167
},
168
{
169
"name": "COMMERCIAL",
170
"value": -1200
171
},
172
{
173
"name": "INDUSTRIAL",
174
"value": -900
175
}
176
]
177
}
178
],
179
"penalty": [
180
{
181
"groupBy": "usageCategory",
182
"buckets": [
183
{
184
"name": "RESIDENTIAL",
185
"value": 1300
186
},
187
{
188
"name": "COMMERCIAL",
189
"value": 1500
190
},
191
{
192
"name": "INDUSTRIAL",
193
"value": 1500
194
}
195
]
196
}
197
],
198
"interest": [
199
{
200
"groupBy": "usageCategory",
201
"buckets": [
202
{
203
"name": "RESIDENTIAL",
204
"value": 1900
205
},
206
{
207
"name": "COMMERCIAL",
208
"value": 1800
209
},
210
{
211
"name": "INDUSTRIAL",
212
"value": 600
213
}
214
]
215
}
216
]
217
}
218
}
219
]
220
}'

2. Water and Sewerage -

a. Index name - ws-national-dashboard
b. Index mapping -
"properties" : {
"channelType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"connectionType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"connectionsCreatedForChannelType" : {
"type" : "long"
},
"connectionsCreatedForConnectionType" : {
"type" : "long"
},
"createdBy" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"createdTime" : {
"type" : "long"
},
"date" : {
"type" : "date",
"format" : "dd-MM-yyyy HH:mm:ss||dd-MM-yyyy||epoch_millis||dd-MM-yyyy'T'HH:mm:ss.SSSZ"
},
"duration" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"lastModifiedBy" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"lastModifiedTime" : {
"type" : "long"
},
"meterType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"module" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"paymentChannelType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"pendingConnectionsForDuration" : {
"type" : "long"
},
"region" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"sewerageConnectionsForChannelType" : {
"type" : "long"
},
"sewerageConnectionsForUsageType" : {
"type" : "long"
},
"slaCompliance" : {
"type" : "long"
},
"state" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"taxHeads" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"tenantId" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"todaysClosedApplications" : {
"type" : "long"
},
"todaysCollectionForChannelType" : {
"type" : "long"
},
"todaysCollectionForConnectionType" : {
"type" : "long"
},
"todaysCollectionForPaymentChannelType" : {
"type" : "long"
},
"todaysCollectionForTaxHeads" : {
"type" : "long"
},
"todaysCollectionForUsageType" : {
"type" : "long"
},
"todaysCompletedApplicationsWithinSLA" : {
"type" : "long"
},
"todaysTotalApplications" : {
"type" : "long"
},
"transactions" : {
"type" : "long"
},
"ulb" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"usageType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"ward" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"waterConnectionsForChannelType" : {
"type" : "long"
},
"waterConnectionsForMeterType" : {
"type" : "long"
},
"waterConnectionsForUsageType" : {
"type" : "long"
}
}
c. Ingest curl -
1
curl --location --request POST 'https://qa.digit.org/national-dashboard/metric/_ingest' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"RequestInfo": {
5
"apiId": "asset-services",
6
"ver": null,
7
"ts": null,
8
"action": null,
9
"did": null,
10
"key": null,
11
"msgId": "search with from and to values",
12
"authToken": "{{access_token}}",
13
"userInfo": {
14
"id": 11131,
15
"uuid": "0a8ef1d4-ef5c-4061-aea5-0ac4a410b87f",
16
"userName": "NDSS",
17
"name": "Lata",
18
"mobileNumber": "7897807878",
19
"emailId": null,
20
"locale": null,
21
"type": "EMPLOYEE",
22
"roles": [
23
{
24
"name": "National Dashboard Admin",
25
"code": "NATADMIN",
26
"tenantId": "pg"
27
}
28
],
29
"active": true,
30
"tenantId": "pb.amritsar",
31
"permanentCity": null
32
}
33
},
34
"Data": [
35
{
36
"date": "20-02-2022",
37
"module": "WS",
38
"ward": "Ward 1",
39
"ulb": "pb.amritsar",
40
"region": "Amritsar-MC",
41
"state": "Punjab",
42
"metrics": {
43
"transactions": 2345,
44
"connectionsCreated": [
45
{
46
"groupBy": "connectionType",
47
"buckets": [
48
{
49
"name": "WATER.METERED",
50
"value": 110
51
},
52
{
53
"name": "WATER.NONMETERED",
54
"value": 50
55
},
56
{
57
"name": "SEWERAGE",
58
"value": 50
59
}
60
]
61
},
62
{
63
"groupBy": "channelType",
64
"buckets": [
65
{
66
"name": "Counter",
67
"value": 60
68
},
69
{
70
"name": "Online",
71
"value": 70
72
},
73
{
74
"name": "System",
75
"value": 50
76
},
77
{
78
"name": "CSC",
79
"value": 30
80
}
81
]
82
}
83
],
84
"todaysCollection": [
85
{
86
"groupBy": "usageType",
87
"buckets": [
88
{
89
"name": "Domestic",
90
"value": 11000
91
},
92
{
93
"name": "Commercial",
94
"value": 5000
95
},
96
{
97
"name": "Institutional",
98
"value": 5600
99
},
100
{
101
"name": "Domestic SLC",
102
"value": 7200
103
},
104
{
105
"name": "Domestic Exempted",
106
"value": 3800
107
},
108
{
109
"name": "Commercial Motor",
110
"value": 4800
111
}
112
]
113
},
114
{
115
"groupBy": "paymentChannelType",
116
"buckets": [
117
{
118
"name": "System",
119
"value": 8000
120
},
121
{
122
"name": "Paytm",
123
"value": 7000
124
},
125
{
126
"name": "Field",
127
"value": 3700
128
},
129
{
130
"name": "Razorpay",
131
"value": 2200
132
},
133
{
134
"name": "PayU",
135
"value": 1000
136
},
137
{
138
"name": "BBPS",
139
"value": 1400
140
},
141
{
142
"name": "POS",
143
"value": 5100
144
},
145
{
146
"name": "Sewakendra",
147
"value": 5600
148
},
149
{
150
"name": "Freecharge",
151
"value": 3400
152
}
153
]
154
},
155
{
156
"groupBy": "taxHeads",
157
"buckets": [
158
{
159
"name": "INTEREST",
160
"value": 7000
161
},
162
{
163
"name": "LATE.CHARGES",
164
"value": 8500
165
},
166
{
167
"name": "ADVANCE",
168
"value": 3700
169
},
170
{
171
"name": "CURRENT.CHARGES",
172
"value": 12422
173
},
174
{
175
"name": "ARREAR.CHARGES",
176
"value": 5778
177
}
178
]
179
},
180
{
181
"groupBy": "connectionType",
182
"buckets": [
183
{
184
"name": "WATER.METERED",
185
"value": 18700
186
},
187
{
188
"name": "WATER.NONMETERED",
189
"value": 8500
190
},
191
{
192
"name": "SEWERAGE",
193
"value": 10200
194
}
195
]
196
}
197
],
198
"sewerageConnections": [
199
{
200
"groupBy": "channelType",
201
"buckets": [
202
{
203
"name": "ONLINE",
204
"value": 30
205
},
206
{
207
"name": "CSC",
208
"value": 11
209
},
210
{
211
"name": "SYSTEM",
212
"value": 9
213
}
214
]
215
},
216
{
217
"groupBy": "usageType",
218
"buckets": [
219
{
220
"name": "Domestic",
221
"value": 11
222
},
223
{
224
"name": "Commercial",
225
"value": 10
226
},
227
{
228
"name": "Residential",
229
"value": 14
230
},
231
{
232
"name": "Institutional",
233
"value": 6
234
},
235
{
236
"name": "Domestic Exempted",
237
"value": 9
238
}
239
]
240
}
241
],
242
"waterConnections": [
243
{
244
"groupBy": "channelType",
245
"buckets": [
246
{
247
"name": "Counter",
248
"value": 47
249
},
250
{
251
"name": "ONLINE",
252
"value": 53
253
},
254
{
255
"name": "CSC",
256
"value": 15
257
},
258
{
259
"name": "SYSTEM",
260
"value": 45
261
}
262
]
263
},
264
{
265
"groupBy": "usageType",
266
"buckets": [
267
{
268
"name": "Domestic",
269
"value": 123
270
},
271
{
272
"name": "Commercial",
273
"value": 22
274
},
275
{
276
"name": "Domestic Exempted",
277
"value": 15
278
}
279
]
280
},
281
{
282
"groupBy": "meterType",
283
"buckets": [
284
{
285
"name": "METERED",
286
"value": 110
287
},
288
{
289
"name": "NON.METERED",
290
"value": 50
291
}
292
]
293
}
294
],
295
"pendingConnections": [
296
{
297
"groupBy": "duration",
298
"buckets": [
299
{
300
"name": "0to3Days",
301
"value": 11
302
},
303
{
304
"name": "3to7Days",
305
"value": 50
306
},
307
{
308
"name": "7to15Days",
309
"value": 5
310
},
311
{
312
"name": "MoreThan15Days",
313
"value": 2
314
}
315
]
316
}
317
],
318
"slaCompliance": 24,
319
"todaysTotalApplications": 35,
320
"todaysClosedApplications": 33,
321
"todaysCompletedApplicationsWithinSLA": 46
322
}
323
}
324
]
325
}'

3. FireNOC -

a. Index name - firenoc-national-dashboard
b. Index mapping -
1
"properties" : {
2
"actualNOCIssuedByDeptForDepartment" : {
3
"type" : "long"
4
},
5
"actualNOCIssuedForDepartment" : {
6
"type" : "long"
7
},
8
"actualNOCIssuedForUsageType" : {
9
"type" : "long"
10
},
11
"applicationType" : {
12
"type" : "text",
13
"fields" : {
14
"keyword" : {
15
"type" : "keyword",
16
"ignore_above" : 256
17
}
18
}
19
},
20
"avgDaysToIssueActualNOCForDepartment" : {
21
"type" : "long"
22
},
23
"avgDaysToIssueProvisionalNOCForDepartment" : {
24
"type" : "long"
25
},
26
"createdBy" : {
27
"type" : "text",
28
"fields" : {
29
"keyword" : {
30
"type" : "keyword",
31