Azure / Azure/azure-rest-api-specs
Instance Metadata add tags object/dict
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
Hi,
so I've noticed that you've implemented tags in the instance metadata as a list.
```
curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq
[...]
"tagsList": [
{
"name": "TagName1",
"value": "Value1"
},
{
"name": "TagName2",
"value": "Value2"
}
],
[...]
```
But the tags are a dictionary, not a list because the names are unique. You can use to represent it more clearly:
```
"tagsdict": {
"TagName1": "Value1",
"Tagname2": "Value2"
}
```
If it were a "real" list in your datastructure in backend you would be able to duplicate keys. As in have same name with different values.
```
{
"compute": {
"tagsList": [
{
"name": "TagName1",
"value": "Value1"
},
{
"name": "TagName1",
"value": "Value3"
},
{
"name": "Tagname2",
"value": "Value2"
}
]
}
}
```
I would like to see a dictionary implemented so that it reflects the data structure of the backend (no duplicated keys allowed).
Greetings
Klaas
Contributor guide
Research direction
Start by locating the Azure instance metadata specification for the `/metadata/instance` endpoint and its `tagsList` response object. Compare the documented response with the requested dictionary shape and verify the expected handling of duplicate tag names; done means the specification reflects the backend structure without duplicate keys.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100