Domain and Bucket Creation

Swarm Storage has two types of context objects: domains and buckets. When you create them from Gateway, follow these guidelines:

Required Header

Gateway requires that the HTTP POST request include the following header to identify the content type as a context object when clients create these contexts:

Content-Type: application/castorcontext

The Gateway returns an HTTP 400 Bad Request error response to the client if contexts are not explicitly identified as shown during creation.

Note

Contexts that already exist in the storage cluster or that are created directly to the cluster do not require this Content-Type specification to work properly with Gateway.

Required Argument

SCSP requires you to add the domain query argument when creating a storage domain, regardless of the existence of a X-Forwarded-Host or Host header on the request.

Optional Sub-Resources

Gateway supports the common application need to immediately create one or more of the IDSYS, Policy, and XFORM sub-resources for the new context in a one-shot request. This is performed by including the additional documents within a JSON formatted request body on the context create request. If you do not need this one-shot creation of authentication for the context, the context is created with an HTTP POST request that is submitted with a null request body, Content-Length zero, and Content-Type of application/castorcontext.

The format of the JSON body of a one-shot creation request must conform to the following JSON schema.

For more about JSON schemas, see json-schema.org.

{ "type": "object", "properties": { "config": { "type": "object", "properties": { "idsys": { "$ref": "https://support.cloud.caringo.com/schemas/idsys-schema.json#" }, "policy": { "$ref": "https://support.cloud.caringo.com/schemas/policy-schema.json#" }, "metaxform": { "$ref": "https://support.cloud.caringo.com/schemas/metaxform-schema.json#" } }, "optional": true, "additionalProperties": false }, "metadata": { "type": "object", "optional": true } }, "additionalProperties": false }

This is an example JSON document using the schema:

{ "config": { "idsys": { ... }, "policy": { ... }, "metaxform": { ... } }, "metadata": { "X-Copyright-Meta": "Copyright 2015 Widgets, Inc." } }

Any combination of the IDSYS, Policy, and XFORM document sub-resources can be included in the one-shot request. IDSYS is only valid for a storage domain context and not for bucket contexts. The same configuration document formats described in this guide are used within the "{ ... }" portions of the example.

Updates to its IDSYS, Policy, or XFORM sub-resources must be done individually and cannot use the composite form of the one-shot creation request after a context object has been created.

© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.