Imports Nacos configurations as a file.
Operation description
The current OpenAPI is not the Nacos-SDK API. For information about the Nacos-SDK API, see Official Documentation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:ImportNacosConfig |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance IDs. |
mse_prepaid_public_cn-**** |
| NamespaceId |
string |
No |
The namespace ID. Default value: public |
f5cdc80a-****-8094-282f5650fc00 |
| Policy |
string |
No |
The policy. |
overwrite |
| FileUrl |
string |
Yes |
The URL of the file that you want to import. This parameter must be set to the URL generated by Microservices Engine (MSE). Otherwise, error information is returned, indicating that the required permissions are not granted. Perform the following steps to obtain the URL: 1. Call the GetImportFileUrl operation to obtain the URL. 2. Use the HTTP PUT method to upload the file to the HTTP URL returned by the preceding step. 3. Call the ImportNacosConfig operation to import Nacos configurations. |
http://mse-shared.oss-xxx.aliyuncs.com/cfg/import/xxxx/2021/01/11/xxxx.zip |
| AcceptLanguage |
string |
No |
The language of the response. Valid values:
|
zh |
Response elements
|
Parameter |
Type |
Description |
Example |
|
object |
The data structure. |
||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| RequestId |
string |
The request ID. |
AF21683A-29C7-4853-AC0F-B5ADEE4**** |
| Success |
boolean |
Indicates whether the call was successful. Valid values:
|
true |
| ErrorCode |
string |
The error code. |
mse-100-100 |
| Code |
integer |
The code. |
1 |
| Message |
string |
The message that is returned for the request. |
The dynamic part in the error message. This parameter is used to replace the **%s** variable in the **ErrMessage** parameter. > If the return value of the **ErrMessage** parameter is **The Value of Input Parameter %s is not valid** and the return value of the **DynamicMessage** parameter is **DtsJobId**, the specified **DtsJobId** parameter is invalid. |
| DynamicMessage |
string |
The dynamic error message, used to replace the %s in the ErrMessage parameter. Note
If the ErrMessage returns The Value of Input Parameter %s is not valid, and DynamicMessage returns DtsJobId, it means that the request parameter DtsJobId is invalid. |
The specified parameter is invalid. |
| Data |
object |
The data returned. |
|
| SuccCount |
integer |
The number of configurations that are imported. |
100 |
| SkipCount |
integer |
The number of configurations that are skipped. |
10 |
| SkipData |
array |
The information about skipped configurations. |
|
|
object |
The data structure. |
||
| DataId |
string |
The ID of the data. |
test.yaml |
| Group |
string |
The group ID. |
public |
| FailData |
array |
The information about configurations that are failed to be imported. |
|
|
object |
The data structure. |
||
| DataId |
string |
The ID of the data. |
test2.yaml |
| Group |
string |
The group ID. |
test |
| Reason |
string |
The failure reason |
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"RequestId": "AF21683A-29C7-4853-AC0F-B5ADEE4****",
"Success": true,
"ErrorCode": "mse-100-100",
"Code": 1,
"Message": "The dynamic part in the error message. This parameter is used to replace the **%s** variable in the **ErrMessage** parameter.\n\n> If the return value of the **ErrMessage** parameter is **The Value of Input Parameter %s is not valid** and the return value of the **DynamicMessage** parameter is **DtsJobId**, the specified **DtsJobId** parameter is invalid.\n",
"DynamicMessage": "The specified parameter is invalid.",
"Data": {
"SuccCount": 100,
"SkipCount": 10,
"SkipData": [
{
"DataId": "test.yaml",
"Group": "public "
}
],
"FailData": [
{
"DataId": "test2.yaml",
"Group": "test",
"Reason": ""
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.