Filesystems/{filesystemName}/filesets/{filesetName}/cos/policy: PUT
Modifies a user defined policy.
Availability
Available on all IBM Storage Scale editions.
Description
The PUT filesystems/{filesystemName}/filesets/{filesetName}/cos/policy request modifies a user defined policy that is used to run a reconcile command. For more information about the fields in the data structures that are returned, see mmafmcosctl command.
Request URL
https://<IP or host name of API server>:port/scalemgmt/v2/filesystems/filesystemName/filesets/filesetName/cos/policy
where:- filesystems/filesystemName
- Specifies the name of the file system to which the fileset belongs. Required.
- cos/policy
- Specifies the resource to be modified.
Request headers
Accept: application/json
Request parameters
The following parameters can be used in the request URL to customize the
request:
Parameter name | Description and applicable keywords | Required/optional |
---|---|---|
filesystemName | The file system name. You can also use keywords such as :all:, :all_local:, or :all_remote: | Required. |
filesetName | The fileset name. This is the path of the fileset. | Required. |
body | Body of the request that contains the required parameters to be passed on to the IBM Storage Scale system to perform the requested operation. | Required. |
Request data
{
"path": "File path",
"policyPath": "policy path",
"rule": " Rule name",
}
For more information about the fields in the following data structures, see the links at the end of this topic.
- "path":"Fileset path"
- The fileset path for the policy.
- "policyPath":"The policy name"
- The name and path of the user defined policy that runs the reconcile command.
- "rule":"Rule name"
- The policy rule name.
Response data
{
"status": {
"code":ReturnCode",
"message":"ReturnMessage"
},
jobs: [
{
"result":"",
{
"commands":"String",
"progress":"String,
"exitCode":"Exit code",
"stderr":"Error",
"stdout":"String",
},
"request":" ",
{
"type":"{GET | POST | PUT | DELETE}",
"url":"URL",
"data":""",
}
"jobId":"ID",
"submitted":"Time",
"completed":Time",
"status":"Job status",
}
],
}
For more information about the fields in the following data structures, see
the links at the end of this topic.- "status":
- Return status.
- "message": "ReturnMessage",
- The return message.
- "code": ReturnCode
- The return code.
- "jobs":
- An array of elements that describe jobs. Each element describes one job.
- "result"
-
- "commands":"String'
- Array of commands that are run in this job.
- "progress":"String'
- Progress information for the request.
- "exitCode":"Exit code"
- Exit code of command. Zero is success, nonzero denotes failure.
- "stderr":"Error"
- CLI messages from stderr.
- "stdout":"String"
- CLI messages from stdout.
- "request"
-
- "type":"{GET | POST | PUT | DELETE}"
- HTTP request type.
- "url":"URL"
- The URL through which the job is submitted.
- "data":" "
- Optional.
- "jobId":"ID",
- The unique ID of the job.
- "submitted":"Time"
- The time at which the job was submitted.
- "completed":Time"
- The time at which the job was completed.
- "status":"RUNNING | COMPLETED | FAILED"
- Status of the job.
Examples
The following example modifies the user defined policy policy2 in the fileset afmkagui.
Request data:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json'
-d '{ \
"path": "/gpfs/fs1/afmkagui",
"policyPath": "/root/policy2",
"rule": "RULE EXTERNAL LIST 'dirtyFiles'", "add": false
}',
'https://glogin03.pok.stglabs.ibm.com:1991/scalemgmt/v2/filesystems/fs1/filesets/afmkagui/cos/policy'
Response data:
Note: In the JSON data that is returned, the return code indicates whether the
command is successful. The response code 200 indicates that the command successfully retrieved the
information. Error code 400 represents an
invalid request and 500 represents internal server error.
{
"jobs": [
{ "jobId": 1000000000028,
"status": "RUNNING",
"submitted": "2022-10-20 06:36:05,638",
"completed": "N/A", "runtime": 15,
}
"request": {
"data": {
"path": "/gpfs/fs1/afmkagui", "policyPath": "/root/policy2", "rule": "RULE EXTERNAL LIST 'dirtyFiles'", "add": false
} ,
"type": "PUT",
"url": "/scalemgmt/v2/filesystems/fs1/filesets/afmkagui/cos/policy",
"result": {},
"pids": []
}
],
"status": {
"code": 202,
"message": "The request was accepted for processing." }
}