This topic describes how to query the details of an event bus.

Sample code:

import com.aliyun.eventbridge.EventBridge;
import com.aliyun.eventbridge.EventBridgeClient;
import com.aliyun.eventbridge.models.Config;
import com.aliyun.eventbridge.models.GetEventBusRequest;
import com.aliyun.eventbridge.models.GetEventBusResponse;

public class getEventBusSample {

    private EventBridge eventBridgeClient;

    public getEventBusSample()  {
        Config authConfig = new Config();
    authConfig.accessKeyId = "{accessKeyId}";
        authConfig.accessKeySecret = "{accessKeySecret}";
        authConfig.endpoint = "{endpoint}";
        eventBridgeClient = new EventBridgeClient(authConfig);
    }

    public void getEventBusSample() {
        try {
            GetEventBusRequest describeEventBusRequest = new GetEventBusRequest();
            describeEventBusRequest.setEventBusName("mybus");
            GetEventBusResponse deScribeResponse = eventBridgeClient.getEventBus(describeEventBusRequest);
            System.out.println("describe bus success : " + deScribeResponse);
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args)  {
        getEventBusSample sample = new getEventBusSample();
        try {
            sample.getEventBusSample();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
}