Shared Mount Point Primary Storage Operations
AddSharedMountPointPrimaryStorage
API Request
URLs
POST zstack/v1/primary-storage/smpHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"url": "/smp_mountpoint",
"name": "smp",
"type": "SharedMountPoint",
"zoneUuid": "f0e339a95f5c4e8a913737160c20548d"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"/smp_mountpoint","name":"smp","type":"SharedMountPoint","zoneUuid":"80396633969c3d3d92938132c793b1ca"}}' \
http://localhost:8080/zstack/v1/primary-storage/smpRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the params structure) | The local URL of the Shared Mount Point primary storage. | 0.6 | |
| name | String | body (contained in the params structure) | The name of the Shared Mount Point primary storage. | 0.6 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the Shared Mount Point primary storage. | 0.6 | |
| type | String | body (contained in the params structure) | Optional. The primary storage type: Shared Mount Point. | 0.6 | |
| zoneUuid | String | body (contained in the params structure) | The zone UUID. | 0.6 | |
| resourceUuid | String | body (contained in the params structure) | Optional. The UUID of the Shared Mount Point primary storage. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"name": "PS1",
"url": "/Cloud_ps",
"type": "SharedMountPoint",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"50028186764548f1b5b49379acaddcda"
]
}
}#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The short description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| zoneUuid | String | The zone UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| url | String | 0.6 | |
| description | String | The detailed description of the resource. | 0.6 |
| totalCapacity | Long | 0.6 | |
| availableCapacity | Long | 0.6 | |
| totalPhysicalCapacity | Long | 0.6 | |
| availablePhysicalCapacity | Long | 0.6 | |
| systemUsedCapacity | Long | 0.6 | |
| type | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| mountPath | String | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| attachedClusterUuids | List | 0.6 |
SDK Sample
Java
SDK
AddSharedMountPointPrimaryStorageAction action = new AddSharedMountPointPrimaryStorageAction();
action.url = "/smp_mountpoint";
action.name = "smp";
action.type = "SharedMountPoint";
action.zoneUuid = "8c54cbec38cb4704b3eb9703a8589637";
action.sessionId = "bb400831e7ce4ca19dca6469845770be";
AddSharedMountPointPrimaryStorageAction.Result res = action.call();Python
SDK
AddSharedMountPointPrimaryStorageAction action = AddSharedMountPointPrimaryStorageAction()
action.url = "/smp_mountpoint"
action.name = "smp"
action.type = "SharedMountPoint"
action.zoneUuid = "7fa8ff29d2db43b783c36800990bf6d8"
action.sessionId = "26ab143d25144285b1bde8752b761bf9"
AddSharedMountPointPrimaryStorageAction.Result res = action.call()