This section provides general information about SCSP INFO that applies to both named and unnamed objects.
INFO is a request to the storage cluster to provide information about a specific object. The INFO message is identical in semantics to the READ request, except that the object (if found) is not returned in the response. If the referenced content is found in the cluster, only the meta-information about that object is returned in the form of response headers. The INFO request is formatted as a simple HTTP request using the HEAD method.
SCSP Method | HTTP Method | RFC 7231 Section |
---|---|---|
INFO | HEAD | 4.3.2 |
Note
SCSP allows HEAD requests with mismatched Accept-Encoding
headers to receive responses as if the encoding matched that of the object. Swarm relaxed this RFC restriction because a HEAD request returns no body contents, so there is nothing to encode.
INFO for named objects
HEAD /mybucket/samplefile.txt HTTP/1.1 Host: cluster.example.com User-Agent: Swarm Client/0.1
INFO for unnamed objects
HEAD /06eec5e2c3f1aadcb41ef7fd52adc049 HTTP/1.1 User-Agent: Swarm Client/0.1
INFO for alias objects
To INFO an alias object, optionally add the alias=yes query argument to the URI portion of the HTTP request line, as shown below.
HEAD /41A140B5271DC8D22FF8D027176A0821?alias=yes HTTP/1.1 User-Agent: Swarm Client/0.1
Normal responses to INFO
See SCSP Headers for a list of response headers.
The responses described in this section might be returned by the storage cluster in the case where the requested content was found. The content's meta-information can be returned directly by the node that received the request or the request might be redirected to another node in the cluster.
Note
If you add ?checkIntegrity
to HEAD and GET requests for the same object, different Content-Length values in the responses will display. This occurs because the HEAD response returns the Content-Length of the manifest rather than the object.
The following response indicates that the requested object was located, but that another node in the cluster will service the request for meta-information. Additionally, all future requests of this storage cluster should be made through the new access node until another 301 response is received. There is no message-body, so the content length is always 0. The value of the Location header indicates which node in the cluster should receive the redirect.
301 Moved Permanently
The client is expected to send another INFO request using the exact URI contained in the Location header.
HTTP/1.1 301 Moved Permanently Date: Wed, 1 Sept 2010 15:59:02 GMT Server: CAStor Cluster/v8b2 Connection: close Location: http://node-ip/name-or-uuid?auth=2096EFA659295BBB819D1FECCE77D2EF Content-Length: 0
307 Temporary Redirect
The following response (307) is similar to the 301 response, except the client should continue to use the current node (the one generating this response) for future requests until further notice.
HTTP/1.1 307 Temporary Redirect Date: Wed, 1 Sept 2010 15:59:02 GMT Server: CAStor Cluster/5.0.0 Location: http://node-ip/name-or-uuid?auth=2096EFA659295BBB819D1FECCE77D2EF Content-Length: 0
Normal responses for named objects
INFO response for a named object in a domain: HTTP/1.1 401 Unauthorized WWW-Authenticate: Digest realm="cluster.example.com/_administrators", nonce="05d0a60ee1f44361f449496505e05116", opaque="fd9c8e14e20fb7c13408c049b7d222af", ` stale=false, ` qop="auth", ` algorithm=MD5 WWW-Authenticate: Basic realm="cluster.example.com/_administrators" Content-Length: 51 Content-Type: text/html Date: Sat, 16 Oct 2010 00:23:24 GMT Server: CAStor Cluster 5.0.0 Allow: HEAD, GET, PUT, POST, COPY, APPEND, DELETE HTTP/1.1 200 OK Castor-System-Alias: ec87e3c7c410cc04fc4c838061898d9c Castor-System-CID: ffffffffffffffffffffffffffffffff Castor-System-Cluster: cluster.example.com Castor-System-Created: Fri, 15 Oct 2010 23:59:40 GMT Castor-System-Name: cluster.example.com Castor-System-Owner: admin@CAStor administrator Castor-System-Version: 1287187180.959 Content-Length: 0 Last-Modified: Fri, 15 Oct 2010 18:35:56 GMT lifepoint: [] reps=16 Etag: "da8bfbb04d089b9c22ae77747f327233" Date: Sat, 16 Oct 2010 00:23:24 GMT Server: CAStor Cluster/5.0.0
The initial 401 Unauthorized response is a normal initial response to HTTP authentication. Because access to a domain always requires administrator credentials, you will always see an initial 401 on an INFO on a domain.
HTTP/1.1 200 OK Castor-System-Alias: d36dfca69ba7752f4708b1fa9bf9918b Castor-System-CID: ec87e3c7c410cc04fc4c838061898d9c Castor-System-Cluster: cluster.example.com Castor-System-Created: Fri, 15 Oct 2010 18:36:05 GMT Castor-System-Name: bucket Castor-System-Version: 1287167765.255 Content-Length: 0 Content-Type: application/x-www-form-urlencoded Last-Modified: Fri, 15 Oct 2010 18:36:05 GMT Etag: "21641b39f4fdc1e86dc67e798a320980" Date: Fri, 15 Oct 2010 23:54:44 GMT Server: CAStor Cluster/5.0.0 HTTP/1.1 200 OK Castor-System-CID: d36dfca69ba7752f4708b1fa9bf9918b Castor-System-Cluster: cluster.example.com Castor-System-Created: Fri, 15 Oct 2010 22:09:19 GMT Castor-System-Name: file.txt Castor-System-Version: 1287180559.436 Content-Length: 26 Content-Type: application/x-www-form-urlencoded Last-Modified: Fri, 15 Oct 2010 22:09:19 GMT Etag: "c744aa90d375aa3e1f228f74b7960e54" Date: Fri, 15 Oct 2010 23:51:44 GMT Server: CAStor Cluster/5.0.0
The response for a named object is very similar to the response for a bucket except that Castor-System-CID is the identifier of the named object's parent (the bucket).
Normal responses for unnamed objects
The following response indicates that the node that received the request found the requested content and is returning meta-information about the object in the headers of this response.
HTTP/1.1 200 OK Date: Wed, 1 Sept 2010 15:59:02 GMT Server: CAStor Cluster/5.0.0 Content-Type: image/jpeg Content-Length: (length of the content of the Swarm object) Replica-Count: (number of replicas in cluster) [ application-meta-information ]
Error responses to INFO
The responses in this section may be returned by the storage cluster when the specified content cannot be found or there is a problem with the INFO request.
The following response indicates a problem with the INFO request, such as missing mandatory headers, invalid message body, or any other violation of HTTP/1.1 by the HEAD request. The reason for the error is included in the status line.
HTTP/1.1 400 Bad Request Date: Wed, 1 Sept 2010 15:59:02 GMT Server: CAStor Cluster 5.0.0 Content-Length: 24 Content-Type: text/html
Indicates that the requested object could not be located in this cluster:
HTTP/1.1 404 Not Found Date: Wed, 1 Sept 2010 15:59:02 GMT Server: CAStor Cluster 5.0.0 Content-Length: 56 Content-Type: text/html