API Documentation

class galileo.api.API(ctrl_addr, ctrl_port, ctrl_cert)[source]

A Galileo API class.

__init__(ctrl_addr, ctrl_port, ctrl_cert)[source]

Initializes Galileo object.

Parameters
  • ctrl_addr – host address (e.g. ‘https://localhost’)

  • ctrl_port – port of the host address (e.g. ‘5000’)

  • ctrl_cert – name of the certificate file (e.g. ‘galileod.crt’)

authenticate()[source]

Authenticate tokens and introduce your user profile to the Galileo network.

Returns

response of POST request after authenticating tokens

backend()[source]

Gets name of the backend server currently being used.

Returns

name of the server

create_socket_client()[source]

Create new socket client, connect to the server, and emit a partial event.

Returns

None

disconnect()[source]

Disconnect from socket client.

Returns

None

get_tokens(username, password)[source]

Get tokens for authentication.

Parameters
  • username – username

  • password – password

Returns

None

group_creation(name, desc, invitees)[source]

Create a new group.

Parameters
  • name – name of group

  • desc – description of group

  • invitees – users that are invited into the group

Returns

None

group_destruction(group_id)[source]

Destroy your existing group.

Parameters

group_id – the ID of group that you want to destroy

Returns

None

group_expulsion(group_id, username)[source]

Remove a user from a group you administer.

Parameters
  • group_id – group ID string

  • username – user you want to remove

Returns

None

group_invite(group_id, user_id)[source]

Invite a user to a group that you administer.

Parameters
  • group_id – group ID string

  • user_id – user that you want to add to the group

Returns

None

group_invite_response(group_id, response)[source]

Response to an invitation to a group.

Parameters
  • group_id – group ID string

  • response – a string that can either be “accept” or “reject”

Returns

None

group_invites_recvd()[source]

Get all group invitations the user has received.

Returns

an object describing all group invitations the user has received

group_invites_sent(group_id)[source]

Get all group invitations the user has sent out for a single group.

Parameters

group_id – the group ID string

Returns

an object describing all the group invitations

group_machine_addition(group_id, machine_id)[source]

Add a machine to a group.

Parameters
  • group_id – group ID string

  • machine_id – ID string of the machine you want to add to the group

Returns

None

group_machine_removal(group_id, machine_id)[source]

Remove a machine from a group.

Parameters
  • group_id – group ID string

  • machine_id – ID string of the machine you want to remove from the group

Returns

None

group_request(group_id)[source]

Send a request for permission to land to all machines in a group you are a part of.

Parameters

group_id – ID of the group

Returns

None

group_request_response(group_id, username, response)[source]

Respond to a permission to land request from a group.

Parameters
  • group_id – group ID string

  • username – username of the user who requested to land

  • response – a string that can either be “accept” or “reject”

Returns

None

group_requests_recvd(group_id)[source]

Get all groups requests the user has received.

Returns

an object describing all group requests the user has received

group_requests_sent()[source]

Get all groups requests the user has sent.

Returns

an object describing all group requests the user has sent

group_withdrawal(group_id)[source]

Leave a group you are a part of.

Parameters

group_id – ID of the group you want to leave

Returns

None

groups()[source]

Get all groups the user belongs in and related information about the groups.

Returns

an object describing all the groups that the user is in

job_download(job_id, results_path)[source]

Download the results of a launched job that has completed

Parameters
  • job_id – Job ID string

  • results_path – A file system path to store the results in

Returns

None

job_hide(job_id)[source]

Hide the current received and sent job list.

Parameters

job_id – job ID string

Returns

None

job_logs(job_id)[source]

Get the current stdout of a job

Parameters

job_id – job ID string

Returns

None

job_pause(job_id)[source]

Pause a running job.

Parameters

job_id – job ID string

Returns

None

job_start(job_id)[source]

Start a job.

Parameters

job_id – job ID string

Returns

None

job_stop(job_id)[source]

Stop a running job.

Parameters

job_id – job ID string

Returns

None

job_submit(path, landing_zone_id)[source]

Submit a job to a machine.

Parameters
  • path – path of the job you want to send

  • landing_zone_id – machine ID string you want the job to run on

Returns

None

job_top(job_id)[source]

Get process status à la ‘docker top’

Parameters

job_id – job ID string

Returns

None

landing_zones()[source]

Machines that you can land a job on.

Returns

an object of machines you can land on

launch_pads()[source]

Users that have permission to land on the current machine.

Returns

an object of users that can land on your machine

local_machine()[source]

Get information about your machine.

Returns

an object with information about your machine

login(username, password)[source]

Login.

Parameters
  • username – username

  • password – password

Returns

None

machines()[source]

Get all machines on the network.

Returns

an object of all machines on the network.

new_access_token()[source]

Get new tokens for authentication.

Returns

response after POST request to refreshing tokens

p2l_invite(launch_pad_id)[source]

Send an invite to another user to land on the machine you sent the invite from.

Parameters

launch_pad_id – username

Returns

None

p2l_invite_response(landing_zone_id, response)[source]

Respond to an invite to land on someone else’s machine.

Parameters
  • landing_zone_id – machine’s ID string

  • response – a string that can be either “accept” or “reject”

Returns

None

p2l_invite_withdrawal(launch_pad_id)[source]

Revoke an invitation to land from a user.

Parameters

launch_pad_id – username

Returns

None

p2l_invites_recvd()[source]

Get all permission to land invitations you have received.

Returns

an object of all invitations you have sent

p2l_invites_sent()[source]

Get all permission to land invitations you have sent.

Returns

an object of all invitations you have sent

p2l_request(landing_zone_id)[source]

Send a permission to land request to a machine.

Parameters

landing_zone_id – machine’s ID string

Returns

None

p2l_request_response(launch_pad_id, response)[source]

The response to a permission to land request.

Parameters
  • launch_pad_id – username

  • response – a string that can be either “accept” or “reject”

Returns

None

p2l_request_withdrawal(landing_zone_id)[source]

Withdraw a permission to land request to a machine that the user had already sent.

Parameters

landing_zone_id – machine’s ID string

Returns

None

p2l_requests_recvd()[source]

Get all permission to land requests you have received.

Returns

an object of all requests you have received.

p2l_requests_sent()[source]

Get all permission to land requests you have sent.

Returns

an object of all requests you have sent

p2l_resignation(landing_zone_id)[source]

Resign from landing on a person’s machine.

Parameters

landing_zone_id – machine’s ID string

Returns

None

p2l_revocation(launch_pad_id)[source]

Revoke a user’s right to land on your machine.

Parameters

launch_pad_id – username

Returns

None

pid()[source]

Get process ID of Galileo daemon.

Returns

process ID

received_jobs()[source]

Get all the jobs you have received.

Returns

an object describing all the jobs you have received

recvdjob(job_id)[source]

Get a job the user had received.

Parameters

job_id – the job ID string

Returns

an object describing related information of job

register()[source]

Register machine to Galileo network to bring your machine online. :return: response of the POST request after registering

send_log(path=None)[source]

Send logs to the specified path.

Parameters

path – path where logs will be kept

Returns

sent_jobs()[source]

Get all the jobs that you have sent.

Returns

an object describing all the jobs you have sent

sentjob(job_id)[source]

Get a job the user had sent.

Parameters

job_id – the job ID string

Returns

an object describing related information of job

share_folder(path)[source]

Initializes a path to a folder so that the files in the folder do not get copied over to the landing zone.

Parameters

path – path to a non-local source

Returns

None

shutdown()[source]

Close the Galileo daemon.

Returns

None

exception galileo.api.AuthorizationError(code, msg)[source]
exception galileo.api.GalileoError(code, msg)[source]
__init__(code, msg)[source]

Initialize self. See help(type(self)) for accurate signature.

exception galileo.api.LoginError(code, msg)[source]
exception galileo.api.RegistrationError(code, msg)[source]