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

fixing NRP networking resource properties #12570

Merged
merged 14 commits into from
Feb 19, 2021
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"CloudError": {
"x-ms-external": true,
"properties": {
"error": {
"Error": {
Copy link
Contributor

Choose a reason for hiding this comment

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

@msyyc @jsntcy Please review this change. Will it impact CLI?

Copy link
Member

Choose a reason for hiding this comment

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

@guptas14, Could you share the background why you need change error to Error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi,
I need to make these changes to fix the Swagger incorrectness identified by S360 automation.
There are several resource properties being returned by Networking RP service, which were missing in Swagger, or which did not tell default values.
For Error property, the Swagger definition has 'e' where all api's return error with 'E' in json object. This CloudError is a generic object for all error properties being returned.

S360 identified issues link:
https://msazure.visualstudio.com/Swagger%20KPIs/_workitems/edit/8187877

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check this report, for instance, generated by S360:
https://portal.azure-devex-tools.com/amekpis/correctness/detail?errorId=136094B8-8B18-40F7-A370-07AC2CCA81B0

Additional properties not allowed: Error
Json path: $.Error
#/definitions/CloudError
network.json#L83

@shenglol Could you please confirm here, regarding these Swagger incorrectness fixes required by NRP.

"$ref": "#/definitions/CloudErrorBody",
"description": "Cloud error body."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,10 @@
"readOnly": true,
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated."
},
"type": {
"type": "string",
"description": "Resource type."
}
},
"allOf": [
Expand Down Expand Up @@ -1153,6 +1157,14 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the network interface resource."
},
"nicType": {
"type": "string",
"description": "Type of Network Interface resource."
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
},
"privateLinkService": {
"$ref": "#/definitions/PrivateLinkService",
"description": "Privatelinkservice of the network interface resource."
}
},
"description": "NetworkInterface properties."
Expand Down Expand Up @@ -1485,7 +1497,8 @@
},
"privateIPAllocationMethod": {
"$ref": "./network.json#/definitions/IPAllocationMethod",
"description": "The private IP address allocation method."
"description": "The private IP address allocation method.",
"default": "Dynamic"
},
"subnet": {
"$ref": "./virtualNetwork.json#/definitions/Subnet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@
"resourceName": {
"type": "string",
"description": "The name of the service and resource."
},
"displayName": {
"type": "string",
"description": "Display name of the resource."
}
},
"description": "The information of an AvailablePrivateEndpointType."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the public IP address resource."
},
"natGateway": {
"$ref": "./network.json#/definitions/NatGateway",
"description": "The NatGateway for the Public IP address."
},
"migrationPhase": {
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"description": "Migration phase of Public IP Address."
},
"linkedPublicIPAddress": {
"$ref": "./network.json#/definitions/PublicIPAddress",
"description": "The linked public IP address of the public IP address resource."
}
},
"description": "Public IP address properties."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the public IP prefix resource."
},
"natGateway": {
"$ref": "./network.json#/definitions/NatGateway",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the NatGateway is defined in netGateway.json not in network.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

"description": "NatGateway of Public IP Prefix."
}
},
"description": "Public IP prefix properties."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@
},
"readOnly": true,
"description": "The list of IP address prefixes."
},
"state": {
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"readOnly": true,
"description": "The state of the service tag."
}
},
"description": "Properties of the service tag information."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1496,10 +1496,12 @@
},
"privateEndpointNetworkPolicies": {
"type": "string",
"default": "Enabled",
"description": "Enable or Disable apply network policies on private end point in the subnet."
},
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
"privateLinkServiceNetworkPolicies": {
"type": "string",
"default": "Enabled",
"description": "Enable or Disable apply network policies on private link service in the subnet."
}
},
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -1574,6 +1576,11 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the virtual network peering resource."
},
"resourceGuid": {
"readOnly": true,
"type": "string",
"description": "The resourceGuid property of the Virtual Network peering resource."
}
},
"description": "Properties of the virtual network peering."
Expand All @@ -1593,6 +1600,10 @@
"readOnly": true,
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated."
},
"type": {
"type": "string",
"description": "Resource type."
}
},
"allOf": [
Expand All @@ -1617,6 +1628,10 @@
"readOnly": true,
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated."
},
"type": {
"type": "string",
"description": "Resource type."
}
},
"allOf": [
Expand Down Expand Up @@ -1849,6 +1864,10 @@
"type": "string"
},
"description": "Contains other available private IP addresses if the asked for address is taken."
},
"isPlatformReserved": {
"type": "boolean",
"description": "Private IP address platform reserved."
}
},
"description": "Response for CheckIPAddressAvailability API service call."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"CloudError": {
"x-ms-external": true,
"properties": {
"error": {
"Error": {
"$ref": "#/definitions/CloudErrorBody",
"description": "Cloud error body."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,10 @@
"readOnly": true,
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated."
},
"type": {
"type": "string",
"description": "Resource type."
}
},
"allOf": [
Expand Down Expand Up @@ -1153,6 +1157,14 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the network interface resource."
},
"nicType": {
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"description": "Type of Network Interface resource."
},
"privateLinkService": {
"$ref": "#/definitions/PrivateLinkService",
"description": "Privatelinkservice of the network interface resource."
}
},
"description": "NetworkInterface properties."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the public IP address resource."
},
"servicePublicIPAddress": {
"$ref": "#/definitions/PublicIPAddress",
"description": "The service public IP address of the public IP address resource."
},
"natGateway": {
"$ref": "./network.json#/definitions/NatGateway",
Copy link
Member

Choose a reason for hiding this comment

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

This reference model doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@raych1 Could you guide how can I mention the reference to NatGateway model here? what should be the correct syntax?

Copy link
Member

Choose a reason for hiding this comment

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

The syntax is correct and the issue is NatGateway doesn't exist in network.json under 2020-08-01 folder.

"description": "The NatGateway for the Public IP address."
},
"migrationPhase": {
"type": "string",
"description": "Migration phase of Public IP Address."
}
},
"description": "Public IP address properties."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the public IP prefix resource."
},
"natGateway": {
"$ref": "./network.json#/definitions/NatGateway",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the NatGateway is defined in netGateway.json not in network.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

"description": "NatGateway of Public IP Prefix."
}
},
"description": "Public IP prefix properties."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,10 @@
"readOnly": true,
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated."
},
"type": {
"type": "string",
"description": "Resource type."
}
},
"allOf": [
Expand Down Expand Up @@ -1496,11 +1500,20 @@
},
"privateEndpointNetworkPolicies": {
"type": "string",
"default": "Enabled",
"description": "Enable or Disable apply network policies on private end point in the subnet."
},
"privateLinkServiceNetworkPolicies": {
"type": "string",
"default": "Enabled",
"description": "Enable or Disable apply network policies on private link service in the subnet."
guptas14 marked this conversation as resolved.
Show resolved Hide resolved
},
"applicationGatewayIpConfigurations": {
"type": "array",
"items":{
"$ref": "./applicationGateway.json#/definitions/ApplicationGatewayIPConfiguration"
},
"description": "Application gateway IP configurations of virtual network resource."
}
},
"description": "Properties of the subnet."
Expand Down Expand Up @@ -1593,6 +1606,10 @@
"readOnly": true,
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated."
},
"type": {
"type": "string",
"description": "Resource type."
}
},
"allOf": [
Expand Down