zilliz 1.4.3

TUI and CLI tool for managing Zilliz Cloud clusters and Milvus operations
Documentation
use zilliz::model::loader::ModelLoader;

#[test]
fn test_load_builtin_models() {
    let models = ModelLoader::load_builtin().expect("Failed to load models");

    // Control plane should have cluster, project, backup, etc.
    assert!(
        models.control_plane.resources.contains_key("cluster"),
        "Missing cluster resource"
    );
    assert!(
        models.control_plane.resources.contains_key("project"),
        "Missing project resource"
    );
    assert!(
        models.control_plane.resources.contains_key("backup"),
        "Missing backup resource"
    );
    assert_eq!(
        models.control_plane.resolved_endpoint(),
        zilliz::model::DEFAULT_CONTROL_PLANE_ENDPOINT,
        "Control plane must resolve to the default endpoint"
    );

    // Data plane should have collection, vector, etc.
    assert!(
        models.data_plane.resources.contains_key("collection"),
        "Missing collection resource"
    );
    assert!(
        models.data_plane.resources.contains_key("vector"),
        "Missing vector resource"
    );
    assert!(
        models.data_plane.resources.contains_key("index"),
        "Missing index resource"
    );

    // Verify operation parsing
    let cluster = &models.control_plane.resources["cluster"];
    assert!(cluster.operations.contains_key("list"));
    assert!(cluster.operations.contains_key("describe"));

    let list_op = &cluster.operations["list"];
    assert_eq!(list_op.method(), "GET");
    assert_eq!(list_op.path(), "/v2/clusters");
}