linode / cli

This is the DEPRECATED Linode CLI. Use https://github.com/linode/linode-cli
https://www.linode.com/docs/platform/linode-cli
Other
466 stars 36 forks source link

is it possible to use API to set GRUB2? #64

Closed centminmod closed 6 years ago

centminmod commented 7 years ago

is it possible to use API to set GRUB2 for distro kernel and use API to reboot linode ?

eatonphil commented 7 years ago

I am not super familiar with this version of the Linode CLI -- at a glance it doesn't seem like you can create a config with the CLI. (@jamesottinger would know for sure.) But you can definitely use the API to create a config with GRUB2 as the kernel and reboot the Linode.

We are also working on a newer version of the API which you can also use to create a config and reboot. There is also a new version of the Linode CLI corresponding to this new API version. At a glance it does not seem like you can create a config with the new CLI either. (@Dorthu would know for sure.)

At the very least, you can use curl or any http request library to create your config and reboot. This page on our new API docs will show you how to do that.

Dorthu commented 7 years ago

I don't believe either version of the cli supports changing Linode configs. You could certainly accomplish this with the V4 API if you needed to do it in a scripted fashion.

centminmod commented 7 years ago

@Dorthu you mean extending the V4 API to support this right ? But right now either V3 or V4 don't support this.

I am trying to figure out what I could do Linode config wise via Linode stackscript + Linode API for my Stackscript https://community.centminmod.com/threads/official-centmin-mod-linode-stackscript.12513/ :)

Dorthu commented 7 years ago

You can already manage Linode configs with the API V4 (docs). The official python library also supports working with configs if that helps.

displague commented 6 years ago

Thanks for reporting this @centminmod.

This cli is deprecated in favor of https://github.com/linode/linode-cli (pip install linode-cli) which offers the ability to set a GRUB2 kernel.

linode-cli linodes config-update --kernel linode/grub2 $LINODE_ID $CONFIG_ID 
$ linode-cli linodes config-update
usage: linode-cli [-h] [--kernel kernel] [--comments comments]
                  [--memory_limit memory_limit] [--run_level run_level]
                  [--virt_mode virt_mode]
                  [--helpers.updatedb_disabled updatedb_disabled]
                  [--helpers.distro distro]
                  [--helpers.modules_dep modules_dep]
                  [--helpers.network network]
                  [--helpers.devtmpfs_automount devtmpfs_automount]
                  [--label label] [--devices.sda.disk_id disk_id]
                  [--devices.sda.volume_id volume_id]
                  [--devices.sdb.disk_id disk_id]
                  [--devices.sdb.volume_id volume_id]
                  [--devices.sdc.disk_id disk_id]
                  [--devices.sdc.volume_id volume_id]
                  [--devices.sdd.disk_id disk_id]
                  [--devices.sdd.volume_id volume_id]
                  [--devices.sde.disk_id disk_id]
                  [--devices.sde.volume_id volume_id]
                  [--devices.sdf.disk_id disk_id]
                  [--devices.sdf.volume_id volume_id]
                  [--devices.sdg.disk_id disk_id]
                  [--devices.sdg.volume_id volume_id]
                  [--devices.sdh.disk_id disk_id]
                  [--devices.sdh.volume_id volume_id]
                  [--root_device root_device]
                  linodeId configId