solarnetwork-api-core
    Preparing search index...

    Class SshCommand

    A command with data.

    Implements

    Index

    Constructors

    Accessors

    Methods

    • Get this object in standard JSON form.

      An example result looks like this:

      {
      "cmd": "attach-ssh",
      "data": {"foo": "bar"}
      }

      If the data value has a toJsonObject() function, that will be invoked and used in the result. Otherwise the data value will be included as-is.

      Returns Record<string, any>

      an object, ready for JSON encoding

    • Create a new attach-ssh command instance

      Parameters

      • authorization: string

        a pre-computed SNWS2 authorization header, which must match exactly a GET request to the /solaruser/api/v1/sec/nodes/meta/:nodeId path using the provided authorization date and, node ID.

      • authorizationDate: number | Date

        the date used in the authorization value

      • username: string

        the SSH username to use

      • password: string

        the SSH password to use

      • OptionalterminalSettings: SshTerminalSettings

        optional terminal settings to use

      Returns SshCommand

    • Parse a JSON string into a Domain.SshCommand instance.

      The JSON must be encoded the same way Domain.SshCommand#toJsonEncoding does.

      Parameters

      • json: undefined | string

        the JSON to parse

      • OptionaldataDecodeFn: (obj: any) => any

        an optional function to decode the obj.data property with

      Returns undefined | SshCommand

      the new instance, or undefined if json is undefined

    • Create a new instance from an object in standard JSON form.

      The object must be in the same style as Domain.SshCommand#toJsonObject produces.

      Parameters

      • obj: any

        the object in standard JSON form

      • OptionaldataDecodeFn: (obj: any) => any

        an optional function to decode the obj.data property with

      Returns undefined | SshCommand

      the new instance, or undefined if obj is undefined