From bedd174645504fa6f50d3a34dcf94e540e489b40 Mon Sep 17 00:00:00 2001 From: ddawson Date: Fri, 17 May 2024 16:21:58 -0700 Subject: [PATCH] add version topics --- .../clio-methods/version.md | 111 ++++++++++++++++ .../server-info-methods/version.md | 125 ++++++++++++++++++ sidebars.yaml | 3 + 3 files changed, 239 insertions(+) create mode 100644 docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md create mode 100644 docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md diff --git a/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md b/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md new file mode 100644 index 0000000000..663a7b5dc7 --- /dev/null +++ b/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md @@ -0,0 +1,111 @@ +--- +seo: + description: Retrieve API version information. +labels: + - Core Server +--- +# version +[[Source]](https://github.com/XRPLF/clio/blob/master/src/ripple/beast/core/SemanticVersion.cpp "Source") + +The `version` command asks the [Clio server](../../../../concepts/networks-and-servers/the-clio-server.md) for API version information. For `rippled` servers, see [`version` (`rippled`)](../server-info-methods/version.md) instead. {% badge href="https://github.com/XRPLF/clio/releases/tag/1.0.0" %}New in: Clio v2.0.0{% /badge %} + + +## Request Format +An example of the request format: + +{% tabs %} + +{% tab label="WebSocket" %} +```json +{ + "command": "version" +} +``` +{% /tab %} + +{% tab label="JSON-RPC" %} +```json +{ + "method": "version", + "params": [ + {} + ] +} +``` +{% /tab %} + +{% /tabs %} + + + +The request does not take any parameters. + +## Response Format + +An example of a successful response: + +{% tabs %} + +{% tab label="WebSocket" %} +```json +{ + "result": { + "version": { + "first": 1, + "last": 2, + "good": 1 + } + }, + "status": "success", + "type": "response", + "warnings": [ + { + "id": 2001, + "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request" + } + ] +} +``` +{% /tab %} + +{% tab label="JSON-RPC" %} +```json +200 OK + +{ + "result": { + "version": { + "first": 1, + "last": 2, + "good": 1 + } + }, + "status": "success", + "type": "response", + "warnings": [ + { + "id":2001, + "message":"This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request" + } + ] +} +``` +{% /tab %} + +{% /tabs %} + +The response follows the [standard format][], with a successful result containing an `info` object as its only field. + +The `version` object returns some arrangement of the following fields: + +| `Field` | Type | Description | +|:---------|:--------|:------------------------------| +| `first` | Integer | Lowest supported API release | +| `last` | Integer | Highest supported API release | +| `good` | Integer | Default API if none specified | + +## Possible Errors + +* Any of the [universal error types][]. + +{% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md b/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md new file mode 100644 index 0000000000..1e5b14f4af --- /dev/null +++ b/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md @@ -0,0 +1,125 @@ +--- +seo: + description: Retrieve API version information. +labels: + - Core Server +--- +# version + +[[Source]](https://github.com/XRPLF/clio/blob/master/src/ripple/beast/core/SemanticVersion.cpp "Source") + +The `version` command asks the server for API version information. For `clio` servers, see [`version` (`clio`)](../clio-methods/version.md) instead. + + +## Request Format +An example of the request format: + +{% tabs %} + +{% tab label="WebSocket" %} +```json +{ + "command": "version" +} +``` +{% /tab %} + +{% tab label="JSON-RPC" %} +```json +{ + "method": "version", + "params": [ + {} + ] +} +``` +{% /tab %} + +{% tab label="Commandline" %} +```sh +#Syntax: version +rippled version +``` +{% /tab %} + +{% /tabs %} + +[Try it! >](/resources/dev-tools/websocket-api-tool#version) + +The request does not takes any parameters. + +## Response Format + +An example of a successful response: + +{% tabs %} + +{% tab label="WebSocket" %} +```json +{ + "result": { + "version": { + "first": "1.0.0", + "good": "1.0.0", + "last": "1.0.0" + } + }, + "status": "success", + "type": "response" +} +``` +{% /tab %} + +{% tab label="JSON-RPC" %} +```json +200 OK + +Headers + +{ + "result": { + "version": { + "first": "1.0.0", + "good": "1.0.0", + "last": "1.0.0" + } + }, + "status": "success", + "type": "response" +} +``` +{% /tab %} + +{% tab label="Commandline" %} +```json +{ + "result": { + "version": { + "first": "1.0.0", + "good": "1.0.0", + "last": "1.0.0" + } + }, + "status": "success", + "type": "response" +} +``` +{% /tab %} + +{% /tabs %} + +The response follows the [standard format][], with a successful result containing a `version` object as its only field. + +The `version` object returns some arrangement of the following fields: + +| `Field` | Type | Description | +|:---------|:-------|:------------------------------| +| `first` | String | Lowest supported API release | +| `last` | String | Highest supported API release | +| `good` | String | Default API if none specified | + +## Possible Errors + +* Any of the [universal error types][]. + +{% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/sidebars.yaml b/sidebars.yaml index af2b270c24..1792a095bb 100644 --- a/sidebars.yaml +++ b/sidebars.yaml @@ -483,6 +483,8 @@ - page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_definitions.md - page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info.md - page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state.md + - page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md + - page: docs/references/http-websocket-apis/public-api-methods/clio-server/index.md expanded: false items: @@ -491,6 +493,7 @@ - page: docs/references/http-websocket-apis/public-api-methods/clio-methods/nft_history.md - page: docs/references/http-websocket-apis/public-api-methods/clio-methods/nft_info.md - page: docs/references/http-websocket-apis/public-api-methods/clio-methods/nfts_by_issuer.md + - page: docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md - page: docs/references/http-websocket-apis/public-api-methods/utility-methods/index.md expanded: false items: