Article #: KA-03899
Published: 09/22/2025
Last reviewed: 09/22/2025
Using the G6 REST API for Automation - Authentication, common endpoints, example scripts
Contents
Introduction
The Panduit G6 PDU provides a comprehensive RESTful API based on the Redfish standard (v1.6.0) that enables automated power management, monitoring, and control. This API allows integration with DCIM platforms, custom automation scripts, and enterprise monitoring systems to programmatically manage PDU operations without manual intervention.Purpose
This article provides guidance for implementing automated workflows using the G6 Redfish API, including:
- Setting up authentication and session management
- Accessing common monitoring and control endpoints
- Building automation scripts for power management tasks
- Integrating with enterprise monitoring and orchestration platforms
Procedure
1. Authentication Setup: Basic Authentication:
curl -k -u redfishuser:password \
https://10.10.106.149/redfish/v1/PowerEquipment/RackPDUs
# Create session
curl -k -X POST https://10.10.106.149/redfish/v1/SessionService/Sessions \
-H "Content-Type: application/json" \
-d '{"username":"redfishuser","password":"12345678"}'
# Use X-Auth-Token from response for subsequent requests
curl -k -H "X-Auth-Token: YOUR_TOKEN" \
https://10.10.106.149/redfish/v1/PowerEquipment/RackPDUs/1/Sensors
2.Common Monitoring Endpoints
PDU Overview:
Base URL: /redfish/v1/PowerEquipment/RackPDUs
PDU Details: /redfish/v1/PowerEquipment/RackPDUs/{id}
Sensor Collection: /redfish/v1/PowerEquipment/RackPDUs/{id}/Sensors
Power Monitoring:
Phase Voltages: /Sensors/VoltageMains1-{4,5,6}
Phase Currents: /Sensors/CurrentMains1-{1,2,3}
Phase Power: /Sensors/PowerMains1-{4,5,6}
Total PDU Power: /Sensors/PDUPower
Outlet Current: /Sensors/CurrentOUTLET{1-36}
Environmental Monitoring:
Temperature Sensors: /Sensors/CabTemp{A-F}
Humidity Sensors: /Sensors/Humidity{A-B}
3. Control Operations
Outlet Control:
# POST to control outlet
url = "https://10.10.106.149/redfish/v1/PowerEquipment/RackPDUs/1/Outlets/OUTLET36/Outlet.PowerControl"
payload = {
"OutletNumber": 36,
"StartupState": "off",
"Outletname": "OUTLET36",
"OnDelay": 15,
"OffDelay": 16,
"RebootDelay": 17,
"OutletStatus": "off"
}
4. Circuit Breaker Management:
- CB Collection:
/redfish/v1/PowerEquipment/RackPDUs/{id}/Branches - CB Control:
/Branches/{A-L}/Circuit.BreakerControl - Reset Metrics:
/Branches/{A-L}/Circuit.ResetMetrics
Troubleshooting
Common Issues and Solutions:
1. Authentication Failures
Issue: 401 Unauthorized errors
Solution:
Verify credentials and user role permissions
Check if account is locked (3 failed attempts triggers lockout)
Ensure HTTPS/HTTP setting matches PDU configuration
Verify user has appropriate role (admin, manager, user)
2. Connection Errors
Issue: Unable to reach API endpoint
Solution:
Verify network connectivity: ping the PDU directly
Check firewall rules for HTTPS (443) or HTTP (80)
Verify SSL certificate if using HTTPS
Use -k flag with curl to bypass certificate validation during testing
3. Session Timeout
Issue: X-Auth-Token becomes invalid
Solution:
Implement session refresh logic before token expiration
Use Basic Authentication for long-running scripts
Monitor for 401 responses and re-authenticate
4. Rate Limiting
Issue: API requests being throttled
Solution:
Implement exponential backoff in scripts
Cache frequently accessed data
Use bulk endpoints when available
Limit polling frequency to reasonable intervals (30-60 seconds)
5. Data Format Issues
Issue: POST requests failing with 400 Bad Request
Solution:
Verify JSON payload structure matches API documentation
Ensure all required fields are included
Check data types (numbers vs strings)
Validate against schema if available
6. Incomplete Sensor Data
Issue: Some sensors return null or zero values
Solution:
Verify sensor is physically connected
Check PDU firmware version compatibility
Allow time for sensor initialization after power-on
Verify sensor type matches PDU configuration
