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:
- Obtain the ModelArts VPC endpoint service address.
- Buy and connect to a ModelArts endpoint.
- Set a VPC access channel for real-time services.
- Create a private DNS zone.
- Access a real-time service through VPC.
- Obtain the ModelArts VPC endpoint service address.
- Log in to the ModelArts management console and choose Service Deployment > Real-Time Services.
- Click Access VPC. In the displayed dialog box, view the VPC endpoint service address.
Figure 1 Viewing a VPC endpoint service address
- Buy and connect to a ModelArts endpoint.
- Log in to the VPC management console. In the navigation pane, choose VPC Endpoint > VPC Endpoints.
- 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
- Region: region where the VPC endpoint is located.
- Confirm the specifications, and click Next and then Submit. The VPC endpoint list page is displayed.
- Set a VPC access channel for real-time services.
- Log in to the ModelArts management console. In the navigation pane, choose Service Deployment > Real-Time Services.
- 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
- Create a private DNS zone.
- Log in to the DNS console. In the navigation pane on the left, choose Private Zones.
- 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
- Click OK.
- Access a real-time service through VPC.
- 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
- Use GUI-based software, cURL command, or Python to access a real-time service. For details, see Access Authenticated Using a Token.
- Use the following API to access a real-time service through VPC:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.