Skip to main content

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 **

ClassMethodHTTP requestDescription
AdminApiadminPeeringPeersDeleteDELETE /admin/peering/peersRemove peers on Peering Service
AdminApiadminPeeringPeersGetGET /admin/peering/peersList all Peering peers
AdminApiadminPeeringPeersPostPOST /admin/peering/peersAdd peers on Peering Service
AdminApiadminPeeringStartPostPOST /admin/peering/startStart Peering
AdminApiadminPeeringStatusGetGET /admin/peering/statusCheck Peering Status
AdminApiadminPeeringStopPostPOST /admin/peering/stopStop Peering
AdminApiadminSystemConfigGetGET /admin/system/configGet systems(estuary/shuttle) config
AdminApiadminUsersGetGET /admin/usersGet all users
AutoretrieveApiadminAutoretrieveInitPostPOST /admin/autoretrieve/initRegister autoretrieve server
AutoretrieveApiadminAutoretrieveListGetGET /admin/autoretrieve/listList autoretrieve servers
AutoretrieveApiautoretrieveHeartbeatPostPOST /autoretrieve/heartbeatMarks autoretrieve server as up
CollectionsApicollectionsColuuidCommitPostPOST /collections/{coluuid}/commitProduce a CID of the collection contents
CollectionsApicollectionsColuuidContentsDeleteDELETE /collections/{coluuid}/contentsDeletes a content from a collection
CollectionsApicollectionsColuuidDeleteDELETE /collections/{coluuid}Deletes a collection
CollectionsApicollectionsColuuidGetGET /collections/{coluuid}Get contents in a collection
CollectionsApicollectionsColuuidPostPOST /collections/{coluuid}Add contents to a collection
CollectionsApicollectionsFsAddPostPOST /collections/fs/addAdd a file to a collection
CollectionsApicollectionsGetGET /collections/List all collections
CollectionsApicollectionsPostPOST /collections/Create a new collection
ContentApicontentAddCarPostPOST /content/add-carAdd Car object
ContentApicontentAddIpfsPostPOST /content/add-ipfsAdd IPFS object
ContentApicontentAddPostPOST /content/addAdd new content
ContentApicontentAggregatedContentGetGET /content/aggregated/{content}Get aggregated content stats
ContentApicontentAllDealsGetGET /content/all-dealsGet all deals for a user
ContentApicontentBwUsageContentGetGET /content/bw-usage/{content}Get content bandwidth
ContentApicontentCreatePostPOST /content/createAdd a new content
ContentApicontentDealsGetGET /content/dealsContent with deals
ContentApicontentEnsureReplicationDatacidGetGET /content/ensure-replication/{datacid}Ensure Replication
ContentApicontentFailuresContentGetGET /content/failures/{content}List all failures for a content
ContentApicontentIdGetGET /content/{id}Content
ContentApicontentImportdealPostPOST /content/importdealImport a deal
ContentApicontentListGetGET /content/listList all pinned content
ContentApicontentReadContGetGET /content/read/{cont}Read content
ContentApicontentStagingZonesGetGET /content/staging-zonesGet staging zone for user
ContentApicontentStatsGetGET /content/statsGet content statistics
ContentApicontentStatusIdGetGET /content/status/{id}Content Status
DealsApidealEstimatePostPOST /deal/estimateEstimate the cost of a deal
DealsApidealInfoDealidGetGET /deal/info/{dealid}Get Deal Info
DealsApidealProposalPropcidGetGET /deal/proposal/{propcid}Get Proposal
DealsApidealQueryMinerGetGET /deal/query/{miner}Query Ask
DealsApidealStatusByProposalPropcidGetGET /deal/status-by-proposal/{propcid}Get Deal Status by PropCid
DealsApidealStatusMinerPropcidGetGET /deal/status/{miner}/{propcid}Deal Status
DealsApidealTransferInProgressGetGET /deal/transfer/in-progressTransfer In Progress
DealsApidealsFailuresGetGET /deals/failuresGet storage failures for user
DealsApidealsMakeMinerPostPOST /deals/make/{miner}Make Deal
DealsApidealsStatusDealGetGET /deals/status/{deal}Get Deal Status
DealsApipublicDealsFailuresGetGET /public/deals/failuresGet storage failures
DealsApipublicMinersStorageQueryMinerGetGET /public/miners/storage/query/{miner}Query Ask
DefaultApidealTransferStatusPostPOST /deal/transfer/status
MetricsApipublicMetricsDealsOnChainGetGET /public/metrics/deals-on-chainGet deal metrics
MinerApipublicMinersDealsMinerGetGET /public/miners/deals/{miner}Get all miners deals
MinerApipublicMinersStatsMinerGetGET /public/miners/stats/{miner}Get miner stats
NetApinetAddrsGetGET /net/addrsNet Addrs
NetApipublicMinersFailuresMinerGetGET /public/miners/failures/{miner}Get all miners
NetApipublicMinersGetGET /public/minersGet all miners
NetApipublicNetAddrsGetGET /public/net/addrsNet Addrs
NetApipublicNetPeersGetGET /public/net/peersNet Peers
PeeringApiadminPeeringPeersDeleteDELETE /admin/peering/peersRemove peers on Peering Service
PeeringApiadminPeeringPeersGetGET /admin/peering/peersList all Peering peers
PeeringApiadminPeeringPeersPostPOST /admin/peering/peersAdd peers on Peering Service
PeeringApiadminPeeringStartPostPOST /admin/peering/startStart Peering
PeeringApiadminPeeringStatusGetGET /admin/peering/statusCheck Peering Status
PeeringApiadminPeeringStopPostPOST /admin/peering/stopStop Peering
PeersApiadminPeeringPeersDeleteDELETE /admin/peering/peersRemove peers on Peering Service
PeersApiadminPeeringPeersGetGET /admin/peering/peersList all Peering peers
PeersApiadminPeeringPeersPostPOST /admin/peering/peersAdd peers on Peering Service
PeersApiadminPeeringStartPostPOST /admin/peering/startStart Peering
PeersApiadminPeeringStatusGetGET /admin/peering/statusCheck Peering Status
PeersApiadminPeeringStopPostPOST /admin/peering/stopStop Peering
PinningApipinningPinsGetGET /pinning/pinsList all pin status objects
PinningApipinningPinsPinidDeleteDELETE /pinning/pins/{pinid}Delete a pinned object
PinningApipinningPinsPinidGetGET /pinning/pins/{pinid}Get a pin status object
PinningApipinningPinsPinidPostPOST /pinning/pins/{pinid}Replace a pinned object
PinningApipinningPinsPostPOST /pinning/pinsAdd and pin object
PublicApipublicByCidCidGetGET /public/by-cid/{cid}Get Content by Cid
PublicApipublicInfoGetGET /public/infoGet public node info
PublicApipublicMetricsDealsOnChainGetGET /public/metrics/deals-on-chainGet deal metrics
PublicApipublicMinersDealsMinerGetGET /public/miners/deals/{miner}Get all miners deals
PublicApipublicMinersFailuresMinerGetGET /public/miners/failures/{miner}Get all miners
PublicApipublicMinersGetGET /public/minersGet all miners
PublicApipublicMinersStatsMinerGetGET /public/miners/stats/{miner}Get miner stats
PublicApipublicNetAddrsGetGET /public/net/addrsNet Addrs
PublicApipublicNetPeersGetGET /public/net/peersNet Peers
PublicApipublicStatsGetGET /public/statsPublic stats
UserApiuserApiKeysGetGET /user/api-keysGet API keys for a user
UserApiuserApiKeysKeyDeleteDELETE /user/api-keys/{key}Revoke a User API Key.
UserApiuserApiKeysPostPOST /user/api-keysCreate API keys for a user
UserApiuserExportGetGET /user/exportExport user data
UserApiuserStatsGetGET /user/statsCreate API keys for a user

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header