How can I enable/disable Network Helper using the Linode API

Linode Staff

Network Helper is disabled on my account, but I'd like to be able to enable/disable it on individual Linodes using the Linode API. How can I do this, and does your python API library support it?

1 Reply

You can enable Network Helper for individual Linodes using the Linode API. The call to enable/disable Network Helper on individual Linodes lives in the Update Configuration Profile section of our API docs, and looks like this:

curl -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    -X PUT -d '{
      "kernel": "linode/latest-64bit",
      "comments": "This is my main Config",
      "memory_limit": 2048,
      "run_level": "default",
      "virt_mode": "paravirt",
      "helpers": {
        "updatedb_disabled": true,
        "distro": true,
        "modules_dep": true,
        "network": true,
        "devtmpfs_automount": false
      },
      "label": "My Config",
      "devices": {
        "sda": {
          "disk_id": 123456,
          "volume_id": null
        },
        "sdb": {
          "disk_id": 123457,
          "volume_id": null
        }
      }
    }' \
    https://api.linode.com/v4/linode/instances/123/configs/23456

This call updates your Linode's Configuration Profile. Since creating/modifying a Configuration Profile requires a Linode and its ID, the Linode must be created first. If you wish to have Network Helper already set on newly created Linodes, you can enable it in your account settings prior to creating any more Linodes. This can also be manipulated using the API, so you can temporarily enable it prior to creating a Linode, if needed.

That said, the Python library lacks support for manipulating Network Helper at this time. I took a look at the class Config in the file objects/linode.py, and this is what I saw:

properties = {
        "id": Property(identifier=True),
        "linode_id": Property(identifier=True),
        "helpers": Property(),#TODO: mutable=True),
        "created": Property(is_datetime=True),
        "root_device": Property(mutable=True),
        "kernel": Property(relationship=Kernel, mutable=True, filterable=True),
        "devices": Property(filterable=True),#TODO: mutable=True),
        "initrd": Property(relationship=Disk),
        "updated": Property(),
        "comments": Property(mutable=True, filterable=True),
        "label": Property(mutable=True, filterable=True),
        "run_level": Property(mutable=True, filterable=True),
        "virt_mode": Property(mutable=True, filterable=True),
        "memory_limit": Property(mutable=True, filterable=True),
    }

Specifically, this is the line I'm looking at:

        "helpers": Property(),#TODO: mutable=True),

This line contains a comment marking it TODO, so this isn't yet implemented. The Python library is still in beta, so you may find that some API features aren't there just yet.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct