NAME
Juju::Environment - Exposed juju api environment
VERSION
version 1.0
SYNOPSIS
use Juju;
my $juju = Juju->new(endpoint => 'wss://localhost:17070', password => 's3cr3t');
ATTRIBUTES
endpoint
Websocket address
username
Juju admin user, this is a tag and should not need changing from the default.
Note This will be changing once multiple user support is released.
password
Password of juju administrator, found in your environments configuration under password
is_authenticated
Stores if user has authenticated with juju api server
Jobs
Supported juju jobs
METHODS
query_cs ($charm)
helper for querying charm store for charm details
_prepare_constraints ($constraints)
Makes sure cpu-cores, cpu-power, mem are integers
constraints
- hash of service constraints
Returns - an updated constraint hash with any integers set properly.
login
Login to juju
reconnect
Reconnects to API server in case of timeout
info
(Deprecated) Environment information
Returns - Juju environment state
environment_info
Return Juju Environment information
status
Returns juju environment status
get_watcher
Returns watcher
get_watched_tasks ($watcher_id)
List of all watches for Id
add_charm ($charm_url)
Add charm
charm_url
- url of charm
get_charm ($charm_url)
Get charm
charm_url
- url of charm
get_env_constraints
Get environment constraints
set_env_constraints ($constraints)
Set environment constraints
constraints
- environment constraints
get_env_config
set_env_config ($config)
config
- Config parameters
add_machine ($series, $constraints, $machine_spec, $parent_id, $container_type)
Allocate new machine from the iaas provider (i.e. MAAS)
series
- OS series (i.e precise)
constraints
- machine constraints
machine_spec
- not sure yet..
parent_id
- not sure yet..
container_type
- uh..
Note: Not quite right as I've no idea wtf its doing yet, need to read the specs.
add_machines ($machines)
Add multiple machines from iaas provider
machines
- List of machines
destroy_machines
Destroy machines
provisioning_script
Not implemented
add_relation ($endpoint_a, $endpoint_b)
Sets a relation between units
remove_relation ($endpoint_a, $endpoint_b)
Removes relation between endpoints
deploy ($service_name, $charm_url, $num_units, $config_yaml, $constraints, $machine_spec)
Deploys a charm to service
set_config ($service_name, $config)
Set's configuration parameters for unit
service_name
- name of service (ie. blog)
config
- hash of config parameters
unset_config ($service_name, $config_keys)
Unsets configuration value for service to restore charm defaults
service_name
- name of service
config_keys
- hash of config keys to unset
set_charm ($service_name, $charm_url, $force)
Sets charm url for service
service_name
- name of service
charm_url
- charm location (ie. cs:precise/wordpress)
get_service ($service_name)
Returns information on charm, config, constraints, service keys.
service_name
- name of service
Returns - Hash of information on service
get_config ($service_name)
Get service configuration
service_name
- name of service
Returns - Hash of service configuration
get_constraints ($service_name)
service_name
- Name of service
set_constraints ($service_name, $constraints)
service_name
- Name of service
constraints
- Service constraints
update_service ($service_name, $charm_url, $force_charm_url, $min_units, $settings, $constraints)
Update a service
destroy_service ($service_name)
Destroys a service
service_name
- name of service
expose ($service_name)
Expose service
service_name
- Name of service
unexpose ($service_name)
Unexpose service
service_name
- Name of service
valid_relation_names
All possible relation names of a service
add_units
add_unit
remove_unit
resolved
get_public_address
set_annotation
Set annotations on entity, valid types are service
, unit
, machine
, environment
get_annotation
AUTHOR
Adam Stokes <adamjs@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2014 by Adam Stokes.
This is free software, licensed under:
The MIT (X11) License
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.