Understanding ENUM type in API

Analepse

Member
Apr 28, 2022
5
1
8
Hello everybody,

I'm trying to understand some stuff about the API and I'm struggling using certain API options that are ENUM type...
As an example, the subnet "type" option in the SDN field (https://pve.proxmox.com/pve-docs/api-viewer/#/cluster/sdn/vnets/%7Bvnet%7D/subnets)

Maybe this topic has already been covered, but I didn't find anything relevant on where to find documentation nor examples on this data type.

Many thanks in advance for all your answers ! :)
 
Hi @Analepse , you didn't actually specify what your struggle is. There are quite a few sites that give an explanation to what an ENUM is in API, ie:
https://appwrite.io/blog/post/enums-api-design

In short, unlike general strings, ENUM has a predefined set of possibile options. In this particular case it has to be a network subnet
Not sure if both long and short formats are accepted.

good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Hi @bbgeek17, thanks for your answer. Sorry, I indeed wasn't very clear about my question. Probably because all of this wasn't very clear in my head too... I looked for what ENUM types were, and after thinking more about all of that it's more like "where can I find all the possible options", because if I understood correctly what I learned they should be defined somewhere ?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!