Help Center/ GeminiDB/ GeminiDB Redis API/ Working with GeminiDB Redis API/ Connecting to an Instance/ Connecting to GeminiDB Redis Instances Through DAS
Updated on 2024-10-08 GMT+08:00

Connecting to GeminiDB Redis Instances Through DAS

DAS enables you to manage DB instances from a web-based console, simplifying database management and improving efficiency. You can connect and manage instances through DAS. By default, you have permissions required for remote login. DAS is secure and convenient for connecting to DB instances.

Precautions

  • If SSL is enabled, you cannot connect to a GeminiDB Redis instance through DAS.

Configuring the Required Permissions

If you have an IAM account, assign DAS FullAccess permissions to all users of the account. For details, see Create User Groups and Assign Permissions.

You can create a custom policy to specify the type of databases that you have permissions for.

  1. Log in to the IAM console and choose Permissions > Policies/Roles.
    Figure 1 Creating a custom policy
  2. Specify a policy name, policy view, and content.
    Figure 2 Configuring a custom policy
    Table 1 Custom policy description

    Parameter

    Description

    Policy Name

    Enter a policy name.

    Policy View

    Select JSON.

    Policy Content

    Configure the following policy content:

    {
        "Version": "1.1",
        "Statement": [
            {
                "Action": [
                    "das:*:*",
                    "nosql:instance:list"
               ],
                "Effect": "Allow"
            }
        ]
    }

    Alternatively, click Select Existing Policy/Role, select DAS FullAccess as a template, and retain only the DB type information. In this example, retain only nosql:instance:list.

    Description

    Enter a policy description.

    Scope

    Retain the default settings (project-level service).

  3. Click OK. You can then view the created custom policy on the Permissions page.
    Figure 3 Viewing the created policy
  4. Create a user group.
    Figure 4 Creating a user group
  5. Authorize the user group created in 4 using the created custom policy.
    Figure 5 Authorizing the user group using the created custom policy
    Figure 6 Selecting the created custom policy
  6. Click the name of the user group and add the required users.
    Figure 7 Adding users

Prerequisites

There is an available GeminiDB Redis instance.

Procedure

  1. Log in to the GeminiDB console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. In the instance list, locate the target instance and click Log In in the Operation column.

    Figure 8 Logging in to a GeminiDB Redis instance

    Alternatively, click the instance name to go to the Basic Information page. Click Log In in the upper right corner of the page.

    Figure 9 Logging in to a GeminiDB Redis instance

  4. Enter the password for logging in to the instance.

    You need to enter the password only when you log in to a GeminiDB Redis instance for the first time or after you reset the password.

    Figure 10 Login page

  5. Manage relevant databases.

    Figure 11 Instance homepage
    • Save to Executed Commands

      This function is enabled by default to save the recently executed commands for your later query.

      Then you can click the Executed Commands tab on the lower page to view historical commands.

      Figure 12 The Executed Commands tab

      If this function is disabled, the commands executed subsequently are not displayed any longer. You can click next to Save Executed SQL Statements in the upper right corner to disable this function.

    • Execute a command.

      You can enter a command in the command window and click Execute or F8.

      • Do not use transactions, Lua scripts, Pub/Sub commands, or other commands that have blocking semantics.
      • For an instance that supports multiple databases, you can change the current database on the console, but cannot change it using a SELECT statement.
      Figure 13 Executing a command

      After a command is executed, you can view the execution result on the Results page.

    • Save

      You can save a command to all instances, the current instance, or the current database. Then you can view details in My Commands.

      Figure 14 Save
    • My Commands

      Common commands are displayed the My Commands page.

      Set a filter to narrow the scope of commands. If you select All, all commands saved in the current account are displayed.

      Figure 15 Filtering commands

      Alternatively, enter a command title or statement in the search box to search for the corresponding command.

      Figure 16 Searching for a command

      On the My Commands page, you can also create, edit, and delete a command or copy it to the Execute window.

      Figure 17 Managing a command
    • Clear

      You can also press F10 to clear the command in the execution window.

      Figure 18 Clearing a command