Querying All Shared File Systems
Function
This API is used to list the basic information of all shared file systems.
URI
- GET /v2/{project_id}/shares?all_tenants={all_tenants}&status={status}&limit={limit}&offset={offset}&sort_key={sort_key}&sort_dir={sort_dir}&project_id={project_id}&is_public={is_public}
- Parameter description
Parameter
Mandatory
Type
Description
project_id
Yes
String
Specifies the project ID of the operator.
all_tenants
No (query parameter)
Boolean
This parameter is available only to users with administrator permissions. Specifies whether to list shared file systems of all tenants. To list shared file systems of all tenants, set it to 1. To list shared file systems only of the current tenant, set it to 0.
project_id
No (query parameter)
String
This parameter is available only to users with administrator permissions. Specifies the ID of the project to which the shared file system belongs. This parameter needs to be used together with all_tenants.
status
No (query parameter)
String
Filters shared file systems by status. Possible values are:
- creating: The shared file system is being created.
- error: The shared file system fails to be created.
- available: The shared file system is available.
- deleting: The shared file system is being deleted.
- error_deleting: The shared file system fails to be deleted.
- extending: The shared file system is being expanded.
- extending_error: The shared file system fails to be expanded.
- shrinking: The shared file system is being shrunk.
- shrinking_error: The shared file system fails to be shrunk.
- shrinking_possible_data_loss_error: The shared file system fails to be shrunk due to data loss.
- manage_starting: Shared file system management starts.
- manage_error: The shared file system fails to be managed.
- unmanage_starting: Canceling shared file system management starts.
- unmanage_error: Failed to cancel shared file system management.
- unmanaged: The shared file system is not managed.
limit
No (query parameter)
Integer
Specifies the maximum number of shared file systems that can be returned. If this parameter is not specified, all the shared file systems are returned by default.
offset
No (query parameter)
Integer
Specifies the offset to define the start point of shared file system listing. The value must be greater than or equal to 0.
sort_key
No (query parameter)
String
Specifies the keyword for sorting the queried shared file systems. Possible values are id, status, size, host, share_proto, availability_zone_id, user_id, project_id, created_at, updated_at, display_name, name, share_type_id, share_network_id, and snapshot_id. By default, the value is sorted by created_at.
sort_dir
No (query parameter)
String
Specifies the direction to sort shared file systems. Possible values are asc (ascending) and desc (descending).
is_public
No (query parameter)
String
When this parameter is set to true, the current tenant can query all its own shared file systems and other tenants' shared file systems whose is_public is set to true. When this parameter is set to false, the current tenant can query only the shared file systems owned by the tenant.
Request Header
The operation message header is the same as that of a common request. For details, see Table 3.
Response
- Parameter description
Parameter
Type
Description
shares
Array of objects
For details, see the description of the share field.
- Description of the share field
Parameter
Type
Description
id
String
Specifies the ID of the shared file system.
links
Array of objects
Specifies the request link information of the shared file system.
name
String
Specifies the name of the shared file system.
- Example response
{ "shares": [ { "id": "1390cb29-539b-4926-8953-d8d6b106071a", "links": [ { "href": "https://192.168.196.47:8796/v2/f24555bfcf3146ca936d21bcb548687e/shares/1390cb29-539b-4926-8953-d8d6b106071a", "rel": "self" }, { "href": "https://192.168.196.47:8796/f24555bfcf3146ca936d21bcb548687e/shares/1390cb29-539b-4926-8953-d8d6b106071a", "rel": "bookmark" } ], "name": null } ] }
Status Codes
- Normal
- Abnormal
Status Code
Description
400 Bad Request
The server failed to process the request.
401 Unauthorized
You must enter a username and the password to access the requested page.
403 Forbidden
Access to the requested page is forbidden.
404 Not Found
The requested page was not found.
405 Method Not Allowed
You are not allowed to use the method specified in the request.
406 Not Acceptable
The response generated by the server could not be accepted by the client.
407 Proxy Authentication Required
You must use the proxy server for authentication. Then the request can be processed.
408 Request Timeout
The request timed out.
409 Conflict
The request could not be processed due to a conflict.
500 Internal Server Error
Failed to complete the request because of an internal service error.
501 Not Implemented
Failed to complete the request because the server does not support the requested function.
502 Bad Gateway
Failed to complete the request because the request is invalid.
503 Service Unavailable
Failed to complete the request because the service is unavailable.
504 Gateway Timeout
A gateway timeout error occurred.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot