All Products
Search
Document Center

Microservices Engine:ImportNacosConfig

Last Updated:Apr 17, 2024

Imports Nacos configurations as a file.

Operation description

Note The operation is not provided in Nacos SDKs. For information about Nacos SDKs, see the official documentation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mse:ImportNacosConfigWrite
  • Cluster
    acs:mse:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the namespace.

mse_prepaid_public_cn-****
NamespaceIdstringNo

The policy.

f5cdc80a-****-8094-282f5650fc00
PolicystringYes

The policy.

Valid values:

  • ABORT

  • OVERWRITE

  • SKIP

overwrite
FileUrlstringYes

The language of the response. Valid values:

  • zh: Chinese
  • en: English
http://mse-shared.oss-xxx.aliyuncs.com/cfg/import/xxxx/2021/01/11/xxxx.zip
AcceptLanguagestringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English
zh

Response parameters

ParameterTypeDescriptionExample
object

The HTTP status code returned.

HttpStatusCodeinteger

The ID of the request.

200
RequestIdstring

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
AF21683A-29C7-4853-AC0F-B5ADEE4****
Successboolean

The error code that is returned.

true
ErrorCodestring

The code returned.

mse-100-100
Codeinteger

The error message returned.

1
Messagestring

The request is successfully processed.

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.
DynamicMessagestring

The details of the data.

The specified parameter is invalid.
Dataobject

The number of configurations that are imported.

SuccCountinteger

The number of configurations that are skipped.

100
SkipCountinteger

The information about skipped configurations.

10
SkipDataobject []

The data structure.

DataIdstring

The ID of the group.

test.yaml
Groupstring

The information about configurations that are failed to be imported.

public
FailDataobject []

The data structure.

DataIdstring

The ID of the group.

test2.yaml

Examples

Sample success responses

JSONformat

{
  "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"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalRequestInvalid request:%sInvalid request: %s
400InvalidParameterParameter error:%sRequest parameter error: %s
403NoPermissionYou are not authorized to perform this operation:%sYou do not have the permission to use this interface:%s
404NotFoundNot found:%sThe resource does not exist:%s
500InternalErrorConsole error. Try again later:%sConsole error. Try again later: %s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-29The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-12-28The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-04-25API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 403
    delete Error Codes: 500