/* * Copyright (C) 2012 Red Hat, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: Michal Minar */ #pragma locale ("en_US") //#pragma namespace ("root/cimv2") [ Description ( "RPM package installed on particular computer system with" " YUM (The Yellowdog Updated, Modified) package manager.") ] class LMI_SoftwarePackage : CIM_SoftwareElement { [ Description ( "The release number (referred to in some older documentation as a" " \"vepoch\") is how the maintainer marks build revisions, starting" " from 1. When a minor change (spec file changed, patch added/removed)" " occurs, or a package is rebuilt to use newer headers or libraries," " the release number should be incremented. If a major change" " (new version of the software being packaged) occurs, the version" " number should be changed to reflect the new software version," " and the release number should be reset to 1.") ] string Release; [ Description ( "It is important to be careful with the version of post-release" " scheme, to ensure that package ordering is correct. It may be" " necessary to use Epoch to ensure that the current package is" " considered newer than the previous package.") ] uint16 Epoch; [ Description ( "Architecture name, that package is compiled for. In case of no" "architecture dependency, this will contain \"noarch\".") ] string Architecture; [ Description ( "A software license is a legal instrument (usually by way of contract" " law) governing the usage or redistribution of software." " All software is copyright protected, except material in the public" " domain. Contractual confidentiality is another way of protecting" " software. A typical software license grants an end-user permission" " to use one or more copies of software in ways where such a use would" " otherwise potentially constitute copyright infringement of the" " software owner's exclusive rights under copyright law. List of" " possible values is based on list of licences approved by the" " Free Software Foundation and OSI. The string is obtained from RPM" " package." ) ] string License; [ Description ( "Denotes the package group, in which the package belongs.") ] string Group; [ Description ( "Size of RPM package in Bytes" ) ] uint64 Size; [ Description ( "Will install available package."), ValueMap { "0", "1", "2" }, Values { "Already installed", "Successful installation", "Failed" } ] uint32 Install( [ IN(false), OUT, Description ( "The reference to newly installed package, if installation was" " successful. Reference to current package if it is already" " installed and Null otherwise.") ] LMI_SoftwareInstalledPackage REF Installed); [ Description ( "Will uninstall installed package."), ValueMap { "0", "1", "2" }, Values { "Not installed", "Successful removal", "Failed" } ] uint32 Remove(); }; [ Description ( "Identifies a file contained by RPM package. It's located" " in directory identified in FileName. The Invoke methods" " check for file existence and whether its attributes match" " those given by RPM package.") ] class LMI_SoftwareFileCheck : CIM_FileSpecification { [ Key, Description ( "Absolute path of file being checked.") ] string Name; [ Description ( "Composition of RPM's name and absolute file path." " It's format is \"rpm_name#path\"") ] string CheckID; [ Override("SoftwareElementID"), Description ( "RPM's nevra. This means: " "\"name-[epoch:]version-release.architecture\"." " If epoch part is missing, a \"0:\" is assumed." ) ] string SoftwareElementID; [ Override("Version"), Description ( "Version of packaged software as listed by RPM package.") ] string Version; [ Description ( "True, if file is present in file system.")] boolean FileExists; [ Override("FileSize"), Description("Size of installed file in Bytes.") ] uint64 FileSize; [ Units("KiloBytes"), Description("File size in Bytes from RPM database.") ] uint64 ExpectedFileSize; [ Description("File mode of installed file as a number.") ] uint32 FileMode; [ Description("File mode as a number given by RPM database.") ] uint32 ExpectedFileMode; [ Description ( "File mode of installed file as an array of permissions." " Each value represents a bit position in file mode."), ValueMap { "0", "1", "2" //XWR Other , "3", "4", "5" //XWR Group , "6", "7", "8" //XWR User , "9","10","11" //Sticky, SGID, SUID }, Values { "Execute Other", "Write Other", "Read Other" , "Execute Group", "Write Group", "Read Group" , "Execute User" , "Write User" , "Read User" , "Sticky", "SGID", "SUID" } ] uint8 FileModeFlags[]; [ Description ( "File mode as an array of permissions of file from RPM database." " Each value represents a bit position in file mode."), ValueMap { "0", "1", "2" //XWR Other , "3", "4", "5" //XWR Group , "6", "7", "8" //XWR User , "9","10","11" //Sticky, SGID, SUID }, Values { "Execute Other", "Write Other", "Read Other" , "Execute Group", "Write Group", "Read Group" , "Execute User" , "Write User" , "Read User" , "Sticky", "SGID", "SUID" } ] uint8 ExpectedFileModeFlags[]; [ Override("MD5Checksum"), Description("MD5 checksum of installed file.") ] string MD5Checksum; [ Description("Checksum of installed file." " Hash algorithm used can be obtained with ChecksumType property.") ] string FileChecksum; [ Description("Checksum of file from RPM database." " Hash algorithm used can be obtained with ChecksumType property.") ] string ExpectedFileChecksum; [ Description("Number of hash algorithm according to RFC4880." " This algorithm is used for making checksums of RPM files and" " packages. This algorithm is same for the whole RPM database."), ValueMap { "0", "1", "2", "3" , "8", "9","10","11" }, Values { "UNKNOWN", "MD5", "SHA-1", "RIPE-MD/160" , "SHA256", "SHA384", "SHA512", "SHA224" } ] uint16 FileChecksumType; [ Description("User ID of installed file.") ] uint32 FileUserID; [ Description("User ID of file from RPM database.") ] uint32 ExpectedFileUserID; [ Description("Group ID of installed file.") ] uint32 FileGroupID; [ Description("Group ID of file from RPM database.") ] uint32 ExpectedFileGroupID; [ Description("Time of last modification of installed file as number a" " of secodns since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).") ] uint64 LastModificationTime; [ Description("Time of last modification of file from RPM database as" " a number of secodns since the Epoch," " 1970-01-01 00:00:00 +0000 (UTC).") ] uint64 ExpectedLastModificationTime; [ Description("Target destination of symbolic link as returned by" " readline. If file is not a symbolic link, NULL is returned.") ] string LinkTarget; [ Description("Target destination of symbolic link from RPM database" " as returned by readline. If file is not a symbolic link," " NULL is returned.") ] string ExpectedLinkTarget; [ Description("File type."), ValueMap { "0", "1", "2", "3" , "4", "5", "6" }, Values { "Unknown", "File", "Directory", "Symlink" , "FIFO", "Character Device", "Block Device" } ] uint16 FileType; [ Description("File type of file in RPM database."), ValueMap { "0", "1", "2", "3" , "4", "5", "6" }, Values { "Unknown", "File", "Directory", "Symlink" , "FIFO", "Character Device", "Block Device" } ] uint16 ExpectedFileType; [ Description ( "Returns array of booleans for verification checks. Each value" " is either true or false, whether file passed the check or not." " True is present also if the check does not apply to the file" " (file implicitly passes the check, if check can not be" " performed)." " PassedFlagsDescriptions returns a description for each field in" " this array saying, what it means.") ] boolean PassedFlags[]; [ Description ( "Returns array of descriptions of checks corresponding to PassedFlags" " array.")] string PassedFlagsDescriptions[]; }; // =================================================================== // Associations // =================================================================== [ Association ] class LMI_SoftwareInstalledPackage : CIM_InstalledSoftwareElement { [ Override("Software"), Weak, Description ( "Reference to the installed RPM package.")] LMI_SoftwarePackage REF Software; [ Override("System"), Min(1), Description ( "Reference to the ComputerSystem hosting a particular" " RPM package.")] CIM_ComputerSystem REF System; [ Description ( "Updates the package to latest version." " When any of \"epoch\", \"version\" or \"release\" argument is given" ", install only matching available package. Otherwise try" " to update to newest package available." " If the \"epoch\", \"version\" and \"release\" of package is" " already installed, or no newer package is available," " \"Already newest\" value is returned."), ValueMap { "0", "1", "2" }, Values { "Already newest", "Successful installation", "Failed" } ] uint16 Update( [ IN(true), Description ( "Specify particular epoch of package to update to." " Update to newest, when empty.") ] string Epoch, [ IN(true), Description ( "Specify particular version of package to update to." " Update to newest, when empty") ] string Version, [ IN(true), Description ( "Specify particular release of package to update to." " Update to newest, when empty.") ] string Release, [ IN(false), OUT, Description ( "The reference to newly installed package, if installation was" " successful. Otherwise reference to current package.") ] LMI_SoftwareInstalledPackage REF Installed); [ Description ( "Verify existence and attributes of files installed from" " RPM package. If all files installed exist and their attributes" " matches, method returns \"Pass\". \"Not passed\" is returned when" " arbitrary file differs in its attributes. And \"Error\" if" " verification could not be done."), ValueMap { "0", "1", "2" }, Values { "Pass", "Not passed", "Error" } ] uint32 CheckIntegrity( [ IN(false), OUT, Description ( "Array of references to LMI_SoftwareFileCheck, that did not pass" " verification.") ] LMI_SoftwareFileCheck REF Failed[]); }; [ Association, Aggregation ] class LMI_SoftwarePackageChecks : CIM_SoftwareElementChecks { [ Override("Element"), Description("The RPM package being checked") ] LMI_SoftwarePackage REF Element; [ Override("Check"), Description("The Check for the element.") ] LMI_SoftwareFileCheck REF Check; };