API 參考
磁碟
儲存磁碟區、磁碟格式化與掛載別名。
型別定義
graphql
type Mutation {
formatDisk(path: String!): Boolean!
setMountAlias(id: ID!, alias: String!): Boolean!
}
type Query {
disks: [Disk!]!
mounts: [Mount!]!
}
type Disk {
id: ID!
name: String!
path: String!
sizeBytes: Long!
removable: Boolean!
model: String
}
enum DriveType {
INTERNAL_STORAGE
SDCARD
USB_STORAGE
APP
}
scalar Long
type Mount {
id: ID!
name: String!
path: String!
mountPoint: String!
fsType: String!
totalBytes: Long!
usedBytes: Long!
freeBytes: Long!
remote: Boolean!
alias: String!
driveType: DriveType!
diskId: String!
label: String!
diskModel: String!
}操作
mutation
formatDisk
格式化指定磁碟;此操作會破壞資料,需要裝置的儲存權限。
graphql
mutation formatDisk($path: String!) {
formatDisk(path: $path)
}mutation
setMountAlias
設定已註冊儲存掛載點的顯示別名。
graphql
mutation setMountAlias($id: ID!, $alias: String!) {
setMountAlias(id: $id, alias: $alias)
}query
disks
列出磁碟及其分區、掛載資訊。
graphql
query disks {
disks { id name path sizeBytes removable model }
}query
mounts
列出所有可用儲存磁碟區,包括內部儲存、SD 卡和 USB。
graphql
query mounts {
mounts { id name path mountPoint fsType totalBytes usedBytes freeBytes }
}