Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 42
Part no.9036931-00 Rev AA February 2021
To access the Restconf server on a switch, RFC 8040 requires a common URL as the root. The root
resource for EXOS is /rest/restconf/. The datastore is represented by a node named data.
Note: All methods are supported on data.
Enable HTTPS on EXOS
To enable HTTPS on an EXOS switch, first enable SSL. The following example starts with a factory default
switch (or VM):
sw1.2 # show ssl
HTTPS Port Number: 443 (Disabled)
Signature Algorithm configured: sha512 With RSA Encryption
Certificate and Private key not configured
Manufacturing certificate: Not present
sw1.3 #
sw1.3 # config ssl certificate privkeylen 4096 country fr organization extreme common-
name extreme
................++
...................................++
Storing the private key. This may take some time.
.Done
sw1.4 #
sw1.4 # show ssl
HTTPS Port Number: 443 (Enabled)
Signature Algorithm configured: sha512 With RSA Encryption
Private Key matches the Certificate's public key.
RSA Private Key: 4096
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 0 (0x0)
Signature Algorithm: sha512WithRSAEncryption
Issuer: C=fr, O=extreme, CN=extreme
Validity
Not Before: Jun 9 10:38:42 2020 GMT
Not After : Jun 9 10:38:42 2021 GMT
Subject: C=fr, O=extreme, CN=extreme
Manufacturing certificate: Not present
sw1.4 #
sw1.4 # enable web HTTPS
sw1.5 # disable web http
This example uses self-signed certificates. This is adequate for testing but will generate warning
messages and could potentially result in errors for some applications.
Note: The requests module, and especially urllib3, produces exceptions if you use HTTPS with insecure
certificates. To remove these exceptions, add the following line to the Python class, after you import
urllib3.
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)