Configuration Dataservice
Configuration Dataservice
The Configuration Dataservice is an essential component of the Zowe™ Application Framework, which acts as a JSON resource storage service, and is accessible externally by REST API and internally to the server by dataservices.
The Configuration Dataservice allows for saving preferences of applications, management of defaults and privileges within a Zowe ecosystem, and bootstrapping configuration of the server's dataservices.
The fundamental element of extensibility of the Zowe Application Framework is a plug-in. The Configuration Dataservice works with data for plug-ins. Every resource that is stored in the Configuration Service is stored for a particular plug-in, and valid resources to be accessed are determined by the definition of each plug-in in how it uses the Configuration Dataservice.
The behavior of the Configuration Dataservice is dependent upon the Resource structure for a plug-in. Each plug-in lists the valid resources, and the administrators can set permissions for the users who can view or modify these resources.
- Resource Scope
- REST API
- App API
- Internal and Bootstrapping
- Packaging Defaults
- Plugin Definition
- Aggregation Policies
- Examples
Resource Scope
Data is stored within the Configuration Dataservice according to the selected Scope. The intent of Scope within the Dataservice is to facilitate company-wide administration and privilege management of Zowe data.
When a user requests a resource, the resource that is retrieved is an override or an aggregation of the broader scopes that encompass the Scope from which they are viewing the data.
When a user stores a resource, the resource is stored within a Scope but only if the user has access privilege to update within that Scope.
Scope is one of the following:
Plugin
Configuration defaults that come with a plugin. Cannot be modified.
Product
Configuration defaults that come with the product. Cannot be modified.
Site
Data that can be used between multiple instances of the Zowe Application Server.
Instance
Data within an individual Zowe Application Server.
Group
Data that is shared between multiple users in a group.(Pending)
User
Data for an individual user.(Pending)
Note: While Authorization tuning can allow for settings such as GET from Instance to work without login, User and Group scope queries will be rejected if not logged in due to the requirement to pull resources from a specific user. Because of this, User and Group scopes will not be functional until the Security Framework is merged into the mainline.
Where Plugin is the broadest scope and User is the narrowest scope.
When you specify Scope User, the service manages configuration for your particular username, using the authentication of the session. This way, the User scope is always mapped to your current username.
Consider a case where a user wants to access preferences for their text editor. One way they could do this is to use the REST API to retrieve the settings resource from the Instance scope.
The Instance scope might contain editor defaults set by the administrator. But, if there are no defaults in Instance, then the data in Group and User would be checked.
Therefore, the data the user receives would be no broader than what is stored in the Instance scope, but might have only been the settings they saved within their own User scope (if the broader scopes do not have data for the resource).
Later, the user might want to save changes, and they try to save them in the Instance scope. Most likely, this action will be rejected because of the preferences set by the administrator to disallow changes to the Instance scope by ordinary users.
REST API
When you reach the Configuration Service through a REST API, HTTP methods are used to perform the desired operation.
The HTTP URL scheme for the configuration dataservice is:
<Server>/plugins/com.rs.configjs/services/data/<plugin ID>/<Scope>/<resource>/<optional subresources>?<query>
Where the resources are one or more levels deep, using as many layers of subresources as needed.
Think of a resource as a collection of elements, or a directory. To access a single element, you must use the query parameter "name="
REST query parameters
Name (string)
Get or put a single element rather than a collection.
Recursive (boolean)
When performing a DELETE, specifies whether to delete subresources too.
Listing (boolean)
When performing a GET against a resource with content subresources, listing=true
will provide the names of the subresources rather than both the names and contents.
REST HTTP methods
Below is an explanation of each type of REST call.
Each API call includes an example request and response against a hypothetical application called the "code editor".