protected override void ProcessRecord()
 {         
     if (ThrottleLevel.ToLower() == "low" && MaxConcurrentCalls != null) //if Throttle Level is set to Low, you can't set the max concurrent call number.
     {
         WriteWarning("When ThrottleLevel is set to Low, MaxConcurrentCalls is automatically set to the default value of 4.");
         MaxConcurrentCalls = null;
     }
     AddWebServiceEndpointRequest req = new AddWebServiceEndpointRequest
     {
         WebServiceId = WebServiceId,
         EndpointName = EndpointName,
         Description = Description,
         ThrottleLevel = ThrottleLevel,
         MaxConcurrentCalls = MaxConcurrentCalls,
         PreventUpdate = PreventUpdate.IsPresent
     };                        
         
     Sdk.AddWebServiceEndpoint(GetWorkspaceSetting(), req);
     WriteObject(string.Format("Web service endpoint \"{0}\" was successfully added.", EndpointName));
 }
Example #2
0
 public void AddWebServiceEndpoint(WorkspaceSetting setting, AddWebServiceEndpointRequest req)
 {
     ValidateWorkspaceSetting(setting);
     Util.AuthorizationToken = setting.AuthorizationToken;
     string queryUrl = WebServiceApi + string.Format("workspaces/{0}/webservices/{1}/endpoints/{2}", setting.WorkspaceId, req.WebServiceId, req.EndpointName);            
     string body = jss.Serialize(req);
     HttpResult hr = Util.HttpPut(queryUrl, body).Result;
     if (!hr.IsSuccess)
         throw new AmlRestApiException(hr);
 }