var searchIndex = {}; searchIndex["juju"] = {"doc":"A library to interface with Juju. For more information about Juju see\n[Juju](https://jujucharms.com/docs/stable/about-juju)","items":[[3,"Status","juju","",null,null],[12,"status_type","","The type of status",0,null],[12,"message","","A message to show alongside the status",0,null],[3,"Context","","",null,null],[12,"relation_type","","The scope for the current relation hook",1,null],[12,"relation_id","","The relation ID for the current relation hook",1,null],[12,"unit","","Local unit ID",1,null],[12,"relations","","relation data for all related units",1,null],[3,"Relation","","",null,null],[12,"name","","The name of a unit related to your service",2,null],[12,"id","","The id of the unit related to your service",2,null],[3,"Hook","","",null,null],[12,"name","","The name of the hook to call",3,null],[12,"callback","","A function to call when Juju calls this hook\n# Failures\nYour function passed in needs to return a String on error so that users will\nknow what happened. Ideally this should also be logged with juju::log",3,null],[4,"JujuError","","",null,null],[13,"IoError","","",4,null],[13,"FromUtf8Error","","",4,null],[13,"ParseIntError","","",4,null],[4,"Transport","","",null,null],[13,"Tcp","","",5,null],[13,"Udp","","",5,null],[4,"StatusType","","For information about what these StatusType variants mean see: [Status reference]\n(https://jujucharms.com/docs/stable/reference-status)",null,null],[13,"Maintenance","","",6,null],[13,"Waiting","","",6,null],[13,"Active","","",6,null],[13,"Blocked","","",6,null],[5,"log","","Logs the msg passed to it\n# Examples\n```\nextern crate juju;\nlet error = "Error information";\njuju::log(&format!("Super important info. Error {}", error));\n```\n# Failures\nDoes not return anything on failure. Java has the same semantics. I'm still wondering\nif this is the right thing to do.",null,{"inputs":[{"name":"string"}],"output":null}],[5,"reboot","","This will reboot your juju instance. Examples of using this are when a new kernel is installed\nand the virtual machine or server needs to be rebooted to use it.\n# Failures\nReturns stderr if the reboot command fails",null,{"inputs":[],"output":{"name":"result"}}],[5,"action_get","","action_get gets the value of the parameter at the given key\nSee [Juju Actions](https://jujucharms.com/docs/devel/authors-charm-actions) for more information\n# Failures\nReturns stderr if the action_get command fails",null,{"inputs":[{"name":"string"}],"output":{"name":"result"}}],[5,"action_set","","action_set permits the Action to set results in a map to be returned at completion of the Action.\nSee [Juju Actions](https://jujucharms.com/docs/devel/authors-charm-actions) for more information\n# Failures\nReturns stderr if the action_set command fails",null,{"inputs":[{"name":"string"},{"name":"string"}],"output":{"name":"result"}}],[5,"action_fail","","See [Juju Actions](https://jujucharms.com/docs/devel/authors-charm-actions) for more information\n# Failures\nReturns stderr if the action_fail command fails",null,{"inputs":[{"name":"string"}],"output":{"name":"result"}}],[5,"unit_get_private_addr","","This will return the private IP address associated with the unit.\nIt can be very useful for services that require communicating with the other units related\nto it.",null,{"inputs":[],"output":{"name":"result"}}],[5,"unit_get_public_addr","","This will return the public IP address associated with the unit.",null,{"inputs":[],"output":{"name":"result"}}],[5,"config_get","","This will return a configuration item that corresponds to the key passed in",null,{"inputs":[{"name":"string"}],"output":{"name":"result"}}],[5,"config_get_all","","config_get_all will return all configuration options as a HashMap<String,String>\n# Failures\nReturns a String of if the configuration options are not able to be transformed into a HashMap",null,{"inputs":[],"output":{"name":"result"}}],[5,"open_port","","This will expose a port on the unit. The transport argument will indicate whether tcp or udp\nshould be exposed",null,{"inputs":[{"name":"usize"},{"name":"transport"}],"output":{"name":"result"}}],[5,"close_port","","This will hide a port on the unit. The transport argument will indicate whether tcp or udp\nshould be exposed",null,{"inputs":[{"name":"usize"},{"name":"transport"}],"output":{"name":"result"}}],[5,"relation_set","","",null,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"result"}}],[5,"relation_get","","",null,{"inputs":[{"name":"string"}],"output":{"name":"result"}}],[5,"relation_get_by_unit","","",null,{"inputs":[{"name":"string"},{"name":"relation"}],"output":{"name":"result"}}],[5,"relation_list","","Returns a list of all related units\n# Failures\nWill return a String of the stderr if the call fails",null,{"inputs":[],"output":{"name":"result"}}],[5,"relation_ids","","",null,{"inputs":[],"output":{"name":"result"}}],[5,"status_set","","Set the status of your unit to indicate to the Juju if everything is ok or something is wrong.\nSee the Status enum for information about what can be set.",null,{"inputs":[{"name":"status"}],"output":{"name":"result"}}],[5,"storage_get_location","","If storage drives were allocated to your unit this will get the path of them.\nIn the storage-attaching hook this will tell you the location where the storage\nis attached to. IE: /dev/xvdf for block devices or /mnt/{name} for filesystem devices",null,{"inputs":[],"output":{"name":"result"}}],[5,"storage_get","","Return the location of the mounted storage device. The mounted\nstorage devices can be gotten by calling storage_list() and\nthen passed into this function to get their mount location.",null,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[5,"storage_list","","Used to list storage instances that are attached to the unit.\nThe names returned may be passed through to storage_get",null,{"inputs":[],"output":{"name":"result"}}],[5,"process_hooks","","Call this to process your cmd line arguments and call any needed hooks\n# Examples\n```\n extern crate juju;\n use std::env;",null,{"inputs":[{"name":"vec"},{"name":"vec"}],"output":{"name":"result"}}],[5,"is_leader","","Returns true/false if this unit is the leader\n# Failures\nWill return stderr as a String if the function fails to run\n# Examples\n```\nextern crate juju;\nlet leader = match juju::is_leader(){\n Ok(l) => l,\n Err(e) => {\n println!("Failed to run. Error was {:?}", e);\n //Bail\n return;\n },\n};\nif leader{\n println!("I am the leader!");\n}else{\n println!("I am not the leader. Maybe later I will be promoted");\n}\n```",null,{"inputs":[],"output":{"name":"result"}}],[11,"fmt","","",4,null],[11,"to_string","","",4,null],[11,"from","","",4,{"inputs":[{"name":"error"}],"output":{"name":"jujuerror"}}],[11,"from","","",4,{"inputs":[{"name":"fromutf8error"}],"output":{"name":"jujuerror"}}],[11,"from","","",4,{"inputs":[{"name":"parseinterror"}],"output":{"name":"jujuerror"}}],[11,"fmt","","",5,null],[11,"fmt","","",6,null],[11,"to_string","","Returns a String representation of the enum variant",6,null],[11,"fmt","","",0,null],[11,"fmt","","",1,null],[11,"new_from_env","","Constructs a new `Context`\nCreates a context that's filled out from the env variables\n # Example usage\n ```\n extern crate juju;\n let context = juju::Context::new_from_env();\n ```",1,{"inputs":[],"output":{"name":"context"}}],[11,"fmt","","",2,null]],"paths":[[3,"Status"],[3,"Context"],[3,"Relation"],[3,"Hook"],[4,"JujuError"],[4,"Transport"],[4,"StatusType"]]}; initSearch(searchIndex);