Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.1 -> main] updated trace_api openapi documentation [docs] #240

Merged
merged 6 commits into from
Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 180 additions & 1 deletion plugins/trace_api_plugin/trace_api.swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
openapi: 3.0.0
info:
title: Trace API
description: See developer documentation at https://docs.eosnetwork.com for information on enabling this plugin.
version: 1.0.0
license:
name: MIT
url: https://opensource.org/licenses/MIT
contact:
url: https://eos.io
url: https://eosnetwork.com
servers:
- url: '{protocol}://{host}:{port}/v1/'
variables:
Expand All @@ -21,9 +22,12 @@ servers:
default: "8080"
components:
schemas: {}
security:
- {}
paths:
/trace_api/get_block:
post:
summary: get block
description: Returns a block trace object containing retired actions and related metadata.
operationId: get_block
requestBody:
Expand All @@ -46,9 +50,184 @@ paths:
oneOf:
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/BlockTraceV0.yaml"
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/BlockTraceV1.yaml"
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/BlockTraceV2.yaml"
"400":
description: Error - requested block number is invalid (not a number, larger than max int)
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 400
message:
type: string
example: "bad or missing block_num"
error:
$ref: "#/component/schema/ERROR_DETAILS"
"404":
description: Error - requested data not present on node
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 400
message:
type: string
example: "bad or missing block_num"
error:
$ref: "#/component/schema/ERROR_DETAILS"
"500":
description: Error - exceptional condition while processing get_block; e.g. corrupt files
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 500
message:
type: string
example: "Trace API encountered an Error which it cannot recover from. Please resolve the error and relaunch the process"
error:
$ref: "#/component/schema/ERROR_DETAILS"

/trace_api/get_transaction_trace:
post:
summary: transaction trace
description: Does a scan of the trace files looking for the transaction
optionationId: get_transaction_trace
requestBody:
content:
application/json:
schema:
type: object
required:
- id
properties:
id:
type: integer
description: Proviade a transaction id
responses:
"200":
content:
application/json:
schema:
oneOf:
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/TransactionTraceV0.yaml"
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/TransactionTraceV1.yaml"
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/TransactionTraceV2.yaml"
- $ref: "https://docs.eosnetwork.com/openapi/v2.0/TransactionTraceV3.yaml"
"400":
description: Error - requested block number is invalid (not a number, larger than max int)
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 400
message:
type: string
example: "bad or missing block_num"
error:
$ref: "#/component/schema/ERROR_DETAILS"
"404":
description: Error - requested data not present on node
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 400
message:
type: string
example: "bad or missing block_num"
error:
$ref: "#/component/schema/ERROR_DETAILS"
"500":
description: Error - exceptional condition while processing get_block; e.g. corrupt files
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 500
message:
type: string
example: "Trace API encountered an Error which it cannot recover from. Please resolve the error and relaunch the process"
error:
$ref: "#/component/schema/ERROR_DETAILS"
component:
schema:
TRACE:
type: object
properties:
global_squence:
type: integer
example: 669
receiver:
type: string
example: myproducer
account:
type: string
example: esio.token
action:
type: string
example: transfer
authorization:
type: array
items:
type: object
properties:
account:
type: string
example: myaccount
permission:
type: string
example: active
data:
type: string
$ref: "https://docs.eosnetwork.com/openapi/v2.0/Sha256.yaml"
return_value:
type: string
example: ""
params:
type: object
properties:
from:
type: string
example: eosio
to:
type: string
example: myproducer
quantity:
type: string
example: "10.000 SYS"
memo:
type: string
example: "first transfer"
ERROR_DETAILS:
type: object
properties:
code:
type: integer
example: 0
name:
type: string
what:
type: string
details:
type: array
items:
type: string