Azure / Azure/azure-sdk-for-python

Invalid value given for parameter Tier

Aperta
#44,200 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
customer-reported Mgmt needs-team-attention PostgreSQL question
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g
PR unite (30g)
217

Descrizione

- **Package Name**: azure-mgmt-postgresqlflexibleservers
- **Package Version**: 2.0.0
- **Operating System**: Windows 11
- **Python Version**: 3.10

**Describe the bug**
A clear and concise description of what the bug is.

After the major change to 2.0.0 I am testing my script and receiving the following error message:
Invalid value given for parameter Tier from the class 'azure.core.exceptions.HttpResponseError'.

The tier values are provided for SKU and Storage. The error appeared after I have changed the code for the server creation from begin_create to begin_create_and_update. The begin_update function was also updated and that works fine with the same parametrisation.

By debugging the code I can see, that the SKU tier is Bustable and the Storage is serialized to P1 value.

The documentation in the Python SDK reference seems not to be updated, but based on the code the change can be implemented more or less straight forward.

The error message is not referring which Tire argument is None more precisely.

(, HttpResponseError('(InvalidParameterValue) Invalid value given for parameter Tier. Specify a valid parameter value.\nCode: InvalidParameterValue\nMessage: Invalid value given for parameter Tier. Specify a valid parameter value.'), )

'(InvalidParameterValue) Invalid value given for parameter Tier. Specify a valid parameter value.
Code: InvalidParameterValue
Message: Invalid value given for parameter Tier. Specify a valid parameter value., NoneType: None'

The serialized json content sent is based on debugging looks similar
{'location': 'westeurope', 'properties': {'administratorLogin': 'dbpostgres', 'administratorLoginPassword': 'something', 'authConfig': {'activeDirectoryAuth': 'Enabled', 'passwordAuth': 'Enabled', 'tenantId': ''}, 'availabilityZone': '', 'backup': {'backupRetentionDays': 7, 'geoRedundantBackup': 'Enabled'}, 'createMode': 'Create', 'highAvailability': {'standbyAvailabilityZone': ''}, 'maintenanceWindow': {'customWindow': 'Disabled', 'dayOfWeek': 0, 'startHour': 0, 'startMinute': 0}, 'network': {'delegatedSubnetResourceId': '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/common/providers/Microsoft.Network/virtualNetworks/vNet1/subnets/build-postgres-subnet', 'privateDnsZoneArmResourceId': '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/platform-rg/providers/Microsoft.Network/privateDnsZones/flexible.private.postgres.database.azure.com', 'publicNetworkAccess': 'Disabled'}, 'storage': {'storageSizeGB': 32, 'tier': 'P1'}, 'version': '11'}, 'sku': {'name': 'Standard_B1ms', 'tier': 'Burstable'}}

**To Reproduce**
Steps to reproduce the behavior:
1. I am trying to create a flexible server to test the code after the major change.

**Expected behavior**
A clear and concise description of what you expected to happen.

The request is accepted to create the server.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo la creazione di un server flessibile con azure-mgmt-postgresqlflexibleservers 2.0.0, quindi confronta la serializzazione della richiesta di begin_create_and_update con il percorso funzionante begin_update. Esamina come vengono convalidati e serializzati i valori di SKU e del livello di archiviazione. Il lavoro è completato quando i parametri di livello documentati vengono accettati durante la creazione e l'errore identifica il Tier non valido quando la convalida fallisce.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, postgresql, python
Ambito
cloud, databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.