summaryrefslogtreecommitdiffstats
path: root/mof/LMI_Software.mof
blob: fd241502f3c682e3022197b0cce0980242264028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
/*
 * 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 <miminar@redhat.com>
 */

#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;

};