In an SMS system, a primary site's site database stores the inventory and configuration information for itself and the sites below it in the site hierarchy. Using the SMS API, your application can access the information in a site database.
The SMS API enables your application to retrieve, add, and remove data in the SMS database. Using the SMS API, you can access the following objects in an SMS database:
The SMS API represents all SMS objects in terms of containers, folders, and scalars. This paradigm provides a standard interface to all types of objects.
Containers hold objects of a specific type. For example, the C_SITE container can contain sites.
Within a container, the instance of an object is represented as a folder. For example, a C_SITE container can contain a set of folders that represent the current site (the site whose SMS database your application is accessing) or sites below the current site in the site hierarchy.
A folder contains scalars, subfolders, or both. A scalar is the value stored for an attribute of a folder. In addition to a value, each scalar also contains a name, a data type, and an access mode. For example, the folder for a site contains scalars for site name, parent site, depth, status, and site type. The folder for a specific site would have a specific value for each scalar. For example, the folder for the TIM site could contain the string "Tim World" for site name.
Note that an inventory rules folder (which can be a subfolder within a package folder) contains a single scalar along with one or more tokens that represent the set of files used to identify a package.
Because some objects themselves can contain multiple components, a folder can also contain subfolders. For example, a site folder can contain subfolders for the domains in the site and any subsites below that site in the site hierarchy.
To access objects in the site database, you must open a container for the type of object you need to access. When you first open a container, it contains no folders. To retrieve objects from the site database, you must populate the container with objects from a site database. The objects are represented as folders in the container. After the container has been populated, you can access the folders and their properties.
Filters can also be set on a container. Filters define the criteria used to select the objects you want to find. If no filter is set for a container, all objects (that is, all objects of the type supported by the container) are returned when the container is populated. There are eight types of filters available. The types of filters that you can set are dependent on the container. For example, filters of type ARCHITECTURE_FILTER, MACHINE_FILTER, GROUP_FILTER, and ATTRIBUTE_FILTER can be set on a machine container.
Your application can configure a filter by adding tokens to the filter. A token lets you specify a condition used to select the objects you want to find. Within a filter, tokens can be connected together using AND or OR operators. For example, a token can be added to the ARCHITECTURE_FILTER of a machine container to find objects that have the Personal Computer architecture.
Note that inventory rules folders use tokens in the same way that filters do—except that each token contains the file name and file attributes used to identify a file.
In addition, filters of type MACHINE_FILTER can be added to the site database by using a filter container. MACHINE_FILTER filters are added as queries in the site database. Your application can also retrieve queries stored in the site database by opening a filter container. When the filter container is opened, it is populated with the queries stored in the site database. These queries are represented as persistent filters in the filter container. Currently, the SMS API does not support deletion of persistent filters from the site database.
The following list shows the hierarchy of the containers and folders supported by the SMS API. Click an item to display details about the object.
Program Item folder (Read/Create/Delete)
Inventory Rules folder (Read/Create/Delete)
Share Package On Server job folder (Read/Create/Delete)
Remove Package From Server job folder (Read/Create/Delete)
System job folder (Read-only)
The folders within the site, site group, machine, and machine group containers are read-only. MIF files are used to maintain (create, update, and delete) the machine objects. For more information about MIF files, see Extending the Inventory. The site and domain objects are maintained by the SMS system. Site groups and machine groups can be created, modified, and deleted by using the SMS Administrator.
The package and job containers allow read, create, and delete operations. For example, you can use the SMS API to view the existing packages and jobs within an SMS database, as well as to create new packages and jobs.
The functions in the SMS API behave in a uniform manner: