Installing Service Software
Function
This interface is used to install service software.
Syntax
Operation type: POST
URL:https://device_ip/redfish/v1/Softwares/DockerServices
Request header:
X-Auth-Token: auth_value
Request message body:
{
"ServiceName": name,
"ServiceDescription": description,
"Version": version,
"ImageFile": file,
"AttachFile": attach,
"AttachFileMountPath": path,
"ResourceQuota": {
"CpuQuota": cpu_quota,
"MemQuota": mem_quota,
"StorageQuota": storage_quota,
"AiQuota": ai_quota
},
"Environments": [
{
"Key": env_key,
"Value": env_value
},
],
"Volumes": [
{
"Name": vol_name,
"MountPath": path,
"TotalSize": size,
"Method": method
}
],
"Options": {
"Priviledge": pri_flag,
"RebootPolicy": policy,
"UseHostNetwork": use_flag,
"PortMap": [
{
"DockerPort": dport,
"HostPort": hport
}
]
},
"IsHwImage":false,
"IsValid":false
}
Parameter Description
Parameter |
Description |
Value |
---|---|---|
device_ip |
IP address for logging in to a device. |
An IPv4 or IPv6 address. |
auth_value |
Authentication parameter contained in the request. |
You can obtain the value from the session created by using /redfish/v1/SessionService/Sessions. |
ServiceName |
Name of a service software instance. |
Character string |
ServiceDescription |
Service software instance description. |
Character string |
Version |
Service software version. |
Character string |
ImageFile |
Docker image file name. |
The value is a string with a maximum of 32 bytes. |
AttachFile |
Name of the attachment to be added. |
The value is a string with a maximum of 32 bytes. |
AttachFileMountPath |
Mount path of the attachment in the container. |
The value is a string with a maximum of 256 bytes. |
CpuQuota |
Maximum CPU resources that can be used by the container service. |
Format: NumberCore. The value range of Number is 0.01 to 1. For example, 0.8Core. |
MemQuota |
Maximum memory resources that can be used by the container service. |
Format: Number MiB |
StorageQuota |
Maximum DM storage resources that can be used by the container service. |
Format: Number GiB |
AiQuota |
AI compute power used by the container service. |
Numeric value:
NOTE:
The Ascend 310 chip does not support compute power allocation. Therefore, the compute power quota cannot be specified for the service software on the Atlas 200 HiLens Kit. You can only determine whether the container service uses AI compute power. |
Key |
Name of the environment variable. |
Character string |
Value |
Value of the environment variable. |
Character string |
Name |
Name of the volume to be attached, for example, /dev/sda1. |
Character string |
MountPath |
Path to which the volume is attached in the container. |
Character string |
TotalSize |
Available capacity. Currently, only the total capacity of the attached volume can be used. |
Format: Number MB/GB |
Method |
Method of using the attached volume. |
|
Priviledge |
Specifies whether the container service can directly access hardware devices. |
Boolean value
|
RebootPolicy |
Container restart policy. |
|
UseHostNetwork |
Whether to use the host network. |
Boolean value
|
DockerPort |
Port number of the container during port mapping. |
Numeric value |
HostPort |
Port number of the host during port mapping. |
Numeric value |
IsHwImage |
Specifies whether the image is a Huawei image. |
Boolean value
|
IsValid |
Specifies whether to verify the image. |
Boolean value
|
Usage Guidelines
None
Example
Request:
POST https://10.10.10.10/redfish/v1/Softwares/DockerServices
Request header:
X-Auth-Token: 6599174c38c36838737d9749179e1ee1
Request message body:
{ "ServiceName": "test", "ServiceDescription": "", "Version": "1.0.0", "ImageFile": "WebUIService.tar.gz", "AttachFile": "mgs.tar", "AttachFileMountPath": "/home/test", "ResourceQuota": { "CpuQuota": "0Core", "MemQuota": "MiB", "StorageQuota": "G", "AiQuota": "" }, "Environments": [ { "Key": "", "Value": "" } ], "Volumes": [ { "Name": "", "MountPath": "", "TotalSize": "", "Method": "" } ], "Options": { "Priviledge": "true", "RebootPolicy": "on-failure", "UseHostNetwork": "true", "PortMap": [ { "DockerPort": "", "HostPort": "" } ] }, "IsHwImage":false, "IsValid":false }
Response:
{
message: " Install docker services successfully"
status: 202
}
Response code: 202
Output Description
Attribute |
Type |
Description |
---|---|---|
status |
Character string |
Response code |
message |
Character string |
Response message |