github.com/s7techlab/cckit@v0.10.5/extensions/owner/chaincode_owner.swagger.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "owner/chaincode_owner.proto",
     5      "version": "version not set"
     6    },
     7    "consumes": [
     8      "application/json"
     9    ],
    10    "produces": [
    11      "application/json"
    12    ],
    13    "paths": {
    14      "/chaincode/owners": {
    15        "get": {
    16          "summary": "Get owners list",
    17          "operationId": "ChaincodeOwnerService_ListOwners",
    18          "responses": {
    19            "200": {
    20              "description": "A successful response.",
    21              "schema": {
    22                "$ref": "#/definitions/ownerChaincodeOwners"
    23              }
    24            },
    25            "default": {
    26              "description": "An unexpected error response.",
    27              "schema": {
    28                "$ref": "#/definitions/runtimeError"
    29              }
    30            }
    31          },
    32          "tags": [
    33            "ChaincodeOwnerService"
    34          ]
    35        },
    36        "post": {
    37          "summary": "Register new chaincode owner, method can be call by current owner or if no owner exists\nIf chaincode owner with same MspID, certificate subject and issuer exists - throws error",
    38          "operationId": "ChaincodeOwnerService_CreateOwner",
    39          "responses": {
    40            "200": {
    41              "description": "A successful response.",
    42              "schema": {
    43                "$ref": "#/definitions/ownerChaincodeOwner"
    44              }
    45            },
    46            "default": {
    47              "description": "An unexpected error response.",
    48              "schema": {
    49                "$ref": "#/definitions/runtimeError"
    50              }
    51            }
    52          },
    53          "parameters": [
    54            {
    55              "name": "body",
    56              "in": "body",
    57              "required": true,
    58              "schema": {
    59                "$ref": "#/definitions/ownerCreateOwnerRequest"
    60              }
    61            }
    62          ],
    63          "tags": [
    64            "ChaincodeOwnerService"
    65          ]
    66        },
    67        "put": {
    68          "summary": "Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate",
    69          "operationId": "ChaincodeOwnerService_UpdateOwner",
    70          "responses": {
    71            "200": {
    72              "description": "A successful response.",
    73              "schema": {
    74                "$ref": "#/definitions/ownerChaincodeOwner"
    75              }
    76            },
    77            "default": {
    78              "description": "An unexpected error response.",
    79              "schema": {
    80                "$ref": "#/definitions/runtimeError"
    81              }
    82            }
    83          },
    84          "parameters": [
    85            {
    86              "name": "body",
    87              "in": "body",
    88              "required": true,
    89              "schema": {
    90                "$ref": "#/definitions/ownerUpdateOwnerRequest"
    91              }
    92            }
    93          ],
    94          "tags": [
    95            "ChaincodeOwnerService"
    96          ]
    97        }
    98      },
    99      "/chaincode/owners/txcreator": {
   100        "post": {
   101          "summary": "Register tx creator as chaincode owner",
   102          "operationId": "ChaincodeOwnerService_CreateOwnerTxCreator",
   103          "responses": {
   104            "200": {
   105              "description": "A successful response.",
   106              "schema": {
   107                "$ref": "#/definitions/ownerChaincodeOwner"
   108              }
   109            },
   110            "default": {
   111              "description": "An unexpected error response.",
   112              "schema": {
   113                "$ref": "#/definitions/runtimeError"
   114              }
   115            }
   116          },
   117          "parameters": [
   118            {
   119              "name": "body",
   120              "in": "body",
   121              "required": true,
   122              "schema": {
   123                "properties": {}
   124              }
   125            }
   126          ],
   127          "tags": [
   128            "ChaincodeOwnerService"
   129          ]
   130        }
   131      },
   132      "/chaincode/owners/whoami": {
   133        "get": {
   134          "summary": "Checks tx creator is owner",
   135          "operationId": "ChaincodeOwnerService_GetOwnerByTxCreator",
   136          "responses": {
   137            "200": {
   138              "description": "A successful response.",
   139              "schema": {
   140                "$ref": "#/definitions/ownerChaincodeOwner"
   141              }
   142            },
   143            "default": {
   144              "description": "An unexpected error response.",
   145              "schema": {
   146                "$ref": "#/definitions/runtimeError"
   147              }
   148            }
   149          },
   150          "tags": [
   151            "ChaincodeOwnerService"
   152          ]
   153        }
   154      },
   155      "/chaincode/owners/{msp_id}/{subject}": {
   156        "get": {
   157          "summary": "Get owner by msp_id and certificate subject",
   158          "operationId": "ChaincodeOwnerService_GetOwner",
   159          "responses": {
   160            "200": {
   161              "description": "A successful response.",
   162              "schema": {
   163                "$ref": "#/definitions/ownerChaincodeOwner"
   164              }
   165            },
   166            "default": {
   167              "description": "An unexpected error response.",
   168              "schema": {
   169                "$ref": "#/definitions/runtimeError"
   170              }
   171            }
   172          },
   173          "parameters": [
   174            {
   175              "name": "msp_id",
   176              "description": "Msp Id",
   177              "in": "path",
   178              "required": true,
   179              "type": "string"
   180            },
   181            {
   182              "name": "subject",
   183              "description": "Certificate subject",
   184              "in": "path",
   185              "required": true,
   186              "type": "string"
   187            }
   188          ],
   189          "tags": [
   190            "ChaincodeOwnerService"
   191          ]
   192        },
   193        "delete": {
   194          "summary": "Delete owner",
   195          "operationId": "ChaincodeOwnerService_DeleteOwner",
   196          "responses": {
   197            "200": {
   198              "description": "A successful response.",
   199              "schema": {
   200                "$ref": "#/definitions/ownerChaincodeOwner"
   201              }
   202            },
   203            "default": {
   204              "description": "An unexpected error response.",
   205              "schema": {
   206                "$ref": "#/definitions/runtimeError"
   207              }
   208            }
   209          },
   210          "parameters": [
   211            {
   212              "name": "msp_id",
   213              "description": "Msp Id",
   214              "in": "path",
   215              "required": true,
   216              "type": "string"
   217            },
   218            {
   219              "name": "subject",
   220              "description": "Certificate subject",
   221              "in": "path",
   222              "required": true,
   223              "type": "string"
   224            }
   225          ],
   226          "tags": [
   227            "ChaincodeOwnerService"
   228          ]
   229        }
   230      }
   231    },
   232    "definitions": {
   233      "ownerChaincodeOwner": {
   234        "type": "object",
   235        "properties": {
   236          "msp_id": {
   237            "type": "string",
   238            "title": "Msp Id"
   239          },
   240          "subject": {
   241            "type": "string",
   242            "title": "certificate subject"
   243          },
   244          "issuer": {
   245            "type": "string",
   246            "title": "certificate issuer"
   247          },
   248          "expires_at": {
   249            "type": "string",
   250            "format": "date-time",
   251            "title": "cert valid not after"
   252          },
   253          "cert": {
   254            "type": "string",
   255            "format": "byte",
   256            "title": "Certificate"
   257          },
   258          "updated_by_msp_id": {
   259            "type": "string",
   260            "title": "Creator identity info"
   261          },
   262          "updated_by_cert": {
   263            "type": "string",
   264            "format": "byte",
   265            "title": "Certificate"
   266          },
   267          "updated_at": {
   268            "type": "string",
   269            "format": "date-time",
   270            "title": "Updated at"
   271          }
   272        },
   273        "title": "State: information stored in chaincode state about chaincode owner"
   274      },
   275      "ownerChaincodeOwners": {
   276        "type": "object",
   277        "properties": {
   278          "items": {
   279            "type": "array",
   280            "items": {
   281              "$ref": "#/definitions/ownerChaincodeOwner"
   282            }
   283          }
   284        },
   285        "title": "List: Chaincode owners"
   286      },
   287      "ownerCreateOwnerRequest": {
   288        "type": "object",
   289        "properties": {
   290          "msp_id": {
   291            "type": "string",
   292            "title": "Msp Id"
   293          },
   294          "cert": {
   295            "type": "string",
   296            "format": "byte",
   297            "title": "Certificate"
   298          }
   299        },
   300        "title": "Request: register owner"
   301      },
   302      "ownerUpdateOwnerRequest": {
   303        "type": "object",
   304        "properties": {
   305          "msp_id": {
   306            "type": "string",
   307            "title": "Msp Id"
   308          },
   309          "cert": {
   310            "type": "string",
   311            "format": "byte",
   312            "title": "Current certificate"
   313          }
   314        },
   315        "title": "Request: update owner certificate"
   316      },
   317      "protobufAny": {
   318        "type": "object",
   319        "properties": {
   320          "type_url": {
   321            "type": "string"
   322          },
   323          "value": {
   324            "type": "string",
   325            "format": "byte"
   326          }
   327        }
   328      },
   329      "runtimeError": {
   330        "type": "object",
   331        "properties": {
   332          "error": {
   333            "type": "string"
   334          },
   335          "code": {
   336            "type": "integer",
   337            "format": "int32"
   338          },
   339          "message": {
   340            "type": "string"
   341          },
   342          "details": {
   343            "type": "array",
   344            "items": {
   345              "$ref": "#/definitions/protobufAny"
   346            }
   347          }
   348        }
   349      }
   350    }
   351  }