/// <summary> /// Update an existing nPod template. /// <para> /// Every change to a nPod template will create a new version of the /// template and generate a new unique identifier (Guid). The parent / /// original nPod template is accessible via the nPod template /// <c>ParentGuid</c> property. /// </para> /// </summary> /// <param name="input"> /// An input object that describes the changes to the nPod template /// </param> /// <returns>The created nPod template</returns> public NPodTemplate UpdateNPodTemplate(UpdateNPodTemplateInput input) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("input", input, true); return(RunMutation <NPodTemplate>(@"updateNPodTemplate", parameters)); }
/// <summary> /// Performs execution of the command /// </summary> protected override void ProcessRecord() { try { UpdateNPodTemplateInput input = new UpdateNPodTemplateInput(); if (ParameterPresent("Name")) { input.Name = Name; } if (ParameterPresent("SavingFactor")) { input.SavingFactor = SavingFactor; } if (ParameterPresent("MirroredVolume")) { input.MirroredVolume = MirroredVolume; } if (ParameterPresent("BootVolume")) { input.BootVolume = BootVolume; } if (ParameterPresent("OperatingSystem")) { input.OperatingSystem = OperatingSystem; } if (ParameterPresent("VolumeSizeBytes")) { input.VolumeSizeBytes = VolumeSizeBytes; } if (ParameterPresent("SharedLun")) { input.SharedLun = SharedLun; } if (ParameterPresent("BootVolumeSizeBytes")) { input.BootVolumeSizeBytes = BootVolumeSizeBytes; } if (ParameterPresent("BootImageURL")) { input.BootImageURL = BootImageURL; } if (ParameterPresent("Application")) { input.Application = Application; } if (ParameterPresent("Note")) { input.Note = Note; } if (ParameterPresent("SnapshotScheduleTemplateGuids")) { input.SnapshotScheduleTemplateGuids = SnapshotScheduleTemplateGuids; } if (ParameterPresent("VolumeCount")) { input.VolumeCount = VolumeCount; } NPodTemplate template = Connection.UpdateNPodTemplate(input); WriteObject(template); } catch (AggregateException exceptions) { foreach (Exception ex in exceptions.InnerExceptions) { WriteError(ex); } } catch (Exception ex) { WriteError(ex); } }