import axios from "axios";
import { MonitoringTargetConfigCreation } from "./MonitoringTargetConfig";
import type { MonitoringType } from "./MonitoringType";

export class MonitoringConfig 
{
    constructor (
        public id: string,
        public configName: string,
        public type: string,
        public interval: string,
        public volumeConfig: VolumeConfig
    ) {}

    static create(config: MonitoringConfigCreation) 
    {
        axios.post(ApiConfig.getHttpBase() + '/monitorings', config)
        .then(() => {

        });
    }
}

class VolumeConfig
{
    constructor (
        public mountPath: string,
        public containerName: string
    ) {}
}

export class MonitoringConfigCreation {
    configName?: string;
    type?: MonitoringType;
    interval?: string;
    volumeConfig: VolumeConfigCreation = new VolumeConfigCreation();
    targetConfig: MonitoringTargetConfigCreation = new MonitoringTargetConfigCreation();
}

class VolumeConfigCreation {
    mountPath?: string
    containerName?: string
}
