Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. List

GET api/v1/nodes/

List node,We can look up nodes from three dimensions, network, organizaton, agent.

Body ParametersTypeNote
pageint
per_pageint
note_typestring
organization_iduuid
agent_ituuid

Example Response Body

Code Block
{
    "data": {
        "data": [
            {
                "id": "4b66c1a8-bf86-4502-8dd5-365b69fa7744",
                "type": "peer",
                "name": "peer0",
                "urls": "http://peer0.org1.cello.com",
                "created_at": "2021-12-10T05:51:14.248562Z",
                "network_id": null,
                "organization": "76ebf68b-019f-45ff-abef-67e3a3d1752f",
                "ports": [
                    {
                        "external": 29691,
                        "internal": 7051
                    },
                    {
                        "external": 30706,
                        "internal": 7053
                    }
                ]
            },
            {
                "id": "efdcbc5b-2695-40fa-93ea-c20bc5eabdcd",
                "type": "orderer",
                "name": "orderer0",
                "urls": "http://orderer0.org1.cello.com",
                "created_at": "2021-12-10T05:51:11.767810Z",
                "network_id": null,
                "organization": "76ebf68b-019f-45ff-abef-67e3a3d1752f",
                "ports": [
                    {
                        "external": 62689,
                        "internal": 7050
                    }
                ]
            }
        ],
        "total": 2
    },
    "msg": null,
    "status": "successful"
}


2. Create

POST api/v1/nodes/

Create an node with the given parameters.

Body ParametersTypeNote
namestring
typestring
numint

Example Requst Body

Code Block
{
    "name": "orderer",
    "type": "orderer",
    "num": 1
}

...

Code Block
{
    "data": {
        "id": "efdcbc5b-2695-40fa-93ea-c20bc5eabdcd"
    },
    "msg": null,
    "status": "successful"
}

3. Operation

POST api/v1/nodes/{id}/operations/

Operating node with start, stop, restart, etc. 

Path ParametersTypeNote
idUUIDNode id


Body ParametersTypeNote
actionstring


4. Delete

DELETE api/v1/nodes/{id}/

Delete node with gived id

Path ParametersTypeNote
idUUIDNode id


5. Update

PUTPUTapi/v1/nodes/{id}/

Update the node with the id

Path ParametersTypeNote
idUUIDNode id


6. Get Config

GET api/v1/nodes/{id}/config/

Get the config file of a node

Path ParametersTypeNote
idUUIDNode id


7. Update Config

POST api/v1/nodes/{id}/config/

Get the config file of a node

Path ParametersTypeNote
idUUIDNode id

Example Request Body

Code Block
Required Content-Type: "multipart/form-data"
{
	"file": /xxx/xxx/orderer.yaml
}


8. Query

GET api/v1/nodes/{id}/

Get the node status

Path ParametersTypeNote
idUUIDNode id