Skip to content

Commit 17b4bdd

Browse files
deer-prudenceFredericHeem
authored andcommitted
Subledgerid swagger update (Azure#18628)
* added subledger id tracking * prettier fix * subledger endpoint added * subledgerids spec added * added * testing changes * fixed pem array * fixed pem array * camel cased * move version to a YYYY-MM-DD value * move version to a YYYY-MM-DD value * open api board changes * small change collectionIds -> collections * fixed examples * prettier fix * match schema of other arrays * updated version * updating file path * updating version in readme * updated model * prettier fix? * updated comments * updated naming * date fix * nextlink update
1 parent e495974 commit 17b4bdd

21 files changed

+182
-78
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"version": "0.1-preview",
4+
"version": "2022-04-20-preview",
55
"title": "ConfidentialLedgerClient",
66
"description": "The ConfidentialLedgerClient writes and retrieves ledger entries against the Confidential Ledger service."
77
},
Lines changed: 126 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"version": "0.1-preview",
4+
"version": "2022-04-20-preview",
55
"title": "ConfidentialLedgerClient",
66
"description": "The ConfidentialLedgerClient writes and retrieves ledger entries against the Confidential Ledger service."
77
},
@@ -122,6 +122,37 @@
122122
}
123123
}
124124
},
125+
"/app/collections": {
126+
"get": {
127+
"operationId": "ConfidentialLedger_GetCollections",
128+
"x-ms-examples": {
129+
"GetCollectionIds": {
130+
"$ref": "./examples/ledger/GetCollections.json"
131+
}
132+
},
133+
"summary": "Retrieves a list of collection ids present in the Confidential Ledger",
134+
"description": "Collection ids are user-created collections of ledger entries",
135+
"parameters": [
136+
{
137+
"$ref": "common.json#/parameters/ApiVersionParameter"
138+
}
139+
],
140+
"responses": {
141+
"200": {
142+
"description": "List of collections",
143+
"schema": {
144+
"$ref": "#/definitions/CollectionArray"
145+
}
146+
},
147+
"default": {
148+
"description": "Error response describing why the operation failed",
149+
"schema": {
150+
"$ref": "common.json#/definitions/ConfidentialLedgerError"
151+
}
152+
}
153+
}
154+
}
155+
},
125156
"/app/transactions": {
126157
"get": {
127158
"operationId": "ConfidentialLedger_GetLedgerEntries",
@@ -132,16 +163,16 @@
132163
},
133164
"x-ms-pageable": {
134165
"itemName": "entries",
135-
"nextLinkName": "@nextLink"
166+
"nextLinkName": "nextLink"
136167
},
137-
"summary": "Gets ledger entries from a sub-ledger corresponding to a range.",
138-
"description": "A sub-ledger id may optionally be specified. Only entries in the specified (or default) sub-ledger will be returned.",
168+
"summary": "Gets ledger entries from a collection corresponding to a range.",
169+
"description": "A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.",
139170
"parameters": [
140171
{
141172
"$ref": "common.json#/parameters/ApiVersionParameter"
142173
},
143174
{
144-
"$ref": "#/parameters/SubLedgerIdParameter"
175+
"$ref": "#/parameters/CollectionIdParameter"
145176
},
146177
{
147178
"$ref": "#/parameters/TransactionIdFromParameter"
@@ -173,13 +204,13 @@
173204
}
174205
},
175206
"summary": "Writes a ledger entry.",
176-
"description": "A sub-ledger id may optionally be specified.",
207+
"description": "A collection id may optionally be specified.",
177208
"parameters": [
178209
{
179210
"$ref": "common.json#/parameters/ApiVersionParameter"
180211
},
181212
{
182-
"$ref": "#/parameters/SubLedgerIdParameter"
213+
"$ref": "#/parameters/CollectionIdParameter"
183214
},
184215
{
185216
"in": "body",
@@ -220,14 +251,14 @@
220251
"$ref": "./examples/ledger/GetLedgerEntry.json"
221252
}
222253
},
223-
"summary": "Gets the ledger entry at the specified transaction id. A sub-ledger id may optionally be specified to indicate the sub-ledger from which to fetch the value.",
254+
"summary": "Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value.",
224255
"description": "To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the response, or if the loading is still ongoing.",
225256
"parameters": [
226257
{
227258
"$ref": "common.json#/parameters/ApiVersionParameter"
228259
},
229260
{
230-
"$ref": "#/parameters/SubLedgerIdParameter"
261+
"$ref": "#/parameters/CollectionIdParameter"
231262
},
232263
{
233264
"$ref": "#/parameters/TransactionIdParameter"
@@ -324,13 +355,13 @@
324355
}
325356
},
326357
"summary": "Gets the current value available in the ledger.",
327-
"description": "A sub-ledger id may optionally be specified.",
358+
"description": "A collection id may optionally be specified.",
328359
"parameters": [
329360
{
330361
"$ref": "common.json#/parameters/ApiVersionParameter"
331362
},
332363
{
333-
"$ref": "#/parameters/SubLedgerIdParameter"
364+
"$ref": "#/parameters/CollectionIdParameter"
334365
}
335366
],
336367
"responses": {
@@ -570,8 +601,8 @@
570601
"type": "string",
571602
"description": "Contents of the ledger entry."
572603
},
573-
"subLedgerId": {
574-
"$ref": "#/definitions/SubLedgerId",
604+
"collectionId": {
605+
"$ref": "#/definitions/Collection",
575606
"readOnly": true
576607
},
577608
"transactionId": {
@@ -641,11 +672,11 @@
641672
"LedgerWriteResult": {
642673
"description": "Returned as a result of a write to the Confidential Ledger, the transaction id in the response indicates when the write will become durable.",
643674
"required": [
644-
"subLedgerId"
675+
"collectionId"
645676
],
646677
"properties": {
647-
"subLedgerId": {
648-
"$ref": "#/definitions/SubLedgerId"
678+
"collectionId": {
679+
"$ref": "#/definitions/Collection"
649680
}
650681
},
651682
"type": "object"
@@ -680,7 +711,7 @@
680711
"state": {
681712
"$ref": "#/definitions/LedgerQueryState"
682713
},
683-
"@nextLink": {
714+
"nextLink": {
684715
"description": "Path from which to retrieve the next page of results.",
685716
"type": "string"
686717
},
@@ -689,38 +720,79 @@
689720
}
690721
}
691722
},
723+
"Pem": {
724+
"type": "string"
725+
},
726+
"PemArray": {
727+
"items": {
728+
"$ref": "#/definitions/Pem"
729+
},
730+
"type": "array"
731+
},
692732
"ReceiptContents": {
693-
"description": "A receipt certifying the transaction at the specified id.",
694-
"required": [
695-
"leaf",
696-
"nodeId",
697-
"proof",
698-
"root",
699-
"signature"
700-
],
701-
"type": "object",
702733
"properties": {
734+
"cert": {
735+
"type": "string"
736+
},
703737
"leaf": {
704-
"description": "Merkle tree leaf for this transaction.",
705738
"type": "string"
706739
},
740+
"leafComponents": {
741+
"$ref": "#/definitions/ReceiptLeafComponents"
742+
},
707743
"nodeId": {
708-
"description": "Id of the node returning the receipt.",
709-
"$ref": "#/definitions/EntityId"
744+
"type": "string"
710745
},
711746
"proof": {
712-
"description": "Merkle proof.",
713-
"$ref": "#/definitions/MerkleProof"
747+
"$ref": "#/definitions/ReceiptElementArray"
714748
},
715749
"root": {
716-
"description": "Root of the Merkle tree at the time the transaction was recorded.",
717750
"type": "string"
718751
},
752+
"serviceEndorsements": {
753+
"$ref": "#/definitions/PemArray"
754+
},
719755
"signature": {
720-
"description": "Signature by the node, with its certificate, over the Merkle root.",
721756
"type": "string"
722757
}
723-
}
758+
},
759+
"required": [
760+
"signature",
761+
"proof",
762+
"nodeId"
763+
],
764+
"type": "object"
765+
},
766+
"ReceiptElement": {
767+
"properties": {
768+
"left": {
769+
"type": "string"
770+
},
771+
"right": {
772+
"type": "string"
773+
}
774+
},
775+
"type": "object"
776+
},
777+
"ReceiptElementArray": {
778+
"items": {
779+
"$ref": "#/definitions/ReceiptElement"
780+
},
781+
"type": "array"
782+
},
783+
"ReceiptLeafComponents": {
784+
"properties": {
785+
"claimsDigest": {
786+
"type": "string"
787+
},
788+
"commitEvidence": {
789+
"type": "string"
790+
},
791+
"writeSetDigest": {
792+
"type": "string"
793+
}
794+
},
795+
"type": "object"
724796
},
725797
"RoleAssignment": {
726798
"description": "Object for assigning a role to a user.",
@@ -738,9 +810,23 @@
738810
},
739811
"type": "object"
740812
},
741-
"SubLedgerId": {
742-
"description": "Identifier for sub-ledgers.",
743-
"type": "string"
813+
"Collection": {
814+
"description": "Identifier for collections.",
815+
"required": [
816+
"collectionId"
817+
],
818+
"properties": {
819+
"collectionId": {
820+
"type": "string"
821+
}
822+
}
823+
},
824+
"CollectionArray": {
825+
"description": "A list of identifiers for ledger collections.",
826+
"items": {
827+
"$ref": "#/definitions/Collection"
828+
},
829+
"type": "array"
744830
},
745831
"TransactionId": {
746832
"description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.",
@@ -809,12 +895,12 @@
809895
"type": "integer",
810896
"description": "The commit in the consensus protocol."
811897
},
812-
"SubLedgerIdParameter": {
813-
"name": "subLedgerId",
898+
"CollectionIdParameter": {
899+
"name": "collectionId",
814900
"in": "query",
815901
"required": false,
816902
"x-ms-parameter-location": "method",
817-
"description": "The sub-ledger id.",
903+
"description": "The collection id.",
818904
"type": "string"
819905
},
820906
"TransactionIdParameter": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerId": "contoso-ledger-12345",
55
"identityServiceUri": "identity.accledger.azure.com"
66
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerUri": "myledger.eastus.cloudapp.azure.com",
55
"userId": "AAD object id",
66
"userDetails": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerUri": "myledger.eastus.cloudapp.azure.com",
55
"userId": "AAD object id"
66
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"parameters": {
3+
"api-version": "2022-04-20-preview",
4+
"ledgerUri": "myledger.eastus.cloudapp.azure.com"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": [
9+
{
10+
"id": "first"
11+
},
12+
{
13+
"id": "second"
14+
}
15+
]
16+
}
17+
}
18+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerUri": "myledger.eastus.cloudapp.azure.com"
55
},
66
"responses": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerUri": "myledger.eastus.cloudapp.azure.com"
55
},
66
"responses": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerUri": "myledger.eastus.cloudapp.azure.com"
55
},
66
"responses": {
77
"200": {
88
"body": {
99
"contents": "Current ledger entry contents.",
10-
"subLedgerId": "DEFAULT_SUBLEDGER",
10+
"collectionId": "DEFAULT_SUBLEDGER",
1111
"transactionId": "4.2"
1212
}
1313
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "0.1-preview",
3+
"api-version": "2022-04-20-preview",
44
"ledgerUri": "myledger.eastus.cloudapp.azure.com"
55
},
66
"responses": {

0 commit comments

Comments
 (0)