From 65f2a5f9b2d03a8e8c469d2a1484e0f067a27b54 Mon Sep 17 00:00:00 2001 From: Uma Parameshwari Date: Thu, 6 Jun 2019 12:12:47 +0530 Subject: [PATCH] BE-602 - Update Swagger with latest UI * Implemented OpenApi - 3.0 * Added Authentication-JWT token to Swagger Change-Id: If6251c028a40aabe3255830dbf27cfe9eff18403 Signed-off-by: Uma Parameshwari --- package.json | 2 +- swagger.json | 2418 +++++++++++++++++++++++--------------------------- 2 files changed, 1110 insertions(+), 1310 deletions(-) diff --git a/package.json b/package.json index 047744f02..5674c33b9 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "save": "^2.3.3", "stomp-broker-js": "^0.1.3", "stompjs": "^2.3.3", - "swagger-ui-express": "^3.0.9", + "swagger-ui-express": "^4.0.5", "utf8-bytes": "0.0.1", "winston": "^2.2.0", "ws": "^5.1.1" diff --git a/swagger.json b/swagger.json index 4b1e90a05..ef850dc77 100644 --- a/swagger.json +++ b/swagger.json @@ -1,1311 +1,1111 @@ { - "swagger": "2.0", - "info": { - "title": "Hyperledger Explorer REST API Swagger", - "description": "Rest API for fabric .", - "version": "1.0.0", - "contact": { - "name": "Hyperledger Team" - } - }, - "host": "localhost:8080", - "schemes": ["http"], - "basePath": "/api", - "produces": ["application/json"], - "tags": [ - { - "name": "Channel", - "description": "Everything about your channel" - }, - { - "name": "Chaincodes", - "description": "Everything about your chaincodes" - }, - { - "name": "Blocks", - "description": "Everything about your blocks" - }, - { - "name": "Transactions", - "description": "Everything about your transactions" - } - ], - "paths": { - "/channels": { - "get": { - "tags": ["Channel"], - "summary": "Query to fetch channels", - "description": "Query to fetch channels", - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Channels" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/status/{channel_genesis_hash}": { - "get": { - "tags": ["Channel"], - "summary": "Query to get BlockCount on a channel", - "description": "Query to get BlockCount on a channel", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "chaincodeCount": { - "type": "string" - }, - "txCount": { - "type": "string" - }, - "peerCount": { - "type": "string" - }, - "latestBLock": { - "type": "number" - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/curChannel": { - "get": { - "tags": ["Channel"], - "summary": "get Current channel", - "description": "get Current channel", - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/curChannel" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/changeChannel/{channel_genesis_hash}": { - "get": { - "tags": ["Channel"], - "summary": "Query to get Change Channel on a channel", - "description": "Query to get Change Channel on a channel", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "currentChannel": { - "type": "string" - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/chaincode/{channel_genesis_hash}": { - "get": { - "tags": ["Chaincodes"], - "summary": "Query to fetch all Installed/instantiated chaincodes", - "description": "Query to fetch all Installed/instantiated chaincodes", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "path": { - "type": "string" - }, - "channel_genesis_hash": { - "type": "string" - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/channel": { - "post": { - "tags": ["Channel"], - "summary": "Create New channel on target peers ", - "description": "Create New channel on target peers", - "consumes": ["application/x-www-form-urlencoded"], - "produces": ["application/json"], - "parameters": [ - { - "name": "channelName", - "in": "formData", - "description": "channel name", - "required": true, - "type": "string" - }, - { - "name": "genesisBlock", - "in": "formData", - "description": "gensis block", - "required": true, - "type": "string" - }, - { - "name": "orgName", - "in": "formData", - "description": "organation name ", - "required": true, - "type": "string" - }, - { - "name": "channelArtificats", - "in": "formData", - "description": "channelArtificats", - "required": true, - "type": "array", - "items": { - "type": "string" - } - }, - { - "name": "profile", - "in": "formData", - "description": "block profile", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/joinChannel": { - "post": { - "tags": ["Channel"], - "summary": "join channel ", - "description": "join channel ", - "consumes": ["application/json", "application/x-www-form-urlencoded"], - "produces": ["application/json"], - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "description": "payload", - "schema": { - "type": "object", - "properties": { - "channelName": { - "type": "string" - }, - "orgName": { - "type": "string" - }, - "peers": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/block/{channel_genesis_hash}/{number}": { - "get": { - "tags": ["Blocks"], - "summary": "Query to Fetch Blocks", - "description": "Query to Fetch Blocks", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "number", - "in": "path", - "description": "block number", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "number": { - "type": "string" - }, - "previous_hash": { - "type": "string" - }, - "channel_genesis_hash": { - "type": "string" - }, - "data_hash": { - "type": "string" - }, - "transactions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "signature": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "number" - } - } - } - }, - "payload": { - "$ref": "#/definitions/blockPayload" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/block/transactions/{channel_genesis_hash}/{number}": { - "get": { - "tags": ["Transactions"], - "summary": "Query to Fetch Block Transactions", - "description": "Query to Fetch Block Transactions", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "number", - "in": "path", - "description": "block number", - "required": true, - "type": "number" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "number": { - "type": "number" - }, - "txCount": { - "type": "number" - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/blockActivity/{channel_genesis_hash}": { - "get": { - "tags": ["Blocks"], - "summary": "Query to Fetch Block Activity List", - "description": "Query to Fetch Block Acivity List", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "txcount": { - "type": "number" - }, - "datahash": { - "type": "string" - }, - "blockhash": { - "type": "string" - }, - "prehash": { - "type": "string" - }, - "createdt": { - "type": "string" - }, - "txhash": { - "type": "string" - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/transaction/{channel_genesis_hash}/{txid}": { - "get": { - "tags": ["Transactions"], - "summary": "Query to Get Transaction by Txid", - "description": "Query to Get Transaction by Txid", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "txid", - "in": "path", - "description": "transaction id", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "row": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "channel_genesis_hash": { - "type": "string" - }, - "channelname": { - "type": "string" - }, - "blockid": { - "type": "number" - }, - "txhash": { - "type": "string" - }, - "createdt": { - "type": "string" - }, - "chaincodename": { - "type": "string" - }, - "status": { - "type": "number" - }, - "creator_msp_id": { - "type": "string" - }, - "endorser_msp_id": { - "type": "string" - }, - "chancode_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "read_set": { - "type": "array", - "items": { - "$ref": "#/definitions/Set" - } - }, - "write_set": { - "type": "array", - "items": { - "$ref": "#/definitions/Set" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/txList/{channel_genesis_hash}/{number}/{txid}": { - "get": { - "tags": ["Transactions"], - "summary": "Query to Get Trasaction List", - "description": "Query to Get Trasaction List", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_gensis_hash", - "required": true, - "type": "string" - }, - { - "name": "number", - "in": "path", - "description": "block number", - "required": true, - "type": "number" - }, - { - "name": "txid", - "in": "path", - "description": "block number", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "channelname": { - "type": "string" - }, - "channel_genesis_hash": { - "type": "string" - }, - "blockid": { - "type": "number" - }, - "txhash": { - "type": "string" - }, - "createdt": { - "type": "string" - }, - "chaincodename": { - "type": "string" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/peers/{channel_genesis_hash}": { - "get": { - "tags": ["Channel"], - "summary": "Peers", - "description": "Peers", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "peers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "requests": { - "type": "string" - }, - "channel_genesis_hash": { - "type": "string" - }, - "server_hostname": { - "type": "string" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/peersStatus/{channelName}": { - "get": { - "tags": ["Channel"], - "summary": "Query Get PeersStatus", - "description": "Query Get PeersStatus", - "parameters": [ - { - "name": "channelName", - "in": "path", - "description": "channel name", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "peers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "requests": { - "type": "string" - }, - "server_hostname": { - "type": "string" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/blockAndTxList/{channel_genesis_hash}/{number}": { - "get": { - "tags": ["Transactions"], - "summary": "Query to Get Block And Transaction List", - "description": "Query to Get Block And Transaction List", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "number", - "in": "path", - "description": "block number", - "required": true, - "type": "number" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "blocknum": { - "type": "number" - }, - "channel_genesis_hash": { - "type": "string" - }, - "data_hash": { - "type": "string" - }, - "prehash": { - "type": "string" - }, - "channelname": { - "type": "string" - }, - "txCount": { - "type": "number" - }, - "createdt": { - "type": "string" - }, - "prev_blockhash": { - "type": "string" - }, - "blockhash": { - "type": "string" - }, - "txhash": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/txByMinute/{channel_genesis_hash}/{hours}": { - "get": { - "tags": ["Transactions"], - "summary": "Query to Get Trasaction BY Minute", - "description": "Query to Get Trasaction By Minute", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "hours", - "in": "path", - "description": "hours ", - "required": true, - "type": "number" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "$ref": "#/definitions/TxCount" - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/txByHour/{channel_genesis_hash}/{days}": { - "get": { - "tags": ["Transactions"], - "summary": "Query to Get Trasaction By Hour", - "description": "Queryto Get Trasaction BY Hour", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "days", - "in": "path", - "description": "days", - "required": true, - "type": "number" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "$ref": "#/definitions/TxCount" - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/blocksByMinute/{channel_genesis_hash}/{hours}": { - "get": { - "tags": ["Blocks"], - "summary": "Query to Get Blocks BY Minute", - "description": "Query to Get Blocks By Minute", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "hours", - "in": "path", - "description": "hours ", - "required": true, - "type": "number" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "$ref": "#/definitions/TxCount" - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/blocksByHour/{channel_genesis_hash}/{days}": { - "get": { - "tags": ["Blocks"], - "summary": "Query to Get Blocks By Hour", - "description": "Query to Get Blocks By Hour", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - }, - { - "name": "days", - "in": "path", - "description": "days", - "required": true, - "type": "number" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "$ref": "#/definitions/TxCount" - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/txByOrg/{channel_genesis_hash}": { - "get": { - "tags": ["Blocks"], - "summary": "Query Get Trasaction By Org", - "description": "Query Get Trasaction BY Org", - "parameters": [ - { - "name": "channel_genesis_hash", - "in": "path", - "description": "channel_genesis_hash", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "properties": { - "count": { - "type": "string" - }, - "creator_msp_id": { - "type": "string" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/channels/info": { - "get": { - "tags": ["Channels"], - "summary": "Query to Get Channels Inforamtion", - "description": "Query to Get channel Information", - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "number" - }, - "channels": { - "type": "array", - "items": { - "type": "object", - "properties": { - "channelName": { - "type": "string" - }, - "channel_genesis_hash": { - "type": "string" - }, - "channel_hash": { - "type": "string" - }, - "createdat": { - "type": "string" - }, - "blocks": { - "type": "number" - }, - "transactions": { - "type": "number" - } - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Channels": { - "type": "object", - "properties": { - "status": { - "default": 200, - "type": "number" - }, - "channels": { - "type": "array", - "items": { - "type": "object", - "properties": { - "channel_id": { - "type": "string" - } - } - } - } - } - }, - "curChannel": { - "type": "object", - "properties": { - "currentChannel": { - "type": "string" - } - } - }, - "blockPayload": { - "type": "object", - "properties": { - "header": { - "type": "object", - "properties": { - "channel_header": { - "type": "object", - "properties": { - "version": { - "type": "number" - }, - "type": { - "type": "number" - }, - "time_stamp": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "txid": { - "type": "string" - }, - "epoch": { - "type": "string" - } - } - }, - "signature_header": { - "type": "object", - "properties": { - "creator": { - "type": "object", - "properties": { - "Mspid": { - "type": "string" - }, - "Idbytes": { - "type": "string" - } - } - }, - "nonce": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "number" - } - }, - "type": { - "type": "string" - } - } - } - } - }, - "data": { - "type": "object" - } - } - } - } - }, - "Set": { - "type": "object", - "properties": { - "chaincode": { - "type": "string" - }, - "set": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "version": { - "type": "object", - "properties": { - "block_num": { - "type": "number" - }, - "tx_num": { - "type": "number" - } - } - } - } - } - } - } - }, - "TxCount": { - "type": "object", - "properties": { - "datetime": { - "type": "string" - }, - "count": { - "type": "string" - } - } - }, - "Error": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - } - } - } + "openapi": "3.0.1", + "info": { + "title": "Hyperledger Explorer REST API Swagger", + "description": "Rest API for fabric", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "name": "Hyperledger Team" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost:8080" + }, + { + "url": "https://localhost:8080" + } + ], + "tags": [ + { + "name": "Login", + "description": "Everything about your Login" + }, + { + "name": "Channel", + "description": "Everything about your channel" + }, + { + "name": "Chaincodes", + "description": "Everything about your chaincodes" + }, + { + "name": "Blocks", + "description": "Everything about your blocks" + }, + { + "name": "Transactions", + "description": "Everything about your transactions" + } + ], + "paths": { + "/api/channels": { + "get": { + "tags": ["Channel"], + "summary": "Query to fetch channels", + "operationId": "fetchChannel", + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/channels/info": { + "get": { + "tags": ["Channel"], + "summary": "Query to fetch channels info", + "operationId": "fetchChannelInfo", + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/status/{channel_genesis_hash}": { + "get": { + "tags": ["Channel"], + "summary": "Query to get Count of all Channel details", + "operationId": "getStstusByHash", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please fill channel genesis hash", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/curChannel": { + "get": { + "tags": ["Channel"], + "summary": "Query to get Current Channel", + "operationId": "getCurrentChannel", + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/changeChannel/{channel_genesis_hash}": { + "get": { + "tags": ["Channel"], + "summary": "Query to Change the Channel", + "operationId": "getChangeChannel", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Query to Change the Channel", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/chaincode/{channel_genesis_hash}": { + "get": { + "tags": ["Chaincodes"], + "summary": "Query to fetch all Installed/instantiated chaincodes", + "operationId": "getChaincode", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Query to fetch all Installed/instantiated chaincodes", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/auth/login": { + "post": { + "tags": ["Login"], + "summary": "Login", + "operationId": "Login", + "requestBody": { + "description": "Login", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/login" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + } + } + }, + "/api/register": { + "post": { + "tags": ["Login"], + "summary": "Register", + "operationId": "register", + "requestBody": { + "description": "Register", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/register" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/joinChannel": { + "post": { + "tags": ["Channel"], + "summary": "Join a New Channel", + "operationId": "joinChannel", + "requestBody": { + "description": "Join a New Channel", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/joinChannel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/block/{channel_genesis_hash}/{number}": { + "get": { + "tags": ["Blocks"], + "summary": "Query to fetch block details", + "operationId": "getBlocks", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please provide channel hash value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "number", + "in": "path", + "description": "Please provide number", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/block/transactions/{channel_genesis_hash}/{number}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to Fetch Block Transactions", + "operationId": "getBlockTransactions", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "number", + "in": "path", + "description": "Please give the number value", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/blockActivity/{channel_genesis_hash}": { + "get": { + "tags": ["Blocks"], + "summary": "Query to fetch BlockActivity List", + "operationId": "getBlockActivity", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Query to fetch BlockActivity List", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/transaction/{channel_genesis_hash}/{txid}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to fetch transactions by txId", + "operationId": "getTransactionById", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please provide Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "txid", + "in": "path", + "description": "Please provide transaction id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/txList/{channel_genesis_hash}/{number}/{txid}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to get transaction List", + "operationId": "getTransactionList", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "number", + "in": "path", + "description": "Please give the number Value", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "txid", + "in": "path", + "description": "Please give the txid value", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/peers/{channel_genesis_hash}": { + "get": { + "tags": ["Channel"], + "summary": "Query to fetch all Installed/instantiated chaincodes", + "operationId": "getPeers", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Query to fetch all Installed/instantiated chaincodes", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/peersStatus/{channelName}": { + "get": { + "tags": ["Channel"], + "summary": "Query to fetch Peer Status", + "operationId": "getPeersStatus", + "parameters": [ + { + "name": "channelName", + "in": "path", + "description": "Query to fetch all Installed/instantiated chaincodes", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/blockAndTxList/{channel_genesis_hash}/{number}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to fetch blocks and transaction list", + "operationId": "getBlockAndTxList", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "number", + "in": "path", + "description": "Please give the number value", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/txByMinute/{channel_genesis_hash}/{hours}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to fetch transaction by minute list", + "operationId": "getTransactionByMin", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "hours", + "in": "path", + "description": "Please give the hour value", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/txByHour/{channel_genesis_hash}/{days}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to fetch blocks and transaction list", + "operationId": "getTxByHour", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "days", + "in": "path", + "description": "Please give the day value", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/blocksByMinute/{channel_genesis_hash}/{hours}": { + "get": { + "tags": ["Blocks"], + "summary": "Query to fetch blocks and transaction list", + "operationId": "getBlkByMin", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "hours", + "in": "path", + "description": "Please give the hours value", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/blocksByHour/{channel_genesis_hash}/{days}": { + "get": { + "tags": ["Blocks"], + "summary": "Query to fetch blocks and transaction list", + "operationId": "getBlocksByHour", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "days", + "in": "path", + "description": "Please give the hours value", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/txByOrg/{channel_genesis_hash}": { + "get": { + "tags": ["Transactions"], + "summary": "Query to fetch transaction by Org", + "operationId": "getTransByOrg", + "parameters": [ + { + "name": "channel_genesis_hash", + "in": "path", + "description": "Please give the Hash Value", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/auth/networklist": { + "get": { + "tags": ["Login"], + "summary": "Query to get networklist", + "operationId": "getNetworkList", + "responses": { + "200": { + "description": "Success", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": {} + }, + "401": { + "description": "UnAuthorized", + "content": {} + }, + "404": { + "description": "Not found", + "content": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + } + }, + "components": { + "schemas": { + "channel": { + "type": "object", + "properties": { + "channelName": { + "type": "string" + }, + "genesisBlock": { + "type": "string" + }, + "orgName": { + "type": "string" + }, + "channelArtifacts": { + "type": "string" + }, + "profile": { + "type": "string" + } + } + }, + "joinChannel": { + "type": "object", + "properties": { + "channelName": { + "type": "string" + }, + "orgName": { + "type": "string" + }, + "peers": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "login": { + "type": "object", + "properties": { + "user": { + "type": "string" + }, + "password": { + "type": "string" + }, + "network": { + "type": "string" + } + } + }, + "register": { + "type": "object", + "properties": { + "user": { + "type": "string" + }, + "password": { + "type": "string" + }, + "affiliation": { + "type": "string" + }, + "roles": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } }