Skip Navigation Links | |
Exit Print View | |
Oracle® ZFS Storage Appliance RESTful Application Programming Interface |
Example Python code to modify an existing resource:
>>> put_data = '{"ip_address_conflict_resolved": false}' >>> request = urllib2.Request("https://zfssa:215/api/alert/v1/actions/actions-001", put_data) >>> request.add_header('Content-Type', 'application/json') >>> request.get_method = lambda: 'PUT' >>> response = opener.open(request) >>> response.getcode() 202 >>> body = json.loads(response.read()) >>> print json.dumps(body, sort_keys=True, indent=4) { "actions": { "category": "network", "datalink_failed": true, "datalink_ok": true, "href": "/api/alert/v1/actions/actions-001", "ip_address_conflict": true, "ip_address_conflict_resolved": false, "ip_interface_degraded": true, "ip_interface_failed": true, "ip_interface_ok": true, "network_port_down": true, "network_port_up": true } }