General Information

At the moment the API is just accessible for ETHZ employees; students can't use the interface actually.

Authentication

The Webservice uses Basic Authentication of ETHZ AD Domain for authorizing, so you can use your personal ETH user account (including domain).

Example:
Username: mmuster@ethz.ch
Password: xxxxxxx

Get existing NAS shares GET

Description: returns the NAS shares which have been created by authenticated user.

URL: https://itshopwsvc.ethz.ch:44348/api/nas

Get a dedicated NAS share GET

Description: returns the specified NAS share, in case the authenticated user is owner or member of the share's admingroup.

URL: https://itshopwsvc.ethz.ch:44348/api/nas/{sharename}

Ordering NAS share POST

Description: ordering a new NAS share. The authenticated user can order shares for third persons as well.

Constraints:

  • name (the sharename pattern requires following information: [ou]_[institute]_[suffix]; be aware that the institute must be affiliated to the OrgUnit)
  • approvalData (sapElement & sapApprover must match)
  • adminGroup (the user has to be a member of the specified admin group)

URL: https://itshopwsvc.ethz.ch:44348/api/nas

Content-Type: application/json

Syntax and semantic of the body parameters

Name

Mandatory

Syntax

Semantic

nameyes

String, starts with orgUnit, followed by institute and suffix,
separated by underscore

defines unique sharename
sizeInGByesnatural numbersize of the Share in GiB
inodesyesnatural numbermax amount of files and folders in Share
thresholdInPercentno0..100threshold in percentage for daily check of occupied size and occupied inodes; when exceeded get notified by email.
adminGroupyesString, AD groupname (without Domain)Permission group on the filesystem and in IT Shop (Modification/Deletion)
storageClassyesQoS1
locationyesRZ | HIT
snapshotPolicynodailySnapshot | noSnapshotRule for disk-based snapshots
backupPolicynodailyBackup | noBackupRule for tape-based backup
sapElementyes

5-digit cost center starting with '2' or

12-digit PSP element incl. hyphen

Billing information
sapApproveryesPrimary e-mail account/ UPNBilling information
approvalReasonnoStringInformation for approver, will be shown in Ethis
(cifs) enablednofalse | truegenerate CIFS/SMB export for the share
(cifs) browsable
nofalse | truethe share will be shown in Windows-Explorer while browsing
(cifs) shareCommentnoStringvisible comment next to the name when browsing
(cifs) hideUnreadablenofalse | trueall files and directories which are not permitted for the user are hidden in the folder tree
(cifs) enableDFSnofalse | truecreates a DFS entry for the share
(cifs) dfsPathnoString, just part of the path subOu\linkname for the DFS entry:
\\d.ethz.ch\groups\subOu\link
(cifs) domainnoDAD domain; always 'D'
(cifs) groupNamenoString, AD group name (without Domain)the group gets an entry in the 'share permissions' and the ACL of the filessystem
(cifs) accessnoAllowed
(cifs) permissionnoFull | Change | ReadPermission level for 'share permission'
(nfs) enablednofalse | truecreates a NFS export for the share
(nfs) clientnoHostname, IP address, subnet (CIDR notation) or netgrouplisted clients get access on the export 
(nfs) accessTypenoRO | RWPermission level: only-read or read-/write access
(nfs) squashnono_root_squash | root_squash

Access on export as root user:

root_squash: the ID for root will be mapped on the highest UID

no_root_squash: the ID for root will be mapped on UID ‘0’. The user has root privileges on share.

(nfs) priviledgedPortsnofalse | truePorts < 1024 are privileged and can only be used when parameter is 'true'
(nfs) protocolVersionnov3_sys | v4_krb5 | v4_sys_krb5defines access protocol and security type for client
useryesETH username (without Domain)this user will be the owner of the share
orgUnityesOuName acc. IT Shopthe user above has to be part of this OU



POST Example - CIFS Export
{
  "name": "phys_astro_experiments",
  "sizeInGB": 1024,
  "inodes": 1024,
  "thresholdInPercent": 95,
  "adminGroup": "ID-PPF-NAS-FileShare",
  "storageClass": "QoS1",
  "location": "RZ",
  "snapshotPolicy": "dailySnapshot",
  "backupPolicy": "dailyBackup",
  "approvalData": {
    "sapElement": "nnnnn",
    "sapApprover": "approver@ethz.ch",
    "approvalReason": "Fileablage fuer experimentelle Daten"
  },
  "cifsExportData": {
    "enabled": true
    "browsable": true,
    "shareComment": "Fileablage fuer experimentelle Daten",
    "hideUnreadable": false,
    "enableDFS": false,
    "dfsPath": "",
    "permissions": [
      {
        "domain": "D",
        "groupName": "ID-PPF-NAS-FileShare",
        "access": "Allowed",
        "permission": "Full"
      }
    ]
  },
  "nfsExportData": {
    "enabled": false
  },
  "user": "mmuster",
  "orgUnit": "phys"
}
POST Example - NFS Export
{
  "name": "phys_astro_experiments",
  "sizeInGB": 1024,
  "inodes": 1024,
  "thresholdInPercent": 95,
  "adminGroup": "ID-PPF-NAS-FileShare",
  "storageClass": "QoS1",
  "location": "RZ",
  "snapshotPolicy": "dailySnapshot",
  "backupPolicy": "dailyBackup",
  "approvalData": {
    "sapElement": "nnnnn",
    "sapApprover": "approver@ethz.ch",
    "approvalReason": "Fileablage fuer experimentelle Daten"
  },
  "cifsExportData": {
    "enabled": false
  },
  "nfsExportData": {
    "enabled": true,
    "permissions": [
      {
        "client": "my-client.ethz.ch",
        "accessType": "RO",
        "squash": "no_root_squash",
        "priviledgedPorts": true,
        "protocolVersion": "v3_sys"
      }
    ]
  },
  "user": "mmuster",
  "orgUnit": "phys"
}

Modify NAS share PUT

Description: Change configuration of specified NAS share

Constraints: 

  • Parameter name, user and orgUnit are mandatory
  • The user must be owner of the share or member of the admin group 

URL: https://itshopwsvc.ethz.ch:44348/api/nas

Content-Type: application/json

Syntax and semantic of the body parameters

Name

Mandatory

Syntax

Semantic

nameyes

String, starting with orgUnit, followed by institute and suffix,
separated by underscore

unique sharename
sizeInGBnonatural numbernew overall size of the share in GiB
inodesnonatural numbernew max amount of files and folders in share
thresholdInPercentno0..100threshold in percentage for daily check of occupied size and occupied inodes; when exceeded get notified by email.
adminGroupnoString, AD group name (without Domain)Permission group on the filesystem and in IT Shop (Modification/Deletion)
snapshotPolicynodailySnapshot | noSnapshotnew rule for disk-based snapshots
backupPolicynodailyBackup | noBackupnew rule for tape-based backup
sapElementno

5-digit cost center starting with '2' or

12-digit PSP element incl. hyphen

Billing information
infomailReceivernoPrimary e-mail account/ UPNBilling information
approvalReasonnoStringInformation for approver, will be shown in Ethis
(cifs) enablednofalse | truegenerate or remove CIFS/SMB export for the share
(cifs) browsable
nofalse | truethe share will be shown in Windows explorer while browsing
(cifs) shareCommentnoStringvisible comment next to the name when browsing
(cifs) hideUnreadablenofalse | trueall files and directories which are not permitted for the user are hidden in the folder tree
(cifs) enableDFSnofalse | truecreates a DFS entry for the share
(cifs) dfsPathnoString, part of the path subOu\linkname for the DFS Entry:
\\d.ethz.ch\groups\subOu\link
(cifs) domainnoDAD Domain; always 'D'
(cifs) groupNamenoString, AD group name (without domain)the group gets an entry in the 'share permissions' and the ACL of the filessystem
(cifs) accessnoAllowed
(cifs) permissionnoFull | Change | ReadPermission level by 'share permissions'
(nfs) enablednofalse | truecreates a NFS export for the share
(nfs) clientnoHostname, IP address , subnet (CIDR notation) or netgrouplisted clients get access on the export 
(nfs) accessTypenoRO | RWPermission level: only-read or read-/write access
(nfs) squashnono_root_squash | root_squash

Access on export as root user:

root_squash: the ID for root will be mapped on the highest UID

no_root_squash: the ID for root will be mapped on UID ‘0’. The user has root privileges on share.

(nfs) priviledgedPortsnofalse | truePorts < 1024 are privileged and can only be used when parameter is 'true'
(nfs) protocolVersionnov3_sys | v4_krb5 | v4_sys_krb5defines access protocol and security type for client
useryesETH username (without domain)this user will be checked for owner of the share
orgUnityesOuName acc. IT Shopthe user above has to be part of this OU


PUT Example
{
  "name": "phys_astro_experiments",
  "sizeInGB": 2048,
  "inodes": 2048,
  "thresholdInPercent": 90,
  "adminGroup": "ID.CCR.PFM.ALL",
  "snapshotPolicy": "hourlySnapshot",
  "backupPolicy": "noBackup",
  "approvalData": {
    "sapElement": "nnnnn",
    "infomailReceiver": "new_approver@ethz.ch",
    "approvalReason": "Mehr Platz fuer experimentelle Daten"
   },
  "cifsExportData": {
    "removePermission": [
      {
        "domain": "D",
        "groupName": "ID-PPF-NAS-FileShare"
      }
    ],
    "enabled": true,
    "browsable": true,
    "shareComment": "Fileablage fuer experimentelle Daten",
    "hideUnreadable": true,
    "enableDFS": true,
    "dfsPath": "astro\exp",
    "permissions": [
      {
        "domain": "D",
        "groupName": "ID.CCR.PFM.ALL",
        "access": "Allowed",
        "permission": "Change"
      }
    ]
  },
  "nfsExportData": {
    "removePermission": [
      {
        "client": "my-client.ethz.ch"
      }
    ],
    "enabled": true,
    "permissions": [
      {
        "client": "my-new-client.ethz.ch",
        "accessType": "RW",
        "squash": "no_root_squash",
        "priviledgedPorts": false,
        "protocolVersion": "v3_sys"
      }
    ]
  },
  "user": "mmuster",
  "orgUnit": "phys"
}
  • No labels