Browse Source

Expose node id on /status

Leszek Wiesner 3 years ago
parent
commit
b3b01cb8a0

+ 3 - 0
distributor-node/src/api-spec/openapi.yml

@@ -173,12 +173,15 @@ components:
     StatusResponse:
       type: object
       required:
+        - id
         - objectsInCache
         - storageLimit
         - storageUsed
         - uptime
         - downloadsInProgress
       properties:
+        id:
+          type: string
         objectsInCache:
           type: integer
           minimum: 0

+ 6 - 0
distributor-node/src/services/networking/distributor-node/generated/api.ts

@@ -78,6 +78,12 @@ export interface ErrorResponse {
  * @interface StatusResponse
  */
 export interface StatusResponse {
+    /**
+     * 
+     * @type {string}
+     * @memberof StatusResponse
+     */
+    id: string;
     /**
      * 
      * @type {number}

+ 1 - 0
distributor-node/src/services/server/controllers/public.ts

@@ -239,6 +239,7 @@ export class PublicApiController {
 
   public async status(req: express.Request, res: express.Response<StatusResponse>): Promise<void> {
     const data: StatusResponse = {
+      id: this.config.id,
       objectsInCache: this.stateCache.getCachedContentLength(),
       storageLimit: this.config.storageLimit,
       storageUsed: this.content.usedSpace,

+ 1 - 0
distributor-node/src/types/generated/OpenApi.ts

@@ -27,6 +27,7 @@ export interface components {
       'message': string
     }
     'StatusResponse': {
+      'id': string
       'objectsInCache': number
       'storageLimit': number
       'storageUsed': number