Updated on 2024-05-20 GMT+08:00

Connecting to an Instance on the Console

You can connect to a GeminiDB Redis instance on the console.

Precautions

  • If SSL is enabled, you cannot connect to the instance on the console.
  • Only proxy-based general-purpose instances can be accessed on the console.

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 management console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. In the instance list, locate the instance that you want to log in to and choose 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 set the password.
    Figure 10 Login page

  5. Manage relevant databases based on service requirements.

    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.

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

    • Execute

      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 12 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 13 Saving a command
    • 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 14 Selecting a filter to view commands

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

      Figure 15 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 16 Managing a command
    • Clear

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