All Products
Search
Document Center

Microservices Engine:ImportNacosConfig

Last Updated:Dec 05, 2025

Imports Nacos configurations as a file.

Operation description

Note

The current OpenAPI is not the Nacos-SDK API. For information about the Nacos-SDK API, see Official Documentation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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: Chinese.

  • en: English.

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: The request was successful.

  • false: The request failed.

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.