The ECI Terminal allows you to interact with containers and run commands in containers. You can open the terminal in a browser or integrate the terminal into your own system. This topic describes how to use the ECI Terminal and integrate the ECI Terminal into your own system.
Use the ECI Terminal
If you want to run commands in a container when you use an elastic container instance, you can call the ExecContainerCommand API operation to obtain the WebSocketUri value. The value indicates the WebSocket URL. The WebSocket URL cannot be directly accessed by using a browser. You can use the HTTP URL returned by the ExecContainerCommand API operation.
When you call the ExecContainerCommand API operation to run a command in a container, the execution exits after the command is run. If you have multiple commands to run, you can call the ExecContainerCommand API operation repeatedly. You can also use the Workbench in the Elastic Container Instance console to connect to the container and then run interactive commands to debug the container. For more information, see Connect to an elastic container instance.
The HTTP URL is effective for 30 seconds. To use the HTTP URL to access a container, you must access this URL in your browser within 30 seconds after the ExecContainerCommand operation is called.
This operation of accessing a container is audited. You can view the audit records on the Logs page in the Elastic Container Instance console. The audit information includes the request time, instance ID, and request IP address. Audit information can be retained for up to one month.
Integrate the ECI Terminal into your own system
After you obtain the HTTP URL by calling the ExecContainerCommand API operation, you can use one of the following methods to integrate the ECI Terminal into your own system:
Access the HTTP URL in a separate window.
Use a frontend application to access the HTTP URL in a new window.
Embed the HTTP URL into the current page.
Embed the HTTP URL into a page of your own system by using an iframe.