Getting SMTP server information

You can get information about a registered SMTP server. For each IBM Spectrum Protect Plus server, you can register only one SMTP server.

Method and URI

To get information about an SMTP server, use a GET method and a URI:

GET     https://{hostname|IP}/api/smtp/{smtpId}

Tip

To get an {smtpId} value based on its name, follow the instructions in Getting an {smtpId}.

Parameters

None.

Data

None.

Example: Get information about an SMTP server

Assume that you registered an SMTP server with IBM Spectrum Protect Plus ({smtpId} 1002).

A Python snippet that is similar to the following example can be used to request information about this SMTP server:

smtp_id = "1002"

requests.get('https://' + spp_ipv4 + '/api/smtp/' + smtp_id,
    headers={...}, verify=...)
_images/reference_smtp_get01.png

Figure 54 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click System Configuration > LDAP/SMTP Servers and click the SMTP Server tab.

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK).

{
    "links": {...},
    "name": "10.0.0.121",
    "hostAddress": "10.0.0.121"
    "rbacPath": "smtp:0/smtp:1002",
    "user": "sarah-smtp",
    "comment": "",
    "portNumber": 25,
    "timeout": 10000,
    "fromAddress": "smtp@bluemachines.com.invalid",
    "subjectPrefix": "IBM Spectrum Protect Plus:",
    "id": "1002"
}