Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
Added group dns
Browse files Browse the repository at this point in the history
I was unable to get `recursive` working, and I'm not quite sure what it means or when it would be used. The example in the man pages seems to imply it is the default.
  • Loading branch information
RichardLitt committed Feb 5, 2016
1 parent 3ed290a commit 7b7c619
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,130 @@ Outputs the list of peers that were removed.

# Group dns

DNS link resolver.

## dns [GET /dns{?arg}]
Multihashes are hard to remember, but domain names are usually easy to
remember. To create memorable aliases for multihashes, DNS TXT
records can point to other DNS links, IPFS objects, IPNS keys, etc.
This command resolves those links to the referenced object.

The following response expamles assume this DNS TXT record:

```
ipfs.io. TXT "dnslink=/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy ..."
```

+ Parameters
+ arg (string, required) - DNS name
+ recursive (string, optional) - Resolve until the result is not a DNS link

+ Request Without Arguments

#### curl

curl -i "http://localhost:5001/api/v0/dns"

+ Body

```
curl -i "http://localhost:5001/api/v0/dns"
```

+ Response 400

+ Headers

```
Date: Fri, 05 Feb 2016 23:30:20 GMT
Content-Length: 34
Content-Type: text/plain; charset=utf-8
```

+ Attributes (string)

+ Body

```
Argument 'domain-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/dns?arg=kitten"

#### curl

curl -i "http://localhost:5001/api/v0/dns?arg="

+ Body

```
curl -i "http://localhost:5001/api/v0/dns?arg="
```

+ Response 500

+ Headers

```
Content-Type: application/json
Trailer: X-Stream-Error
Transfer-Encoding: chunked
Date: Fri, 05 Feb 2016 23:31:17 GMT
Transfer-Encoding: chunked
```

+ Attributes (Error)
- Message: "not a valid domain name"
- Code: 0

+ Body

```
{
"Message": "not a valid domain name",
"Code": 0
}
```

+ Request With Argument

#### curl

curl -i "http://localhost:5001/api/v0/dns?arg=ipfs.io"

+ Body

```
curl -i "http://localhost:5001/api/v0/dns?arg=ipfs.io"
```

+ Response 200

+ Headers

```
Content-Type: application/json
Trailer: X-Stream-Error
Transfer-Encoding: chunked
Date: Fri, 05 Feb 2016 23:32:31 GMT
Transfer-Encoding: chunked
```

+ Attributes (object)
- Path (string)

+ Body

```
{
"Path": "/ipfs/QmZAxDc6toRXbwC3kbDzfJhtqRsgdqpJChykEHU7hT98hS"
}
```

# Group file

## ls
Expand Down

0 comments on commit 7b7c619

Please sign in to comment.