protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, ContainerIdOrName)) { ContainerAttachParameters attachParams = null; if (this.Attach) { attachParams = new ContainerAttachParameters { Stdin = this.Input, Stdout = true, Stderr = true, Stream = true }; } var cDetail = await DkrClient.Containers.InspectContainerAsync(id); await ContainerOperations.StartContainerAsync( this.DkrClient, id, attachParams, cDetail.Config.Tty, null, this.CmdletCancellationToken); if (PassThru) { WriteObject((await ContainerOperations.GetContainersByIdOrName(id, DkrClient)).Single()); } } }
protected override void ProcessRecord() { base.ProcessRecord(); foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { if (Force.ToBool()) { DkrClient.Containers.KillContainerAsync( id, new ContainerKillParameters()).WaitUnwrap(); } else { if (!DkrClient.Containers.StopContainerAsync( id, new ContainerStopParameters(), CancelSignal.Token).AwaitResult()) { throw new ApplicationFailedException("The container has already stopped."); } } if (PassThru.ToBool()) { WriteObject(ContainerOperations.GetContainerById(id, DkrClient)); } } }
protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, ContainerIdOrName)) { if (Force) { await DkrClient.Containers.KillContainerAsync( id, new ContainerKillParameters()); } else { if (!await DkrClient.Containers.StopContainerAsync( id, new ContainerStopParameters(), CmdletCancellationToken)) { throw new ApplicationFailedException("The container has already stopped."); } } if (PassThru) { WriteObject((await ContainerOperations.GetContainersByIdOrName(id, DkrClient)).Single()); } } }
protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, ContainerIdOrName)) { WriteObject(await DkrClient.Containers.InspectContainerAsync(id)); } }
protected override void ProcessRecord() { base.ProcessRecord(); foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { WriteObject(DkrClient.Containers.InspectContainerAsync(id).AwaitResult()); } }
protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { await DkrClient.Containers.RemoveContainerAsync(id, new ContainerRemoveParameters() { Force = Force.ToBool() } ); } }
protected override void ProcessRecord() { base.ProcessRecord(); foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { DkrClient.Containers.RemoveContainerAsync(id, new ContainerRemoveParameters() { Force = Force.ToBool() } ).WaitUnwrap(); } }
protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { if (!await DkrClient.Containers.StartContainerAsync(id, new ContainerStartParameters())) { throw new ApplicationFailedException("The container has already started."); } if (PassThru) { WriteObject((await ContainerOperations.GetContainersByIdOrName(id, DkrClient)).Single()); } } }
protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { var waitResponse = await DkrClient.Containers.WaitContainerAsync( id, CmdletCancellationToken); WriteVerbose("Status Code: " + waitResponse.StatusCode.ToString()); ContainerOperations.ThrowOnProcessExitCode(waitResponse.StatusCode); if (PassThru.ToBool()) { WriteObject(await ContainerOperations.GetContainerById(id, DkrClient)); } } }
protected override void ProcessRecord() { base.ProcessRecord(); foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { if (!DkrClient.Containers.StartContainerAsync( id, new HostConfig()).AwaitResult()) { throw new ApplicationFailedException("The container has already started."); } if (PassThru.ToBool()) { WriteObject(ContainerOperations.GetContainerById(id, DkrClient)); } } }
protected override async Task ProcessRecordAsync() { foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { var commitResult = await DkrClient.Miscellaneous.CommitContainerChangesAsync( new CommitContainerChangesParameters() { ContainerID = id, RepositoryName = Repository, Tag = Tag, Comment = Message, Author = Author, Config = Configuration }); WriteObject(await ContainerOperations.GetImageById(commitResult.ID, DkrClient)); } }
protected override void ProcessRecord() { base.ProcessRecord(); foreach (var id in ParameterResolvers.GetContainerIds(Container, Id)) { var waitResponse = DkrClient.Containers.WaitContainerAsync( id, CancelSignal.Token).AwaitResult(); WriteVerbose("Status Code: " + waitResponse.StatusCode.ToString()); ContainerOperations.ThrowOnProcessExitCode(waitResponse.StatusCode); if (PassThru.ToBool()) { WriteObject(ContainerOperations.GetContainerById(id, DkrClient)); } } }