Configuring Image Download Information
Function
The address, account, and password of the third-party image repository must be configured. The repository server address can be a domain name or an IP address. When this API is called repeatedly, the existing image download information configuration will be updated.
- The image download information is transferred by MEF Center to Kubernetes and KubeEdge. KubeEdge stores the data in Kubernetes and the EdgeCore database of the MEF Edge device. You can customize Kubernetes and KubeEdge to harden the security of the account and password of the image repository based on your requirements.
- You are advised to use a trusted third-party image repository. If an insecure third-party image repository address is configured, insecure transmission may occur.
If a domain name is used, you need to configure the mapping between the domain name and IP address in the host directory /etc/hosts of the edge device MEF Edge. For details, see Configuring Local Domain Name Mapping.
Syntax
Operation type: POST
URL: https://{ip}:{port}/edgemanager/v1/image/config
{
"domain": domain
"ip": ip,
"port": port,
"account": account,
"password": password
}
Request Parameters
Parameter |
Mandatory/Optional |
Description |
Value |
|---|---|---|---|
domain |
Optional |
Domain name of the image repository server |
A valid domain name. The value is a character string, containing 3 to 63 characters, including uppercase letters, lowercase letters, digits, and special characters (.-). It must start and end with a letter or digit, but cannot contain only digits. The value cannot be localhost. At least one of domain and ip must be transferred. If both parameters are provided, domain prevails. |
ip |
Optional |
IP address of the image repository server |
The value is a character string. It must be a valid IPv4 address. It cannot be all 0s, all 255s, loopback address 127.0.0.1, or the host address of MEF Edge. At least one of domain and ip must be transferred. If both parameters are provided, domain prevails. |
port |
Mandatory |
Port number used by the image repository to provide services externally |
The value must be an integer ranging from 1 to 65535. |
account |
Mandatory |
Account for downloading images |
The value is a string of up to 256 characters. The value can contain uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-). The value cannot start or end with an underscore (_) or hyphen (-). |
password |
Mandatory |
Password for downloading images |
Byte array. The array length ranges from 8 to 20. The image repository password cannot contain colons (:). NOTE:
The password must meet the following requirements; otherwise, security risks may exist.
|
Usage Example
Request:
POST https://10.10.10.10:30035/edgemanager/v1/image/config
Request message body:
{
"domain": "xxx.huawei.com",
"ip": "10.10.10.10",
"port": 6443,
"account": "ImageRepository",
"password": [72, 117, 97, 119, 101, 105, 49, 50, 35, 36]
}
{
"status": "00000000",
"msg": "success"
}
Response status code: 200
Output Description
Parameter |
Type |
Description |
|---|---|---|
status |
String |
Error code |
msg |
String |
Description |