platypush.plugins.linode

class platypush.plugins.linode.LinodePlugin(token: str, **kwargs)[source]

This plugin can interact with a Linode account and manage node and volumes.

To get your token:

  • Login to <https://cloud.linode.com/>.
  • Go to My Profile -> API Tokens -> Add a Personal Access Token.
  • Select the scopes that you want to provide to your new token.

Requires:

  • linode_api4 (pip install linode_api4)
__init__(token: str, **kwargs)[source]
Parameters:token – Your Linode token.
boot(instance: str, token: Optional[str] = None) → None[source]

Boot an instance.

Parameters:
  • instance – Label of the instance to be booted.
  • token – Default access token override.
get_measurement(*args, **kwargs)[source]

Implemented by the subclasses.

Returns:Either a raw scalar:

output = 273.16

or a name-value dictionary with the values that have been read:

output = {
    "temperature": 21.5,
    "humidity": 41.0
}

or a list of values:

[
    0.01,
    0.34,
    0.53,
    ...
]
reboot(instance: str, token: Optional[str] = None) → None[source]

Reboot an instance.

Parameters:
  • instance – Label of the instance to be rebooted.
  • token – Default access token override.
shutdown(instance: str, token: Optional[str] = None) → None[source]

Shutdown an instance.

Parameters:
  • instance – Label of the instance to be shut down.
  • token – Default access token override.
status(token: Optional[str] = None, instance: Optional[str] = None) → Union[platypush.message.response.linode.LinodeInstanceResponse, platypush.message.response.linode.LinodeInstancesResponse][source]

Get the full status and info of the instances associated to a selected account.

Parameters:
  • token – Override the default access token if you want to query another account.
  • instance – Select only one node by label.
Returns:

platypush.message.response.linode.LinodeInstanceResponse if label is specified, platypush.message.response.linode.LinodeInstancesResponse otherwise.