protected void ExecuteImageDeleteMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]);
            string imageName         = (string)ParseParameter(invokeMethodInputParameters[1]);

            ImagesClient.Delete(resourceGroupName, imageName);
        }
示例#2
0
        public void CorrectRequestForDelete() {
            var factory = Substitute.For<IConnection>();
            var client = new ImagesClient(factory);

            client.Delete(9001);

            var parameters = Arg.Is<List<Parameter>>(list => (int)list[0].Value == 9001);
            factory.Received().ExecuteRaw("images/{id}", parameters, Method.DELETE);
        }
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, CallSettings)
     // Create client
     ImagesClient imagesClient = ImagesClient.Create();
     // Initialize request argument(s)
     string project = "";
     string image   = "";
     // Make the request
     Operation response = imagesClient.Delete(project, image);
     // End snippet
 }
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteImageRequest, CallSettings)
     // Create client
     ImagesClient imagesClient = ImagesClient.Create();
     // Initialize request argument(s)
     DeleteImageRequest request = new DeleteImageRequest
     {
         RequestId = "",
         Image     = "",
         Project   = "",
     };
     // Make the request
     Operation response = imagesClient.Delete(request);
     // End snippet
 }
示例#5
0
        protected override void ProcessRecord()
        {
            ExecuteClientAction(() =>
            {
                if (ShouldProcess(this.ResourceGroupName, VerbsCommon.Remove) &&
                    (this.Force.IsPresent ||
                     this.ShouldContinue(Properties.Resources.ResourceRemovalConfirmation,
                                         "Remove-AzureRmImage operation")))
                {
                    string resourceGroupName = this.ResourceGroupName;
                    string imageName         = this.ImageName;

                    var result = ImagesClient.Delete(resourceGroupName, imageName);
                    WriteObject(result);
                }
            });
        }
        public override void ExecuteCmdlet()
        {
            ExecuteClientAction(() =>
            {
                if (ShouldProcess(this.ImageName, VerbsCommon.Remove) &&
                    (this.Force.IsPresent ||
                     this.ShouldContinue(Properties.Resources.ResourceRemovalConfirmation,
                                         "Remove-AzureRmImage operation")))
                {
                    string resourceGroupName = this.ResourceGroupName;
                    string imageName         = this.ImageName;

                    var result   = ImagesClient.Delete(resourceGroupName, imageName);
                    var psObject = new PSOperationStatusResponse();
                    ComputeAutomationAutoMapperProfile.Mapper.Map <Azure.Management.Compute.Models.OperationStatusResponse, PSOperationStatusResponse>(result, psObject);
                    WriteObject(psObject);
                }
            });
        }