Skip to content

img0

Admin API - Storage Policy

Create Storage Policy (shell)

Instructions

  1. SSH to your Config / Installer node (Node 1) as training
  2. Create the JSON payload for RF4 storage policy
    echo '{
        "compressionType": "NONE",
        "consistencyLevel": {
            "metadataR": [
                "QUORUM"
            ],
            "metadataW": [
                "QUORUM"
            ],
            "read": [
                "QUORUM"
            ],
            "readEC": [
                "QUORUM"
            ],
            "write": [
                "QUORUM"
            ],
            "writeEC": [
                "QUORUM"
            ],
            "writeNew": []
        },
        "defaultProtectionScheme": "HSFS",
        "ecscheme": null,
        "elasticsearchEnabled": false,
        "encryptionEnabled": false,
        "encryptionType": "NONE",
        "groups": [],
        "policyDescription": "4 Replicas",
        "policyId": "",
        "policyName": "RF4",
        "region": "",
        "replicationScheme": {
            "DC1": "4"
        },
        "sizeThreshold": 0,
        "status": "ACTIVE",
        "systemDefault": true
    }' > ~/admin_api/create_policy.txt
    

Instructions

  1. Issue the Admin API call to create the policy from the JSON payload
    curl -s -X PUT -H "Content-Type: application/json" -k -u sysadmin:$auth_pass -d @/home/training/admin_api/create_policy.txt https://$admin_endpoint:19443/bppolicy | python -mjson.tool
    


Info

The Key Elements of the payload are:-
ConsistencyLevel: You can set the CL of the policy here, in our example we are setting all to QUORUM
defaultProtectionScheme: “HSFS” denotes this a a Replication Policy
policyName: ”RF4” is the policy name. This is just a label and does not enforce any sort of data protection based on name.
replicationScheme: This is where you state the protection required. In this example, we are creating 4 copies in DC1.

Instructions

  1. Check that the RF4 Storage Policy has been created in the CMC and is in an ACTIVE state

Instructions

  1. Finally we are going to set the newly created policy as default
  2. Issue the Admin API call modified to newly replace with the newly created storage policy id.
    curl -X POST -k -u sysadmin:$auth_pass https://localhost:19443/bppolicy/default?policyId=<THE-POLICY-ID>