White Papers

Configuration details
9 Dell Storage Manager REST API Cookbook | 3089-WP-SAN
1.5 Establish the DSM parameters
The main.py used for this paper contains the following initialization attributes to establish the connection to
the DSM Data Collector.
# define env incl. DSM IP addr, port & login credentials
DSM_ip = '<nnn.nnn.nnn.nnn>' # IP address of DSM instance
DSM_port = '3033' # Default port of DSM instance
DSM_id = '<Username>' # Login credentials for DSM
DSM_pass = '<Password>' # Password
verify_cert = False # Default = False
apiversion = '2.0' # Default = 2.0
1.6 Define the base URL and header information
The base URL and header information are in the ./main.py file and should remain as provided.
# define base URL for DSM REST API interface
baseURL = 'https://%s:%s/api/rest/' % (DSM_ip, DSM_port)
# define HTTP content headers
header = {}
header['Content-Type'] = 'application/json; charset=utf-8'
header['Accept'] = 'application/json'
header['x-dell-api-version'] = apiversion
1.7 Create a requests.Session() object
These two lines in ./main.py create a requests.Session() object named connection. This object is used
throughout the rest of this paper to reference the open connection to the DSM Data Collector.
# define the connection session
connection = requests.Session()
connection.auth = (DSM_id, DSM_pass)