Package cm_api :: Package endpoints :: Module hosts
[hide private]
[frames] | no frames]

Module hosts

source code

Classes [hide private]
  ApiHost
Functions [hide private]
 
create_host(resource_root, host_id, name, ipaddr, rack_id=None)
Create a host
source code
 
get_host(resource_root, host_id)
Lookup a host by id
source code
 
get_all_hosts(resource_root, view=None)
Get all hosts
source code
 
delete_host(resource_root, host_id)
Delete a host by id
source code
Variables [hide private]
  HOSTS_PATH = '/hosts'
  __package__ = 'cm_api.endpoints'
Function Details [hide private]

create_host(resource_root, host_id, name, ipaddr, rack_id=None)

source code 

Create a host

Parameters:
  • resource_root - The root Resource object.
  • host_id - Host id
  • name - Host name
  • ipaddr - IP address
  • rack_id - Rack id. Default None
Returns:
An ApiHost object

get_host(resource_root, host_id)

source code 

Lookup a host by id

Parameters:
  • resource_root - The root Resource object.
  • host_id - Host id
Returns:
An ApiHost object

get_all_hosts(resource_root, view=None)

source code 

Get all hosts

Parameters:
  • resource_root - The root Resource object.
Returns:
A list of ApiHost objects.

delete_host(resource_root, host_id)

source code 

Delete a host by id

Parameters:
  • resource_root - The root Resource object.
  • host_id - Host id
Returns:
The deleted ApiHost object