Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: AnthonyTsu1984 <[email protected]>
  • Loading branch information
AnthonyTsu1984 committed Nov 28, 2024
1 parent 08332da commit 737f327
Show file tree
Hide file tree
Showing 98 changed files with 9,622 additions and 0 deletions.
75 changes: 75 additions & 0 deletions API_Reference/milvus-sdk-java/v2.4.x/v1/Alias/alterAlias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# alterAlias()

A MilvusClient interface. This method alters an alias from one collection to another.

```java
R<RpcStatus> alterAlias(AlterAliasParam requestParam);
```

#### AlterAliasParam

Use the `AlterAliasParam.Builder` to construct an `AlterAliasParam` object.

```java
import io.milvus.param.AlterAliasParam;
AlterAliasParam.Builder builder = AlterAliasParam.newBuilder();
```

Methods of `AlterAliasParam.Builder`:

<table>
<tr>
<th><p>Method</p></th>
<th><p>Description</p></th>
<th><p>Parameters</p></th>
</tr>
<tr>
<td><p><br/>withCollectionName(String collectionName)</p></td>
<td><p>Sets the target collection name. Collection name cannot be empty or null.</p></td>
<td><p>collectionName: The name of the target collection to alter the alias to.</p></td>
</tr>
<tr>
<td><p>withDatabaseName(String databaseName)</p></td>
<td><p>Sets the database name. database name can be null for default database.</p></td>
<td><p>databaseName: The database name.</p></td>
</tr>
<tr>
<td><p>withAlias(String alias)</p></td>
<td><p>Sets the collection alias to alter. Collection alias cannot be empty or null.</p></td>
<td><p>alias: The alias to alter.</p></td>
</tr>
<tr>
<td><p>build()</p></td>
<td><p>Constructs a CreateAliasParam object.</p></td>
<td></td>
</tr>
</table>

The `AlterAliasParam.Builder.build()` can throw the following exceptions:

- ParamException: error if the parameter is invalid.

#### Returns

This method catches all the exceptions and returns an `R<RpcStatus>` object.

- If the API fails on the server side, it returns the error code and message from the server.

- If the API fails by RPC exception, it returns `R.Status.Unknown` and the error message of the exception.

- If the API succeeds, it returns `R.Status.Success`.

#### Example

```java
import io.milvus.param.*;

AlterAliasParam param = AlterAliasParam.newBuilder()
.withCollection(COLLECTION_NAME)
.withAlias("alias1")
.build();
R<RpcStatus> response = client.alterAlias(param)
if (response.getStatus() != R.Status.Success.getCode()) {
System.out.println(response.getMessage());
}
```
75 changes: 75 additions & 0 deletions API_Reference/milvus-sdk-java/v2.4.x/v1/Alias/createAlias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# createAlias()

A MilvusClient interface. This method creates an alias for a collection. Alias cannot be duplicated. The same alias cannot be assigned to different collections. Instead, you can specify multiple aliases for each collection.

```java
R<RpcStatus> createAlias(CreateAliasParam requestParam);
```

#### CreateAliasParam

Use the `CreateAliasParam.Builder` to construct a `CreateAliasParam` object.

```java
import io.milvus.param.CreateAliasParam;
CreateAliasParam.Builder builder = CreateAliasParam.newBuilder();
```

Methods of `CreateAliasParam.Builder`:

<table>
<tr>
<th><p>Method</p></th>
<th><p>Description</p></th>
<th><p>Parameters</p></th>
</tr>
<tr>
<td><p>withCollectionName(<br/>String collectionName)</p></td>
<td><p>Sets the target collection name. <br/>Collection name cannot be empty or null.</p></td>
<td><p>collectionName: The name of the target collection to create an alias for.</p></td>
</tr>
<tr>
<td><p>withDatabaseName(String databaseName)</p></td>
<td><p>Sets the database name. database name can be null for default database.</p></td>
<td><p>databaseName: The database name.</p></td>
</tr>
<tr>
<td><p>withAlias(String alias)</p></td>
<td><p>Sets the collection alias.<br/>Collection alias cannot be empty or null.</p></td>
<td><p>alias: The alias of the target collection.</p></td>
</tr>
<tr>
<td><p>build()</p></td>
<td><p>Constructs a CreateAliasParam object.</p></td>
<td><p>N/A</p></td>
</tr>
</table>

`CreateAliasParam.Builder.build()` can throw the following exceptions:

- ParamException: error if the parameter is invalid.

#### Returns

This method catches all the exceptions and returns an `R<RpcStatus>` object.

- If the API fails on the server side, it returns the error code and message from the server.

- If the API fails by RPC exception, it returns `R.Status.Unknown` and the error message of the exception.

- If the API succeeds, it returns `R.Status.Success`.

#### Example

```java
import io.milvus.param.*;

CreateAliasParam param = CreateAliasParam.newBuilder()
.withCollectionName(COLLECTION_NAME)
.withAlias("alias1")
.build();
R<RpcStatus> response = client.createAlias(param)
if (response.getStatus() != R.Status.Success.getCode()) {
System.out.println(response.getMessage());
}
```
69 changes: 69 additions & 0 deletions API_Reference/milvus-sdk-java/v2.4.x/v1/Alias/dropAlias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# dropAlias()

A MilvusClient interface. This method drops an alias for the specified collection.

```java
R<RpcStatus> dropAlias(DropAliasParam requestParam);
```

#### DropAliasParam

Use the `DropAliasParam.Builder` to construct a `DropAliasParam` object.

```java
import io.milvus.param.DropAliasParam;
DropAliasParam.Builder builder = DropAliasParam.newBuilder();
```

Methods of `DropAliasParam.Builder`:

<table>
<tr>
<th><p>Method</p></th>
<th><p>Description</p></th>
<th><p>Parameters</p></th>
</tr>
<tr>
<td><p>withAlias(String alias)</p></td>
<td><p>Sets the collection alias. <br/>The alias cannot be empty or null.</p></td>
<td><p>alias: The alias to drop.</p></td>
</tr>
<tr>
<td><p>withDatabaseName(String databaseName)</p></td>
<td><p>Sets the database name. database name can be null for default database.</p></td>
<td><p>databaseName: The database name.</p></td>
</tr>
<tr>
<td><p>build()</p></td>
<td><p>Constructs a CreateAliasParam object.</p></td>
<td><p>N/A</p></td>
</tr>
</table>

The `DropAliasParam.Builder.build()` can throw the following exceptions:

- ParamException: error if the parameter is invalid.

#### Returns

This method catches all the exceptions and returns an `R<RpcStatus>` object.

- If the API fails on the server side, it returns the error code and message from the server.

- If the API fails by RPC exception, it returns `R.Status.Unknown` and the error message of the exception.

- If the API succeeds, it returns `R.Status.Success`.

#### Example

```java
import io.milvus.param.*;

DropAliasParam param = DropAliasParam.newBuilder()
.withAlias("alias1")
.build();
R<RpcStatus> response = client.dropAlias(param)
if (response.getStatus() != R.Status.Success.getCode()) {
System.out.println(response.getMessage());
}
```
69 changes: 69 additions & 0 deletions API_Reference/milvus-sdk-java/v2.4.x/v1/Alias/listAliases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# listAliases()

A MilvusClient interface. This method lists the aliases of a collection.

```java
R<ListAliasesResponse> listAliases(ListAliasesParam requestParam);
```

#### ListAliasesParam

Use the `ListAliasesParam.Builder` to construct a `ListAliasesParam` object.

```java
import io.milvus.param.ListAliasesParam;
ListAliasesParam.Builder builder = ListAliasesParam.newBuilder();
```

Methods of `ListAliasesParam.Builder`:

<table>
<tr>
<th><p>Method</p></th>
<th><p>Description</p></th>
<th><p>Parameters</p></th>
</tr>
<tr>
<td><p><br/>withCollectionName(String collectionName)</p></td>
<td><p>Sets the target collection name. Collection name cannot be empty or null.</p></td>
<td><p>collectionName: The name of the target collection to list the aliases.</p></td>
</tr>
<tr>
<td><p>withDatabaseName(String databaseName)</p></td>
<td><p>Sets the database name. database name can be null for default database.</p></td>
<td><p>databaseName: The database name.</p></td>
</tr>
<tr>
<td><p>build()</p></td>
<td><p>Constructs a ListAliasesParam object.</p></td>
<td><p>N/A</p></td>
</tr>
</table>

The `ListAliasesParam.Builder.build()` can throw the following exceptions:

- ParamException: error if the parameter is invalid.

#### Returns

This method catches all the exceptions and returns an `R<RpcStatus>` object.

- If the API fails on the server side, it returns the error code and message from the server.

- If the API fails by RPC exception, it returns `R.Status.Unknown` and the error message of the exception.

- If the API succeeds, it returns a valid `ListAliasesResponse` held by the `R` template. You can use `ListAliasesResponse` to get the information of aliases.

#### Example

```java
import io.milvus.param.*;

ListAliasesParam param = ListAliasesParam.newBuilder()
.withCollection(COLLECTION_NAME)
.build();
R<ListAliasesResponse> response = client.listAliases(param)
if (response.getStatus() != R.Status.Success.getCode()) {
System.out.println(response.getMessage());
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# createCredential()

A MilvusClient interface. This method creates a credential using the given username and password.

```java
R<RpcStatus> createCredential(CreateCredentialParam requestParam);
```

#### CreateCredentialParam

Use the `CreateCredentialParam.Builder` to construct a `CreateCredentialParam` object.

```java
import io.milvus.param.CreateCredentialParam;
CreateCredentialParam.Builder builder = CreateCredentialParam.newBuilder();
```

Methods of `CreateCredentialParam.Builder`:

<table>
<tr>
<th><p>Method</p></th>
<th><p>Description</p></th>
<th><p>Parameters</p></th>
</tr>
<tr>
<td><p>withUsername(String username)</p></td>
<td><p>Sets the username. Username cannot be empty or null.</p></td>
<td><p>username: The user name used to create the credential.</p></td>
</tr>
<tr>
<td><p>withPassword(String password)</p></td>
<td><p>Sets the password. Password cannot be empty or null.</p></td>
<td><p>password: The corresponding password to create the credential.</p></td>
</tr>
<tr>
<td><p>build()</p></td>
<td><p>Constructs a CreateCredentialParam object.</p></td>
<td><p>N/A</p></td>
</tr>
</table>

The `CreateCredentialParam.Builder.build()` can throw the following exceptions:

- ParamException: error if the parameter is invalid.

#### Returns

This method catches all the exceptions and returns an `R<RpcStatus>` object.

- If the API fails on the server side, it returns the error code and message from the server.

- If the API fails by RPC exception, it returns `R.Status.Unknown` and the error message of the exception.

- If the API succeeds, it returns `R.Status.Success`.

#### Example

```java
import io.milvus.param.*;

CreateCredentialParam param = CreateCredentialParam.newBuilder()
.withUsername("user")
.withPassword("password")
.build();
R<RpcStatus> response = client.createCredential(param)
if (response.getStatus() != R.Status.Success.getCode()) {
System.out.println(response.getMessage());
}
```
Loading

0 comments on commit 737f327

Please sign in to comment.