Skip to content

Commit 9b04d5e

Browse files
committed
feat(fabric-persistence): save discovery results in a database
- Add `discoverNetwork` function for saving current fabric network structure to the database. - Add `DiscoverNetworkEndpointV1` endpoint for refreshing the discovery results. - Add tests for new functions. Depends on #3726 Closes #3836 Signed-off-by: Michal Bajer <[email protected]>
1 parent 4244eb6 commit 9b04d5e

File tree

19 files changed

+1337
-112
lines changed

19 files changed

+1337
-112
lines changed

packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ client.go
66
configuration.go
77
go.mod
88
go.sum
9+
model_discover_network_response_v1.go
910
model_error_exception_response_v1.go
1011
model_status_response_v1.go
1112
model_tracked_operation_v1.go

packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ All URIs are relative to *http://localhost*
7777

7878
Class | Method | HTTP request | Description
7979
------------ | ------------- | ------------- | -------------
80+
*DefaultApi* | [**DiscoverNetworkV1**](docs/DefaultApi.md#discovernetworkv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/discover-network | Refresh Fabric network structure in the database through discovery.
8081
*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/status | Get the status of persistence plugin for fabric
8182

8283

8384
## Documentation For Models
8485

86+
- [DiscoverNetworkResponseV1](docs/DiscoverNetworkResponseV1.md)
8587
- [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md)
8688
- [StatusResponseV1](docs/StatusResponseV1.md)
8789
- [TrackedOperationV1](docs/TrackedOperationV1.md)

packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ paths:
3232
http:
3333
verbLowerCase: get
3434
path: /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/status
35+
/api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/discover-network:
36+
post:
37+
operationId: discoverNetworkV1
38+
parameters: []
39+
responses:
40+
"200":
41+
content:
42+
application/json:
43+
schema:
44+
$ref: '#/components/schemas/DiscoverNetworkResponseV1'
45+
description: OK
46+
"500":
47+
content:
48+
application/json:
49+
schema:
50+
$ref: '#/components/schemas/ErrorExceptionResponseV1'
51+
description: Internal Server Error
52+
summary: Refresh Fabric network structure in the database through discovery.
53+
x-hyperledger-cacti:
54+
http:
55+
verbLowerCase: post
56+
path: /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/discover-network
3557
components:
3658
schemas:
3759
TrackedOperationV1:
@@ -99,6 +121,21 @@ components:
99121
- operationsRunning
100122
- webServicesRegistered
101123
type: object
124+
DiscoverNetworkResponseV1:
125+
example:
126+
message: message
127+
status: true
128+
properties:
129+
status:
130+
nullable: false
131+
type: boolean
132+
message:
133+
nullable: false
134+
type: string
135+
required:
136+
- message
137+
- status
138+
type: object
102139
ErrorExceptionResponseV1:
103140
properties:
104141
message:

packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api_default.go

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_discover_network_response_v1.go

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cactus-plugin-persistence-fabric/src/main/json/openapi.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@
7373
}
7474
}
7575
},
76+
"DiscoverNetworkResponseV1": {
77+
"type": "object",
78+
"required": ["status", "message"],
79+
"properties": {
80+
"status": {
81+
"type": "boolean",
82+
"nullable": false
83+
},
84+
"message": {
85+
"type": "string",
86+
"nullable": false
87+
}
88+
}
89+
},
7690
"ErrorExceptionResponseV1": {
7791
"type": "object",
7892
"required": ["message", "error"],
@@ -124,6 +138,41 @@
124138
}
125139
}
126140
}
141+
},
142+
"/api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/discover-network": {
143+
"post": {
144+
"operationId": "discoverNetworkV1",
145+
"summary": "Refresh Fabric network structure in the database through discovery.",
146+
"x-hyperledger-cacti": {
147+
"http": {
148+
"verbLowerCase": "post",
149+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/discover-network"
150+
}
151+
},
152+
"parameters": [],
153+
"responses": {
154+
"200": {
155+
"description": "OK",
156+
"content": {
157+
"application/json": {
158+
"schema": {
159+
"$ref": "#/components/schemas/DiscoverNetworkResponseV1"
160+
}
161+
}
162+
}
163+
},
164+
"500": {
165+
"description": "Internal Server Error",
166+
"content": {
167+
"application/json": {
168+
"schema": {
169+
"$ref": "#/components/schemas/ErrorExceptionResponseV1"
170+
}
171+
}
172+
}
173+
}
174+
}
175+
}
127176
}
128177
}
129178
}

0 commit comments

Comments
 (0)