Beispiel #1
0
        public DockerImage(TorizonRestAPI.Model.DockerImage model, TargetDevice device)
        {
            Utils.CopyProperties <TorizonRestAPI.Model.DockerImage>(model, this, PropertyChanged);
            api = TorizonAPIManager.GetDevicesApi();

            this.Device = device;
        }
Beispiel #2
0
        public MountPoints(DockerContainer container) : base("_Mountpoint", new MountPointInstantiator())
        {
            this.container = container;
            this.device    = container.Device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Beispiel #3
0
        public MemInfo(DockerContainer container)
        {
            this.container = container;
            this.device    = container.Device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Beispiel #4
0
        public Processes(DockerContainer container) : base("Pid", new ProcessInstantiator())
        {
            this.container = container;
            this.device    = container.Device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Beispiel #5
0
        public static async Task <Application> LoadAsync(string path)
        {
            TorizonRestAPI.Api.ApplicationsApi api = TorizonAPIManager.GetApplicationsApi();

            TorizonRestAPI.Model.Application model = Utils.ObjectOrException <TorizonRestAPI.Model.Application>(await api.ApplicationsLoadAsync(path));

            return(new Application(model));
        }
Beispiel #6
0
        public static async Task <Application> CreateAsync(string platformid, string path, string username)
        {
            TorizonRestAPI.Api.ApplicationsApi api = TorizonAPIManager.GetApplicationsApi();

            TorizonRestAPI.Model.Application model = Utils.ObjectOrException <TorizonRestAPI.Model.Application>(await api.ApplicationsCreateAsync(platformid, path, username));

            return(new Application(model));
        }
Beispiel #7
0
 public static async Task <bool> CheckDockerAsync()
 {
     try
     {
         TorizonRestAPI.Api.VersionApi      api           = TorizonAPIManager.GetVersionApi();
         TorizonRestAPI.Model.DockerVersion dockerVersion = Utils.ObjectOrException <TorizonRestAPI.Model.DockerVersion>(await api.VersionDockerAsync());
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
Beispiel #8
0
        public TargetDevice(TorizonRestAPI.Model.TargetDevice model)
        {
            Utils.CopyProperties <TorizonRestAPI.Model.TargetDevice>(model, this, PropertyChanged);

            api = TorizonAPIManager.GetDevicesApi();

            this.images      = new DockerImages(this);
            this.containers  = new DockerContainers(this);
            this.processes   = new Processes(this);
            this.mountpoints = new MountPoints(this);
            this.meminfo     = new MemInfo(this);

            State        = ConnectionState.Unknown;
            ErrorMessage = "";
        }
Beispiel #9
0
        public static Action CreateProgressTask(ref Progress progressRef, Action <string, int> taskUpdateStatus)
        {
            ProgressApi progressApi = TorizonAPIManager.GetProgressApi();
            Progress    progress    = progressApi.ProgressCreate();

            progressRef = progress;

            return(() => {
                while (progress.Pending)
                {
                    progress = progressApi.ProgressStatus(progress.Id);

                    foreach (string msg in progress.Messages)
                    {
                        taskUpdateStatus?.Invoke(msg, progress._Progress);
                    }
                }

                // send 100% for the current task
                taskUpdateStatus?.Invoke("Done", -100);
            });
        }
Beispiel #10
0
        public MountPoints(TargetDevice device) : base("_Mountpoint", new MountPointInstantiator())
        {
            this.device = device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Beispiel #11
0
        public MemInfo(TargetDevice device)
        {
            this.device = device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Beispiel #12
0
 protected Eulas(IObjectsCollectionInstantiator <Eula, TorizonRestAPI.Model.Eula> instantiator) : base("Id", instantiator)
 {
     api = TorizonAPIManager.GetEulasApi();
 }
Beispiel #13
0
 public DockerImages(TargetDevice device) : base("Id", new DockerImageInstantiator(device))
 {
     this.api    = TorizonAPIManager.GetDevicesApi();
     this.device = device;
 }
Beispiel #14
0
        public Processes(TargetDevice device) : base("Pid", new ProcessInstantiator())
        {
            this.device = device;

            api = TorizonAPIManager.GetDevicesApi();
        }
Beispiel #15
0
        public Platform(TorizonRestAPI.Model.Platform model)
        {
            Utils.CopyProperties <TorizonRestAPI.Model.Platform>(model, this, PropertyChanged);

            this.api = TorizonAPIManager.GetPlatformsApi();
        }
Beispiel #16
0
 private Application(TorizonRestAPI.Model.Application model)
 {
     api = TorizonAPIManager.GetApplicationsApi();
     Utils.CopyProperties <TorizonRestAPI.Model.Application>(model, this, PropertyChanged);
 }
Beispiel #17
0
 protected Platforms(IObjectsCollectionInstantiator <Platform, TorizonRestAPI.Model.Platform> instantiator) : base("Name", instantiator)
 {
     api = TorizonAPIManager.GetPlatformsApi();
 }
Beispiel #18
0
        public Eula(TorizonRestAPI.Model.Eula model)
        {
            Utils.CopyProperties <TorizonRestAPI.Model.Eula>(model, this, PropertyChanged);

            api = TorizonAPIManager.GetEulasApi();
        }