Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove-AzsPlatformImage Does Not Return Anything #44

Open
TheOnlyWei opened this issue Aug 11, 2020 · 6 comments
Open

Remove-AzsPlatformImage Does Not Return Anything #44

TheOnlyWei opened this issue Aug 11, 2020 · 6 comments
Assignees

Comments

@TheOnlyWei
Copy link
Contributor

TheOnlyWei commented Aug 11, 2020

For the AzureStack modules that are used with AzureRM, when you run a command like this:

Remove-AzsPlatformImage -Location local -Offer UbuntuServer -Publisher Canonical -Sku 16.04-LTS -Version 1.0.0

Nothing is returned. However it reportedly should return a boolean according to its documentation:

https://docs.microsoft.com/en-us/powershell/module/azs.compute.admin/remove-azsplatformimage?view=azurestackps-2.0.2&viewFallbackFrom=azurestackps-2.5.0

Another issue is that it doesn't seem to remove the image immediately, but this is not documented anywhere. The command does not stall until the removal is complete, so either that feature should be implemented or a warning given to the user.

This issue should be verified with the AzureStack modules that are used with the newer Az modules as well.

@TheOnlyWei TheOnlyWei changed the title $a = Remove-AzsPlatformImage Does Not Return Anything Remove-AzsPlatformImage Does Not Return Anything Aug 11, 2020
@bganapa
Copy link
Member

bganapa commented Aug 11, 2020

@deathly809 @hannah-murphy-0 please provide inputs here

@deathly809
Copy link
Member

It looks like it never returned a boolean value which is weird. It looks like it should delete asynchronously from the code. I will keep looking.

@deathly809
Copy link
Member

deathly809 commented Aug 11, 2020

@bganapa Isn't the powershell and documentation automatically generated?

If you look at the API spec we don't specify anything about booleans for delete.

Perhaps AutoRest made a mistake?

        "responses": {
          "200": {
            "description": "OK"
          }
        }

@TheOnlyWei
Copy link
Contributor Author

TheOnlyWei commented Sep 2, 2020

@deathly809 Sorry, I have been busy. Should the platform image be removed instantaneously? Last I remembered the command doesn't wait until the resource is deleted and also gives no warning of taking time to remove the resource. I think it would be better user experience to make the API more uniform with other commands like Remove-AzResourceGroup where it waits for the resource to be deleted while also returning a Boolean explaining that the removal was successful.

@deathly809
Copy link
Member

deathly809 commented Sep 2, 2020

I will create an internal task to see if we can get some cycles to look at this issue.

  1. See if we can make the cmdlet work like Remove-AzsResourceGroup (wait for completion)
  2. See why Remove-AzsPlatformImage is not returning a boolean.

Just to be clear, the seccond is all in the PowerShell and is created using AutoRest. I am not sure why it is treating the endpoint different.

@bganapa
Copy link
Member

bganapa commented Jan 13, 2021

@hannah-murphy-0 can you provide your inputs here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants