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

Commit

Permalink
Added Group `name
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLitt committed Feb 11, 2016
1 parent 9d87018 commit 6932ab1
Showing 1 changed file with 254 additions and 2 deletions.
256 changes: 254 additions & 2 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -1661,9 +1661,261 @@ root will not be listable, as it is virtual. Access known paths directly.

# Group name

## publish
IPFS namespace (IPNS) tool

## resolve
IPNS is a PKI namespace, where names are the hashes of public keys, and
the private key enables publishing new (signed) values. In publish, the
default value of <name> is your own identity public key.

This command cannot be called directly.

## publish [POST /name/publish{?arg}{&resolve,lifetime,ttl}]
Publish an object to IPNS

+ Parameters
+ arg (string, required) - IPFS path of the object to be published
+ resolve (boolean, optional) - Resolve given path before publishing
+ Default: `true`
+ lifetime (string, optional) - Time duration that the record will be valid for.
This accepts durations such as '300s', '1.5h' or '2h45m'. Valid time units are
'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'. Default: '24h'.
+ ttl (string, optional) - Time duration this record should be cached for. Caution: experimental.

+ Request Without Arguments

#### curl

curl -i -X POST "http://localhost:5001/api/v0/name/publish"

+ Body

```
curl -i -X POST "http://localhost:5001/api/v0/name/publish"
```

+ Response 400

+ Headers

```
Date: Thu, 11 Feb 2016 16:22:43 GMT
Content-Length: 32
Content-Type: text/plain; charset=utf-8
```

+ Attributes (string)

+ Body

```
Argument 'ipfs-path' is required
```

+ Request With Empty Argument

The response is the same if the argument is invalid. For example:

curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg=kitten"

#### curl

curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg="

+ Body

```
curl -i -X POST "http://localhost:5001/api/v0/name/publish?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
Trailer: X-Stream-Error
Transfer-Encoding: chunked
Date: Thu, 11 Feb 2016 16:23:34 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 -X POST "http://localhost:5001/api/v0/name/publish?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ"

+ Body

```
curl -i -X POST "http://localhost:5001/api/v0/name/publish?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
Trailer: X-Stream-Error
Transfer-Encoding: chunked
Date: Thu, 11 Feb 2016 16:26:14 GMT
Transfer-Encoding: chunked
```

+ Attributes (object)
+ Name (Multihash) - IPFS hash
+ Value (Multihash) - IPFS path

+ Body

```
{
"Name": "QmdYnTGEjDHHvbcT6TucgDLBCF3f6cYZUDqMbUVr9bvTh2",
"Value":"QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ"
}
```

## resolve [POST /name/resolve]
Gets the value currently published at an IPNS name

+ Parameters
+ arg (string, required) - The IPNS name to resolve. Defaults to your node's peerID.
+ recursive (boolean, optional) - Resolve until the result is not an IPNS name
+ nocache (boolean, optional) - Do not used cached entries

+ Request Without Arguments

#### curl

curl -i -X POST "http://localhost:5001/api/v0/name/resolve"

+ Body

```
curl -i -X POST "http://localhost:5001/api/v0/name/resolve"
```

+ 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
Trailer: X-Stream-Error
Transfer-Encoding: chunked
Date: Thu, 11 Feb 2016 17:45:08 GMT
Transfer-Encoding: chunked
```

+ Attributes (object)
+ Path (MultiAddr)

+ Body

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

+ Request With Empty Argument

The response is the same if the argument is invalid. For example:

curl -i -X POST "http://localhost:5001/api/v0/name/resolve?arg=kitten"

#### curl

curl -i -X POST "http://localhost:5001/api/v0/name/resolve?arg="

+ Body

```
curl -i -X POST "http://localhost:5001/api/v0/name/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 18:02:02 GMT
Transfer-Encoding: chunked
```

+ Attributes (Error)
- Message: "could not resolve name."
- Code: 0

+ Body

```
{
"Message": "could not resolve name.",
"Code": 0
}
```

+ Request With Argument

#### curl

curl -i -X POST "http://localhost:5001/api/v0/name/resolve?arg=QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"

+ Body

```
curl -i -X POST "http://localhost:5001/api/v0/name/resolve?arg=QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
```

+ 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 20:37:53 GMT
Transfer-Encoding: chunked
```

+ Attributes (object)

+ Body

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

# Group object

Expand Down

0 comments on commit 6932ab1

Please sign in to comment.