AzureML.PowerShell.PatchWebServiceEndpoint.ProcessRecord C# (CSharp) Method

ProcessRecord() protected method

protected ProcessRecord ( ) : void
return void
        protected override void ProcessRecord()
        {            
            ProgressRecord pr = new ProgressRecord(1, "Patch Web Service Endpoint", "Web Service");
            pr.PercentComplete = 1;
            pr.CurrentOperation = "Getting web service...";
            WriteProgress(pr);
            WebService ws = Sdk.GetWebServicesById(GetWorkspaceSetting(), WebServiceId);

            pr.PercentComplete = 10;
            pr.StatusDescription = "Web Service \"" + ws.Name + "\"";
            pr.CurrentOperation = "Getting web service endpoint...";
            WriteProgress(pr);

            WebServiceEndPoint wep = Sdk.GetWebServiceEndpointByName(GetWorkspaceSetting(), WebServiceId, EndpointName);
            pr.PercentComplete = 20;
            pr.StatusDescription = "Web Service \"" + ws.Name + "\", Endpoint \"" + wep.Name + "\"";
            pr.CurrentOperation = "Patching web service endpoint with new trained model...";
            WriteProgress(pr);

            dynamic patchReq = new
            {
                Resources = new[] {
                    new {
                        Name = ResourceName,
                        Location = new {
                            BaseLocation = BaseLocation,
                            RelativeLocation = RelativeLocation,
                            SasBlobToken = SasBlobToken
                        }
                    }
                }
            };
            Sdk.PatchWebServiceEndpoint(GetWorkspaceSetting(), WebServiceId, EndpointName, patchReq);
            WriteObject(string.Format("Endpoint \"{0}\" resource \"{1}\" successfully patched.", wep.Name, wep.Resources[0].Name));
        }
    }
PatchWebServiceEndpoint