Skip to main content
Storage Management/Data Storage APIs/Local Storage Related Interfaces
POSTLocal Storage Related InterfacesSince 0.6SynchronousAuth Required

Add Local Storage as Data Storage

Add Local Storage as Data Storage

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • urlStringRequired

    Local storage path

  • nameStringRequired

    Local storage data storage name

  • descriptionString

    Detailed description of the local storage data storage

  • typeString

    Type is LocalStorage

  • zoneUuidStringRequired

    Data Center UUID

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error

    • codeStringRequired

      Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001

    • descriptionStringRequired

      Brief description of the error

    • detailsStringRequired

      Detailed error information

    • elaborationStringRequired

      Reserved field, defaults to null

    • opaqueLinkedHashMapRequired

      Reserved field, defaults to null

    • causeErrorCodeRequired

      Root cause. The source error that triggered the current error. If there is no original error, this field is null

  • inventoryPrimaryStorageInventoryRequired

    For details, see inventory

    • uuidStringRequired

      Resource UUID, uniquely identifies the resource

    • zoneUuidStringRequired

      Data Center UUID

    • nameStringRequired

      Resource name

    • urlStringRequired

      地址。

    • descriptionStringRequired

      Detailed description of the resource

    • totalCapacityLongRequired

      总容量。

    • availableCapacityLongRequired

      可用容量。

    • totalPhysicalCapacityLongRequired

      总物理容量。

    • availablePhysicalCapacityLongRequired

      可用物理容量。

    • systemUsedCapacityLongRequired

      系统已使用容量。

    • typeStringRequired

      类型。

    • stateStringRequired

      当前状态。

    • statusStringRequired

      状态信息。

    • mountPathStringRequired

      mount路径。

    • createDateTimestampRequired

      Creation time

    • lastOpDateTimestampRequired

      Last modification time

    • attachedClusterUuidsListRequired

      附加集群UUID。

Endpoint

POST/zstack/v1/primary-storage/local-storage

/zstack/v1/primary-storage/local-storage

Operation ID

AddLocalPrimaryStorage

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/primary-storage/local-storage' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"url":"<url>","name":"<name>","description":"<description>","type":"<type>","zoneUuid":"<zoneUuid>","resourceUuid":"<resourceUuid>","systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "name": "PS1", "url": "/Cloud_ps", "type": "LocalStorage", "state": "Enabled", "status": "Connected", "attachedClusterUuids": [ "562116d368c8467c95c53321757538dc" ] } }

Change History

This API has no change history records yet.

View all change history