Dell EMC PowerStore REST API and PSTCLI Cheatsheet

Photo of author
Written By Amit Singh

I am a technology enthusiast with 15 years of experience in SAN and NAS Storage. 

Base URL & Documentation

Table

ResourceURL
Swagger UIhttps://<PowerStore_MGMT_IP>/swaggerui
OpenAPI JSONhttps://<PowerStore_MGMT_IP>/api/rest/openapi.json
REST API Basehttps://<PowerStore_MGMT_IP>:443/api/rest/

The PowerStore REST API is API-first โ€” all functionality exposed externally is available through the API, and the GUI/CLI are consumers of it.


Authentication

Step 1: Login Session (Get Token)

bash

curl -k -s -X GET \
  -H "Accept: application/json" \
  -H "Content-type: application/json" \
  -u admin:YourPassword \
  -c mycookie.txt \
  -L https://10.20.30.40:443/api/rest/login_session

Response includes:

JSON

[{"id":"fd406a0e-a82c-46d6-b31b-5bfa31a543ef"}]

Headers returned:

  • DELL-EMC-TOKEN: <token_value> โ€” Required for all subsequent requests
  • Session cookie (mycookie.txt) โ€” Reuse for the session

Step 2: Use Token in Subsequent Calls

bash

curl -k -s -X GET \
  -H "DELL-EMC-TOKEN: <your_token>" \
  -H "Accept: application/json" \
  -H "Content-type: application/json" \
  -b mycookie.txt \
  -L https://10.20.30.40:443/api/rest/<endpoint>

Common REST API Endpoints

System & Appliance

Table

OperationMethodEndpointExample
List AppliancesGET/api/rest/appliance?select=*
List NodesGET/api/rest/node?select=*
List AlertsGET/api/rest/alert?select=id,severity,resource_type
List Audit EventsGET/api/rest/audit_event?select=*
List IP Pool AddressesGET/api/rest/ip_pool_address?select=*

Volumes

Table

OperationMethodEndpointBody/Params
List VolumesGET/api/rest/volume?select=id,name,size,logical_used
Get Volume by IDGET/api/rest/volume/{id}โ€”
Create VolumePOST/api/rest/volume{"name":"vol1","size":1073741824}
Modify VolumePATCH/api/rest/volume/{id}{"name":"vol1_renamed"}
Delete VolumeDELETE/api/rest/volume/{id}โ€”

Hosts

Table

OperationMethodEndpointBody/Params
List HostsGET/api/rest/host?select=id,name,os_type
Create HostPOST/api/rest/host{"name":"host1","os_type":"Linux"}
Get HostGET/api/rest/host/{id}โ€”
Delete HostDELETE/api/rest/host/{id}โ€”

Volume-Host Mapping

Table

OperationMethodEndpointBody
Map Volume to HostPOST/api/rest/volume/{id}/attach{"host_id":"host-uuid","logical_unit_number":99}
Unmap VolumePOST/api/rest/volume/{id}/detach{"host_id":"host-uuid"}

Snapshots

Table

OperationMethodEndpointBody
List SnapshotsGET/api/rest/volume/{id}/snapshotโ€”
Create SnapshotPOST/api/rest/volume/{id}/snapshot{"name":"snap1"}
Delete SnapshotDELETE/api/rest/snapshot/{id}โ€”
Restore from SnapshotPOST/api/rest/snapshot/{id}/restoreโ€”

Replication

Table

OperationMethodEndpointBody
List Replication SessionsGET/api/rest/replication_sessionโ€”
Create Replication RulePOST/api/rest/replication_rule{"name":"rule1","rpo":"One_Hour"}

Metrics

Table

OperationMethodEndpointBody
Generate Performance MetricsPOST/api/rest/metrics/generate{"entity":"performance_metrics_by_appliance","entity_id":"A1","interval":"Twenty_Sec"}

REST API Query Parameters

Table

ParameterDescriptionExample
selectChoose fields to return?select=id,name,size or ?select=*
orderSort results?order=name or ?order=-name (desc)
limitPagination (default 100)?limit=5
Filters13 operators (gt, lt, eq, etc.)?resource_type=eq.volume

Tip: By default, GET returns only id for collection queries. Use select=* when exploring, then narrow down for production scripts.


REST API curl Examples

List All Volumes with Size & Used Space

bash

curl -k -s -X GET \
  -H "DELL-EMC-TOKEN: <token>" \
  -H "Accept: application/json" \
  -b mycookie.txt \
  "https://10.20.30.40/api/rest/volume?select=id,name,size,logical_used" | jq

Create a 1 GB Volume

bash

curl -k -s -X POST \
  -H "DELL-EMC-TOKEN: <token>" \
  -H "Accept: application/json" \
  -H "Content-type: application/json" \
  -b mycookie.txt \
  -d '{"name":"test_vol","size":1073741824}' \
  https://10.20.30.40/api/rest/volume

Map Volume to Host (LUN 99)

bash

curl -k -s -X POST \
  -H "DELL-EMC-TOKEN: <token>" \
  -H "Content-type: application/json" \
  -b mycookie.txt \
  -d '{"host_id":"host-uuid","logical_unit_number":99}' \
  https://10.20.30.40/api/rest/volume/{vol_id}/attach

Unmap Volume from Host

bash

curl -k -s -X POST \
  -H "DELL-EMC-TOKEN: <token>" \
  -H "Content-type: application/json" \
  -b mycookie.txt \
  -d '{"host_id":"host-uuid"}' \
  https://10.20.30.40/api/rest/volume/{vol_id}/detach

Delete a Volume

bash

curl -k -s -X DELETE \
  -H "DELL-EMC-TOKEN: <token>" \
  -H "Accept: application/json" \
  -b mycookie.txt \
  https://10.20.30.40/api/rest/volume/{vol_id}

Generate Performance Metrics

bash

curl -k -s -X POST \
  -H "DELL-EMC-TOKEN: <token>" \
  -H "Content-type: application/json" \
  -b mycookie.txt \
  -d '{"entity":"performance_metrics_by_appliance","entity_id":"A1","interval":"Twenty_Sec"}' \
  https://10.20.30.40/api/rest/metrics/generate

Dell EMC PowerStore PSTCLI Reference

Installation & Connection

Download pstcli from Dell Support and install it on your Linux/Windows management host.

Basic Syntax

bash

pstcli [-d <address>] [-port <number>] [-u <user_name>] [-p <password>] [-ssl {interactive|reject|accept|store}] [-header] <object> <action> [<qualifiers>]

Common Switches

Table

SwitchDescription
-d <IP>Destination PowerStore management IP
-u <user>Username
-p <password>Password
-ssl acceptAuto-accept SSL certificate
-ssl storeAccept and store certificate permanently
-headerDisplay header in output
-asyncPerform operation asynchronously

First Connection (Accept Certificate)

bash

pstcli -d 10.0.0.1 -u admin -p MyPassword456! -ssl interactive

Select option 3 to accept and store the certificate permanently. Future calls won’t prompt.


PSTCLI Object Types & Actions

Volume Operations

Table

ActionCommandExample
List volumesvolume showpstcli -d 10.0.0.1 -u admin -p Pass volume show
Create volumevolume createpstcli -d 10.0.0.1 -u admin -p Pass volume create -name testvol -size 1073741824
Get volume detailsvolume -id <id> showpstcli -d 10.0.0.1 -u admin -p Pass volume -id 12345 show
Rename volumevolume setpstcli -d 10.0.0.1 -u admin -p Pass volume -name oldvol set -name newvol
Expand volumevolume setpstcli -d 10.0.0.1 -u admin -p Pass volume -id 12345 set -size 2147483648
Delete volumevolume deletepstcli -d 10.0.0.1 -u admin -p Pass volume -id 12345 delete
Map to hostvolume attachpstcli -d 10.0.0.1 -u admin -p Pass volume -name testvol attach -host_name host1 -lun 99
Unmap from hostvolume detachpstcli -d 10.0.0.1 -u admin -p Pass volume -name testvol detach -host_name host1

Volume size must be a multiple of 8192 bytes. Maximum volume size is 256TB.

Host Operations

Table

ActionCommandExample
List hostshost showpstcli -d 10.0.0.1 -u admin -p Pass host show
Create hosthost createpstcli -d 10.0.0.1 -u admin -p Pass host create -name host1 -os_type Linux
Delete hosthost deletepstcli -d 10.0.0.1 -u admin -p Pass host -name host1 delete

Host Group Operations

Table

ActionCommandExample
List host groupshost_group showpstcli -d 10.0.0.1 -u admin -p Pass host_group show
Create host grouphost_group createpstcli -d 10.0.0.1 -u admin -p Pass host_group create -name hg1
Add host to grouphost_group setpstcli -d 10.0.0.1 -u admin -p Pass host_group -name hg1 set -add_host host1

Snapshot Operations

Table

ActionCommandExample
List snapshotssnapshot showpstcli -d 10.0.0.1 -u admin -p Pass snapshot show
Create snapshotsnapshot createpstcli -d 10.0.0.1 -u admin -p Pass snapshot create -volume_id 12345 -name snap1
Delete snapshotsnapshot deletepstcli -d 10.0.0.1 -u admin -p Pass snapshot -id snap-id delete
Restore snapshotsnapshot restorepstcli -d 10.0.0.1 -u admin -p Pass snapshot -id snap-id restore

Volume Group Operations

Table

ActionCommandExample
List volume groupsvolume_group showpstcli -d 10.0.0.1 -u admin -p Pass volume_group show
Create volume groupvolume_group createpstcli -d 10.0.0.1 -u admin -p Pass volume_group create -name vg1
Add volume to groupvolume_group setpstcli -d 10.0.0.1 -u admin -p Pass volume_group -name vg1 set -add_volume vol1

Replication Operations

Table

ActionCommandExample
List replication sessionsreplication_session showpstcli -d 10.0.0.1 -u admin -p Pass replication_session show
Failoverreplication_session failoverpstcli -d 10.0.0.1 -u admin -p Pass replication_session -id sess-id failover
Failbackreplication_session failbackpstcli -d 10.0.0.1 -u admin -p Pass replication_session -id sess-id failback

User Management

Table

ActionCommandExample
List local userslocal_user showpstcli -d 10.0.0.1 -u admin -p Pass local_user show
Change passwordlocal_user setpstcli -d 10.0.0.1 -u admin -p Pass local_user -name operator set -password NewPass -current_password OldPass

System & Monitoring

Table

ActionCommandExample
List appliancesappliance showpstcli -d 10.0.0.1 -u admin -p Pass appliance show
List nodesnode showpstcli -d 10.0.0.1 -u admin -p Pass node show
List alertsalert showpstcli -d 10.0.0.1 -u admin -p Pass alert show
List hardwarehardware showpstcli -d 10.0.0.1 -u admin -p Pass hardware show

PSTCLI Complete Provisioning Workflow

1. Create a Volume

bash

pstcli -d 10.0.0.1 -u admin -p MyPassword456! -header volume create -name oracle_data -size 1073741824

Output:

plain

PowerStore system: 10.0.0.1
Timezone:          Eastern Daylight Time (UTC-04:00)
User:              admin

Created
1:    id = 12345

2. Map Volume to Host (LUN 99)

bash

pstcli -d 10.0.0.1 -u admin -p MyPassword456! volume -name oracle_data attach -host_name r730xd-2 -lun 99

3. Verify Mapping

bash

pstcli -d 10.0.0.1 -u admin -p MyPassword456! host -name r730xd-2 show

4. Unmap Volume

bash

pstcli -d 10.0.0.1 -u admin -p MyPassword456! volume -name oracle_data detach -host_name r730xd-2

5. Delete Volume

bash

pstcli -d 10.0.0.1 -u admin -p MyPassword456! volume -name oracle_data delete

Prerequisites before deleting: Volume must not be mapped to any host, not be a member of a volume group, not have an associated protection policy, and not have secure snapshots.


Getting Help in PSTCLI

bash

# General help
pstcli -?

# Help on a specific object
pstcli -d 10.0.0.1 -u admin -p Pass volume -?

# Help on a specific action
pstcli -d 10.0.0.1 -u admin -p Pass volume set -?

# Interactive session
pstcli -d 10.0.0.1 -u admin -p Pass -session

Useful Tips

Table

TipCommand/Method
Avoid password promptsexport PSTPASS=YourPassword then use -p $PSTPASS
curl alias for headersalias pstcurl='curl -k -s -H "Accept: application/json" -H "Content-type: application/json" -H "DELL-EMC-TOKEN: <token>" -b mycookie.txt'
Format JSON outputPipe curl to jq or json_reformat
Explore all endpointsVisit https://<IP>/swaggerui in a browser
API-first designEvery GUI/CLI action maps to a REST API call โ€” use browser DevTools or Swagger to discover endpoints

I am a technology enthusiast with 15 years of experience in SAN and NAS Storage. I work with one of the fortune 500 companies as SAN Storage Architect.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.