SMB/shares/{shareName}: PUT

Modifies an existing SMB share.

Availability

Available on all IBM Spectrum Scale™ editions.

Description

The PUT smb/shares/shareName request modifying an existing SMB share. For more information about the fields in the data structures that are returned, see mmsmb command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/smb/shares/shareName
where
smb/shares
Specifies SMB share as the resource. Required.
shareName
Specifies the SMB share to be modified. Required.

Request headers

Accept: application/json

Request data

Request data

The following list of attributes are available in the response data:

{
         "smbOptions"(
         "browseable":"{yes | no}"
         "guestok": "{yes | no}"
         "smbencrypt": "{auto | default | mandatory | disabled}"
         "adminusers": "Users"
         "comment": "Comments"
         "cscpolicy": "Client-side caching policy"
         "fileidalgorithm": "{fsname | hostname | fsnamenodirs |     fsnamenorootdir}"
         "gpfsleases": "{yes | no}"
         "gpfsrecalls": "{yes | no}"
         "gpfssharemodes,": "{yes | no}"
         "gpfssyncio": "{yes | no}"
         "hideunreadable": "{yes | no}"
         "oplocks": "{yes | no}"
         "posixlocking": "{yes | no}"
         "readonly": "{yes | no}"
         "syncopsonclose": "{yes | no}"
         }
         "removeSmboptions": ["List of SMB options to be removed"]
}
The details of the parameters are given in the following list:
"smbOptions":
An array of information about SMB shares addresses. The array contains elements that describe the SMB shares. For more information about the fields in this structure, see the links at the end of this topic.
"browseable":""Browseable"
If the value is set as yes, the export is shown in the Windows Explorer browser while browsing the file server.
"guestok": "{yes | no}"
The guest ok parameter means that the access is permitted as the default guest user. By default, this parameter is set to yes and it cannot be changed.
"smbencrypt": "{auto | default | mandatory | disabled}"
This option controls whether the remote client is allowed or required to use SMB encryption. This option controls whether the remote client is allowed or required to use SMB encryption. Possible values are auto, mandatory, and disabled.
"adminusers": "Users"
Using this option, administrative users can be defined in the format of admin users=user1;user2, ..usern. The users must be domain users. ,
"comment": "Comments"
User-defined text.
"cscpolicy": "{manual | disable | documents | programs}"
The client-side caching policy specifies how the clients that are capable of offline caching caches the files in the share.
"fileidalgorithm": "{fsname | hostname | fsnamenodirs | fsnamenorootdir}"
This option allows to control the level of enforced data integrity. If the data integrity is ensured on the application level, it can be beneficial in cluster environments to reduce the level of enforced integrity for performance reasons.
"gpfsleases": "{yes | no}"
These are cross protocol oplocks (opportunistic locks). That is, an SMB client can lock a file that provides the user improved performance while reading or writing to the file because no other user read or write to this file. If the value is set as yes, clients accessing the file over the other protocols can break the lock of an SMB client and the user gets informed when another user is accessing the same file at the same time.
"gpfsrecalls": "{yes | no}"
If the value is set as yes, files that are migrated from disk recalled on access. If recalls = no, files are not recalled on access and the client receives.
"gpfssharemodes,": "{yes | no}"
An application can set share modes. If you set gpfs:sharemodes = yes, the share modes that are specified by the application is respected by all protocols and not only by the SMB protocol. If you set gpfs:sharemodes = no, then the share modes that are specified by the application is only respected by the SMB protocol.
"gpfssyncio": "{yes | no}"
If the value is set as yes, the files in an export for which the setting is enabled, are opened with the OSYNC flag. Accessing a file is faster if gpfs:syncio is set to yes. Performance for certain workloads can be improved when SMB accesses the file with the OSYNC flag set. For example, updating only small blocks in a large file as observed with database applications. The underlying GPFS™ behavior is then changed to not read a complete block, if there is only a small update to it.
"hideunreadable": "{yes | no}"
If the value is set as yes, all files and directories that the user has no permission to read is hidden from directory listings in the export. The hideunreadable=yes option is also known as access-based enumeration. When a user is listing (enumerating) the directories and files within the export, they see only the files and directories that they have read access to.
"oplocks": "{yes | no}"
If the value is set as yes, a client might request an opportunistic lock (oplock) from an SMB server when it opens a file. If the server grants the request, the client can cache large chunks of the file without informing the server what it is doing with the cached chunks until the task is completed. Caching large chunks of a file saves a lot of network I/O round-trip time and enhances performance.
"posixlocking": "{yes | no}"
If the value is set as yes, it is tested if a byte−range (fcntl) lock is already present on the requested portion of the file before granting a byte−range lock to an SMB client. For improved performance on SMB−only shares this option can be disabled. Disabling locking on cross−protocol shares can result in data integrity issues when clients concurrently set locks on a file through multiple protocols, for example, SMB and NFS.
"readonly": "{yes | no}"
If the value is set as yes, files cannot be modified or created on this export independent of the ACLs.
"syncopsonclose": "{yes | no}"
This option ensures that the file system synchronizes data to the disk each time a file is closed after writing. The written data is flushed to the disk.
"removeSmboptions": ["List of SMB options to be removed"]
Specifies the SMB options to be removed.

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 SMB share smbShare1.

Request data:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json' 
-d '{
  "smbOptions": {
    "browseable": "yes",
    "guestok": "yes",
    "smbencrypt": "auto",
    "adminusers": "admin",
    "comment": "This is a comment",
    "cscpolicy": "manual",
    "fileidalgorithm": "fsname",
    "gpfsleases": "yes",
    "gpfsrecalls": "yes",
    "gpfssharemodes": "yes",
    "gpfssyncio": "yes",
    "hideunreadable": "yes",
    "oplocks": "yes",
    "posixlocking": "yes",
    "readonly": "yes",
    "syncopsonclose": "yes"
  },
  "removeSmbOptions": [
    "string"
  ]
}' "https://198.51.100.1:443/scalemgmt/v2/smb/shares/smbShare1"
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.
{
  "status": {
    "code": "200",
    "message": "..."
  },
  "job": [
    {
      "result": {},
      "request": {
        "type": "PUT",
        "url": "/scalemgmt/v2/smb/shares/smbShare1",
        "data": "{
          "smbOptions": {
          "browseable": "yes",
          "guestok": "yes",
          "smbencrypt": "auto",
          "adminusers": "admin",
          "comment": "This is a comment",
          "cscpolicy": "manual",
          "fileidalgorithm": "fsname",
          "gpfsleases": "yes",
          "gpfsrecalls": "yes",
          "gpfssharemodes": "yes",
          "gpfssyncio": "yes",
          "hideunreadable": "yes",
          "oplocks": "yes",
          "posixlocking": "yes",
          "readonly": "yes",
          "syncopsonclose": "yes"
  },
         "removeSmbOptions": [
         "string"
  ]}"
      },
      "jobId": "12345",
      "submitted": "2016-11-14 10.35.56",
      "completed": "2016-11-14 10.35.56",
      "status": "COMPLETED"
    }
  ]
}