diff --git a/tests/postman/collections/Hyperledger Cello Api Engine.postman_collection.json b/tests/postman/collections/Hyperledger Cello Api Engine.postman_collection.json new file mode 100644 index 000000000..ecdf29b02 --- /dev/null +++ b/tests/postman/collections/Hyperledger Cello Api Engine.postman_collection.json @@ -0,0 +1,2017 @@ +{ + "info": { + "_postman_id": "deaa6f62-4155-4b00-b84f-ed1354f3f321", + "name": "Hyperledger Cello API Engine", + "description": "Hyperledger Cello is a blockchain provision and operation system, which helps manage blockchain networks in an efficient way. This document is a complete API collection for its API Engine with all RESTful endpoints", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Authentication", + "item": [ + { + "name": "Login User", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "if (pm.response.code === 200) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"token\", jsonData.data.token);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"email\": \"foo@email.com\",\n\t\"password\": \"foo\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/login", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "login" + ] + }, + "description": "Login with email and password to get access token" + } + }, + { + "name": "Refresh Token", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"refresh\": \"{{refresh_token}}\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/login/refresh/", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "login", + "refresh", + "" + ] + }, + "description": "Refresh access token using refresh token" + } + }, + { + "name": "Verify Token", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"token\": \"{{token}}\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/token-verify", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "token-verify" + ] + }, + "description": "Verify the validity of access token" + } + }, + { + "name": "Register User", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"org_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"username\": \"admin\",\n\t\"email\": \"admin@email.com\",\n\t\"password\": \"password\",\n\t\"orgName\": \"org1.example.com\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/register", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "register" + ] + }, + "description": "Register new user with organization" + } + } + ], + "description": "Authentication and user registration endpoints" + }, + { + "name": "Agents", + "item": [ + { + "name": "List Agents", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/agents", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + }, + { + "key": "name", + "value": "", + "disabled": true + }, + { + "key": "status", + "value": "", + "disabled": true + }, + { + "key": "type", + "value": "", + "disabled": true + } + ] + }, + "description": "Get list of agents with pagination and filtering options" + } + }, + { + "name": "Create Agent", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"agent_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"cello-agent-docker\",\n\t\"type\": \"docker\",\n\t\"urls\": \"http://cello.docker.agent:5001\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/agents", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents" + ] + }, + "description": "Create new agent" + } + }, + { + "name": "Get Agent", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/agents/{{agent_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents", + "{{agent_id}}" + ] + }, + "description": "Get agent details by ID" + } + }, + { + "name": "Update Agent", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"updated-agent-name\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/agents/{{agent_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents", + "{{agent_id}}" + ] + }, + "description": "Update agent information" + } + }, + { + "name": "Partial Update Agent", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"partial-updated-name\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/agents/{{agent_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents", + "{{agent_id}}" + ] + }, + "description": "Partially update agent information" + } + }, + { + "name": "Delete Agent", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/agents/{{agent_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents", + "{{agent_id}}" + ] + }, + "description": "Delete agent by ID" + } + }, + { + "name": "Apply Agent", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"type\": \"kubernetes\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/agents/organization", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents", + "organization" + ] + }, + "description": "Apply for agent assignment to organization" + } + }, + { + "name": "Release Agent", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/agents/{{agent_id}}/organization", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "agents", + "{{agent_id}}", + "organization" + ] + }, + "description": "Release agent from organization assignment" + } + } + ], + "description": "Agent management endpoints for Docker and Kubernetes agents" + }, + { + "name": "Organizations", + "item": [ + { + "name": "List Organizations", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/organizations", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "organizations" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + }, + { + "key": "name", + "value": "", + "disabled": true + } + ] + }, + "description": "Get list of organizations with pagination" + } + }, + { + "name": "Create Organization", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"org_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"org1.example.com\",\n\t\"peernum\": 2,\n\t\"orderernum\": 1\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/organizations", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "organizations" + ] + }, + "description": "Create new organization with specified peer and orderer nodes" + } + }, + { + "name": "Get Organization", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/organizations/{{org_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "organizations", + "{{org_id}}" + ] + }, + "description": "Get organization details by ID" + } + }, + { + "name": "Update Organization", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"updated-org.example.com\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/organizations/{{org_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "organizations", + "{{org_id}}" + ] + }, + "description": "Update organization information" + } + }, + { + "name": "Delete Organization", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/organizations/{{org_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "organizations", + "{{org_id}}" + ] + }, + "description": "Delete organization by ID" + } + } + ], + "description": "Organization management endpoints" + }, + { + "name": "Networks", + "item": [ + { + "name": "List Networks", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/networks", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "networks" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + }, + { + "key": "status", + "value": "", + "disabled": true + } + ] + }, + "description": "Get list of blockchain networks" + } + }, + { + "name": "Create Network", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"network_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"test-network\",\n\t\"consensus\": \"etcdraft\",\n\t\"database\": \"leveldb\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/networks", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "networks" + ] + }, + "description": "Create new blockchain network" + } + }, + { + "name": "Get Network", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/networks/{{network_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "networks", + "{{network_id}}" + ] + }, + "description": "Get network details by ID" + } + }, + { + "name": "Delete Network", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/networks/{{network_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "networks", + "{{network_id}}" + ] + }, + "description": "Delete network by ID" + } + } + ], + "description": "Blockchain network management endpoints" + }, + { + "name": "Nodes", + "item": [ + { + "name": "List Nodes", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/nodes", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + }, + { + "key": "type", + "value": "", + "disabled": true + }, + { + "key": "name", + "value": "", + "disabled": true + } + ] + }, + "description": "Get list of blockchain nodes (peers and orderers)" + } + }, + { + "name": "Create Peer Node", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"peer_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"peer0\",\n\t\"type\": \"peer\",\n\t\"num\": 1\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes" + ] + }, + "description": "Create new peer node" + } + }, + { + "name": "Create Orderer Node", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"orderer_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"orderer0\",\n\t\"type\": \"orderer\",\n\t\"num\": 1\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes" + ] + }, + "description": "Create new orderer node" + } + }, + { + "name": "Get Node", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}" + ] + }, + "description": "Get node details by ID" + } + }, + { + "name": "Update Node", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"updated-peer0\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}" + ] + }, + "description": "Update node information" + } + }, + { + "name": "Delete Node", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}" + ] + }, + "description": "Delete node by ID" + } + }, + { + "name": "Operate Node", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"action\": \"start\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}/operations", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}", + "operations" + ] + }, + "description": "Perform operations on node (start, stop, restart)" + } + }, + { + "name": "Get Node Config", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}/config", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}", + "config" + ] + }, + "description": "Download node configuration files" + } + }, + { + "name": "Upload Node Config", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}/config", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}", + "config" + ] + }, + "description": "Upload node configuration file" + } + }, + { + "name": "Join Channel", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": [], + "description": "Genesis block file" + } + ] + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}/block", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}", + "block" + ] + }, + "description": "Upload genesis block to join channel" + } + }, + { + "name": "List Node Users", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}/users", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}", + "users" + ] + }, + "description": "Get list of users registered to node" + } + }, + { + "name": "Register User to Node", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"username\": \"user1\",\n\t\"password\": \"password123\",\n\t\"type\": \"client\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/nodes/{{peer_id}}/users", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "nodes", + "{{peer_id}}", + "users" + ] + }, + "description": "Register new user to node" + } + } + ], + "description": "Blockchain node (peer and orderer) management endpoints" + }, + { + "name": "Channels", + "item": [ + { + "name": "List Channels", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/channels", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "channels" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + } + ] + }, + "description": "Get list of channels" + } + }, + { + "name": "Create Channel", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"channel_id\", jsonData.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"mychannel\",\n\t\"orderers\": [\"{{orderer_id}}\"],\n\t\"peers\": [\"{{peer_id}}\"]\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/channels", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "channels" + ] + }, + "description": "Create new channel with specified peers and orderers" + } + }, + { + "name": "Get Channel", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/channels/{{channel_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "channels", + "{{channel_id}}" + ] + }, + "description": "Get channel details by ID" + } + }, + { + "name": "Update Channel", + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "msp_id", + "value": "Org1MSP", + "type": "text" + }, + { + "key": "org_type", + "value": "Application", + "type": "text" + }, + { + "key": "data", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{base_url}}/api/v1/channels/{{channel_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "channels", + "{{channel_id}}" + ] + }, + "description": "Update channel configuration" + } + } + ], + "description": "Blockchain channel management endpoints" + }, + { + "name": "Chaincodes", + "item": [ + { + "name": "List Chaincodes", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/chaincodes", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "chaincodes" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + } + ] + }, + "description": "Get list of chaincode packages" + } + }, + { + "name": "Upload Chaincode Package", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"chaincode_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": [], + "description": "Chaincode package (.tar.gz)" + }, + { + "key": "description", + "value": "Sample chaincode for testing", + "type": "text" + } + ] + }, + "url": { + "raw": "{{base_url}}/api/v1/chaincodes/chaincodeRepo", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "chaincodes", + "chaincodeRepo" + ] + }, + "description": "Upload chaincode package file" + } + }, + { + "name": "Approve Chaincode", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"channel_name\": \"mychannel\",\n\t\"chaincode_name\": \"mycc\",\n\t\"chaincode_version\": \"1.0\",\n\t\"sequence\": 1,\n\t\"policy\": \"\",\n\t\"init_flag\": false\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/chaincodes/{{chaincode_id}}/approve", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "chaincodes", + "{{chaincode_id}}", + "approve" + ] + }, + "description": "Approve chaincode for organization" + } + }, + { + "name": "Commit Chaincode", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"channel_name\": \"mychannel\",\n\t\"chaincode_name\": \"mycc\",\n\t\"chaincode_version\": \"1.0\",\n\t\"sequence\": 1,\n\t\"policy\": \"\",\n\t\"init_flag\": false\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/chaincodes/{{chaincode_id}}/commit", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "chaincodes", + "{{chaincode_id}}", + "commit" + ] + }, + "description": "Commit chaincode definition to channel" + } + } + ], + "description": "Chaincode management endpoints for smart contract deployment" + }, + { + "name": "Users", + "item": [ + { + "name": "List Users", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/users?page=1&per_page=10", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "users" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + }, + { + "key": "username", + "value": "", + "disabled": true + } + ] + }, + "description": "Get list of users with pagination and filtering" + } + }, + { + "name": "Create User", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"user_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"username\": \"testuser\",\n\t\"email\": \"testuser@email.com\",\n\t\"password\": \"password123\",\n\t\"role\": \"operator\",\n\t\"organization\": \"{{org_id}}\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/users", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "users" + ] + }, + "description": "Create new user" + } + }, + { + "name": "Get User", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/users/{{user_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "users", + "{{user_id}}" + ] + }, + "description": "Get user details by ID" + } + }, + { + "name": "Update User", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"password\": \"newpassword123\"\n}" + }, + "url": { + "raw": "{{base_url}}/api/v1/users/{{user_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "users", + "{{user_id}}" + ] + }, + "description": "Update user information" + } + }, + { + "name": "Delete User", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/users/{{user_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "users", + "{{user_id}}" + ] + }, + "description": "Delete user by ID" + } + } + ], + "description": "User management endpoints" + }, + { + "name": "Files", + "item": [ + { + "name": "List Files", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/files", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "files" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "per_page", + "value": "10" + }, + { + "key": "name", + "value": "", + "disabled": true + }, + { + "key": "type", + "value": "", + "disabled": true + } + ] + }, + "description": "Get list of uploaded files" + } + }, + { + "name": "Upload File", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "if (pm.response.code === 201) {", + " var jsonData = pm.response.json();", + " pm.environment.set(\"file_id\", jsonData.data.id);", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": [] + }, + { + "key": "name", + "value": "test-file", + "type": "text" + }, + { + "key": "type", + "value": "config", + "type": "text" + } + ] + }, + "url": { + "raw": "{{base_url}}/api/v1/files", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "files" + ] + }, + "description": "Upload new file" + } + }, + { + "name": "Get File", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/files/{{file_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "files", + "{{file_id}}" + ] + }, + "description": "Get file details by ID" + } + }, + { + "name": "Delete File", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "JWT {{token}}", + "type": "text" + } + ], + "url": { + "raw": "{{base_url}}/api/v1/files/{{file_id}}", + "host": [ + "{{base_url}}" + ], + "path": [ + "api", + "v1", + "files", + "{{file_id}}" + ] + }, + "description": "Delete file by ID" + } + } + ], + "description": "File management endpoints for configuration and other files" + } + ], + "variable": [ + { + "key": "base_url", + "value": "http://127.0.0.1:8080", + "type": "string" + }, + { + "key": "token", + "value": "", + "type": "string" + }, + { + "key": "refresh_token", + "value": "", + "type": "string" + }, + { + "key": "org_id", + "value": "", + "type": "string" + }, + { + "key": "agent_id", + "value": "", + "type": "string" + }, + { + "key": "network_id", + "value": "", + "type": "string" + }, + { + "key": "peer_id", + "value": "", + "type": "string" + }, + { + "key": "orderer_id", + "value": "", + "type": "string" + }, + { + "key": "channel_id", + "value": "", + "type": "string" + }, + { + "key": "chaincode_id", + "value": "", + "type": "string" + }, + { + "key": "user_id", + "value": "", + "type": "string" + }, + { + "key": "file_id", + "value": "", + "type": "string" + } + ] +} \ No newline at end of file diff --git a/tests/postman/test/Hyperledger Cello Api Engine.postman_collection.json b/tests/postman/test/Hyperledger Cello Api Engine.postman_collection.json deleted file mode 100644 index 9814fdeb7..000000000 --- a/tests/postman/test/Hyperledger Cello Api Engine.postman_collection.json +++ /dev/null @@ -1,2903 +0,0 @@ -{ - "info": { - "_postman_id": "deaa6f62-4155-4b00-b84f-ed1354f3f321", - "name": "Hyperledger Cello Api Engine", - "description": "Hyperledger Cello Api Engine", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Login Admin", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"token\", jsonData.token);", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{ \n\t\"email\": \"foo@email.com\",\n\t\"password\": \"foo\"\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/login", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "login" - ] - }, - "description": "Login Admin" - }, - "response": [ - { - "name": "Login Admin", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{ \n\t\"email\": \"foo@email.com\",\n\t\"password\": \"foo\"\n}\n" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/login", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "login" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Sat, 13 Nov 2021 01:11:04 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "POST, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "455" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMmY1NjgxOGYtODIwZC00MDdkLTk0YjQtN2JlZGY4Y2I1MDQ5IiwidXNlcm5hbWUiOiJmb29AZW1haWwuY29tIiwiZXhwIjoxNjM3MzcwNjY0LCJlbWFpbCI6ImZvb0BlbWFpbC5jb20ifQ.Iiz24e_MoKLVCZc-tD5aDWpnOI4Hqe3e2xU-TEf1PTo\",\n \"user\": {\n \"id\": \"2f56818f-820d-407d-94b4-7bedf8cb5049\",\n \"username\": \"foo@email.com\",\n \"role\": \"admin\",\n \"email\": \"foo@email.com\",\n \"organization\": {\n \"id\": \"665d1636-8e1f-4238-bcfd-308ab69e5dde\",\n \"name\": \"org1.cello.com\"\n }\n }\n}" - } - ] - }, - { - "name": "List Agents", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/agents", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "agents" - ] - }, - "description": "List Agents" - }, - "response": [ - { - "name": "List Agents", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/agents", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "agents" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Mon, 06 Dec 2021 05:50:54 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "307" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"total\": 1,\n \"data\": [\n {\n \"id\": \"ec88a3c3-54d1-41ef-ae94-1c10d460405f\",\n \"name\": \"cello-agent-docker\",\n \"status\": \"active\",\n \"created_at\": \"2021-12-06T05:45:49.297480Z\",\n \"type\": \"docker\",\n \"urls\": \"http://cello.docker.agent:5001\",\n \"organization\": \"eb4d97eb-fe70-442c-9aff-14764f942652\"\n }\n ]\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Retrieve Organization", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/organizations/:org_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "organizations", - ":org_id" - ], - "variable": [ - { - "key": "org_id", - "value": "f881d6de-d665-4c3c-936c-593705e9a07e" - } - ] - }, - "description": "List Agents" - }, - "response": [] - }, - { - "name": "Create Organization", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"org.foo.com\",\n \"orderernum\": 1,\n \"peernum\": 2\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/organizations", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "organizations" - ] - }, - "description": "Create Organization" - }, - "response": [] - }, - { - "name": "Create Network", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"test1\",\n \"consensus\": \"etcdraft\",\n \"database\": \"leveldb\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/networks", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "networks" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "Create Network", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"test1\",\n \"consensus\": \"etcdraft\",\n \"database\": \"leveldb\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/networks", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "networks" - ] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Sat, 13 Nov 2021 01:11:54 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "87" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"9ca9ab40-cd25-42a8-baaf-8a217d9ad335\"\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Create Channel", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"channel1\",\n \"orderers\": [\n \"5eed76e9-88ad-47a4-8598-200f714205dd\"\n ],\n \"peers\": [\n \"0aefdde1-cbd9-4df3-a42d-aabf3929fd8f\"\n ]\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "Create Channel", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"channel1\",\n \"orderers\": [\n \"5eed76e9-88ad-47a4-8598-200f714205dd\"\n ],\n \"peers\": [\n \"0aefdde1-cbd9-4df3-a42d-aabf3929fd8f\"\n ]\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels" - ] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Mon, 06 Dec 2021 05:46:22 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "45" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"id\": \"4e3d86e1-20a3-4297-9c2e-1943d637be53\"\n}" - } - ] - }, - { - "name": "Update Channel", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"peers\": [\"4ff3c4b5-f6aa-4d29-bf0b-60aa150bd08c\"],\n \"orderers\": [\"dc4ca49e-554a-4c48-8771-2757e5f99eb3\"]\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels/:channel_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels", - ":channel_id" - ], - "variable": [ - { - "key": "channel_id", - "value": "db0baf14-3d1d-49a4-9c17-fb76384da85e" - } - ] - }, - "description": "Create Organization" - }, - "response": [] - }, - { - "name": "Create Orderer Nodes", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"orderer\",\n \"type\": \"orderer\",\n \"num\": 1\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "Create Orderer Nodes", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"orderer\",\n \"type\": \"orderer\",\n \"num\": 1\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes" - ] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Sat, 13 Nov 2021 01:11:47 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "87" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"db08dfbe-6fb7-4dd1-80d3-73fb31d3465f\"\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Create Peer Nodes", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"peer\",\n \"type\": \"peer\",\n \"num\": 1\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "Create Peer Nodes", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"peer\",\n \"type\": \"peer\",\n \"num\": 1\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes" - ] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Sat, 13 Nov 2021 01:11:43 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "87" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"b0782172-b037-4e0e-80e8-cc92a5b457fc\"\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Operate Node", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"start\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes/:node_id/operations", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes", - ":node_id", - "operations" - ], - "variable": [ - { - "key": "node_id", - "value": "dc4ca49e-554a-4c48-8771-2757e5f99eb3" - } - ] - }, - "description": "Create Organization" - }, - "response": [] - }, - { - "name": "List Nodes", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "List Nodes", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Mon, 06 Dec 2021 05:46:04 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "650" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"data\": [\n {\n \"id\": \"5eed76e9-88ad-47a4-8598-200f714205dd\",\n \"type\": \"orderer\",\n \"name\": \"orderer0\",\n \"urls\": \"http://orderer0.org1.cello.com\",\n \"created_at\": \"2021-12-06T05:45:56.367381Z\",\n \"network_id\": null,\n \"organization\": \"eb4d97eb-fe70-442c-9aff-14764f942652\",\n \"ports\": [\n {\n \"external\": 20673,\n \"internal\": 7050\n }\n ]\n },\n {\n \"id\": \"0aefdde1-cbd9-4df3-a42d-aabf3929fd8f\",\n \"type\": \"peer\",\n \"name\": \"peer0\",\n \"urls\": \"http://peer0.org1.cello.com\",\n \"created_at\": \"2021-12-06T05:45:52.188596Z\",\n \"network_id\": null,\n \"organization\": \"eb4d97eb-fe70-442c-9aff-14764f942652\",\n \"ports\": [\n {\n \"external\": 13512,\n \"internal\": 7051\n },\n {\n \"external\": 51076,\n \"internal\": 7053\n }\n ]\n }\n ],\n \"total\": 2\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "List Network", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/networks", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "networks" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "List Network", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/networks", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "networks" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Mon, 06 Dec 2021 05:47:35 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "166" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"total\": 1,\n \"data\": [\n {\n \"id\": \"7c2261c0-f7f0-49ef-8f76-a04f3754091c\",\n \"name\": \"test1\",\n \"created_at\": \"2021-12-06T05:46:01.206666Z\"\n }\n ]\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "List Channels", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels" - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "List Channels", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Fri, 19 Nov 2021 20:37:51 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "243" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"total\": 1,\n \"data\": [\n {\n \"id\": \"9ad94f1b-159b-4018-9984-b9d0d78f457f\",\n \"name\": \"channel1\",\n \"network\": {\n \"id\": \"00187a7a-e5de-48af-9f8f-f759504718c7\",\n \"name\": \"test1\"\n },\n \"organizations\": [\n {\n \"id\": \"f96d61fb-4ec6-4f39-b43b-dd3476d07530\",\n \"name\": \"org1.cello.com\"\n }\n ]\n }\n ]\n}" - } - ] - }, - { - "name": "Retrieve Channel", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"orgID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels/:channel_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels", - ":channel_id" - ], - "variable": [ - { - "key": "channel_id", - "value": "4e3d86e1-20a3-4297-9c2e-1943d637be53" - } - ] - }, - "description": "Create Organization" - }, - "response": [ - { - "name": "Retrieve Channel", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/channels/:channel_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "channels", - ":channel_id" - ], - "variable": [ - { - "key": "channel_id", - "value": "4e3d86e1-20a3-4297-9c2e-1943d637be53" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Mon, 06 Dec 2021 05:48:08 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, PUT, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "264" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"id\": \"4e3d86e1-20a3-4297-9c2e-1943d637be53\",\n \"name\": \"channel1\",\n \"network\": {\n \"id\": \"7c2261c0-f7f0-49ef-8f76-a04f3754091c\",\n \"name\": \"test1\"\n },\n \"organizations\": [\n {\n \"id\": \"eb4d97eb-fe70-442c-9aff-14764f942652\",\n \"name\": \"org1.cello.com\"\n }\n ],\n \"create_ts\": \"2021-12-06T05:46:22.622761Z\"\n}" - } - ] - }, - { - "name": "Retrieve Organization", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Test is right org\", function () {", - " var jsonData = pm.response.json();", - " var orgName = pm.environment.get(\"orgName\");", - "", - " tests[\"Name is right\"] = jsonData.name === orgName;", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/organizations/:orgID", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "organizations", - ":orgID" - ], - "variable": [ - { - "key": "orgID", - "value": "eb4d97eb-fe70-442c-9aff-14764f942652" - } - ] - }, - "description": "Retrieve Organization" - }, - "response": [] - }, - { - "name": "Create Admin with organization", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"operatorID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"username\": \"test\",\n\t\"role\": \"administrator\",\n\t\"password\": \"foo\",\n \"passwordAgain\": \"foo\",\n \"orgName\": \"org1.cello.com\",\n\t\"email\": \"foo@email.com\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/register", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "register" - ] - }, - "description": "Create Admin with organization" - }, - "response": [ - { - "name": "Create Admin with organization", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"username\": \"test\",\n\t\"role\": \"administrator\",\n\t\"password\": \"foo\",\n \"passwordAgain\": \"foo\",\n \"orgName\": \"org1.cello.com\",\n\t\"email\": \"foo@email.com\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/register", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "register" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Sat, 13 Nov 2021 01:10:56 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "POST, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "87" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"665d1636-8e1f-4238-bcfd-308ab69e5dde\"\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Create Agent", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"agentID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"cello-agent-docker\",\n\t\"type\": \"docker\",\n\t\"urls\": \"http://cello.docker.agent:5001\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/agents", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "agents" - ] - }, - "description": "Create Agent" - }, - "response": [ - { - "name": "Create Agent", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"cello-agent-docker\",\n\t\"type\": \"docker\",\n\t\"urls\": \"http://cello.docker.agent:5001\"\n}" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/agents", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "agents" - ] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Sat, 13 Nov 2021 01:11:35 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, POST, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "87" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"dfaa6b06-87db-4272-9a34-937afc170229\"\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Retrieve Agent", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Test is right agent\", function () {", - " var jsonData = pm.response.json();", - " var agentName = pm.environment.get(\"k8sAgentName\");", - " var agentCapacity = parseInt(pm.environment.get(\"agentCapacity\"));", - " var k8sAgentWorkerApi = pm.environment.get(\"k8sAgentWorkerApi\");", - "", - " tests[\"Name is right\"] = jsonData.name === agentName;", - " tests[\"Capacity is right\"] = jsonData.capacity === agentCapacity;", - " tests[\"Worker api is right\"] = jsonData.worker_api === k8sAgentWorkerApi;", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/agents/:agent_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "agents", - ":agent_id" - ], - "variable": [ - { - "key": "agent_id", - "value": "ec88a3c3-54d1-41ef-ae94-1c10d460405f" - } - ] - }, - "description": "Retrieve Agent" - }, - "response": [ - { - "name": "Retrieve Agent", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/agents/:agent_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "agents", - ":agent_id" - ], - "variable": [ - { - "key": "agent_id", - "value": "ec88a3c3-54d1-41ef-ae94-1c10d460405f" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Date", - "value": "Mon, 06 Dec 2021 05:49:10 GMT" - }, - { - "key": "Server", - "value": "WSGIServer/0.2 CPython/3.8.12" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Vary", - "value": "Accept, Origin" - }, - { - "key": "Allow", - "value": "GET, PUT, PATCH, DELETE, HEAD, OPTIONS" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "Content-Length", - "value": "249" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "same-origin" - } - ], - "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"ec88a3c3-54d1-41ef-ae94-1c10d460405f\",\n \"name\": \"cello-agent-docker\",\n \"status\": \"active\",\n \"created_at\": \"2021-12-06T05:45:49.297480Z\",\n \"type\": \"docker\",\n \"organization_id\": \"eb4d97eb-fe70-442c-9aff-14764f942652\"\n },\n \"msg\": null,\n \"status\": \"successful\"\n}" - } - ] - }, - { - "name": "Auth Operator", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"operatorToken\", jsonData.token);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"username\": \"{{operatorName}}\",\n\t\"password\": \"{{operatorPassword}}\"\n}" - }, - "url": { - "raw": "{{apiServer}}{{webRoot}}/auth/login/", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "auth", - "login", - "" - ] - }, - "description": "Auth Operator" - }, - "response": [] - }, - { - "name": "Apply agent with operator token", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"appliedAgentID\", jsonData.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{operatorToken}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"type\": \"kubernetes\",\n\t\"capacity\": {{agentCapacity}}\n}" - }, - "url": { - "raw": "{{apiServer}}{{webRoot}}/agents/organization", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "agents", - "organization" - ] - }, - "description": "Apply agent with operator token" - }, - "response": [] - }, - { - "name": "Retrieve Agent with operator token", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Test is right agent\", function () {", - " var jsonData = pm.response.json();", - " var agentID = pm.environment.get(\"appliedAgentID\");", - "", - " tests[\"ID is right\"] = jsonData.id === agentID;", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{operatorToken}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiServer}}{{webRoot}}/agents/{{agentID}}", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "agents", - "{{agentID}}" - ] - }, - "description": "Retrieve Agent with operator token" - }, - "response": [] - }, - { - "name": "Release Agent with operator token", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 204\", function () {", - " pm.response.to.have.status(204);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{operatorToken}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "{{apiServer}}{{webRoot}}/agents/{{agentID}}/organization", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "agents", - "{{agentID}}", - "organization" - ] - }, - "description": "Release agent with operator token" - }, - "response": [] - }, - { - "name": "Delete Agent", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 204\", function () {", - " pm.response.to.have.status(204);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "{{apiServer}}{{webRoot}}/agents/{{agentID}}", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "agents", - "{{agentID}}" - ] - }, - "description": "Delete Agent" - }, - "response": [] - }, - { - "name": "Delete Network", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 204\", function () {", - " pm.response.to.have.status(204);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "JWT {{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/networks/:network_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "networks", - ":network_id" - ], - "variable": [ - { - "key": "network_id", - "value": "97722c2c-7b38-4d45-ac73-113dfbe5edf1" - } - ] - }, - "description": "Delete Agent" - }, - "response": [] - }, - { - "name": "Delete User", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 204\", function () {", - " pm.response.to.have.status(204);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "{{apiServer}}{{webRoot}}/users/{{operatorID}}", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "users", - "{{operatorID}}" - ] - }, - "description": "Delete User" - }, - "response": [] - }, - { - "name": "Delete Organization", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 204\", function () {", - " pm.response.to.have.status(204);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "{{apiServer}}{{webRoot}}/organizations/{{orgID}}", - "host": [ - "{{apiServer}}{{webRoot}}" - ], - "path": [ - "organizations", - "{{orgID}}" - ] - }, - "description": "Delete Organization" - }, - "response": [] - }, - { - "name": "Verify Token", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNGE1ZTUxMWUtZmM5Yi00M2ZkLTgwMjktMmU5NDgwZjg2MTUwIiwidXNlcm5hbWUiOiJmb29AZW1haWwuY29tIiwiZXhwIjoxNjM2Njg5MDg3LCJlbWFpbCI6ImZvb0BlbWFpbC5jb20ifQ.AlLyT1YzLJJWijpH_XZZSisjMznpPK8mr1pmSKwoK_w\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/token-verify", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "token-verify" - ] - } - }, - "response": [] - }, - { - "name": "Retrieve Channel", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes/:node_id", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes", - ":node_id" - ], - "variable": [ - { - "key": "node_id", - "value": "953bcca2-77c4-42e1-a496-d8efe0ea4ecc" - } - ] - } - }, - "response": [] - }, - { - "name": "Retrieve Node Config File", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/zip", - "type": "text" - } - ], - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes/:node_id/config", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes", - ":node_id", - "config" - ], - "variable": [ - { - "key": "node_id", - "value": "953bcca2-77c4-42e1-a496-d8efe0ea4ecc" - } - ] - } - }, - "response": [] - }, - { - "name": "Upload Node Config File", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 202\", function () {", - " pm.response.to.have.status(202);", - "});" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "file", - "type": "file", - "src": "/home/orderer.yaml" - } - ] - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes/:node_id/config", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes", - ":node_id", - "config" - ], - "variable": [ - { - "key": "node_id", - "value": "953bcca2-77c4-42e1-a496-d8efe0ea4ecc" - } - ] - } - }, - "response": [] - }, - { - "name": "Peer Join Channel", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "file", - "type": "file", - "src": "/home/ppx/Desktop/channel1.block" - } - ] - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/nodes/:node_id/block", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "nodes", - ":node_id", - "block" - ], - "variable": [ - { - "key": "node_id", - "value": "ecef0a57-1fe3-435c-9a08-71fababc3460" - } - ] - } - }, - "response": [] - }, - { - "name": "Upload Chaincode Package", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "JWT {{token}}", - "type": "text" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "file", - "type": "file", - "src": "mycc.tar.gz" - }, - { - "key": "description", - "value": "CC Description", - "type": "text" - } - ] - }, - "url": { - "raw": "http://127.0.0.1:8080/api/v1/chaincodes/chaincodeRepo", - "protocol": "http", - "host": [ - "127", - "0", - "0", - "1" - ], - "port": "8080", - "path": [ - "api", - "v1", - "chaincodes", - "chaincodeRepo" - ] - } - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "apiServer", - "value": "http://localhost:8081/" - }, - { - "key": "webRoot", - "value": "api/v1" - } - ] -} \ No newline at end of file