Skip to content

octoprint.cli.client#

client_options = bulk_options([click.option('--apikey', '-a', type=click.STRING), click.option('--host', '-h', type=click.STRING), click.option('--port', '-p', type=click.INT), click.option('--httpuser', type=click.STRING), click.option('--httppass', type=click.STRING), click.option('--https', is_flag=True), click.option('--prefix', type=click.STRING)]) module-attribute #

Common options to configure an API client.

cli(ctx, apikey, host, port, httpuser, httppass, https, prefix) #

Basic API client.

command(ctx, path, command, str_params, int_params, float_params, bool_params, timeout) #

Sends a JSON command to the specified server path.

delete(ctx, path, timeout) #

Sends a DELETE request to the specified server path.

get(ctx, path, timeout) #

Performs a GET request against the specified server path.

patch_json(ctx, path, data, timeout) #

PATCHes JSON data to the specified server path.

post_from_file(ctx, path, file_path, json_flag, yaml_flag, timeout) #

POSTs JSON data to the specified server path, taking the data from the specified file.

post_json(ctx, path, data, timeout) #

POSTs JSON data to the specified server path.

upload(ctx, path, file_path, params, file_name, content_type, timeout) #

Uploads the specified file to the specified server path.