Filesystems/{filesystemName}/owner/{path}: PUT
Sets owner for a file or directory.
Availability
Available on all IBM Storage Scale editions.
Description
The PUT filesystems/filesystemName/owner/path request sets owner for files or directories within a particular file system.
The file and directory ownership can be controlled by Linux® commands such as stat and chown. You can use either ID or name of the user or group to define the ownership. If you use both ID and name, the ID takes precedence. Only the user with DataAccess role can change the owner of a file or a non-empty directory. Empty directories can be changed by other roles such as Administrator, ProtocolAdmin, StorageAdmin, and SecurityAdmin.
Request URL
https://<IP address or hostname of API server>:<port>/scalemgmt/v2/filesystems/FilesystemName/owner/path
where- filesystemName
- Specifies the file system to which the file or directory belongs. Required.
- path
- The path of the file or directory for which you want to set the owner. Required.
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. |
path | The file path relative to file system's mount point. The path of the
file or directory is specified with forward slashes (/). For example:
mnt/gpfs0/rest01. The forward slashes in the path are encoded to %2Fin the request URL. |
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":"Path",
"user":"User name",
"uid":"User ID",
"group":"Group name",
"gid":"Group ID",
"permission":"Permissions"
"recursive": "true | false"
}
For more information about the fields in the following data structures, see
the links at the end of the topic.- "path":"Path"
- The path of the file or directory.
- "user":"User name"
- Name of the owner.
- "uid":"User ID"
- Unique identifier of the owner.
- "group":"Group name"
- Name of the user group that owns the file or directory.
- "gid":"Group ID"
- Unique identifier of the user group that owns the file or directory.
- "permission":"Access permissions"
- The number of permissions that are set by using the CLI command chmod. If nothing is specified, then no action is allowed.
- "recursive":"true | false"
- Specifies whether the owner is defined recursively for the entire file system or for the specific directory that is defined in the endpoint path.
Response data
{
"status": {
"code":ReturnCode,
"message":"ReturnMessage"
},
"owner": [
"path":"Path",
"user":"User name",
"uid":"User ID",
"group":"Group name",
"gid":"Group ID",
"permissions": Number of Permissions,
"recursive": true | false
],
}
For more information about the fields in the following data structures, see
the links at the end of the topic.- "status":
- Return status.
- "message": "ReturnMessage",
- The return message.
- "code": ReturnCode
- The return code.
- "Owner":"Owner details"
-
- "path":"Path"
- The path of the file or directory.
- "user":"User name"
- Name of the owner.
- "uid":"User ID"
- Unique identifier of the owner.
- "group":"Group name"
- Name of the user group that owns the file or directory.
- "gid":"Group ID"
- Unique identifier of the user group that owns the file or directory.
- "permissions":"Number of permissions"
- The number of permissions that are set by using the CLI command chmod.
- "recursive":true | false
- Specifies whether owner is defined recursively for the entire file system or for the specific directory that is defined in the endpoint path.
Examples
The following example sets owner for the files and directories of the file system gpfs0.
Request data:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json'
-d '{
"path": "/mnt/gpfs0/xaz",
"user": "testuser55",
"uid": "1234",
"group": "mygroup",
"gid": "4711"
"permissions": 700
"recursive" : "true"
}' "https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/owner/%2Fmnt%2Fgpfs0%2Fxaz"
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": 1000000000002,
"status": "COMPLETED",
"submitted": "2021-07-08 09:44:35,020",
"completed": "2021-07-08 10:00:31,022",
"runtime": 7,
"request": {
"data": {
"gid": 4711,
"group": "mygroup",
"permissions": 700,
"recursive": false,
"uid": 1234,
"user": "testuser55"
},
"type": "PUT",
"url": "/scalemgmt/v2/filesystems/gpfs0/owner/mydir"
},
"result": {},
"pids": []
}
],
"status": {
"code": 202,
"message": "The request finished successfully."
}
}