Updated on 2024-06-12 GMT+08:00

Accessing a Real-Time Service (VPC Channel)

Context

To access a ModelArts real-time service from an internal VPC node of your account, you can use a VPC channel. By creating an endpoint in your VPC and connecting to the ModelArts VPC endpoint service, you can access the real-time service from your VPC endpoint.

Procedure

To access a real-time service through a VPC channel, perform the following steps:

  1. Obtain the ModelArts VPC endpoint service address.
  2. Buy and connect to a ModelArts endpoint.
  3. Set a VPC access channel for real-time services.
  4. Create a private DNS zone.
  5. Access a real-time service through VPC.
  1. Obtain the ModelArts VPC endpoint service address.

    1. Log in to the ModelArts management console and choose Service Deployment > Real-Time Services.
    2. Click Access VPC. In the displayed dialog box, view the VPC endpoint service address.
      Figure 1 Viewing a VPC endpoint service address

  2. Buy and connect to a ModelArts endpoint.

    1. Log in to the VPC management console. In the navigation pane, choose VPC Endpoint > VPC Endpoints.
    2. Click Buy VPC Endpoint in the upper right corner.
      • Region: region where the VPC endpoint is located.

        Resources in different regions cannot communicate with each other. The region must be the same as that of ModelArts.

      • Service Category: Select Find a service by name.
      • VPC Endpoint Service Name: Enter the endpoint service address obtained in 1. Click Verify on the right. The system automatically sets VPC, Subnet, and Private IP Address.
      • Create a Private Domain Name: Retain the default setting.
        Figure 2 Buying a VPC endpoint
    3. Confirm the specifications, and click Next and then Submit. The VPC endpoint list page is displayed.

  3. Set a VPC access channel for real-time services.

    1. Log in to the ModelArts management console. In the navigation pane, choose Service Deployment > Real-Time Services.
    2. Click Access VPC. In the displayed dialog box, select the VPC used in 2. The endpoint ID and endpoint IP address are automatically displayed.
      Figure 3 Selecting VPC

  4. Create a private DNS zone.

    1. Log in to the DNS console. In the navigation pane on the left, choose Private Zones.
    2. Click Create Private Zone. Set the following parameters:
      • Domain Name: infer-modelarts-<regionId>.myhuaweicloud.com. The current region ID without hyphens (-) is the value of regionId.
      • VPC: VPC selected in Figure 4
        Figure 4 Creating a private zone
    3. Click OK.

  5. Access a real-time service through VPC.

    1. Use the following API to access a real-time service through VPC:
      https://{Private DNS domain name}/{URL}
      • Private DNS domain name: private domain name set in Figure 4. You can also click Access VPC on the real-time service list page to view the domain name in the displayed dialog box.
      • URL: The URL for a real-time service is the part after the domain name of API URL in the Usage Guides tab of the service details page.
        Figure 5 Obtaining the URL
    2. Use GUI-based software, cURL command, or Python to access a real-time service. For details, see Access Authenticated Using a Token.