Skip to content

Commit 13da608

Browse files
Merge pull request #971 from milvus-io/udpate-ref
update docs
2 parents 57fcb59 + 722fb0d commit 13da608

File tree

420 files changed

+34803
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+34803
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# createRole()
2+
3+
This operation creates a custom role.
4+
5+
```java
6+
public void createRole(CreateRoleReq request)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
createRole(CreateRoleReq.builder()
13+
.roleName(String roleName)
14+
.build()
15+
)
16+
```
17+
18+
**BUILDER METHODS:**
19+
20+
- `roleName(String roleName)`
21+
22+
The name of the role to create.
23+
24+
**RETURNS:**
25+
26+
*void*
27+
28+
**EXCEPTIONS:**
29+
30+
- **MilvusClientExceptions**
31+
32+
This exception will be raised when any error occurs during this operation.
33+
34+
## Example
35+
36+
```java
37+
import io.milvus.v2.client.ConnectConfig
38+
import io.milvus.v2.client.MilvusClientV2
39+
import io.milvus.v2.service.rbac.request.CreateRoleReq
40+
41+
// 1. Set up a client
42+
ConnectConfig connectConfig = ConnectConfig.builder()
43+
.uri("http://localhost:19530")
44+
.token("root:Milvus")
45+
.build();
46+
47+
MilvusClientV2 client = new MilvusClientV2(connectConfig);
48+
49+
// 2. Create a role
50+
CreateRoleReq createRoleReq = CreateRoleReq.builder()
51+
.roleName("read_only")
52+
.build();
53+
54+
client.createRole(createRoleReq);
55+
```
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# createUser()
2+
3+
This operation creates a user.
4+
5+
```java
6+
public void createUser(CreateUserReq request)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
createUser(CreateUserReq.builder()
13+
.userName(String userName)
14+
.password(String password)
15+
.build()
16+
)
17+
```
18+
19+
**BUILDER METHODS:**
20+
21+
- `userName(String roleName)`
22+
23+
The name of the user to create.
24+
25+
- `password(String password)`
26+
27+
The password of the user to create.
28+
29+
**RETURNS:**
30+
31+
*void*
32+
33+
**EXCEPTIONS:**
34+
35+
- **MilvusClientExceptions**
36+
37+
This exception will be raised when any error occurs during this operation.
38+
39+
## Example
40+
41+
```java
42+
import io.milvus.v2.client.ConnectConfig
43+
import io.milvus.v2.client.MilvusClientV2
44+
import io.milvus.v2.service.rbac.request.CreateUserReq
45+
46+
// 1. Set up a client
47+
ConnectConfig connectConfig = ConnectConfig.builder()
48+
.uri("http://localhost:19530")
49+
.token("root:Milvus")
50+
.build();
51+
52+
MilvusClientV2 client = new MilvusClientV2(connectConfig);
53+
54+
// 2. Create a user
55+
CreateUserReq createUserReq = CreateUserReq.builder()
56+
.userName("test")
57+
.password("Zilliz@2023")
58+
.build();
59+
60+
client.createUser(createUserReq);
61+
```
62+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# describeRole()
2+
3+
This operation describes a specific role.
4+
5+
```java
6+
public DescribeRoleResp describeRole(DescribeRoleReq request)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
describeRole(DescribeRoleReq.builder()
13+
.roleName(String roleName)
14+
.build()
15+
)
16+
```
17+
18+
**BUILDER METHODS:**
19+
20+
- `roleName(String roleName)`
21+
22+
The name of the role to describe.
23+
24+
**RETURN Type:**
25+
26+
*DescribeRoleResp.GrantInfo*
27+
28+
**RETURNS:**
29+
30+
A **DescribeRoleResp.GrantInfo** object representing the permissions assigned to the role.
31+
32+
**PARAMETERS:**
33+
34+
- **objectType** (*String*):
35+
The type of the object being granted a privilege.
36+
37+
- **privilege** (*String*):
38+
The specific privilege granted to the object.
39+
40+
- **objectName** (*String*):
41+
The name of the object to which the privilege is granted.
42+
43+
- **dbName** (*String*):
44+
The name of the database associated with the granted privilege.
45+
46+
- **grantor** (*String*):
47+
The name of the entity (user or role) that granted the privilege.
48+
49+
**EXCEPTIONS:**
50+
51+
- **MilvusClientExceptions**
52+
53+
This exception will be raised when any error occurs during this operation.
54+
55+
## Example
56+
57+
```java
58+
import io.milvus.v2.client.ConnectConfig
59+
import io.milvus.v2.client.MilvusClientV2
60+
import io.milvus.v2.service.rbac.request.DescribeUserReq
61+
62+
// 1. Set up a client
63+
ConnectConfig connectConfig = ConnectConfig.builder()
64+
.uri("http://localhost:19530")
65+
.token("root:Milvus")
66+
.build();
67+
68+
MilvusClientV2 client = new MilvusClientV2(connectConfig);
69+
70+
// 2. Describe a role
71+
DescribeRoleReq describeRoleReq = DescribeRoleReq.builder()
72+
.roleName("test")
73+
.build();
74+
client.describeRole(describeRoleReq);
75+
```
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# describeUser()
2+
3+
This operation describes a specific user.
4+
5+
```java
6+
public DescribeUserResp describeUser(DescribeUserReq request)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
describeUser(DescribeUserReq.builder()
13+
.userName(String userName)
14+
.build()
15+
)
16+
```
17+
18+
**BUILDER METHODS:**
19+
20+
- `userName(String userName)`
21+
22+
The name of the user to describe.
23+
24+
**RETURN TYPE:**
25+
26+
*DescribeUserResp*
27+
28+
**RETURNS:**
29+
30+
A **DescribeUserResp** object containing the details of the user.
31+
32+
**PARAMETERS:**
33+
34+
- **roles** (*List\<String\>*) -
35+
36+
A list of role names associated with the user.
37+
38+
**EXCEPTIONS:**
39+
40+
- **MilvusClientExceptions**
41+
42+
This exception will be raised when any error occurs during this operation.
43+
44+
## Example
45+
46+
```java
47+
DescribeUserReq describeUserReq = DescribeUserReq.builder()
48+
.userName("test")
49+
.build();
50+
DescribeUserResp describeUserResp = client.describeUser(describeUserReq);
51+
```
52+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# dropRole()
2+
3+
This operation drops a custom role.
4+
5+
```java
6+
public void dropRole(DropRoleReq request)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
dropRole(DropRoleReq.builder()
13+
.roleName(String roleName)
14+
.build()
15+
)
16+
```
17+
18+
**BUILDER METHODS:**
19+
20+
- `roleName(String roleName)`
21+
22+
The name of the role to drop.
23+
24+
**RETURNS:**
25+
26+
*void*
27+
28+
**EXCEPTIONS:**
29+
30+
- **MilvusClientExceptions**
31+
32+
This exception will be raised when any error occurs during this operation.
33+
34+
## Example
35+
36+
```java
37+
DropRoleReq dropRoleReq = DropRoleReq.builder()
38+
.roleName("test")
39+
.build();
40+
client.dropRole(dropRoleReq);
41+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# dropUser()
2+
3+
This operation drops a user.
4+
5+
```java
6+
public void dropUser(DropUserReq request)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
dropUser(DropUserReq.builder()
13+
.userName(String userName)
14+
.build()
15+
)
16+
```
17+
18+
**BUILDER METHODS:**
19+
20+
- `userName(String userName)`
21+
22+
The name of the user to drop.
23+
24+
**RETURNS:**
25+
26+
*void*
27+
28+
**EXCEPTIONS:**
29+
30+
- **MilvusClientExceptions**
31+
32+
This exception will be raised when any error occurs during this operation.
33+
34+
## Example
35+
36+
```java
37+
DropUserReq dropUserReq = DropUserReq.builder()
38+
.userName("test")
39+
.build();
40+
client.dropUser(dropUserReq);
41+
```

0 commit comments

Comments
 (0)