Estuary API Bash client
Overview
This is a Bash client script for accessing Estuary API service.
The script uses cURL underneath for making all REST calls.
Usage
# Make sure the script has executable rights
$ chmod u+x
# Print the list of operations available on the service
$ ./ -h
# Print the service description
$ ./ --about
# Print detailed information about specific operation
$ ./ <operationId> -h
# Make GET request
./ --host http://<hostname>:<port> --accept xml <operationId> <queryParam1>=<value1> <header_key1>:<header_value2>
# Make GET request using arbitrary curl options (must be passed before <operationId>) to an SSL service using username:password
-k -sS --tlsv1.2 --host https://<hostname> -u <user>:<password> --accept xml <operationId> <queryParam1>=<value1> <header_key1>:<header_value2>
# Make POST request
$ echo '<body_content>' | --host <hostname> --content-type json <operationId> -
# Make POST request with simple JSON content, e.g.:
# {
# "key1": "value1",
# "key2": "value2",
# "key3": 23
# }
$ echo '<body_content>' | --host <hostname> --content-type json <operationId> key1==value1 key2=value2 key3:=23 -
# Preview the cURL command without actually executing it
$ --host http://<hostname>:<port> --dry-run <operationid>
Docker image
You can easily create a Docker image containing a preconfigured environment for using the REST Bash client including working autocompletion and short welcome message with basic instructions, using the generated Dockerfile:
docker build -t my-rest-client .
docker run -it my-rest-client
By default you will be logged into a Zsh environment which has much more advanced auto completion, but you can switch to Bash, where basic autocompletion is also available.
Shell completion
Bash
The generated bash-completion script can be either directly loaded to the current Bash session using:
source .bash-completion
Alternatively, the script can be copied to the /etc/bash-completion.d
(or on OSX with Homebrew to /usr/local/etc/bash-completion.d
):
sudo cp .bash-completion /etc/bash-completion.d/
OS X
On OSX you might need to install bash-completion using Homebrew:
brew install bash-completion
and add the following to the ~/.bashrc
:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Zsh
In Zsh, the generated _
Zsh completion file must be copied to one of the folders under $FPATH
variable.
Documentation for API Endpoints
All URIs are relative to **
Class | Method | HTTP request | Description |
---|---|---|---|
AdminApi | adminPeeringPeersDelete | DELETE /admin/peering/peers | Remove peers on Peering Service |
AdminApi | adminPeeringPeersGet | GET /admin/peering/peers | List all Peering peers |
AdminApi | adminPeeringPeersPost | POST /admin/peering/peers | Add peers on Peering Service |
AdminApi | adminPeeringStartPost | POST /admin/peering/start | Start Peering |
AdminApi | adminPeeringStatusGet | GET /admin/peering/status | Check Peering Status |
AdminApi | adminPeeringStopPost | POST /admin/peering/stop | Stop Peering |
AdminApi | adminSystemConfigGet | GET /admin/system/config | Get systems(estuary/shuttle) config |
AdminApi | adminUsersGet | GET /admin/users | Get all users |
AutoretrieveApi | adminAutoretrieveInitPost | POST /admin/autoretrieve/init | Register autoretrieve server |
AutoretrieveApi | adminAutoretrieveListGet | GET /admin/autoretrieve/list | List autoretrieve servers |
AutoretrieveApi | autoretrieveHeartbeatPost | POST /autoretrieve/heartbeat | Marks autoretrieve server as up |
CollectionsApi | collectionsColuuidCommitPost | POST /collections/{coluuid}/commit | Produce a CID of the collection contents |
CollectionsApi | collectionsColuuidContentsDelete | DELETE /collections/{coluuid}/contents | Deletes a content from a collection |
CollectionsApi | collectionsColuuidDelete | DELETE /collections/{coluuid} | Deletes a collection |
CollectionsApi | collectionsColuuidGet | GET /collections/{coluuid} | Get contents in a collection |
CollectionsApi | collectionsColuuidPost | POST /collections/{coluuid} | Add contents to a collection |
CollectionsApi | collectionsFsAddPost | POST /collections/fs/add | Add a file to a collection |
CollectionsApi | collectionsGet | GET /collections/ | List all collections |
CollectionsApi | collectionsPost | POST /collections/ | Create a new collection |
ContentApi | contentAddCarPost | POST /content/add-car | Add Car object |
ContentApi | contentAddIpfsPost | POST /content/add-ipfs | Add IPFS object |
ContentApi | contentAddPost | POST /content/add | Add new content |
ContentApi | contentAggregatedContentGet | GET /content/aggregated/{content} | Get aggregated content stats |
ContentApi | contentAllDealsGet | GET /content/all-deals | Get all deals for a user |
ContentApi | contentBwUsageContentGet | GET /content/bw-usage/{content} | Get content bandwidth |
ContentApi | contentCreatePost | POST /content/create | Add a new content |
ContentApi | contentDealsGet | GET /content/deals | Content with deals |
ContentApi | contentEnsureReplicationDatacidGet | GET /content/ensure-replication/{datacid} | Ensure Replication |
ContentApi | contentFailuresContentGet | GET /content/failures/{content} | List all failures for a content |
ContentApi | contentIdGet | GET /content/{id} | Content |
ContentApi | contentImportdealPost | POST /content/importdeal | Import a deal |
ContentApi | contentListGet | GET /content/list | List all pinned content |
ContentApi | contentReadContGet | GET /content/read/{cont} | Read content |
ContentApi | contentStagingZonesGet | GET /content/staging-zones | Get staging zone for user |
ContentApi | contentStatsGet | GET /content/stats | Get content statistics |
ContentApi | contentStatusIdGet | GET /content/status/{id} | Content Status |
DealsApi | dealEstimatePost | POST /deal/estimate | Estimate the cost of a deal |
DealsApi | dealInfoDealidGet | GET /deal/info/{dealid} | Get Deal Info |
DealsApi | dealProposalPropcidGet | GET /deal/proposal/{propcid} | Get Proposal |
DealsApi | dealQueryMinerGet | GET /deal/query/{miner} | Query Ask |
DealsApi | dealStatusByProposalPropcidGet | GET /deal/status-by-proposal/{propcid} | Get Deal Status by PropCid |
DealsApi | dealStatusMinerPropcidGet | GET /deal/status/{miner}/{propcid} | Deal Status |
DealsApi | dealTransferInProgressGet | GET /deal/transfer/in-progress | Transfer In Progress |
DealsApi | dealsFailuresGet | GET /deals/failures | Get storage failures for user |
DealsApi | dealsMakeMinerPost | POST /deals/make/{miner} | Make Deal |
DealsApi | dealsStatusDealGet | GET /deals/status/{deal} | Get Deal Status |
DealsApi | publicDealsFailuresGet | GET /public/deals/failures | Get storage failures |
DealsApi | publicMinersStorageQueryMinerGet | GET /public/miners/storage/query/{miner} | Query Ask |
DefaultApi | dealTransferStatusPost | POST /deal/transfer/status | |
MetricsApi | publicMetricsDealsOnChainGet | GET /public/metrics/deals-on-chain | Get deal metrics |
MinerApi | publicMinersDealsMinerGet | GET /public/miners/deals/{miner} | Get all miners deals |
MinerApi | publicMinersStatsMinerGet | GET /public/miners/stats/{miner} | Get miner stats |
NetApi | netAddrsGet | GET /net/addrs | Net Addrs |
NetApi | publicMinersFailuresMinerGet | GET /public/miners/failures/{miner} | Get all miners |
NetApi | publicMinersGet | GET /public/miners | Get all miners |
NetApi | publicNetAddrsGet | GET /public/net/addrs | Net Addrs |
NetApi | publicNetPeersGet | GET /public/net/peers | Net Peers |
PeeringApi | adminPeeringPeersDelete | DELETE /admin/peering/peers | Remove peers on Peering Service |
PeeringApi | adminPeeringPeersGet | GET /admin/peering/peers | List all Peering peers |
PeeringApi | adminPeeringPeersPost | POST /admin/peering/peers | Add peers on Peering Service |
PeeringApi | adminPeeringStartPost | POST /admin/peering/start | Start Peering |
PeeringApi | adminPeeringStatusGet | GET /admin/peering/status | Check Peering Status |
PeeringApi | adminPeeringStopPost | POST /admin/peering/stop | Stop Peering |
PeersApi | adminPeeringPeersDelete | DELETE /admin/peering/peers | Remove peers on Peering Service |
PeersApi | adminPeeringPeersGet | GET /admin/peering/peers | List all Peering peers |
PeersApi | adminPeeringPeersPost | POST /admin/peering/peers | Add peers on Peering Service |
PeersApi | adminPeeringStartPost | POST /admin/peering/start | Start Peering |
PeersApi | adminPeeringStatusGet | GET /admin/peering/status | Check Peering Status |
PeersApi | adminPeeringStopPost | POST /admin/peering/stop | Stop Peering |
PinningApi | pinningPinsGet | GET /pinning/pins | List all pin status objects |
PinningApi | pinningPinsPinidDelete | DELETE /pinning/pins/{pinid} | Delete a pinned object |
PinningApi | pinningPinsPinidGet | GET /pinning/pins/{pinid} | Get a pin status object |
PinningApi | pinningPinsPinidPost | POST /pinning/pins/{pinid} | Replace a pinned object |
PinningApi | pinningPinsPost | POST /pinning/pins | Add and pin object |
PublicApi | publicByCidCidGet | GET /public/by-cid/{cid} | Get Content by Cid |
PublicApi | publicInfoGet | GET /public/info | Get public node info |
PublicApi | publicMetricsDealsOnChainGet | GET /public/metrics/deals-on-chain | Get deal metrics |
PublicApi | publicMinersDealsMinerGet | GET /public/miners/deals/{miner} | Get all miners deals |
PublicApi | publicMinersFailuresMinerGet | GET /public/miners/failures/{miner} | Get all miners |
PublicApi | publicMinersGet | GET /public/miners | Get all miners |
PublicApi | publicMinersStatsMinerGet | GET /public/miners/stats/{miner} | Get miner stats |
PublicApi | publicNetAddrsGet | GET /public/net/addrs | Net Addrs |
PublicApi | publicNetPeersGet | GET /public/net/peers | Net Peers |
PublicApi | publicStatsGet | GET /public/stats | Public stats |
UserApi | userApiKeysGet | GET /user/api-keys | Get API keys for a user |
UserApi | userApiKeysKeyDelete | DELETE /user/api-keys/{key} | Revoke a User API Key. |
UserApi | userApiKeysPost | POST /user/api-keys | Create API keys for a user |
UserApi | userExportGet | GET /user/export | Export user data |
UserApi | userStatsGet | GET /user/stats | Create API keys for a user |
Documentation For Models
- Collections.Collection
- Main.createCollectionBody
- Main.deleteContentFromCollectionBody
- Main.estimateDealBody
- Main.getApiKeysResp
- Main.importDealBody
- Main.userStatsResponse
- Util.ContentAddIpfsBody
- Util.ContentAddResponse
- Util.ContentCreateBody
- Util.HttpError
Documentation For Authorization
bearerAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header