public void PatchBlobService() { var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(ExpectedResults.BlobServiceGetResponse) }; var handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; var subscriptionId = Guid.NewGuid().ToString(); var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString); var client = GetClient(handler, token); var settings = new BlobServiceWritableSettings { FrontEndCallbackThreadsCount = 100 }; var patchParam = new BlobServicePatchParameters { BlobService = new BlobServiceRequest() { Settings = settings } }; var result = client.BlobService.Patch( Constants.ResourceGroupName, Constants.FarmId, patchParam); // validate requestor Assert.Equal(handler.Method.Method, "PATCH", StringComparer.OrdinalIgnoreCase); var expectedUri = string.Format( BlobServiceUriTemplate, Constants.BaseUri, subscriptionId, Constants.ResourceGroupName, Constants.FarmId); Assert.Equal(handler.Uri.AbsoluteUri, expectedUri); CompareExpectedResult(result.Resource.BlobService); }
protected override void Execute() { string confirmString; BlobServiceWritableSettings settings = Tools.ToSettingsObject <SetBlobService, BlobServiceWritableSettings>(this, out confirmString); if (ShouldProcess( Resources.SetServiceDescription.FormatInvariantCulture(Resources.BlobService, confirmString), Resources.SetServiceWarning.FormatInvariantCulture(Resources.BlobService, confirmString), Resources.ShouldProcessCaption)) { BlobServiceGetResponse result = Client.BlobService.Patch(ResourceGroupName, FarmName, new BlobServicePatchParameters { BlobService = new BlobServiceRequest { Settings = settings } }); WriteObject(new BlobServiceResponse(result.Resource)); } }
public void PatchBlobService() { var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(ExpectedResults.BlobServiceGetResponse) }; var handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; var subscriptionId = Guid.NewGuid().ToString(); var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString); var client = GetClient(handler, token); var settings = new BlobServiceWritableSettings { FrontEndCallbackThreadsCount = 100 }; var patchParam = new BlobServicePatchParameters { BlobService = new BlobServiceRequest() { Settings = settings } }; var result = client.BlobService.Patch( Constants.ResourceGroupName, Constants.FarmId, patchParam); // validate requestor Assert.Equal(handler.Method.Method, "PATCH", StringComparer.OrdinalIgnoreCase); var expectedUri = string.Format( BlobServiceUriTemplate, Constants.BaseUri, subscriptionId, Constants.ResourceGroupName, Constants.FarmId); Assert.Equal(handler.Uri.AbsoluteUri, expectedUri); CompareExpectedResult(result.Resource.BlobService); }