Azure / Azure/autorest.powershell

[Size Only]:Add configuration option to make New-* cmdlets non-idempotent

Open
#569 2 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Some APIs, like AzureStack Admin APIs use PUT for create, but do not support headers like
```
if-none-match: *
```

That would force the PUT to fail if the resource already existed.

- Determine a high-level design for how we could make 'New-*' cmdlets that used such a PUT operation non-idempotent (that is, make them fail if the resource already exists)
- Determine a rough cost for implementing this in the generator

- The *brute force* method would be to compose `GET` and `PUT` operations for the resource

``` powershell
$foo = Get-AzWidget
If ($foo -ne $null)
{
throw new PSInvalidOperationException("Widget already exists")
}

New-AzWidget
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.