From ec1940e8dc5346c5081a9a502c5cca3572deb120 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Thu, 11 Feb 2016 16:51:45 -0500 Subject: [PATCH 1/4] Added Group `resolve` --- apiary.apib | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/apiary.apib b/apiary.apib index aa43fd9..8a6c293 100644 --- a/apiary.apib +++ b/apiary.apib @@ -2493,6 +2493,130 @@ trip latency information. ## gc # Group resolve +Resolve the value of names to IPFS. + +## resolve [GET /resolve{?arg}{&resolve}] +There are a number of mutable name protocols that can link among +themselves and into IPNS. For example IPNS references can (currently) +point at IPFS object, and DNS links can point at other DNS links, IPNS +entries, or IPFS objects. This command accepts any of these +identifiers and resolves them to the referenced item. + ++ Parameters + + arg (string, required) - The name to resolve. + + recursive (boolean, optional) - Resolve until the result is an IPFS name + ++ Request Without Arguments + + #### curl + + curl -i "http://localhost:5001/api/v0/resolve" + + + Body + + ``` + curl -i "http://localhost:5001/api/v0/resolve" + ``` + ++ Response 400 + + + Headers + + ``` + Date: Thu, 11 Feb 2016 21:49:48 GMT + Content-Length: 27 + Content-Type: text/plain; charset=utf-8 + ``` + + + Attributes (string) + + + Body + + ``` + Argument 'name' is required + ``` + ++ Request With Empty Argument + + The response is the same if the argument is invalid. For example: + + curl -i "http://localhost:5001/api/v0/resolve?arg=kitten" + + #### curl + + curl -i "http://localhost:5001/api/v0/resolve?arg=" + + + Body + + ``` + curl -i "http://localhost:5001/api/v0/resolve?arg=" + ``` + ++ Response 500 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output + Content-Type: application/json + Server: go-ipfs/0.4.0-dev + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Thu, 11 Feb 2016 21:50:15 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (Error) + - Message: "invalid ipfs ref path" + - Code: 0 + + + Body + + ``` + { + "Message": "invalid ipfs ref path", + "Code": 0 + } + ``` + ++ Request With Argument + + #### curl + + curl -i "http://localhost:5001/api/v0/resolve?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + + + Body + + ``` + curl -i "http://localhost:5001/api/v0/resolve?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output + Content-Type: application/json + Server: go-ipfs/0.4.0-dev + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Thu, 11 Feb 2016 21:50:55 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + - Path (Multiaddr) + + + Body + + ``` + { + "Path": "/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + } + ``` # Group stats From 8b405b08a4d21b4d5a76dd5693d3884dff81a1ce Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Thu, 18 Feb 2016 15:54:02 -0500 Subject: [PATCH 2/4] Added period --- apiary.apib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apiary.apib b/apiary.apib index 8a6c293..1545ecf 100644 --- a/apiary.apib +++ b/apiary.apib @@ -2497,14 +2497,14 @@ Resolve the value of names to IPFS. ## resolve [GET /resolve{?arg}{&resolve}] There are a number of mutable name protocols that can link among -themselves and into IPNS. For example IPNS references can (currently) -point at IPFS object, and DNS links can point at other DNS links, IPNS +themselves and into IPNS. For example IPNS references can (currently) +point an IPFS object, and DNS links can point at other DNS links, IPNS entries, or IPFS objects. This command accepts any of these identifiers and resolves them to the referenced item. + Parameters + arg (string, required) - The name to resolve. - + recursive (boolean, optional) - Resolve until the result is an IPFS name + + recursive (boolean, optional) - Resolve until the result is an IPFS name. + Request Without Arguments From e9e94eaffa8230da415eacfe89ee5c4d36e93e5d Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Fri, 26 Feb 2016 12:24:45 -0500 Subject: [PATCH 3/4] Added at --- apiary.apib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiary.apib b/apiary.apib index 1545ecf..386991b 100644 --- a/apiary.apib +++ b/apiary.apib @@ -2498,7 +2498,7 @@ Resolve the value of names to IPFS. ## resolve [GET /resolve{?arg}{&resolve}] There are a number of mutable name protocols that can link among themselves and into IPNS. For example IPNS references can (currently) -point an IPFS object, and DNS links can point at other DNS links, IPNS +point at an IPFS object, and DNS links can point at other DNS links, IPNS entries, or IPFS objects. This command accepts any of these identifiers and resolves them to the referenced item. From de5681a8f1007950a5b03d12d9e0657e7b955620 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Fri, 26 Feb 2016 12:25:03 -0500 Subject: [PATCH 4/4] Added default false to recursive option --- apiary.apib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiary.apib b/apiary.apib index 386991b..b5a5a45 100644 --- a/apiary.apib +++ b/apiary.apib @@ -2504,7 +2504,7 @@ identifiers and resolves them to the referenced item. + Parameters + arg (string, required) - The name to resolve. - + recursive (boolean, optional) - Resolve until the result is an IPFS name. + + recursive (boolean, optional) - Resolve until the result is an IPFS name. Default: false. + Request Without Arguments