ViPR 2.1 - Configure EMC ViPR through the REST API to Support Applications Using the CAS SDK

Table of Contents

Introduction

EMC ViPR enables CAS SDK applications to use ViPR-managed storage. This procedure tells you how to use the ViPR REST API to create the CAS pools, clusters, and profiles required to support CAS SDK applications.

To configure ViPR CAS through the REST API, perform the following tasks:

Before you begin

Note Image
To access the ViPR REST API, use any web browser or programming platform that can issue HTTP requests. The EMC ViPR REST API Reference document provides details.

Back to Top

Create a CAS cluster using the API

A CAS cluster is a single logical CAS archive accessible to an SDK-based client application. Client applications can store, retrieve, and delete fixed content objects from a CAS cluster.

Before you begin

Ensure that the underlying ViPR storage is provisioned before configuring the CAS cluster. An object namespace, created during provisioning, is required for CAS cluster creation.

Note Image
To complete the ViPR CAS configuration, after you create the CAS cluster, you must associate it with a CAS pool and a CAS profile.

Procedure

  1. Create a CAS cluster.
    CAS cluster creation requires the following options:
    Option Description
    Name The name you give to the CAS cluster.
    Namespace The namespace you created during provisioning to associate with this CAS cluster.
    Cluster mask Defines the capabilities available for applications that access this cluster. They include read, write, delete, privileged-delete, exist, and clip-enumeration.
    Retention Classes (Optional) The retention class name and retention period (in seconds). You set retention, if required, through a separate API command after you create the CAS cluster.

    Create a CAS cluster using POST /dataservice/cas-cluster. In the following example "cas_cluster1" is created and associated with namespace "NS-1."

    POST https://<ViPR_VIP>:4443/dataservice/cas-cluster
    <cas_cluster_create>
    <cluster_mask>read</cluster_mask>
    <cluster_mask>write</cluster_mask>
    <cluster_mask>delete</cluster_mask>
    <cluster_mask>exist</cluster_mask>
    <cluster_mask>clip-enumeration</cluster_mask>
    <name>cas_cluster1</name>
    <namespace>NS-1</namespace>
    </cas_cluster_create> 
  2. Set the retention class for the CAS Cluster (if required) using POST /object/namespace/<namespace_ID>/retention. In the following example, the ViPR Admin creates a retention class named retention2yrs that has a retention period of 2 years (63072000 seconds).
    Note Image
    You set the retention class through the object/namespace REST API, not the dataservice/cas-cluster REST API call you used to create the CAS cluster.

    POST https://<ViPR_VIP>:4443/object/namespace/<namespace_id>/retention
    
    <retention_class_create>
    <name>retention2yrs</name>
    <period>63072000</period>
    </retention_class_create>
  3. GET the details of the CAS cluster using GET /dataservice/cas-cluster.
    GET https://<ViPR_VIP>:4443/dataservice/cas-cluster
    
    Response
    HTTP 200 OK
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?
    <cas_clusters>
    <cas_cluster>
    <cluster_mask>read</cluster_mask>
    <cluster_mask>write</cluster_mask><
    cluster_mask>delete</cluster_mask>
    <cluster_mask>exist</cluster_mask>
    <cluster_mask>clip-enumeration</cluster_mask>
    <name>cas_cluster1</name>
    <namespace>NS-1</namespace>
    </cas_cluster>
    </cas_clusters>
    
  4. GET the details for the CAS cluster retention settings using POST /object/namespaces/<namespace_ID>/retention.
    GET https://<ViPR_VIP>:4443/object/namespaces/<namespace_id>/retention
    Response
    HTTP 200 OK
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?
    <retention_class_create>
    <name>retention2yrs</name>
    <period>63072000</period>
    </retention_class_create>
    

After you finish

You can now create a CAS pool and CAS profile to complete the ViPR CAS configuration.

Back to Top

Create a CAS pool using the ViPR REST API

A CAS pool represents a bucket that has CAS specific metadata. A CAS pool associates objects in a CAS cluster with a ViPR Data Services bucket.

Before you begin

The underlying storage must be provisioned by the ViPR Admin before creating a CAS pool. A ViPR project, object virtual pool, bucket, and a CAS cluster are required to create a CAS pool.

Procedure

  1. Note Image
    A CAS pool that you create through the API requires an existing bucket. However, the ViPR user interface enables you to create a CAS pool with an existing bucket or a new bucket.

    You create a CAS pool using POST /dataservice/cas-cluster/<namespace_id>/pool. In this example, the pool mask is set to allow read, write, delete, exist, and clip-enumeration and the bucket used for the CAS pool is named CAS_Pool_1.
    POST https://<ViPR_VIP>:4443/dataservice/cas-cluster/<namespace_id>/pool/
    
    <cas_pool_create>
    <mask>read</mask>
    <mask>write</mask>
    <mask>delete</mask>
    <mask>exist</mask>
    <mask>clip-enumeration</mask>
    <name>CAS_Pool_1</name>
    </cas_pool_create>
  2. Verify the pool mask details for the CAS pool using GET /dataservice/cas-cluster/<namespace_id>/pool/<pool_id>.
    GET https://<ViPR_VIP>:4443/dataservice/cas-cluster/<namespace_id>/pool/<pool_id>
    
    Response
    HTTP 200 OK
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?
    <cas_pool>
    <mask>read</mask>
    <mask>write</mask>
    <mask>delete</mask>
    <mask>exist</mask>
    <mask>clip-enumeration</mask>
    <name>CAS_Pool_1</name>
    </cas_pool>
  3. You can generate a list of CAS pools and their associated masks using GET /dataservice/cas-cluster/<namespace_id>/pool/ :
    GET https://<ViPR_VIP>:4443/dataservice/cas-cluster/<namespace_id>/pool/
    
    Response
    HTTP 200 OK
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?
    <cas_pools>
    <cas_pool>
    <mask>read</mask>
    <mask>write</mask>
    <mask>delete</mask>
    <mask>privileged-delete</mask>
    <mask>exist</mask>
    <mask>clip-enumeration</mask>
    <name>CAS_Pool_1</name>
    </cas_pool>
    <cas_pool>
    <mask>read</mask>
    <mask>write</mask>
    <mask>delete</mask>
    <mask>privileged-delete</mask>
    <mask>exist</mask>
    <mask>clip-enumeration</mask>
    <name>CAS_Pool_2</name>
    </cas_pool>
    </cas_pool></cas_pools>
    

After you finish

Before ViPR CAS configuration is complete, you must create a CAS profile.

Back to Top

Create a CAS profile with the API

A CAS access profile contains the application credentials required to authenticate with a CAS cluster. Each access profile defines a set of capabilities that controls how client applications can interact with the associated cluster. These capabilities authorize functions such as read, write, delete, privileged-delete, exist, and clip-enumeration.

Before you begin

The underlying storage must be provisioned before creating a CAS profile. A ViPR project, object virtual pool, CAS pool, and a CAS cluster are required.

Procedure

  1. Create a CAS profile using POST /dataservice/cas-cluster/<namespace_id>/profile/. In this example, a profile named "ImageArchiver" is provided access capabilities to Home Pool "pool1," and Profile metadata (key= Image_metadata; value=CATSCAN_images) is added.
    POST https://<ViPR_VIP>:4443/dataservice/cas-cluster<namespace_id>/profile/
    
    <cas_profile_create>
    <capabilities>read</capabilities>
    <capabilities>write</capabilities>
    <capabilities>delete</capabilities>
    <capabilities>privileged-delete</capabilities>
    <capabilities>exist</capabilities>
    <capabilities>clip-enumeration</capabilities>
    <enabled>true</enabled>
    <homepool>pool1</homepool>
    <metadata>
    <entry>
    <key>Image_metadata</key>
    <value>CATSCAN_images</value>
    </entry>
    </metadata>
    <secret>secret</secret>
    <name>ImageArchiver</name>
    </cas_profile_create>
    
    
  2. GET the details of the CAS profile using GET /dataservice/cas-cluster/<namespace_id>/profile/<profile_id>.
    GET https://<ViPR_VIP>:4443/dataservice/cas-cluster/<namespace_id>/profile/<profile_id>
    Response
    HTTP 200 OK
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?
    <cas_profile>
    <capabilities>read</capabilities>
    <capabilities>write</capabilities>
    <capabilities>delete</capabilities>
    <capabilities>privileged-delete</capabilities>
    <capabilities>exist</capabilities>
    <capabilities>clip-enumeration</capabilities>
    <enabled>true</enabled>
    <homepool>pool1</homepool>
    <metadata>
    <entry>
    <key>Image_metadata</key>
    <value>CATSCAN_images</value>
    </entry>
    </metadata>
    <secret>secret</secret>
    <name>ImageArchiver</name>
    </cas_profile>

After you finish

Once the CAS cluster, CAS pool, and CAS profile are created, the ViPR CAS environment is accessible by the CAS SDK application.

Back to Top