Machinery

Machinery interfaces.

class Machinery

Machinery for GlassFish environment.

Parameters:
  • params (dict) – Machinery parameters.
  • mgmt_public_key_path (str) – Management public key path.
  • log_out (fileobj) – Logging output.
server_node_dir

System directory of nodes on server machines.

Return type:str
server(name, authorized_key_paths=None)

Restore a GlassFish server machine.

Parameters:
  • name (str) – Name of the machine.
  • authorized_key_paths (iter) – Iterator of authorized public key paths.
Return type:

ServerMachine

Returns:

The restored GlassFish server machine.

load_balancer(name)

Restore a GlassFish load balancer machine.

Parameters:name (str) – Name of the machine.
Return type:AJP13LoadBalancerMachine
Returns:The restored GlassFish load balancer machine.
class Machine

Machine for GlassFish environment.

host

Host of this machine.

Return type:str
ping_cmd()

Create a suitable command for ensuring this machine is accessible.

Return type:str
Returns:The suitable command.
class ServerMachine

Bases: Machine

GlassFish server machine.

appserver_user

Application server user name.

Return type:str
Returns:The application server user name.
appserver_public_key_path

Public key file path of application server user.

Return type:str
Returns:The public key file path.
password_file_path(pwd_id)

Path relative to asadmin command working directory of an already created password file identified by the given identifier.

Parameters:pwd_id – The identifier used by this machine to identify the password file.
Return type:str
Returns:The path of the password file.
asadmin_cmd(asadmin_args)

Create a suitable asadmin command for this machine with the given arguments.

Parameters:asadmin_args (list) – asadmin utility arguments.
Return type:str
Returns:The suitable command.
create_password_file_cmd(pwd_id, passwords)

Create a suitable command for creating a password file for asadmin utility.

Parameters:
  • pwd_id – The identifier used by this machine to identify the password file. It should be generated by the caller.
  • passwords (dict) – A dictionary with asadmin known key passwords.
Return type:

str

Returns:

The suitable command.

delete_password_file_cmd(pwd_id)

Create a suitable command for deleting a previous created password file.

Parameters:pwd_id – The identifier used by this machine to identify the password file.
Return type:str
Returns:The suitable command.
install_master_password_cmd(domain_name, node_name, node_host)

Create a suitable command for copying the saved master password of the domain with the given name to the specified node with the given name and host.

Parameters:
  • domain_name (str) – Name of the source domain.
  • node_name (str) – Name of the target node.
  • node_host (str) – Host of the target node.
Return type:

str

Returns:

The suitable command.

class AJP13LoadBalancerMachine

Bases: Machine

AJP/1.3 load balancer machine.

web_user

Web user name.

Return type:str
add_instance_cmd(name, host, port)

Create a suitable command for adding an instance to this load balancer.

Parameters:
  • name (str) – Instance name.
  • host (str) – Instance host.
  • port (str) – Instance port.
Return type:

str

Returns:

The suitable command.

remove_instance_cmd(name)

Create a suitable command for removing an instance from this load balancer.

Parameters:name (str) – Instance name.
Return type:str
Returns:The suitable command.