Persist user or application data
You can use this operation to persist data to be used by a specific user or application.
HTTP method and URI path
PUT /zosmf/IzuUICommon/persistence/user/<pluginId>/<taskId>/<resourcePath>
PUT /zosmf/IzuUICommon/persistence/app/<pluginId>/<taskId>/<resourcePath>
- zosmf/IzuUICommon/persistence identifies the data persistence services.
- user indicates that the service will persist the data only for the user who is logged into z/OSMF when the service is invoked.
- app indicates that the service will persist the data globally for the application.
- <pluginId> is the unique identifier you assigned to the plug-in.
- <taskId> is the unique identifier you assigned to the task.
- <resourcePath> is the path in the JSON object to the
attribute where you want the data to be stored. The persisted data
is stored in a JSON object using a tree structure. To persist data,
specify all the nodes or branches that must be traversed in the JSON
structure to access that data. Use a forward slash (/) to separate
each node or branch, and specify the nodes in the order in which they
are listed in the structure.
For example, to persist data for the history attribute shown in the sample JSON object in Figure 1, specify the following resource path: /SETTINGS/history/.
Figure 1. Sample JSON structure for persisted data{ "private": { "created": "2013-07-09T02:52:47.921Z", "majorv": 0, "minorv": 0, "modified": "2014-01-13T15:01:39.409Z" }, "public": { "SETTINGS": { "authorization": { "auth": true }, "history": { "acct": [ "OMVS0803" ], "proc": [ "CEANNKJ" ], "rsize": [ "50000" ], "ugrp": [ "ZOSMFGRP" ] }, "trace": { "init": false, "task": false } } } }
Standard headers
Content-Type: application/json
Custom headers
None.
Request content
Your request must include a JSON object that contains the value to be persisted and the version. For more details, see Content type used for HTTP request and response data.
Usage considerations
Required authorizations
Expected response
On completion, the service returns an HTTP response, which includes a status code indicating whether your request completed. Status code 200 indicates success. A status code of 4nn or 5nn indicates that an error has occurred. For more details, see Error handling.
The response also includes a JSON object that contains the current data after being modified. For more details, see Content type used for HTTP request and response data.
Example
- The data is for a task with the ID MYTASK that resides in plug-in com.ibm.zoszmf.myapp.
- The data is being persisted for the user who is currently logged into z/OSMF.
- The JSON object that contains the persistence data uses the structure provided in Figure 1.
- The data to be persisted is updating the rsize attribute.
PUT /zosmf/IzuUICommon/persistence/user/com.ibm.zoszmf.myapp/MYTASK/SETTINGS/history/ HTTP/1.1
Host: zosmf1.yourco.com
Accept: application/json
Content-Type: application/json
{
"version" : "1.0.0",
"value" : {"history":{"rsize":["40000"]}},
"update" : true
}
HTTP/1.1 200 OK
Date: Thu, 13 Jan 2011 05:39:28 +0000GMT
Content-Type: application/json
{
"version" : "1.0.0",
"value" :
{
"authorization":{"auth":true},
"history":{"ugrp":["ZOSMFGRP"],"acct":["OMVS0803"],"rsize":["40000"],"proc":["CEANNKJ"]},
"trace":{"init":false,"task":false}
}
}