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

Adding a new GET api in Microsoft.Network for ServiceTags, with pagination #11075

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"parameters": {
"api-version": "2020-07-01",
"location": "centraluseuap",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "Public",
"id": "/subscriptions/5833e0eb-b53c-4156-b478-2eac8f04aec6/providers/Microsoft.Network/serviceTags/Public",
"type": "Microsoft.Network/serviceTags",
"changeNumber": "74",
"cloud": "Public",
"tagname": "ActionGroup",
"tagid": "ActionGroup",
"properties": {
"changeNumber": "3",
"region": "",
"state": "GA",
"networkFeatures": [
"API",
"NSG",
"UDR",
"FW"
],
"systemService": "ActionGroup",
"addressPrefixes": [
"13.66.60.119/32",
"13.66.143.220/30",
"13.66.202.14/32",
"13.66.248.225/32",
"13.66.249.211/32",
"13.67.10.124/30",
"13.69.109.132/30",
"13.71.199.112/30",
"13.77.53.216/30",
"13.77.172.102/32",
"13.77.183.209/32",
"13.78.109.156/30",
"13.84.49.247/32",
"13.84.51.172/32",
"13.84.52.58/32",
"13.86.221.220/30",
"13.106.38.142/32",
"13.106.38.148/32",
"13.106.54.3/32",
"13.106.54.19/32",
"13.106.57.181/32",
"13.106.57.196/31",
"20.38.149.132/30",
"20.42.64.36/30",
"20.43.121.124/30",
"20.44.17.220/30",
"20.45.123.236/30",
"20.150.172.228/30",
"20.192.238.124/30",
"20.193.202.4/30",
"40.68.195.137/32",
"40.68.201.58/32",
"40.68.201.65/32",
"40.68.201.206/32",
"40.68.201.211/32",
"40.68.204.18/32",
"40.115.37.106/32",
"40.121.219.215/32",
"40.121.221.62/32",
"40.121.222.201/32",
"40.121.223.186/32",
"51.104.9.100/30",
"52.183.20.244/32",
"52.183.31.0/32",
"52.183.94.59/32",
"52.184.145.166/32",
"191.233.50.4/30",
"191.233.207.64/26",
"2603:1020:605:402::178/125",
"2603:1020:c04:402::178/125"
]
}
},
{
"name": "Public",
"id": "/subscriptions/5833e0eb-b53c-4156-b478-2eac8f04aec6/providers/Microsoft.Network/serviceTags/Public",
"type": "Microsoft.Network/serviceTags",
"changeNumber": "74",
"cloud": "Public",
"tagname": "ActionGroup.EastUS2",
"tagid": "ActionGroup.EastUS2",
"properties": {
"changeNumber": "1",
"region": "eastus2",
"state": "GA",
"networkFeatures": [
"API",
"NSG",
"FW"
],
"systemService": "ActionGroup",
"addressPrefixes": [
"20.44.17.220/30",
"52.184.145.166/32"
]
}
},
{
"name": "Public",
"id": "/subscriptions/5833e0eb-b53c-4156-b478-2eac8f04aec6/providers/Microsoft.Network/serviceTags/Public",
"type": "Microsoft.Network/serviceTags",
"changeNumber": "74",
"cloud": "Public",
"tagname": "ActionGroup.GermanyWestCentral",
"tagid": "ActionGroup.GermanyWestCentral",
"properties": {
"changeNumber": "1",
"region": "germanywc",
"state": "GA",
"networkFeatures": [
"API",
"NSG",
"FW"
],
"systemService": "ActionGroup",
"addressPrefixes": [
"2603:1020:c04:402::178/125"
]
}
},
{
"name": "Public",
"id": "/subscriptions/5833e0eb-b53c-4156-b478-2eac8f04aec6/providers/Microsoft.Network/serviceTags/Public",
"type": "Microsoft.Network/serviceTags",
"changeNumber": "74",
"cloud": "Public",
"tagname": "ActionGroup.UKWest",
"tagid": "ActionGroup.UKWest",
"properties": {
"changeNumber": "1",
"region": "ukwest",
"state": "GA",
"networkFeatures": [
"API",
"NSG",
"FW"
],
"systemService": "ActionGroup",
"addressPrefixes": [
"2603:1020:605:402::178/125"
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,49 @@
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags/paged": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you should added new API for the paged version of serviceTags. Please look at other examples in NRP to evolve the existing API to support paging.

Copy link
Contributor Author

@guptas14 guptas14 Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chiragg4u So, as I discussed with you during office hours, https://stackoverflow.microsoft.com/questions/225823 , the current ServiceTag definition returned by api is a single object of structure:

public class ServiceTag {

public string Name { get; set; }

public string Id { get; set; }

public string Type { get; set; }

public string ChangeNumber { get; set; }

public string Cloud { get; set; }

public List<ServiceTagInformation> Values { get; set; }

}

And, the requirement is to paginate over the Values list , and not ServiceTag.
Hence, I plan to add a new definition ServiceTagsDetail, as per the PR.
If I change the definition returned by old api, it would break the existing workflow.
What do you suggest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO adding a query parameter to get the optimal response would be better

"get": {
"operationId": "ServiceTagsDetail_List",
"description": "Gets a list of service tag detail resources, paginated.",
"parameters": [
{
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The location that will be used as a reference for version (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to)."
},
{
"$ref": "./network.json#/parameters/ApiVersionParameter"
},
{
"$ref": "./network.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "Request successful. Returns a list of service tag detail resources, paginated.",
"schema": {
"$ref": "#/definitions/ServiceTagsDetailResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./network.json#/definitions/CloudError"
}
}
},
"x-ms-examples": {
"Get list of service tags": {
"$ref": "./examples/ServiceTagsDetailResult.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -161,6 +204,67 @@
}
},
"description": "Properties of the service tag information."
},
"ServiceTagsDetailResult": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/ServiceTagsDetail"
},
"description": "A list of ServiceTags detail in pages."
},
"nextLink": {
"type": "string",
"description": "The URL to get the next set of results."
}
},
"description": "Response for the ListServiceTags Paginated API service call."
},
"ServiceTagsDetail": {
"properties": {
"name": {
"type": "string",
"readOnly": true,
"description": "The name of the cloud."
},
"id": {
"type": "string",
"readOnly": true,
"description": "The ID of the cloud."
},
"type": {
"type": "string",
"readOnly": true,
"description": "The azure resource type."
},
"changeNumber": {
"type": "string",
"readOnly": true,
"description": "The iteration number."
},
"cloud": {
"type": "string",
"readOnly": true,
"description": "The name of the cloud."
},
"tagname": {
"type": "string",
"readOnly": true,
"description": "The name of service tag."
},
"tagid": {
"type": "string",
"readOnly": true,
"description": "The ID of service tag."
},
"properties": {
"$ref": "#/definitions/ServiceTagInformationPropertiesFormat",
"readOnly": true,
"description": "Properties of the service tag information."
}
},
"description": "Service Tag Detail resource."
}
}
}