Expanding the Pegasus Provider Interface Proposal

Mike Brasher, Karl Schopmeyer, Chip Vincent 22 May 2001

Introduction

We defined a set of interfaces for Pegasus providers based on the CIM Operations. We recognized several limitations in that first set of interfaces, particularly the fact that there was no easy path back to the CIMOM from the provider. The initial interfaces provides a handle to get to the repository but not to put CIM operations back into the CIMOM. At a recent work group meeting, IBM proposed a further set of changes to provide a more consistent interface and to reduce the possibility that the interface will have to change with future changes to the CIM Operations.

This document is a proposal to make these changes.

Objectives

  1. Extend for the next set of functionality primarily indications.
  2. Provide more information to the provider
  3. Enable providers to perform varying levels of operation (dump and smart providers).
  4. Support implementation specific objects.
  5. Isolate the API from changes to the CIM standard and implementation specific objects.
  6. Prepare for the implementation of standardized provider registration

Summary of Proposed Changes

We propose the following changes: 
  1. Create an operational context for each transaction. This context would allow us to pass information such as security and locale to the provider. In addition, we have considered that this interface could also make the target CIM class available to the provider so it would not have to be specifically requested.
  2. Modify the boolean parameters passed so they get passed in a single variable. Today several of the CIM Operations include boolean parameters. While we are not sure these will change, any change would cause a signature change to the provider
  3. Simplify and unify the object identity parameters. - Today the object ID is passed as a set of parameters, Namespace, Class/instance ID. This could easily be consolidated into a single CIMReference parameter so that the namespace, object ID, etc. could be broken out by the provider. WHY?
  4. Subdivide the Provider interface. - Today we have a single interface to the provider that allows the provider to implement all of the possible CIM operations. First, it is not clear that the provider needs all of the operations. Second, there are subsets of provider functionality (method providers, property providers, etc.) that only implement a subset of the CIM Operations. The proposal is to create specific interfaces to support just these subsets.
  5. Add a provider operation to shutdown a provider. We will have to provide a more organized shutdown than is provided today. One of the operations will be to shutdown the providers. To do this in an organized manner we will need to communicate the shutdown command to the providers.
  6. Add the indication interfaces. - We are beginning to do the design for indications now. One of the interfaces will be the provider interface for moving indications from the provider to the Object Manager.

Definition of the Proposed Changes

This section defines the proposed implementation for each of these changes.

Context for each Provider and for each Operation

Operations do not currently support parameters to describe context information (such as security or localization parameters). In addition, there will be additional requirements for the provider to request information for things like system parameters, system state information, etc.

As part of this we also want to create a handle so that CIM Operations can be effecitively passed from the provider back to the Object Manager.

 

We propose modifying both the provider context and adding an operational context parameter.  

 

Provider Context

Today - one parameter, the CIM Repository handle provided with the initialize as follows:

virtual void initialize(CIMRepository& repository);
The provider saves the repository handle for later access using the CIMRepository interface. We don't want providers to have access to the repository but we do want them to have easy access back to the Object Manager with CIM Operations.

We could provide access to the Object Manager delegator except that this would bypass any security features that we would want to implement.  We propose adding a new interface which will provide:

Operation Context

Introduce OperationContext which communicates context information to operation methods and allows implementation specific context information to be passed to providers.
OperationContext encapsulates
Locale information
User credentials
Implementation TBD

CIMInstance MyProvider::getInstance(..., const OperationContext & context, ...)
{
    // ...
    // get locale from operation context
    // ...
    // get user credentials from operation context
    // ...
    return(CIMInstance(instance));
}

Boolean Parameters

Operations currently use multiple arguments to represent additional information (Boolean localOnly, Boolean includeQualifiers, Boolean includeClassOrigin, etc.) Replace optional request parameters with a 32 bit unsigned integer flags parameter.
struct OperationFlag
{
    const static Uint32 localOnly = 0x00000001;
    const static Uint32 includeQualifiers = 0x00000002;
    const static Uint32 includeClassOrigin = 0x00000004;
    const static Uint32 deepInheritance = 0x00000008;
};
The following is an example of the use of the compacted binary parameter.
CIMInstance MyProvider::getInstance(..., const Uint32 flags, ...)
{
    // . . .
    Boolean localOnly = false;
	    CIMInstance instance;
    if(flags & OperationFlag::localOnly) 
    {  // get only local properties
	// . . .
    }
	return(CIMInstance(instance));
}

Simplify Object Identity Parameters

Operations currently use two arguments to identify objects.
  1. const String& namespace, String& className for class oriented operations (e.g., getClass() and enumerateInstances()).
  2. const String& namespace, const CIMReference& instance in instance oriented operations (e.g., getInstance and enumInstances()).
Use CIMReference which encapsulates namespace, class name, and key bindings (for instance references) and isolates operation methods from changes in object identification (such as the addition of namespace type).
CIMInstance MyProvider::getInstance(const CIMReference & ref, …)
{
    // get the namespace path (e.g., "root" or "root//sample"
    String namespacePath = ref.getNamespace();

    // get the class name
    String className = ref.getModel().getClassName();

    // get the instance keys
    Array keySet = ref.getKeyBindings();

	if(keySet().getSize() == 0)
	{
      	    // throw exception
	}
	CIMInstance instance;

	// ...
	
	return(CIMInstance(instance));
}
Actually, this largely exists today. We are supplying the CIMReference including the namespacepath component normally
and the remainder of the CIMReference is part of the defined paths today. However, it requires changing the type for
the paths throughout the model Thus
virtual CIMClass getClass(
	const String& nameSpace,
	const String& className,
	Boolean localOnly = true,
	Boolean includeQualifiers = true,
	Boolean includeClassOrigin = false,
	const Array& propertyList = EmptyStringArray());
would become
virtual CIMClass getClass(
	const CIMReference& className,
	Boolean localOnly = true,
	Boolean includeQualifiers = true,
	Boolean includeClassOrigin = false,
	const Array& propertyList = EmptyStringArray());
To accomplish this:
  1. All provider operations would change to drop the nameSpace parameter.
  2. Those classes that provide className as a string would change to provide it and the namespace as CIMReference (this is the following class operations. At the same time, it is not certain that we need the class interfaces for the provider. We have no plans to implement a class provider at this point because we have not seen the requirement.
  3. Most instance operations remaine the same except that the namespace parameter would be removed. Thus, getInstance which today is:
        virtual CIMInstance getInstance(
    	    const String& nameSpace,
    	    const CIMReference& instanceName,
    	    Boolean localOnly = true,
    	    Boolean includeQualifiers = false,
    	    Boolean includeClassOrigin = false,
    	    const Array& propertyList = EmptyStringArray());
        
    Becomes:
        virtual CIMInstance getInstance(
    
    	    const CIMReference& instanceName,
    	    Boolean localOnly = true,
    	    Boolean includeQualifiers = false,
    	    Boolean includeClassOrigin = false,
    	    const Array& propertyList = EmptyStringArray());
        
    The following instance functions can be modified this way:
  4. The qualifier functions probably do not need to be implemented in any case. It is not clear that we need class qualifier modification tools in the provider.
  5. The functions that will be different are those operations tha move entire clases or instances as part of the operation. This includes Today, for example, the modifyInstance is as follows:
    	virtual void modifyInstance(
    	    const String& nameSpace,
    	    CIMInstance& modifiedInstance);
        
    Could become:
        TBD
        
  6. Association operation - These functions represent minimal change since they use CIMReference today. For example:
    virtual Array referenceNames(
    	const String& nameSpace,
    	const CIMReference& objectName,
    	const String& resultClass = String::EMPTY,
    	const String& role = String::EMPTY);
    
    Would be modified simply be modified by removing the nameSpace parameter.
  7. Exec Query - The execQuery is a special case since the parameter set for this is unique.
        virtual Array execQuery(
    	    const String& queryLanguage,
    	    const String& query) ;
        
    There is no reason to change this functional interface.

Subdivide Provider Interface

TBD

Terminate Provider Operation

This one is simple. The method name is:
    Terminate();
    
It will be issued by the Object Manager to all active providers in the process of Object Manager shutdown. This means that ALL providers must implement this interface just as they must implement the Initialize() interface today. Normally the requirement on the provider would be to stop any continuous operations that are in process and then return a response. At this point we have not proposed any special requirements such as timers for shutdown,etc.

Indication Interface

We will discuss this as part of another document on indication implementation.