API requests
API requests include a URL and in some cases HTTP parameters or JSON data.
URL for an API request
The URL for an API request has the following format:
https://IP address or host name:port/scalemgmt/v2/resource_type/[resource_element] whereIP address or host name:port- Specifies the IP address or hostname and the port of the IBM Storage Scale management API server, which is IBM Storage Scale GUI server.
/scalemgmt/v2- Specifies the path of the API server. This path is not configurable; it must be
/scalemgmt/v2. resource_type- Specifies a resource type. The following list specifies the supported resource types.
- ces/addresses
- ces/services
- cluster
- config
- filesets
- filesystems
- info
- jobs
- nfs/export
- nodes
- nodes/health
- nodeclasses
- quotas
- smb/shares
- snapshots
- perfmon
- /filesystems/{filesystemName}/filesets/{filesetName}/psnaps
- thresholds
Note: The full list of resource types can be accessed from the REST API explorer that is available at https://<GUI server IP>:<port number>/api/explorer/. resource_element- Specifies the name of a particular resource, such as the name of a file system, a fileset, a node, or a snapshot. Optional.
As described earlier, an API request that ends with a resource type indicates a request that
affects all the instances of that resource in the cluster. For example, the following HTTP request,
sent with a GET method, returns information about all the nodes in the
cluster:
'https://198.51.100.1:443/scalemgmt/v2/filesystems/nodesIn contrast, an API request that ends with a resource element that follows the resource type,
indicates a request that affects only the specified resource element. For example, the following
HTTP request, sent with a GET method, returns information about the specified node,
node1.'https://198.51.100.1:443/scalemgmt/v2/filesystems/nodes/node1Data in API requests
Some types of API requests require one or more input parameters that follow the resource or
resource element. For example, sent with a GET method, the following request returns information
about all the filesets in the specified file system:
| Request method | GET |
|---|---|
| URL | https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/filesets/fs1
|
| JSON data | None. |
Also, some API requests require input parameters to be included in the body of the HTTP request in JSON format. For example, the following request creates a new snapshot in a file system. The JSON data specifies the name of the file system and the name of the new fileset:
| Request method | POST |
|---|---|
| URL | https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/snapshots |
| JSON data |
|
Request headers
The following headers are needed for
requests.
’content-type: application/json’ ’accept: application/json’