curl examples
Table of Contents
Notation
In this README:
G- denotes a (hostname:port) address of a gateway (any gateway in a given AIS cluster)
T- (hostname:port) of a storage target
G-or-T- (hostname:port) of any node member of the cluster
Overview
AIStore supports a growing number and variety of RESTful operations. To illustrate common conventions, let’s take a look at the example:
This command queries one of the AIS nodes (denoted as G-or-T) for its configuration. The query - as well as most of other control plane queries - results in a JSON-formatted output that can be viewed with any compatible JSON viewer.
Notice the 6 (six) elements of a RESTful operation:
- Command line option or flag
The -X (or --request) and -L (--location) options are important. Run curl --help for help.
- HTTP verb (aka method):
PUT,GET,HEAD,POST,DELETE, orPATCH
For a brief summary of the standard HTTP verbs and their CRUD semantics, see REST API tutorial.
- Hostname (or IPv4 address) and TCP port of one of the AIStore daemons
Most RESTful operations performed on an AIStore proxy/gateway will likely have a clustered scope. Exceptions include querying proxy’s own configuration via ?what=config.
For developers and first-time users: if you deployed AIS locally having followed these instructions then most likely you will have
http://localhost:8080as the primary proxy, and generally,http://localhost:808xfor all locally-deployed AIS daemons.
- URL path: version of the REST API, RESTful resource, and possibly more forward-slash delimited specifiers
For example: /v1/cluster where v1 is the API version and cluster is the resource. Resources include:
For the most recently updated URL paths, see:
- URL query, e.g.,
?what=config
All API requests that operate on a bucket carry the bucket’s specification in the URL query, including backend provider and namespace. An empty backend provider indicates an AIS bucket; an empty namespace translates as global (default) namespace.
- HTTP request and response headers
All supported query parameters and HTTP headers are enumerated in:
Easy URL
“Easy URL” is a simple alternative mapping of the AIS API to handle URL paths that look as follows:
- GET http(s)://host:port/provider/[bucket[/object]]
- PUT http(s)://host:port/provider/[bucket[/object]]
This enables convenient usage of your Internet Browser or curl. You can use simple intuitive URLs to execute GET, PUT, list-objects, and list-buckets.
AIS provides S3 compatibility via its
/s3endpoint. S3 compatibility shall not be confused with “easy URL” mapping.
For more details, see easy URL readme.
API Reference
For complete API reference documentation, see:
- HTTP API Reference - comprehensive OpenAPI-generated documentation
For programmatic access:
- Go API - native Go client
- Python SDK - Python client
Probing liveness and readiness
Note:
http://localhost:8080address must be understood as a placeholder for an arbitrary AIStore endpoint (AIS_ENDPOINT).
Health probe during cluster startup:
The prr=true query parameter requests an additional check for whether the cluster is ready to rebalance upon membership changes.
Backend Provider
Any storage bucket that AIS handles may originate in a 3rd party Cloud, in another AIS cluster, or be created in AIS itself. To resolve naming and partition namespace with respect to both physical isolation and QoS, AIS introduces the concept of provider.
- Backend Provider - an abstraction that allows delineating between “remote” and “local” buckets.
Backend provider is an optional parameter across all AIStore APIs that handle access to user data and bucket configuration (GET, PUT, DELETE, and Range/List operations).
See also:
Curl Examples
Note: The examples below are provided for reference. For the most recently updated action names and message formats, see
api/apc. For authoritative API documentation, see HTTP API Reference.
Basic operations
Listing
Cluster operations
Node operations
Bucket properties
Multi-object operations
Storage services
Object operations
Querying information
Queries use GET with ?what=<...>. Many operations can target either the entire cluster (/v1/cluster) or a specific node (/v1/daemon).
Example: querying remote clusters
Example: querying node log
Example: cluster statistics
This causes an intra-cluster broadcast where the requesting proxy consolidates results from all nodes into a JSON output containing proxy and target request counters, per-target capacities, and more.
See Also
- HTTP API Reference - OpenAPI documentation
- AIS CLI - command-line interface
- Batch operations
- ETL