|
1 | 1 | { |
2 | 2 | "swagger": "2.0", |
3 | 3 | "info": { |
4 | | - "version": "0.1-preview", |
| 4 | + "version": "2022-04-20-preview", |
5 | 5 | "title": "ConfidentialLedgerClient", |
6 | 6 | "description": "The ConfidentialLedgerClient writes and retrieves ledger entries against the Confidential Ledger service." |
7 | 7 | }, |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | }, |
| 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 | + }, |
125 | 156 | "/app/transactions": { |
126 | 157 | "get": { |
127 | 158 | "operationId": "ConfidentialLedger_GetLedgerEntries", |
|
132 | 163 | }, |
133 | 164 | "x-ms-pageable": { |
134 | 165 | "itemName": "entries", |
135 | | - "nextLinkName": "@nextLink" |
| 166 | + "nextLinkName": "nextLink" |
136 | 167 | }, |
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.", |
139 | 170 | "parameters": [ |
140 | 171 | { |
141 | 172 | "$ref": "common.json#/parameters/ApiVersionParameter" |
142 | 173 | }, |
143 | 174 | { |
144 | | - "$ref": "#/parameters/SubLedgerIdParameter" |
| 175 | + "$ref": "#/parameters/CollectionIdParameter" |
145 | 176 | }, |
146 | 177 | { |
147 | 178 | "$ref": "#/parameters/TransactionIdFromParameter" |
|
173 | 204 | } |
174 | 205 | }, |
175 | 206 | "summary": "Writes a ledger entry.", |
176 | | - "description": "A sub-ledger id may optionally be specified.", |
| 207 | + "description": "A collection id may optionally be specified.", |
177 | 208 | "parameters": [ |
178 | 209 | { |
179 | 210 | "$ref": "common.json#/parameters/ApiVersionParameter" |
180 | 211 | }, |
181 | 212 | { |
182 | | - "$ref": "#/parameters/SubLedgerIdParameter" |
| 213 | + "$ref": "#/parameters/CollectionIdParameter" |
183 | 214 | }, |
184 | 215 | { |
185 | 216 | "in": "body", |
|
220 | 251 | "$ref": "./examples/ledger/GetLedgerEntry.json" |
221 | 252 | } |
222 | 253 | }, |
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.", |
224 | 255 | "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.", |
225 | 256 | "parameters": [ |
226 | 257 | { |
227 | 258 | "$ref": "common.json#/parameters/ApiVersionParameter" |
228 | 259 | }, |
229 | 260 | { |
230 | | - "$ref": "#/parameters/SubLedgerIdParameter" |
| 261 | + "$ref": "#/parameters/CollectionIdParameter" |
231 | 262 | }, |
232 | 263 | { |
233 | 264 | "$ref": "#/parameters/TransactionIdParameter" |
|
324 | 355 | } |
325 | 356 | }, |
326 | 357 | "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.", |
328 | 359 | "parameters": [ |
329 | 360 | { |
330 | 361 | "$ref": "common.json#/parameters/ApiVersionParameter" |
331 | 362 | }, |
332 | 363 | { |
333 | | - "$ref": "#/parameters/SubLedgerIdParameter" |
| 364 | + "$ref": "#/parameters/CollectionIdParameter" |
334 | 365 | } |
335 | 366 | ], |
336 | 367 | "responses": { |
|
570 | 601 | "type": "string", |
571 | 602 | "description": "Contents of the ledger entry." |
572 | 603 | }, |
573 | | - "subLedgerId": { |
574 | | - "$ref": "#/definitions/SubLedgerId", |
| 604 | + "collectionId": { |
| 605 | + "$ref": "#/definitions/Collection", |
575 | 606 | "readOnly": true |
576 | 607 | }, |
577 | 608 | "transactionId": { |
|
641 | 672 | "LedgerWriteResult": { |
642 | 673 | "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.", |
643 | 674 | "required": [ |
644 | | - "subLedgerId" |
| 675 | + "collectionId" |
645 | 676 | ], |
646 | 677 | "properties": { |
647 | | - "subLedgerId": { |
648 | | - "$ref": "#/definitions/SubLedgerId" |
| 678 | + "collectionId": { |
| 679 | + "$ref": "#/definitions/Collection" |
649 | 680 | } |
650 | 681 | }, |
651 | 682 | "type": "object" |
|
680 | 711 | "state": { |
681 | 712 | "$ref": "#/definitions/LedgerQueryState" |
682 | 713 | }, |
683 | | - "@nextLink": { |
| 714 | + "nextLink": { |
684 | 715 | "description": "Path from which to retrieve the next page of results.", |
685 | 716 | "type": "string" |
686 | 717 | }, |
|
689 | 720 | } |
690 | 721 | } |
691 | 722 | }, |
| 723 | + "Pem": { |
| 724 | + "type": "string" |
| 725 | + }, |
| 726 | + "PemArray": { |
| 727 | + "items": { |
| 728 | + "$ref": "#/definitions/Pem" |
| 729 | + }, |
| 730 | + "type": "array" |
| 731 | + }, |
692 | 732 | "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", |
702 | 733 | "properties": { |
| 734 | + "cert": { |
| 735 | + "type": "string" |
| 736 | + }, |
703 | 737 | "leaf": { |
704 | | - "description": "Merkle tree leaf for this transaction.", |
705 | 738 | "type": "string" |
706 | 739 | }, |
| 740 | + "leafComponents": { |
| 741 | + "$ref": "#/definitions/ReceiptLeafComponents" |
| 742 | + }, |
707 | 743 | "nodeId": { |
708 | | - "description": "Id of the node returning the receipt.", |
709 | | - "$ref": "#/definitions/EntityId" |
| 744 | + "type": "string" |
710 | 745 | }, |
711 | 746 | "proof": { |
712 | | - "description": "Merkle proof.", |
713 | | - "$ref": "#/definitions/MerkleProof" |
| 747 | + "$ref": "#/definitions/ReceiptElementArray" |
714 | 748 | }, |
715 | 749 | "root": { |
716 | | - "description": "Root of the Merkle tree at the time the transaction was recorded.", |
717 | 750 | "type": "string" |
718 | 751 | }, |
| 752 | + "serviceEndorsements": { |
| 753 | + "$ref": "#/definitions/PemArray" |
| 754 | + }, |
719 | 755 | "signature": { |
720 | | - "description": "Signature by the node, with its certificate, over the Merkle root.", |
721 | 756 | "type": "string" |
722 | 757 | } |
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" |
724 | 796 | }, |
725 | 797 | "RoleAssignment": { |
726 | 798 | "description": "Object for assigning a role to a user.", |
|
738 | 810 | }, |
739 | 811 | "type": "object" |
740 | 812 | }, |
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" |
744 | 830 | }, |
745 | 831 | "TransactionId": { |
746 | 832 | "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 | 895 | "type": "integer", |
810 | 896 | "description": "The commit in the consensus protocol." |
811 | 897 | }, |
812 | | - "SubLedgerIdParameter": { |
813 | | - "name": "subLedgerId", |
| 898 | + "CollectionIdParameter": { |
| 899 | + "name": "collectionId", |
814 | 900 | "in": "query", |
815 | 901 | "required": false, |
816 | 902 | "x-ms-parameter-location": "method", |
817 | | - "description": "The sub-ledger id.", |
| 903 | + "description": "The collection id.", |
818 | 904 | "type": "string" |
819 | 905 | }, |
820 | 906 | "TransactionIdParameter": { |
|
0 commit comments