lib/YuiRestClient/Http/WidgetController.pm

NAME

YuiRestClient::Http::WidgetController - Class to communicate with the REST server

COPYRIGHT

Copyright 2020 SUSE LLC

SPDX-License-Identifier: FSFAP

AUTHORS

QE Yam <qe-yam at suse de>

SYNOPSIS

return $self->{widget_controller}->find($self->{filter}->get_filter());
$self->{widget_controller}->send_action($params);

DESCRIPTION

Overview

A class that provides a controller to retrieve widgets from the REST server or send actions to the server.

Class and object methods

Class attributes:

{api_version} - The version of the YUI Rest API
{host} - The hostname or IP of the REST server
{port} - The port of the REST server
{timeout} - The timeout for communication with the server
{interval} - Interval time to try to reach the server

Class methods:

new($args) - create a new WidgetController instance

Arguments in $args use the same names as the class attributes described above.

set_timeout($timeout) - change timeout setting

Allows adjustments of timeout settings after the instance is created.

set_interval($interval - change interval time

Allows adjustments to the interval time after the instance is created.

set_host() - change host name or IP address

Allows adjustments to the host parameter after the instance is created.

set_port() - changes the port

Allows adjustments to the port number after the instance is created.

find($args) - retrieve JSON data for UI widget

The widget is defined by $args. Args is a hash that identifies a widget. The JSON data is retrieved using http_get() from Http::HttpClient.

send_action($args) - sends action to an UI widget

The widget is defined by $args. Args is a hash that identifies the widget. The action is submitted to the server by using http_post() from Http::HttpClient.