Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Create a file system share

Creates a file system share of type CIFS or NFS.

HTTP request syntax (URI)
POST <base_URI>/v8/storage/filesystem-shares/{type}
Parameters
Name Type Required Values Description
type URI_PARAM Y string File system share type. The only possible values are cifs or nfs.
name BODY Y string Share name.
virtualServerId BODY Y number Specifies either the virtual server object ID or the HNAS storage virtual server ID.
filesystemId BODY Y string Either the file system object ID or HNAS file system ID.
filesystemPath BODY Y string Absolute filesystem path where the share resides - for NFS exports, the path should be UNIX format, for CIFS shares the path should be Windows format, and the \ character needs to be escaped.
settings BODY Y object Share setting. Depending on what value type is, the value for a share setting is either the object of the CIFS settings or the object of the NFS settings.
Return codes
Code Data Description
201 filesystemShare File system share object created successfully.
400 Error Message Missing or invalid request contents.
403Error MessageOperation forbidden by access level.
404 Error Message Requested resource not found.
500 Error message Error associated with the storage system.

Any HTTP status code other than 201 indicates that the API did not complete successfully.

Request example 1: Create NFS export on virtual server 5
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.57.75:8444/v8/storage/filesystem-shares/nfs -d '{"name":"xyz-test-nfs-01-21-3", "virtualServerId":5, "filesystemId":"75412709E1CB9AAB0000000000000000", "filesystemPath":"/xyz/test/path/1204", "settings":{"accessConfig":"*", "snapshotOption":"SHOW_AND_ALLOW_ACCESS", "localReadCacheOption":"DISABLED", "transferToReplicationTargetSetting":"DO_NOT_TRANSFER"}}' -X POST
Response example 1
HTTP/1.1 201 Created
{
  "filesystemShare" : {
    "filesystemId" : "75412709E1CB9AAB0000000000000000",
    "objectId" : "353a3a3a65646430653862322d353462612d313164312d393131622d346265653366616163613362",
    "name" : "/xyz-test-nfs-01-21-3",
    "path" : "/xyz/test/path/1204",
    "settings" : {
      "accessConfig" : "*",
      "localReadCacheOption" : "DISABLED",
      "snapshotOption" : "SHOW_AND_ALLOW_ACCESS",
      "transferToReplicationTargetSetting" : "DO_NOT_TRANSFER"
    },
    "shareId" : "edd0e8b2-54ba-11d1-911b-4bee3faaca3b",
    "virtualServerId" : 5
  },
  "uri" : "https://172.17.57.75:8444/v8/storage/filesystem-shares/nfs/353a3a3a65646430653862322d353462612d313164312d393131622d346265653366616163613362"
}
Request example 2: Create CIFS/SMB share on virtual server 5
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.57.75:8444/v8/storage/filesystem-shares/cifs -d '{"name":"xyz-test-cifs-01-21-4", "virtualServerId":5, "filesystemId":"75412709E1CB9AAB0000000000000000","filesystemPath":"\\mypath-cifs-1", "settings":{"accessConfig":"*", "comment":"xyz comment", "userHomeDirectoryPath":"", "isScanForVirusesEnabled":false, "maxConcurrentUsers":100, "snapshotOption":"SHOW_AND_ALLOW_ACCESS", "cacheOption":"MANUAL_CACHING_DOCS", "transferToReplicationTargetSetting":"DO_NOT_TRANSFER", "userHomeDirectoryMode":"OFF", "isFollowSymbolicLinks":false, "isFollowGlobalSymbolicLinks":false, "isForceFileNameToLowercase":false, "isABEEnabled":false}}' -X POST
Response example 2
HTTP/1.1 201 Created
{
  "filesystemShare" : {
    "filesystemId" : "75412709E1CB9AAB0000000000000000",
    "objectId" : "353a3a3a39316331336136382d353462612d313164312d393131612d346265653366616163613362",
    "name" : "xyz-test-cifs-01-21-4",
    "path" : "\\mypath-cifs-1",
    "settings" : {
      "accessConfig" : "*",
      "cacheOption" : "MANUAL_CACHING_DOCS",
      "comment" : "xyz comment",
      "isABEEnabled" : false,
      "isFollowGlobalSymbolicLinks" : false,
      "isFollowSymbolicLinks" : false,
      "isForceFileNameToLowercase" : false,
      "isScanForVirusesEnabled" : false,
      "maxConcurrentUsers" : 100,
      "snapshotOption" : "SHOW_AND_ALLOW_ACCESS",
      "transferToReplicationTargetSetting" : "DO_NOT_TRANSFER",
      "userHomeDirectoryMode" : "OFF",
      "userHomeDirectoryPath" : ""
    },
    "shareId" : "91c13a68-54ba-11d1-911a-4bee3faaca3b",
    "virtualServerId" : 5
  },
  "uri" : "https://172.17.57.75:8444/v8/storage/filesystem-shares/cifs/353a3a3a39316331336136382d353462612d313164312d393131612d346265653366616163613362"
}

 

  • Was this article helpful?