1# Copyright (c) 2018 Cisco and/or its affiliates. 2# 3# This file is part of Ansible 4# 5# Ansible is free software: you can redistribute it and/or modify 6# it under the terms of the GNU General Public License as published by 7# the Free Software Foundation, either version 3 of the License, or 8# (at your option) any later version. 9# 10# Ansible is distributed in the hope that it will be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# GNU General Public License for more details. 14# 15# You should have received a copy of the GNU General Public License 16# along with Ansible. If not, see <http://www.gnu.org/licenses/>. 17# 18 19from ansible.module_utils.network.ftd.configuration import ParamName, PATH_PARAMS_FOR_DEFAULT_OBJ 20 21 22class FtdOperations: 23 """ 24 Utility class for common operation names 25 """ 26 GET_SYSTEM_INFO = 'getSystemInformation' 27 GET_MANAGEMENT_IP_LIST = 'getManagementIPList' 28 GET_DNS_SETTING_LIST = 'getDeviceDNSSettingsList' 29 GET_DNS_SERVER_GROUP = 'getDNSServerGroup' 30 31 32def get_system_info(resource): 33 """ 34 Executes `getSystemInformation` operation and returns information about the system. 35 36 :param resource: a BaseConfigurationResource object to connect to the device 37 :return: a dictionary with system information about the device and its software 38 """ 39 path_params = {ParamName.PATH_PARAMS: PATH_PARAMS_FOR_DEFAULT_OBJ} 40 system_info = resource.execute_operation(FtdOperations.GET_SYSTEM_INFO, path_params) 41 return system_info 42