Child pages
  • CreateStore
Skip to end of metadata
Go to start of metadata

Description

The CreateStore API allows the Account Owner to create Stores.

 

In apstrata, data & digital assets are persisted in a database container called a Store. Individual data items persisted in a Store are called Documents

All Documents saved in an apstrata Store are secured individually with ACLs (from wikipedia: Access Control Lists), allowing developers to specify the Users and/or Groups that can view, update or delete a Document, or more granularly individual fields within that Document. In addition, apstrata provides a "gate" ACL system per Store, allowing a developer to decide the Users and/or Groups that are permitted globally to create, read, update or delete documents on that Store.

A developer can create any number of Stores (limited only by his apstrata account type) to persist different types of data from his application, this would be dictated by security, scalability or application partitioning reasons. As an example the developer might create a Store called PO for his purchase orders repository and another one called Catalog for his inventory description and images.

Apstrata Stores are transactional, allowing the developer to run reliably Atomic bundles of persistant operations (Create, Read, Update, Delete) that will succeed or fail together.

Upon creation, apstrata accounts are configured with a store named "DefaultStore". An account owner can delete this store and create others if needed. 

As described above, ACL settings on each store specify who can invoke each of the SaveDocument, DeleteDocument, GetFile, and Query services in general. For more specific details about Store configuration parameters, please check the SaveConfiguration API.


Default Store

When you register for apstrata, a store called "DefaultStore " will be created for you.

In all services that require you to specify a store or, in case you have NOT sent the apsdb.store parameter, the request store will be considered the default store.

Note that if you deleted the DefaultStore, and requested a service that requires a store, an error will be thrown.

Specific Request Parameters

(Refer to Common Request Parameters)

Name

Description

Required

Default

Possible Values

apsdb.store

The store name of the store to be created. It must be unique.

Yes

 

 

apsdb.saveDocumentACL

Sets the users or groups who have access to the SaveDocument service.The ACL are applied per store sent in the [storeName] attribute.Each new value will replace the existing one.

No

 

ACL predefined identifiers ("nobody”, “anonymous", "authenticated-users") or users or groups

apsdb.deleteDocumentACL

Sets the users or groups who have access to the DeleteDocument service.The ACL are applied per store sent in the [storeName] attribute.Each new value will replace the existing one.

No

 

ACL predefined identifiers ("nobody”, “anonymous", "authenticated-users") or users or groups

apsdb.getFileACL

Sets the users or groups who have access to the GetFile service.The ACL are applied per store sent in the [storeName] attribute.Each new value will replace the existing one.

No

 

ACL predefined identifiers ("nobody”, “anonymous", "authenticated-users") or users or groups

apsdb.queryACL

Sets the users or groups who have access to the  Query service.The ACL are applied per store sent in the [storeName] attribute.Each new value will replace the existing one.

No

 

ACL predefined identifiers ("nobody”, “anonymous", "authenticated-users") or users or groups

Specific Response Elements

(Refer to Common Response Elements)

Specific Logical Errors

(Refer to Common Logical Error Codes)

Error

Message

Status Code

INVALID_STORE_NAME

Store name is invalid. Please refer to the online documentation for a detailed list of acceptable values

400

DUPLICATE_STORE_NAME

Store already exists, please choose another name

400

STORE_NOT_FOUND

The store was not found

404

NOT_ENOUGH_SPACE

Not enough space in your current plan to create a new store

409

MAX_STORES_EXCEEDED

The maximum number of allowed stores has been exceeded.

400

PARAMETER_REQUIRED

 

400

 

Examples

Sample Request

Request URL: http://sandbox.apstrata.com/apsdb/rest/[authenticationkey]/CreateStore?apsws.time=[timestamp]&apsws.authSig=[signature] 



POST parameters:

apsdb.store=ClevelandMain 



Sample XML Response

Success XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
    <metadata>
        <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId>
        <status>success</status>       
    </metadata>
</response> 



Failure XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
    <metadata 
        <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId>
        <status>failure</status>
        <errorCode>[errorCode]</errorCode>
        <errorDetail>[failMsg]</errorDetail>
    </metadata>
</response> 



Sample JSON Response

{"response": {
    "metadata": {
        "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "status": "sucess"
    }
}} 


 

 

  • No labels