github.com/s7techlab/cckit@v0.10.5/gateway/chaincode.swagger.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "chaincode.proto",
     5      "version": "version not set"
     6    },
     7    "consumes": [
     8      "application/json"
     9    ],
    10    "produces": [
    11      "application/json"
    12    ],
    13    "paths": {
    14      "/chaincode-instance/events": {
    15        "get": {
    16          "summary": "Chaincode events s",
    17          "operationId": "ChaincodeInstanceEventsService_Events",
    18          "responses": {
    19            "200": {
    20              "description": "A successful response.",
    21              "schema": {
    22                "$ref": "#/definitions/gatewayChaincodeEvents"
    23              }
    24            },
    25            "default": {
    26              "description": "An unexpected error response.",
    27              "schema": {
    28                "$ref": "#/definitions/runtimeError"
    29              }
    30            }
    31          },
    32          "parameters": [
    33            {
    34              "name": "from_block.num",
    35              "description": "Block number.",
    36              "in": "query",
    37              "required": false,
    38              "type": "string",
    39              "format": "int64"
    40            },
    41            {
    42              "name": "to_block.num",
    43              "description": "Block number.",
    44              "in": "query",
    45              "required": false,
    46              "type": "string",
    47              "format": "int64"
    48            },
    49            {
    50              "name": "event_name",
    51              "in": "query",
    52              "required": false,
    53              "type": "array",
    54              "items": {
    55                "type": "string"
    56              },
    57              "collectionFormat": "multi"
    58            },
    59            {
    60              "name": "limit",
    61              "in": "query",
    62              "required": false,
    63              "type": "integer",
    64              "format": "int64"
    65            }
    66          ],
    67          "tags": [
    68            "ChaincodeInstanceEventsService"
    69          ]
    70        }
    71      },
    72      "/chaincode-instance/events-stream": {
    73        "get": {
    74          "summary": "Chaincode events stream",
    75          "operationId": "ChaincodeInstanceEventsService_EventsStream",
    76          "responses": {
    77            "200": {
    78              "description": "A successful response.(streaming responses)",
    79              "schema": {
    80                "type": "object",
    81                "properties": {
    82                  "result": {
    83                    "$ref": "#/definitions/cckitgatewayChaincodeEvent"
    84                  },
    85                  "error": {
    86                    "$ref": "#/definitions/runtimeStreamError"
    87                  }
    88                },
    89                "title": "Stream result of cckitgatewayChaincodeEvent"
    90              }
    91            },
    92            "default": {
    93              "description": "An unexpected error response.",
    94              "schema": {
    95                "$ref": "#/definitions/runtimeError"
    96              }
    97            }
    98          },
    99          "parameters": [
   100            {
   101              "name": "from_block.num",
   102              "description": "Block number.",
   103              "in": "query",
   104              "required": false,
   105              "type": "string",
   106              "format": "int64"
   107            },
   108            {
   109              "name": "to_block.num",
   110              "description": "Block number.",
   111              "in": "query",
   112              "required": false,
   113              "type": "string",
   114              "format": "int64"
   115            },
   116            {
   117              "name": "event_name",
   118              "in": "query",
   119              "required": false,
   120              "type": "array",
   121              "items": {
   122                "type": "string"
   123              },
   124              "collectionFormat": "multi"
   125            }
   126          ],
   127          "tags": [
   128            "ChaincodeInstanceEventsService"
   129          ]
   130        }
   131      },
   132      "/chaincode-instance/exec": {
   133        "post": {
   134          "summary": "Exec: Query or Invoke",
   135          "operationId": "ChaincodeInstanceService_Exec",
   136          "responses": {
   137            "200": {
   138              "description": "A successful response.",
   139              "schema": {
   140                "$ref": "#/definitions/protosResponse"
   141              }
   142            },
   143            "default": {
   144              "description": "An unexpected error response.",
   145              "schema": {
   146                "$ref": "#/definitions/runtimeError"
   147              }
   148            }
   149          },
   150          "parameters": [
   151            {
   152              "name": "body",
   153              "in": "body",
   154              "required": true,
   155              "schema": {
   156                "$ref": "#/definitions/gatewayChaincodeInstanceExecRequest"
   157              }
   158            }
   159          ],
   160          "tags": [
   161            "ChaincodeInstanceService"
   162          ]
   163        }
   164      },
   165      "/chaincode-instance/invoke": {
   166        "post": {
   167          "summary": "Invoke chaincode on peers, according to endorsement policy and the SEND to orderer",
   168          "operationId": "ChaincodeInstanceService_Invoke",
   169          "responses": {
   170            "200": {
   171              "description": "A successful response.",
   172              "schema": {
   173                "$ref": "#/definitions/protosResponse"
   174              }
   175            },
   176            "default": {
   177              "description": "An unexpected error response.",
   178              "schema": {
   179                "$ref": "#/definitions/runtimeError"
   180              }
   181            }
   182          },
   183          "parameters": [
   184            {
   185              "name": "body",
   186              "in": "body",
   187              "required": true,
   188              "schema": {
   189                "$ref": "#/definitions/gatewayChaincodeInstanceInvokeRequest"
   190              }
   191            }
   192          ],
   193          "tags": [
   194            "ChaincodeInstanceService"
   195          ]
   196        }
   197      },
   198      "/chaincode-instance/query": {
   199        "get": {
   200          "summary": "Query chaincode on home peer. Do NOT send to orderer.",
   201          "operationId": "ChaincodeInstanceService_Query",
   202          "responses": {
   203            "200": {
   204              "description": "A successful response.",
   205              "schema": {
   206                "$ref": "#/definitions/protosResponse"
   207              }
   208            },
   209            "default": {
   210              "description": "An unexpected error response.",
   211              "schema": {
   212                "$ref": "#/definitions/runtimeError"
   213              }
   214            }
   215          },
   216          "parameters": [
   217            {
   218              "name": "input.args",
   219              "description": "Input contains the arguments for invocation.",
   220              "in": "query",
   221              "required": false,
   222              "type": "array",
   223              "items": {
   224                "type": "string",
   225                "format": "byte"
   226              },
   227              "collectionFormat": "multi"
   228            }
   229          ],
   230          "tags": [
   231            "ChaincodeInstanceService"
   232          ]
   233        }
   234      },
   235      "/chaincode/events": {
   236        "get": {
   237          "summary": "Chaincode events",
   238          "operationId": "ChaincodeEventsService_Events",
   239          "responses": {
   240            "200": {
   241              "description": "A successful response.",
   242              "schema": {
   243                "$ref": "#/definitions/gatewayChaincodeEvents"
   244              }
   245            },
   246            "default": {
   247              "description": "An unexpected error response.",
   248              "schema": {
   249                "$ref": "#/definitions/runtimeError"
   250              }
   251            }
   252          },
   253          "parameters": [
   254            {
   255              "name": "locator.chaincode",
   256              "description": "Chaincode name.",
   257              "in": "query",
   258              "required": false,
   259              "type": "string"
   260            },
   261            {
   262              "name": "locator.channel",
   263              "description": "Channel name.",
   264              "in": "query",
   265              "required": false,
   266              "type": "string"
   267            },
   268            {
   269              "name": "from_block.num",
   270              "description": "Block number.",
   271              "in": "query",
   272              "required": false,
   273              "type": "string",
   274              "format": "int64"
   275            },
   276            {
   277              "name": "to_block.num",
   278              "description": "Block number.",
   279              "in": "query",
   280              "required": false,
   281              "type": "string",
   282              "format": "int64"
   283            },
   284            {
   285              "name": "event_name",
   286              "in": "query",
   287              "required": false,
   288              "type": "array",
   289              "items": {
   290                "type": "string"
   291              },
   292              "collectionFormat": "multi"
   293            },
   294            {
   295              "name": "limit",
   296              "in": "query",
   297              "required": false,
   298              "type": "integer",
   299              "format": "int64"
   300            }
   301          ],
   302          "tags": [
   303            "ChaincodeEventsService"
   304          ]
   305        }
   306      },
   307      "/chaincode/events-stream": {
   308        "get": {
   309          "summary": "Chaincode events stream",
   310          "operationId": "ChaincodeEventsService_EventsStream",
   311          "responses": {
   312            "200": {
   313              "description": "A successful response.(streaming responses)",
   314              "schema": {
   315                "type": "object",
   316                "properties": {
   317                  "result": {
   318                    "$ref": "#/definitions/cckitgatewayChaincodeEvent"
   319                  },
   320                  "error": {
   321                    "$ref": "#/definitions/runtimeStreamError"
   322                  }
   323                },
   324                "title": "Stream result of cckitgatewayChaincodeEvent"
   325              }
   326            },
   327            "default": {
   328              "description": "An unexpected error response.",
   329              "schema": {
   330                "$ref": "#/definitions/runtimeError"
   331              }
   332            }
   333          },
   334          "parameters": [
   335            {
   336              "name": "locator.chaincode",
   337              "description": "Chaincode name.",
   338              "in": "query",
   339              "required": false,
   340              "type": "string"
   341            },
   342            {
   343              "name": "locator.channel",
   344              "description": "Channel name.",
   345              "in": "query",
   346              "required": false,
   347              "type": "string"
   348            },
   349            {
   350              "name": "from_block.num",
   351              "description": "Block number.",
   352              "in": "query",
   353              "required": false,
   354              "type": "string",
   355              "format": "int64"
   356            },
   357            {
   358              "name": "to_block.num",
   359              "description": "Block number.",
   360              "in": "query",
   361              "required": false,
   362              "type": "string",
   363              "format": "int64"
   364            },
   365            {
   366              "name": "event_name",
   367              "in": "query",
   368              "required": false,
   369              "type": "array",
   370              "items": {
   371                "type": "string"
   372              },
   373              "collectionFormat": "multi"
   374            }
   375          ],
   376          "tags": [
   377            "ChaincodeEventsService"
   378          ]
   379        }
   380      },
   381      "/chaincode/exec": {
   382        "post": {
   383          "summary": "Exec: Query or Invoke",
   384          "operationId": "ChaincodeService_Exec",
   385          "responses": {
   386            "200": {
   387              "description": "A successful response.",
   388              "schema": {
   389                "$ref": "#/definitions/protosResponse"
   390              }
   391            },
   392            "default": {
   393              "description": "An unexpected error response.",
   394              "schema": {
   395                "$ref": "#/definitions/runtimeError"
   396              }
   397            }
   398          },
   399          "parameters": [
   400            {
   401              "name": "body",
   402              "in": "body",
   403              "required": true,
   404              "schema": {
   405                "$ref": "#/definitions/gatewayChaincodeExecRequest"
   406              }
   407            }
   408          ],
   409          "tags": [
   410            "ChaincodeService"
   411          ]
   412        }
   413      },
   414      "/chaincode/invoke": {
   415        "post": {
   416          "summary": "Invoke chaincode on peers, according to endorsement policy and the SEND to orderer",
   417          "operationId": "ChaincodeService_Invoke",
   418          "responses": {
   419            "200": {
   420              "description": "A successful response.",
   421              "schema": {
   422                "$ref": "#/definitions/protosResponse"
   423              }
   424            },
   425            "default": {
   426              "description": "An unexpected error response.",
   427              "schema": {
   428                "$ref": "#/definitions/runtimeError"
   429              }
   430            }
   431          },
   432          "parameters": [
   433            {
   434              "name": "body",
   435              "in": "body",
   436              "required": true,
   437              "schema": {
   438                "$ref": "#/definitions/gatewayChaincodeInvokeRequest"
   439              }
   440            }
   441          ],
   442          "tags": [
   443            "ChaincodeService"
   444          ]
   445        }
   446      },
   447      "/chaincode/query": {
   448        "get": {
   449          "summary": "Query chaincode on home peer. Do NOT send to orderer.",
   450          "operationId": "ChaincodeService_Query",
   451          "responses": {
   452            "200": {
   453              "description": "A successful response.",
   454              "schema": {
   455                "$ref": "#/definitions/protosResponse"
   456              }
   457            },
   458            "default": {
   459              "description": "An unexpected error response.",
   460              "schema": {
   461                "$ref": "#/definitions/runtimeError"
   462              }
   463            }
   464          },
   465          "parameters": [
   466            {
   467              "name": "locator.chaincode",
   468              "description": "Chaincode name.",
   469              "in": "query",
   470              "required": false,
   471              "type": "string"
   472            },
   473            {
   474              "name": "locator.channel",
   475              "description": "Channel name.",
   476              "in": "query",
   477              "required": false,
   478              "type": "string"
   479            },
   480            {
   481              "name": "input.args",
   482              "description": "Input contains the arguments for invocation.",
   483              "in": "query",
   484              "required": false,
   485              "type": "array",
   486              "items": {
   487                "type": "string",
   488                "format": "byte"
   489              },
   490              "collectionFormat": "multi"
   491            }
   492          ],
   493          "tags": [
   494            "ChaincodeService"
   495          ]
   496        }
   497      }
   498    },
   499    "definitions": {
   500      "cckitgatewayChaincodeEvent": {
   501        "type": "object",
   502        "properties": {
   503          "event": {
   504            "$ref": "#/definitions/protosChaincodeEvent"
   505          },
   506          "block": {
   507            "type": "string",
   508            "format": "uint64"
   509          },
   510          "tx_timestamp": {
   511            "type": "string",
   512            "format": "date-time"
   513          },
   514          "payload": {
   515            "$ref": "#/definitions/gatewayRawJson"
   516          }
   517        }
   518      },
   519      "gatewayBlockLimit": {
   520        "type": "object",
   521        "properties": {
   522          "num": {
   523            "type": "string",
   524            "format": "int64",
   525            "title": "Block number"
   526          }
   527        },
   528        "title": "Block limit number for event stream subscription or event list\nValues can be negative"
   529      },
   530      "gatewayChaincodeEvents": {
   531        "type": "object",
   532        "properties": {
   533          "locator": {
   534            "$ref": "#/definitions/gatewayChaincodeLocator"
   535          },
   536          "from_block": {
   537            "$ref": "#/definitions/gatewayBlockLimit"
   538          },
   539          "to_block": {
   540            "$ref": "#/definitions/gatewayBlockLimit"
   541          },
   542          "items": {
   543            "type": "array",
   544            "items": {
   545              "$ref": "#/definitions/cckitgatewayChaincodeEvent"
   546            }
   547          }
   548        }
   549      },
   550      "gatewayChaincodeExecRequest": {
   551        "type": "object",
   552        "properties": {
   553          "locator": {
   554            "$ref": "#/definitions/gatewayChaincodeLocator"
   555          },
   556          "type": {
   557            "$ref": "#/definitions/gatewayInvocationType"
   558          },
   559          "input": {
   560            "$ref": "#/definitions/gatewayChaincodeInput"
   561          }
   562        },
   563        "title": "Chaincode execution specification"
   564      },
   565      "gatewayChaincodeInput": {
   566        "type": "object",
   567        "properties": {
   568          "args": {
   569            "type": "array",
   570            "items": {
   571              "type": "string",
   572              "format": "byte"
   573            },
   574            "description": "Input contains the arguments for invocation."
   575          },
   576          "transient": {
   577            "type": "object",
   578            "additionalProperties": {
   579              "type": "string",
   580              "format": "byte"
   581            },
   582            "description": "TransientMap contains data (e.g. cryptographic material) that might be used\nto implement some form of application-level confidentiality. The contents\nof this field are supposed to always be omitted from the transaction and\nexcluded from the ledger."
   583          }
   584        },
   585        "title": "Chaincode invocation input"
   586      },
   587      "gatewayChaincodeInstanceExecRequest": {
   588        "type": "object",
   589        "properties": {
   590          "type": {
   591            "$ref": "#/definitions/gatewayInvocationType"
   592          },
   593          "input": {
   594            "$ref": "#/definitions/gatewayChaincodeInput"
   595          }
   596        }
   597      },
   598      "gatewayChaincodeInstanceInvokeRequest": {
   599        "type": "object",
   600        "properties": {
   601          "input": {
   602            "$ref": "#/definitions/gatewayChaincodeInput"
   603          }
   604        }
   605      },
   606      "gatewayChaincodeInvokeRequest": {
   607        "type": "object",
   608        "properties": {
   609          "locator": {
   610            "$ref": "#/definitions/gatewayChaincodeLocator"
   611          },
   612          "input": {
   613            "$ref": "#/definitions/gatewayChaincodeInput"
   614          }
   615        }
   616      },
   617      "gatewayChaincodeLocator": {
   618        "type": "object",
   619        "properties": {
   620          "chaincode": {
   621            "type": "string",
   622            "title": "Chaincode name"
   623          },
   624          "channel": {
   625            "type": "string",
   626            "title": "Channel name"
   627          }
   628        },
   629        "title": "Chaincode locator - channel name and chaincode name"
   630      },
   631      "gatewayInvocationType": {
   632        "type": "string",
   633        "enum": [
   634          "INVOCATION_TYPE_QUERY",
   635          "INVOCATION_TYPE_INVOKE"
   636        ],
   637        "default": "INVOCATION_TYPE_QUERY",
   638        "description": "- INVOCATION_TYPE_QUERY: Simulation\n - INVOCATION_TYPE_INVOKE: Simulation and applying to ledger",
   639        "title": "Chaincode invocation type"
   640      },
   641      "gatewayRawJson": {
   642        "type": "object",
   643        "properties": {
   644          "value": {
   645            "type": "string",
   646            "format": "byte"
   647          }
   648        }
   649      },
   650      "protobufAny": {
   651        "type": "object",
   652        "properties": {
   653          "type_url": {
   654            "type": "string"
   655          },
   656          "value": {
   657            "type": "string",
   658            "format": "byte"
   659          }
   660        }
   661      },
   662      "protosChaincodeEvent": {
   663        "type": "object",
   664        "properties": {
   665          "chaincode_id": {
   666            "type": "string"
   667          },
   668          "tx_id": {
   669            "type": "string"
   670          },
   671          "event_name": {
   672            "type": "string"
   673          },
   674          "payload": {
   675            "type": "string",
   676            "format": "byte"
   677          }
   678        },
   679        "title": "ChaincodeEvent is used for events and registrations that are specific to chaincode\nstring type - \"chaincode\""
   680      },
   681      "protosResponse": {
   682        "type": "object",
   683        "properties": {
   684          "status": {
   685            "type": "integer",
   686            "format": "int32",
   687            "description": "A status code that should follow the HTTP status codes."
   688          },
   689          "message": {
   690            "type": "string",
   691            "description": "A message associated with the response code."
   692          },
   693          "payload": {
   694            "type": "string",
   695            "format": "byte",
   696            "description": "A payload that can be used to include metadata with this response."
   697          }
   698        },
   699        "description": "A response with a representation similar to an HTTP response that can\nbe used within another message."
   700      },
   701      "runtimeError": {
   702        "type": "object",
   703        "properties": {
   704          "error": {
   705            "type": "string"
   706          },
   707          "code": {
   708            "type": "integer",
   709            "format": "int32"
   710          },
   711          "message": {
   712            "type": "string"
   713          },
   714          "details": {
   715            "type": "array",
   716            "items": {
   717              "$ref": "#/definitions/protobufAny"
   718            }
   719          }
   720        }
   721      },
   722      "runtimeStreamError": {
   723        "type": "object",
   724        "properties": {
   725          "grpc_code": {
   726            "type": "integer",
   727            "format": "int32"
   728          },
   729          "http_code": {
   730            "type": "integer",
   731            "format": "int32"
   732          },
   733          "message": {
   734            "type": "string"
   735          },
   736          "http_status": {
   737            "type": "string"
   738          },
   739          "details": {
   740            "type": "array",
   741            "items": {
   742              "$ref": "#/definitions/protobufAny"
   743            }
   744          }
   745        }
   746      }
   747    }
   748  }