Struct inapi::Host
[−]
[src]
pub struct Host { pub hostname: String, // some fields omitted }
Primitive for communicating with a managed host.
Examples
let mut host = Host::connect("hosts/myhost.json").unwrap(); let cmd = Command::new("whoami"); let result = cmd.exec(&mut host).unwrap();
Fields
hostname: String
Hostname or IP of managed host
Methods
impl Host
[src]
fn connect<P: AsRef<Path>>(path: P) -> Result<Host, Error>
[src]
Create a new Host connected to the endpoint specified in the data file.
This function expects to find the following keys in the root namespace: "hostname", "api_port", "file_port".
fn connect_endpoint(
hostname: &str,
api_port: u32,
file_port: u32
) -> Result<Host, Error>
[src]
hostname: &str,
api_port: u32,
file_port: u32
) -> Result<Host, Error>
Create a new Host connected to the specified endpoint. Note that this function does not load any user data.
fn connect_payload(
api_endpoint: &str,
file_endpoint: &str
) -> Result<Host, Error>
[src]
api_endpoint: &str,
file_endpoint: &str
) -> Result<Host, Error>
Create a new Host specifically for use inside a payload.
fn data(&self) -> &Value
[src]
Get data for Host.
fn data_owned(&self) -> Rc<Value>
[src]
Get a reference counted version of data for Host.