SoftLayer.sshkey

SSH Key Manager/helpers

copyright:
  1. 2013, SoftLayer Technologies, Inc. All rights reserved.
license:

MIT, see LICENSE for more details.

class SoftLayer.managers.sshkey.SshKeyManager(client)[source]

Manages account SSH keys.

Parameters:client (SoftLayer.API.Client) – an API client instance
add_key(key, label, notes=None)[source]

Adds a new SSH key to the account.

Parameters:
  • key (string) – The SSH key to add
  • label (string) – The label for the key
Returns:

A dictionary of the new key’s information.

client = None

A valid SoftLayer.API.Client object that will be used for all actions.

delete_key(id)[source]

Permanently deletes an SSH key from the account.

Parameters:id (int) – The ID of the key to delete
edit_key(id, label=None, notes=None)[source]

Edits information about an SSH key.

Parameters:
  • id (int) – The ID of the key to edit
  • label (string) – The new label for the key
  • notes (string) – Notes to set or change on the key
Returns:

A Boolean indicating success or failure

get_key(id)[source]

Returns full information about a single SSH key.

Parameters:id (int) – The ID of the key to retrieve
Returns:A dictionary of information about the key
list_keys(label=None)[source]

Lists all SSH keys on the account.

Parameters:label (string) – Filter list based on SSH key label
Returns:A list of dictionaries with information about each key
resolve_ids(identifier)

Takes a string and tries to resolve to a list of matching ids. What exactly ‘identifier’ can be depends on the resolvers

Parameters:identifier (string) – identifying string
Returns list:
resolvers = []

A list of resolver functions. Used primarily by the CLI to provide a variety of methods for uniquely identifying an object such as label.

sshkey = None

Reference to the SoftLayer_Security_Ssh_Key API object.

Project Versions

Previous topic

SoftLayer.network

Next topic

SoftLayer.ssl

This Page