How to import a configuration from an agent

Copy the configuration of a device into IXON Cloud after changing it locally; you will learn how to do this with the API.

Introduction

The configuration of an agent can also be changed on the device itself, for example in the local web interface or through the SecureEdge API.

This scenario occurs when the changes that are applied on the device (e.g., while it's offline) do not match the configuration that is stored in the Cloud. This can be as a result of configuring the device "locally" (Web Interface/API, display, USB) either online or offline.

Importing copies the configuration from the device into IXON Cloud, so that both match. It is the opposite of pushing, which sends the configuration from IXON Cloud to the device.

On this page, you will learn how to import a configuration in Fleet Manager and about the API equivalent.

🚧

Import before you push

After changing a device locally, import its configuration into IXON Cloud before you push anything. Otherwise, IXON Cloud still holds the old configuration, and a later push can send it to the device again and undo your local changes.

When to import

Import the configuration after a change that was made on the device, and not in IXON Cloud, for example:

  • Changes in the local web interface of a SecureEdge or SecureEdge Pro.
  • Changes made through the SecureEdge API.
  • Changes made on an offline gateway.
  • Using a USB stick or performing a change on the display, both online and offline.

The AgentListConfigurationImport endpoint

Importing is done with AgentListConfigurationImport. Send the publicId of one or more agents in a list:

curl --request PUT \
     --url https://portal.ixon.cloud:443/api/agents/configuration/import \
     --header 'Api-Application: <your_application_id>' \
     --header 'Api-Company: <your_company_id>' \
     --header 'Api-Version: 2' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <your_bearer_token>' \
     --header 'content-type: application/json' \
     --data '
[
  {
    "publicId": "<your_agent_id>"
  }
]
'
{
  "type": "AgentConfigurationImportResult",
  "data": {
    "agent": {
      "publicId": "<your_agent_id>",
      "reference": {
        "name": "Agent"
      }
    },
    "issues": []
  },
  "status": "success"
}

Issues

The issues list contains warnings for parts of the configuration that could not be imported. The request still returns success.

Currently, the only issue type is linked-resources. It occurs when you delete a resource on the device, but resources in IXON Cloud are still linked to it.

For example, you delete an additional LAN network on a SecureEdge or SecureEdge Pro, but data sources or services in IXON Cloud are still linked to that LAN network. The import does not remove the LAN network in IXON Cloud, so there is still a configuration difference after the import. Fleet Manager shows a Config import warning based on the content of issues.

{
  "type": "AgentConfigurationImportResult",
  "data": {
    "agent": {
      "publicId": "<your_agent_id>",
      "reference": {
        "name": "Agent"
      }
    },
    "issues": [
      {
        "issueType": "linked-resources",
        "message": "Resource cannot be deleted due to linked resources",
        "publicId": "<AgentLanNetwork publicId>",
        "reference": {
          "name": "AgentLanNetwork"
        },
        "resources": [
          {
            "publicId": "<AgentDevice publicId>",
            "reference": {
              "name": "AgentDevice"
            }
          }
        ]
      }
    ]
  },
  "status": "success"
}
FieldDescription
issueTypeThe type of issue: linked-resources.
messageA description of the issue.
publicIdThe public ID of the resource that could not be deleted, here the LAN network.
reference.nameThe type of that resource.
resourcesThe resources that are linked to it and prevent the deletion, each with a publicId and a reference.name.

The response above triggers the following Config import warning in Fleet Manager:

Errors

An invalid request returns a 4XX status code with a list of errors:

{
  "status": "error",
  "type": "Error",
  "data": [
    {
      "message": "<error message>",
      "propertyName": "publicId",
      "listIndex": 0
    }
  ]
}

propertyName and listIndex tell you which field, and which item in your list, caused the error. Both can be null.


Did this page help you?