下载
中文
注册

导入服务器证书

命令功能

导入服务器证书。

命令格式

操作类型:POST

URLhttps://device_ip/redfish/v1/Systems/SecurityService/HttpsCert/Actions/HttpsCert.ImportServerCertificate

请求头:

X-Auth-Token: auth_value
Content-Type: header_type

请求消息体:

{
    "FileName":filename,
    "Password":password
}

请求参数

表1 请求参数

参数名

是否必选

参数说明

取值

FileName

必选

服务器证书文件名

字符串,仅支持.cer或者.crt格式的证书。

长度为1~255,可由大小写字母(a~z、A~Z)、数字(0~9)和其他字符(_.-)组成,且不含“..”,后缀只能为"crt"和"cer"。

Password

必选

当前用户的密码

字符串,用户自定义。

长度为8~20字符,可由大小写字母(a~z、A~Z)、数字(0~9)、其他字符(`~!@#$%^&*()-_=+\|[{}];:'",<.>/?)和空格组成,至少包含其中3类字符。

使用指南

使用实例

请求样例:

POST https://10.10.10.10/redfish/v1/Systems/SecurityService/HttpsCert/Actions/HttpsCert.ImportServerCertificate

请求头:

X-Auth-Token: auth_value
Content-Type: application/json

请求消息体:

{
    "FileName":"server.crt",
    "Password":"password"
}
响应样例:
{
    "error": {
        "code": "Base.1.0.Success",
        "message": "Operation success. See ExtendedInfo for more information.",
        "@Message.ExtendedInfo": [
            {
                "@odata.type": "#MessageRegistry.v1_0_0.MessageRegistry",
                "Description": "Indicates that no error has occurred.",
                "Message": "Import custom certificate successfully.",
                "Severity": "OK",
                "NumberOfArgs": null,
                "ParamTypes": null,
                "Resolution": "None"
            }
        ]
    }
}

响应码:202

输出说明

表2 操作输出说明

字段

类型

说明

code

字符串

指示消息注册表中特定消息ID的字符串。

message

字符串

与消息注册表中的消息对应的易读的消息。

@odata.type

字符串

消息资源的OData描述信息。

Description

字符串

消息资源的具体描述。

Message

字符串

消息资源的详细信息。

Severity

字符串

严重性。支持的严重级别包括:

  • OK
  • Warning
  • Critical

NumberOfArgs

数字

消息描述的参数个数。

ParamTypes

数组

参数类型列表。

Resolution

字符串

事件处理建议。