Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
95b942a1
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
95b942a1
编写于
7月 27, 2022
作者:
Z
zhangxingxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update apis
Signed-off-by:
N
zhangxingxia
<
zhangxingxia1@huawei.com
>
上级
a98b408b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
38 deletion
+43
-38
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md
...n/application-dev/reference/apis/js-apis-volumemanager.md
+43
-38
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md
浏览文件 @
95b942a1
...
@@ -239,7 +239,7 @@ getVolumeByUuid(uuid: string, callback: AsyncCallback<Volume>): void
...
@@ -239,7 +239,7 @@ getVolumeByUuid(uuid: string, callback: AsyncCallback<Volume>): void
## volumemanager.getVolumeById
## volumemanager.getVolumeById
getVolumeById(
i
d: string): Promise
<
Volume
>
getVolumeById(
volumeI
d: string): Promise
<
Volume
>
异步通过卷id获得卷信息,以promise方式返回。
异步通过卷id获得卷信息,以promise方式返回。
...
@@ -251,7 +251,7 @@ getVolumeById(id: string): Promise<Volume>
...
@@ -251,7 +251,7 @@ getVolumeById(id: string): Promise<Volume>
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------ | ---- | ---- |
| -------- | ------ | ---- | ---- |
|
i
d | string | 是 | 卷id |
|
volumeI
d | string | 是 | 卷id |
**返回值:**
**返回值:**
...
@@ -262,8 +262,8 @@ getVolumeById(id: string): Promise<Volume>
...
@@ -262,8 +262,8 @@ getVolumeById(id: string): Promise<Volume>
**示例:**
**示例:**
```
js
```
js
let
i
d
=
""
;
let
volumeI
d
=
""
;
volumemanager
.
getVolumeById
(
i
d
).
then
(
function
(
volume
)
{
volumemanager
.
getVolumeById
(
volumeI
d
).
then
(
function
(
volume
)
{
console
.
info
(
"
getVolumeById successfully:
"
+
JSON
.
stringify
(
volume
));
console
.
info
(
"
getVolumeById successfully:
"
+
JSON
.
stringify
(
volume
));
}).
catch
(
function
(
error
){
}).
catch
(
function
(
error
){
console
.
info
(
"
getVolumeById failed with error:
"
+
error
);
console
.
info
(
"
getVolumeById failed with error:
"
+
error
);
...
@@ -272,7 +272,7 @@ getVolumeById(id: string): Promise<Volume>
...
@@ -272,7 +272,7 @@ getVolumeById(id: string): Promise<Volume>
## volumemanager.getVolumeById
## volumemanager.getVolumeById
getVolumeById(
i
d: string, callback: AsyncCallback
<
Volume
>
): void
getVolumeById(
volumeI
d: string, callback: AsyncCallback
<
Volume
>
): void
异步通过卷id获得卷信息,以callback方式返回。
异步通过卷id获得卷信息,以callback方式返回。
...
@@ -282,16 +282,16 @@ getVolumeById(id: string, callback: AsyncCallback<Volume>): void
...
@@ -282,16 +282,16 @@ getVolumeById(id: string, callback: AsyncCallback<Volume>): void
**参数:**
**参数:**
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| -------- | ------------------------------------------------ | ---- |
-------------------- |
| -------- | ------------------------- | ---- | ---------
-------------------- |
|
id | string | 是 | 卷id
|
|
volumeId | string | 是 | 卷id
|
| callback | callback:AsyncCallback
<
[Volume](#volume)
>
| 是 | 获取卷信息之后的回调
|
| callback | callback:AsyncCallback
<
[Volume](#volume)
>
| 是 | 获取卷信息之后的回调
|
**示例:**
**示例:**
```
js
```
js
let
i
d
=
""
;
let
volumeI
d
=
""
;
volumemanager
.
getVolumeById
(
i
d
,
(
error
,
volume
)
=>
{
volumemanager
.
getVolumeById
(
volumeI
d
,
(
error
,
volume
)
=>
{
// do something
// do something
});
});
```
```
...
@@ -361,7 +361,7 @@ setVolumeDescription(uuid: string, description: string, callback: AsyncCallback&
...
@@ -361,7 +361,7 @@ setVolumeDescription(uuid: string, description: string, callback: AsyncCallback&
## volumemanager.format
## volumemanager.format
format(vol
Id
: string): Promise
<
void
>
format(vol
umeId: string, fsType
: string): Promise
<
void
>
异步对指定卷进行格式化,以promise方式返回。
异步对指定卷进行格式化,以promise方式返回。
...
@@ -373,19 +373,21 @@ format(volId: string): Promise<void>
...
@@ -373,19 +373,21 @@ format(volId: string): Promise<void>
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------ | ---- | ---- |
| ----------- | ------ | ---- | ---- |
| volId | string | 是 | 卷id |
| volumeId | string | 是 | 卷id |
| fsType | string | 是 | 文件系统类型 |
**返回值:**
**返回值:**
| 类型
| 说明
|
| 类型
| 说明
|
| --------------------- | -------------
---------- |
| ---------------------- |
---------- |
| Promise
<
void
>
| 对指定卷进行格式化
|
| Promise
<
void
>
| 对指定卷进行格式化 |
**示例:**
**示例:**
```
js
```
js
let
volId
=
""
;
let
volumeId
=
""
;
volumemanager
.
format
(
volId
).
then
(
function
()
{
let
fsType
=
""
;
volumemanager
.
format
(
volumeId
,
fsType
).
then
(
function
()
{
console
.
info
(
"
format successfully
"
);
console
.
info
(
"
format successfully
"
);
}).
catch
(
function
(
error
){
}).
catch
(
function
(
error
){
console
.
info
(
"
format failed with error:
"
+
error
);
console
.
info
(
"
format failed with error:
"
+
error
);
...
@@ -394,7 +396,7 @@ format(volId: string): Promise<void>
...
@@ -394,7 +396,7 @@ format(volId: string): Promise<void>
## volumemanager.format
## volumemanager.format
format(vol
Id
: string, callback: AsyncCallback
<
void
>
): void
format(vol
umeId: string, fsType
: string, callback: AsyncCallback
<
void
>
): void
异步对指定卷进行格式化,以callback方式返回。
异步对指定卷进行格式化,以callback方式返回。
...
@@ -404,23 +406,25 @@ format(volId: string, callback: AsyncCallback<void>): void
...
@@ -404,23 +406,25 @@ format(volId: string, callback: AsyncCallback<void>): void
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------- | ---- | ---------------- |
| -------- | ------------------------- | ---- | ----------------------------- |
| volId | string | 是 | 卷id |
| volumeId | string | 是 | 卷id |
| callback | callback:AsyncCallback
<
void
>
| 是 | 对指定卷进行格式化 |
| fsType | string | 是 | 文件系统类型 |
| callback | callback:AsyncCallback
<
void
>
| 是 | 对指定卷格式化后的回调 |
**示例:**
**示例:**
```
js
```
js
let
volId
=
""
;
let
volumeId
=
""
;
volumemanager
.
format
(
volId
,
(
error
,
bool
)
=>
{
let
fsType
=
""
;
volumemanager
.
format
(
volumeId
,
fsType
,
(
error
,
bool
)
=>
{
// do something
// do something
});
});
```
```
## volumemanager.partition
## volumemanager.partition
partition(
volId: string, fstype: string
): Promise
<
void
>
partition(
diskId: string, type: number
): Promise
<
void
>
异步对磁盘进行分区,以promise方式返回。
异步对磁盘进行分区,以promise方式返回。
...
@@ -431,9 +435,9 @@ partition(volId: string, fstype: string): Promise<void>
...
@@ -431,9 +435,9 @@ partition(volId: string, fstype: string): Promise<void>
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------ | ---- | ---- |
| ----------- | ------ | ---- | ---- |
|
vol
Id | string | 是 | 卷所属的磁盘id |
|
disk
Id | string | 是 | 卷所属的磁盘id |
|
fstype | string
| 是 | 分区类型 |
|
type | number
| 是 | 分区类型 |
**返回值:**
**返回值:**
...
@@ -444,9 +448,9 @@ partition(volId: string, fstype: string): Promise<void>
...
@@ -444,9 +448,9 @@ partition(volId: string, fstype: string): Promise<void>
**示例:**
**示例:**
```
js
```
js
let
vol
Id
=
""
;
let
disk
Id
=
""
;
let
fstype
=
""
;
let
type
=
0
;
volumemanager
.
partition
(
volId
,
fs
type
).
then
(
function
()
{
volumemanager
.
partition
(
diskId
,
type
).
then
(
function
()
{
console
.
info
(
"
partition successfully
"
);
console
.
info
(
"
partition successfully
"
);
}).
catch
(
function
(
error
){
}).
catch
(
function
(
error
){
console
.
info
(
"
partition failed with error:
"
+
error
);
console
.
info
(
"
partition failed with error:
"
+
error
);
...
@@ -455,7 +459,7 @@ partition(volId: string, fstype: string): Promise<void>
...
@@ -455,7 +459,7 @@ partition(volId: string, fstype: string): Promise<void>
## volumemanager.partition
## volumemanager.partition
partition(
volId: string, fstype : string
, callback: AsyncCallback
<
void
>
): void
partition(
diskId: string, type: number
, callback: AsyncCallback
<
void
>
): void
异步对磁盘进行分区,以callback方式返回。
异步对磁盘进行分区,以callback方式返回。
...
@@ -467,16 +471,16 @@ partition(volId: string, fstype : string, callback: AsyncCallback<void>):
...
@@ -467,16 +471,16 @@ partition(volId: string, fstype : string, callback: AsyncCallback<void>):
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------- | ---- | ---------------- |
| -------- | --------------------------------------- | ---- | ---------------- |
|
vol
Id | string | 是 | 卷所属的磁盘id |
|
disk
Id | string | 是 | 卷所属的磁盘id |
|
fstype | string
| 是 | 分区类型 |
|
type | number
| 是 | 分区类型 |
| callback | callback:AsyncCallback
<
void
>
| 是 | 对磁盘进行分区 |
| callback | callback:AsyncCallback
<
void
>
| 是 | 对磁盘进行分区 |
**示例:**
**示例:**
```
js
```
js
let
vol
Id
=
""
;
let
disk
Id
=
""
;
let
fstype
=
""
;
let
type
=
0
;
volumemanager
.
partition
(
volId
,
fs
type
,
(
error
,
bool
)
=>
{
volumemanager
.
partition
(
diskId
,
type
,
(
error
,
bool
)
=>
{
// do something
// do something
});
});
```
```
...
@@ -491,6 +495,7 @@ partition(volId: string, fstype : string, callback: AsyncCallback<void>):
...
@@ -491,6 +495,7 @@ partition(volId: string, fstype : string, callback: AsyncCallback<void>):
| ----------- | ------- | -------------------- |
| ----------- | ------- | -------------------- |
| id | string | 卷id |
| id | string | 卷id |
| uuid | string | 卷uuid |
| uuid | string | 卷uuid |
| diskId | string | 卷所属的磁盘id |
| description | string | 卷相关描述 |
| description | string | 卷相关描述 |
| removable | boolean | 是否为可移动存储设备 |
| removable | boolean | 是否为可移动存储设备 |
| state | number | 当前卷状态 |
| state | number | 当前卷状态 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录