Ejemplo n.º 1
0
        public MountPoints(DockerContainer container) : base("_Mountpoint", new MountPointInstantiator())
        {
            this.container = container;
            this.device    = container.Device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Ejemplo n.º 2
0
        public MemInfo(DockerContainer container)
        {
            this.container = container;
            this.device    = container.Device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Ejemplo n.º 3
0
        public Processes(DockerContainer container) : base("Pid", new ProcessInstantiator())
        {
            this.container = container;
            this.device    = container.Device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Ejemplo n.º 4
0
        public async Task <DockerContainer> GetContainerAsync(string configuration, TargetDevice targetdevice, Action <DockerContainer> ContainerUpdated)
        {
            TorizonRestAPI.Model.DockerContainer model = Utils.ObjectOrException <TorizonRestAPI.Model.DockerContainer>(await api.ApplicationGetcontainerAsync(this.Id, configuration, targetdevice.Id));

            DockerContainer container = new DockerContainer(model, targetdevice);

            ContainerUpdated?.Invoke(container);
            return(container);
        }
Ejemplo n.º 5
0
        public DockerContainer GetSDKContainer(string configuration)
        {
            TorizonRestAPI.Model.DockerContainer model =
                Utils.ObjectOrException <TorizonRestAPI.Model.DockerContainer>(
                    api.ApplicationSdkContainer(this.Id, configuration)
                    );

            DockerContainer container = new DockerContainer(model, null);

            return(container);
        }
Ejemplo n.º 6
0
        public async Task <DockerContainer> RunAsync(string configuration, TargetDevice targetdevice, Action <string, int> runningAction, Action <DockerContainer> ApplicationStarted)
        {
            Progress        progress  = null;
            DockerContainer container = null;

            var taskBuild = CreateProgressTask(ref progress, runningAction);

            _ = api.ApplicationRunAsync(this.Id, configuration, targetdevice.Id, progress?.Id).ContinueWith(task => {
                TorizonRestAPI.Model.DockerContainer model =
                    Utils.ObjectOrException <TorizonRestAPI.Model.DockerContainer>(task.Result);

                container = new DockerContainer(model, targetdevice);
                ApplicationStarted?.Invoke(container);
            });

            await Task.Run(taskBuild);

            return(container);
        }