ResourceDefinition
uris
/redfish/v1/Managers/manager_id/SmtpService
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | SMTP服务资源模型的OData描述信息 | |
| @odata.id | string | true | SMTP服务资源的访问路径 | |
| @odata.type | string | true | SMTP服务资源的类型 | |
| Name | string | true | SMTP服务资源的名称 | |
| Id | string | true | SMTP服务资源的ID | |
| ServiceEnabled | boolean | false | SMTP服务的使能状态 | |
| CertVerificationEnabled | boolean | false | SMTP校验服务端证书使能说明该属性自8.91版本(1710),3.8.0.1版本(1711)开始使用 | |
| ServerAddress | string | false | SMTP服务器地址 | |
| ServerPort | number | false | SMTP服务器端口 | |
| TLSEnabled | boolean | false | 是否启用TLS | |
| AnonymousLoginEnabled | boolean | false | 是否使用匿名 | |
| SenderUserName | string | false | 发件人用户名 | |
| SenderPassword | string | false | 发件人密码 | |
| SenderAddress | string | false | 发件人电子邮箱 | |
| EmailSubject | string | false | 邮件主题 | |
| EmailSubjectContains | array | false | 主题附加信息 ● HostName ● BoardSN ● ProductAssetTag | |
| AlarmSeverity | null或字符串 | false | 告警发送级别 ● Critical (紧急) ● Major (严重及以上) ● Minor (轻微及以上) ● Normal (正常及以上) ● null(不发送告警) | |
| ReportType | 枚举 | false | 上报事件类型: ● OemEvent:自定义事件 ● SEL:传感器事件 | |
| RootCertificate.Subject | string | true | 证书使用者 | |
| RootCertificate.Issuer | string | true | 证书签发者 | |
| RootCertificate.ValidNotBefore | string | true | 生效起始日期 | |
| RootCertificate.ValidNotAfter | string | true | 生效结束日期 | |
| RootCertificate.SerialNumber | string | true | 证书序列号 | |
| RootCertificate.SignatureAlgorithm | string | true | 签名算法 | |
| RootCertificate.KeyUsage | string | true | 密钥用法 | |
| RootCertificate.PublicKeyLengthBits | number | true | 公钥长度 | |
| MemberId | string | false | 序号 | |
| Enabled | boolean | false | 启用状态 | |
| EmailAddress | string | false | 收件人电子邮箱地址 | |
| Description | string | false | 描述 | |
| SmtpService.SubmitTestEvent | object | true | 发送测试事件 | |
| SmtpService.ImportRootCertificate | object | true | 导入根证书说明该接口自8.91版本(1710),3.8.0.1版本(1711)开始使用 | |
| target | string | true | Action操作路径 | |
| Redfish.ActionInfo | string | true | Action操作信息查询路径 | |
| code | string | true | 指示消息注册表中特定消息ID的字符串 | |
| message | string | true | 与消息注册表中的消息对应的易读的错误消息 | |
| MessageId | string | true | 消息ID | |
| RelatedProperties | array | true | 消息相关属性 | |
| Message | string | true | 详细信息 | |
| MessageArgs | array | true | 信息参数 | |
| Severity | string | true | 严重性Redfish支持的严重级别包括:OK、Warning、Critical。 | |
| Resolution | string | true | 解决建议 |
supported_methods
- GET
- PATCH
- POST
HTTP methods
GET
命令功能
查询 SMTP 资源信息
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SmtpService
请求头:
X-Auth-Token: auth_value请求消息体: 无
参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| device_ip | 登录设备的IP地址 | IPv4或IPv6地址 |
| auth_value | 请求消息的鉴权参数 | 可通过/redfish/v1/SessionService/Sessions创建会话时获得 |
使用指南
无
使用实例
请求样例: GET https://device_ip/redfish/v1/Managers/manager_id/SmtpService
X-Auth-Token: auth_value 请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#HwSmtpService.HwSmtpService",
"@odata.id": "/redfish/v1/Managers/1/SmtpService",
"@odata.type": "#HwSmtpService.v1_0_0.HwSmtpService",
"Id": "SmtpService",
"Name": "Smtp",
"ServiceEnabled": false,
"CertVerificationEnabled": false,
"AnonymousLoginEnabled": false,
"ServerAddress": null,
"ServerPort": 25,
"TLSEnabled": true,
"SenderUserName": null,
"SenderPassword": null,
"SenderAddress": null,
"EmailSubject": "Server Alert",
"EmailSubjectContains": [],
"RootCertificate": {
"Issuer": "CN=xxx, OU=IT, O=xxx, L=, S=GuangDong, C=CN",
"Subject": "CN=xxx, OU=IT, O=xxx, L=, S=GuangDong, C=CN",
"ValidNotBefore": "Jan 28 2016 GMT",
"ValidNotAfter": "Jan 27 2019 GMT",
"SerialNumber": "d5 39 e6 3a 2d 53 de 90",
"SignatureAlgorithm": "sha256WithRSAEncryption",
"KeyUsage": "Certificate Signing, CRL Sign",
"PublicKeyLengthBits": 2048
},
"RecipientAddresses": [
{
"MemberId": "0",
"Enabled": false,
"EmailAddress": null,
"Description": null
},
{
"MemberId": "1",
"Enabled": false,
"EmailAddress": null,
"Description": null
},
{
"MemberId": "2",
"Enabled": false,
"EmailAddress": null,
"Description": null
},
{
"MemberId": "3",
"Enabled": false,
"EmailAddress": null,
"Description": null
}
],
"ReportType": "SEL",
"Actions": {
"#SmtpService.SubmitTestEvent": {
"target": "/redfish/v1/Managers/1/SmtpService/Actions/SmtpService.SubmitTestEvent",
"@Redfish.ActionInfo": "/redfish/v1/Managers/1/SmtpService/SubmitTestEventActionInfo"
},
"#SmtpService.ImportRootCertificate": {
"target": "/redfish/v1/Managers/1/SmtpService/Actions/SmtpService.ImportRootCertificate",
"@Redfish.ActionInfo": "/redfish/v1/Managers/1/SmtpService/ImportRootCertificateActionInfo"
}
}
}响应码:200
PATCH
命令功能
修改 SMTP 资源属性
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SmtpService
请求头:
X-Auth-Token: auth_value
Content-Type: header_type
If-Match: ifmatch_value请求消息体:
{
"ServiceEnabled": ServiceEnabled_value,
"CertVerificationEnabled": CertVerificationEnabled_value,
"ServerAddress": ServerAddress_value,
"ServerPort": ServerPort_value,
"TLSEnabled": TLSEnabled_value,
"AnonymousLoginEnabled": AnonymousLoginEnabled_value,
"SenderUserName": SenderUserName_value,
"SenderPassword": SenderPassword_value,
"SenderAddress": SenderAddress_value,
"EmailSubject": EmailSubject_value,
"EmailSubjectContains": EmailSubjectContains_value,
"AlarmSeverity": AlarmSeverity_value,
"ReportType": ReportType_value,
"RecipientAddresses": [
{
"Enabled": Enabled_value,
"EmailAddress": EmailAddress_value,
"Description": Description_value
}
]
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| ifmatch_value | 请求消息的匹配参数 | 可通过对相应资源发起GET操作,从响应头中获取(对应于“ETag”参数) |
| ServiceEnabled_value | SMTP服务使能 | ● true ● false |
| CertVerificationEnabled_value | SMTP校验服务端证书使能 | ● true ● false |
| ServerAddress_value | SMTP服务地址 | 字符串类型值说明未启用匿名时修改该参数属性需要同时修改发件人密码 |
| ServerPort_value | SMTP服务端口 | 1~65535 |
| TLSEnabled_value | TLS启用设置 | ● true ● false |
| AnonymousLoginEnabled_value | 是否使用匿名 | ● true ● false说明使用匿名模式发件人密码将自动清空。 |
| SenderUserName_value | 发件人用户名 | 字符串类型值说明未启用匿名时修改该参数属性需要同时修改发件人密码。 |
| SenderPassword_value | 发件人密码 | 字符串类型值 |
| SenderAddress_value | 发件人邮箱 | 字符串类型值 |
| EmailSubject_value | 邮箱主题 | 字符串类型值 |
| EmailSubjectContains_value | 主题附加信息 | 可设置主机名、单板序列号、产品资产标签一个或多个 |
| AlarmSeverity_value | 告警发送级别 | ● Critical (紧急) ● Major (严重及以上) ● Minor (轻微及以上) ● Normal (正常及以上) ● null(不发送告警) |
| ReportType | 上报事件类型 | ● OemEvent:自定义事件 ● SEL:传感器事件 |
| Enabled_value | 接收告警的邮件启用状态 | ● true ● false |
| EmailAddress_value | 电子邮箱地址 | 字符串类型值 |
| Description_value | 描述 | 字符串类型值 |
使用指南
可以同时设置多个属性
使用实例
请求样例: PATCH https://device_ip/redfish/v1/Managers/manager_id/SmtpService
X-Auth-Token: auth_value Content-Type: header_type If-Match: ifmatch_value 请求消息体:
{
"ServiceEnabled": ServiceEnabled_value,
"CertVerificationEnabled": CertVerificationEnabled_value,
"ServerAddress": ServerAddress_value,
"ServerPort": ServerPort_value,
"TLSEnabled": TLSEnabled_value,
"AnonymousLoginEnabled": AnonymousLoginEnabled_value,
"SenderUserName": SenderUserName_value,
"SenderPassword": SenderPassword_value,
"SenderAddress": SenderAddress_value,
"EmailSubject": EmailSubject_value,
"EmailSubjectContains": EmailSubjectContains_value,
"AlarmSeverity": AlarmSeverity_value,
"ReportType": ReportType_value,
"RecipientAddresses": [
{
"Enabled": Enabled_value,
"EmailAddress": EmailAddress_value,
"Description": Description_value
}
]
}响应样例:
{
"@odata.context": "/redfish/v1/$metadata#HwSmtpService.HwSmtpService",
"@odata.id": "/redfish/v1/Managers/1/SmtpService",
"@odata.type": "#HwSmtpService.v1_0_0.HwSmtpService",
"Id": "SmtpService",
"Name": "Smtp",
"ServiceEnabled": false,
"CertVerificationEnabled": false,
"ServerAddress": null,
"ServerPort": 25,
"TLSEnabled": true,
"AnonymousLoginEnabled": false,
"SenderUserName": "",
"SenderPassword": null,
"SenderAddress": null,
"EmailSubject": "Server Alert",
"EmailSubjectContains": [],
"AlarmSeverity": "Normal",
"RootCertificate": {
"Issuer": "CN=xxx, OU=IT, O=xxx, L=, S=GuangDong, C=CN",
"Subject": "CN=xxx, OU=IT, O=xxx, L=, S=GuangDong, C=CN",
"ValidNotBefore": "Jan 28 2016 GMT",
"ValidNotAfter": "Jan 27 2019 GMT",
"SerialNumber": "d5 39 e6 3a 2d 53 de 90",
"SignatureAlgorithm": "sha256WithRSAEncryption",
"KeyUsage": "Certificate Signing, CRL Sign",
"PublicKeyLengthBits": 2048
},
"RecipientAddresses": [
{
"MemberId": "0",
"Enabled": false,
"EmailAddress": "smtptest@it.software.com",
"Description": "smtptest"
},
{
"MemberId": "1",
"Enabled": false,
"EmailAddress": null,
"Description": null
},
{
"MemberId": "2",
"Enabled": false,
"EmailAddress": null,
"Description": null
},
{
"MemberId": "3",
"Enabled": false,
"EmailAddress": null,
"Description": null
}
],
"ReportType": "SEL",
"Actions": {
"#SmtpService.SubmitTestEvent": {
"target": "/redfish/v1/Managers/1/SmtpService/Actions/SmtpService.SubmitTestEvent",
"@Redfish.ActionInfo": "/redfish/v1/Managers/1/SmtpService/SubmitTestEventActionInfo"
}
}
}响应码:200
POST (ACTION)
ImportRootCertificate
命令功能
导入 SMTP 根证书
说明 须知 此资源已经废弃,仅供兼容性用途使用。建议使用redfish/v1/CertificateService接口 进行CA证书/吊销列表管理 自BMC300 5.2.0.1版本后CA证书升级为资源池,所有BMC业务共用资源池中的CA证 书,此接口导入证书会影响到其他包含根证书的接口。共用CA证书业务包括: Syslog、SMTP、LDAP、SSL证书自动更新、远程HTTPS服务器、双因素登录业务
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SmtpService/Actions/SmtpService.ImportRootCertificate
请求头:
X-Auth-Token: auth_value
Content-Type: header_type请求消息体:
{
"Type": type,
"Content": value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| type | 导入smtp证书的方式 | ● text,表明value值是证书内容 ● URI,表明value值是URI(本地或者远程) |
| value | 内容 | 1:可以是证书的内容2:可以是证书本地路径 (只能在/tmp目录下)或者远程路径(支持的文件传输的协议有https、sftp、nfs、cifs、scp) 3:value的含义由type表示 |
使用指南
无
使用实例
请求样例: POST https://device_ip/redfish/v1/Managers/manager_id/SmtpService/Actions/SmtpService.ImportRootCertificate
X-Auth-Token: auth_value Content-Type: header_type 请求消息体:
{
"Type": type,
"Content": value
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "iBMC.1.0.CertImportOKNone",
"RelatedProperties": [],
"Message": "The certificate has been imported successfully.",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200
POST (ACTION)
SubmitTestEvent
命令功能
发送 SMTP 测试邮件
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SmtpService/Actions/SmtpService.SubmitTestEvent
请求头:
X-Auth-Token: auth_value
Content-Type: header_type请求消息体:
{
"MemberId": value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| value | 序号 | 0,1,2,3 |
使用指南
无
使用实例
请求样例: POST https://device_ip/redfish/v1/Managers/manager_id/SmtpService/Actions/SmtpService.SubmitTestEvent
X-Auth-Token: auth_value Content-Type: header_type 请求消息体:
{
"MemberId": value
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200