protected override void OnProcessRecord() { ServiceManagementPlatformImageRepositoryProfile.Initialize(); ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { OperationStatusResponse op = null; bool found = ExtensionExists(); var publishCnfm = Resources.ExtensionPublishingConfirmation; var publishCptn = Resources.ExtensionPublishingCaption; var upgradeCnfm = Resources.ExtensionUpgradingConfirmation; var upgradeCptn = Resources.ExtensionUpgradingCaption; this.IsInternalExtension = string.Equals(this.ExtensionMode, PublicModeStr) ? false : string.Equals(this.ExtensionMode, InternalModeStr) ? true : true; if (found && (this.Force.IsPresent || this.ShouldContinue(upgradeCnfm, upgradeCptn))) { var parameters = Mapper.Map <ExtensionImageUpdateParameters>(this); op = this.ComputeClient.ExtensionImages.Update(parameters); } else if (!found && (this.Force.IsPresent || this.ShouldContinue(publishCnfm, publishCptn))) { var parameters = Mapper.Map <ExtensionImageRegisterParameters>(this); op = this.ComputeClient.ExtensionImages.Register(parameters); } return(op); }); }
protected override void OnProcessRecord() { ServiceManagementPlatformImageRepositoryProfile.Initialize(); ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { var publisherExtension = this.ComputeClient.HostedServices .ListPublisherExtensions() .FirstOrDefault(e => e.ProviderNameSpace.Equals(this.Publisher) && e.Type.Equals(this.ExtensionName) && e.Version.Equals(this.Version)); if (publisherExtension != null) { IsJsonExtension = publisherExtension.IsJsonExtension; IsInternalExtension = publisherExtension.IsInternalExtension; BlockRoleUponFailure = publisherExtension.BlockRoleUponFailure; } if (!string.IsNullOrEmpty(this.ExtensionMode)) { this.IsInternalExtension = this.ExtensionMode.Equals(InternalModeStr); } var parameters = Mapper.Map <ExtensionImageUpdateParameters>(this); return(this.ComputeClient.ExtensionImages.Update(parameters)); }); }
protected override void OnProcessRecord() { ServiceManagementPlatformImageRepositoryProfile.Initialize(); if (this.Force.IsPresent || this.ShouldContinue(Resources.ExtensionUnpublishingConfirmation, Resources.ExtensionUnpublishingCaption)) { ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => this.ComputeClient.ExtensionImages.Unregister(this.Publisher, this.ExtensionName, this.Version)); } }
protected override void OnProcessRecord() { ServiceManagementPlatformImageRepositoryProfile.Initialize(); ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { var vmExtension = this.ComputeClient.VirtualMachineExtensions .ListVersions(this.Publisher, this.ExtensionName) .FirstOrDefault(e => e.Version.Equals(this.Version)); var serviceExtn = this.ComputeClient.HostedServices .ListExtensionVersions(this.Publisher, this.ExtensionName) .FirstOrDefault(e => e.Version.Equals(this.Version)); if (vmExtension != null) { IsJsonExtension = vmExtension.IsJsonExtension; IsInternalExtension = vmExtension.IsInternalExtension; DisallowMajorVersionUpgrade = vmExtension.DisallowMajorVersionUpgrade; } else if (serviceExtn != null) { IsJsonExtension = serviceExtn.IsJsonExtension; IsInternalExtension = serviceExtn.IsInternalExtension; BlockRoleUponFailure = serviceExtn.BlockRoleUponFailure; } if (!string.IsNullOrEmpty(this.ExtensionMode)) { this.IsInternalExtension = this.ExtensionMode.Equals(InternalModeStr); } var parameters = Mapper.Map <ExtensionImageUpdateParameters>(this); return(this.ComputeClient.ExtensionImages.Update(parameters)); }); }
protected override void ProcessRecord() { ServiceManagementPlatformImageRepositoryProfile.Initialize(); WriteObject(Mapper.Map <ExtensionCertificateConfig>(this)); }