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 ApplicationGroup to EventHub Namespace #17430

Merged
merged 92 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
1a41aa1
Copying latest version from stable
Jan 20, 2022
c6e218f
ApplicationGroup added
Jan 20, 2022
20796d8
Fix validations
Jan 20, 2022
4e69cb9
Fix validations
Jan 20, 2022
f6fba70
Validations fix continued
Jan 20, 2022
7a7739c
Validations fix continued
Jan 20, 2022
3123a03
Fix contd.
Jan 20, 2022
c86de98
Fix validations contd.
Jan 20, 2022
06ced13
Fix contd.
Jan 20, 2022
1d046be
Fix validations contd.
Jan 20, 2022
815c3de
Fix contd.
Jan 20, 2022
3f56089
Fix validations
Jan 21, 2022
1e14052
Fix contd.
Jan 21, 2022
286b8d4
Fix validations contd.
Jan 21, 2022
5a58986
Validations fix continued
Jan 21, 2022
2caadf1
PR comments addressed
Jan 24, 2022
09fef2e
Minor description change
Jan 24, 2022
ed395f2
Reset previous 2 commits
Jan 27, 2022
47f692e
PR comments addressed
Jan 31, 2022
a5a4148
Added x-ms-identifier in array for satisfying newly introduced pipeline.
damodaravadhani Jan 31, 2022
79f0190
Changing name field
Feb 1, 2022
8f37a1a
Merge branch 'applicationgroup-eh-v2' of https://github.com/SayanMS09…
Feb 1, 2022
374f65d
Contract changes
Feb 3, 2022
fdff5f4
PublicNetworkAccess Enum value addition for NSP
Feb 7, 2022
61e9535
Nsp public APIs
Feb 8, 2022
fb9fed9
NSP Lint fix
Feb 8, 2022
f28cbcc
Lint Update
Feb 8, 2022
a871758
Nsp Lint Update
Feb 8, 2022
95eb65e
Nsp Lint Update
Feb 8, 2022
0a01c0c
Moving NSP to correct API Version
Feb 8, 2022
b4a4ae5
Move NSP examples to correct API Version
Feb 8, 2022
a9631ec
Move NSP examples to correct API Version
Feb 8, 2022
2435f8b
Moving New update of PublicNetworkAccess to correct API Version
Feb 8, 2022
e439fa9
Nsp Examples fix
Feb 8, 2022
9a5e340
Nsp Examples fix
Feb 8, 2022
b32af66
Nsp Examples fix
Feb 8, 2022
e0c8325
Nsp Examples fix
Feb 8, 2022
388787c
Nsp Examples fix
Feb 8, 2022
0b4d73b
Spell Fix
Feb 9, 2022
00226d9
Nsp AccessRules update
Feb 9, 2022
0d40417
Swagger changes for TLS Picker
manojprasad-ms Feb 9, 2022
b6cfe53
Merge branch 'applicationgroup-eh-v2' of https://github.com/SayanMS09…
manojprasad-ms Feb 9, 2022
4d8f13b
Removing error response from the v1 definition
damodaravadhani Feb 10, 2022
c8c2121
Adding error response from the v1 definition
damodaravadhani Feb 10, 2022
e766329
NSP State enum update
Feb 14, 2022
d10918d
changed to use ErrorResponse from v2
Feb 14, 2022
88ef72a
NSP Lint Fixes
Feb 16, 2022
4c4412e
Merge branch 'applicationgroup-eh-v2' of https://github.com/SayanMS09…
Feb 16, 2022
a37a993
NSP Lint Fixes
Feb 16, 2022
33d7e6c
NSP Example update
Feb 16, 2022
596f63f
Changing data model definition
damodaravadhani Feb 17, 2022
0f26c36
Update examples
Feb 17, 2022
3aacd73
Fix style
Feb 17, 2022
eaa4588
Fix style contd.
Feb 17, 2022
e08385e
Test ApplicationGroupPolicy
Feb 17, 2022
18f698e
Test ApplicationGroupPolicy
Feb 17, 2022
a32b7c2
Test ApplicationGroupPolicy
Feb 17, 2022
174c515
Test ApplicationGroupPolicy
Feb 17, 2022
235c710
Update Policy type
Feb 18, 2022
22b53c8
Test ApplicationGroupPolicy
Feb 18, 2022
c739e98
Fix Pipeline checks
Feb 18, 2022
22456ff
Test ApplicationGroupPolicy
Feb 18, 2022
46367e8
Test ApplicationGroupPolicy
Feb 18, 2022
bc4db64
PR comments addressed
Feb 18, 2022
d9ae9aa
Fixing checks
Feb 18, 2022
a881456
Addressed comments
Feb 18, 2022
1793e30
Merge branch 'applicationgroup-eh-v2' of https://github.com/SayanMS09…
Feb 18, 2022
84f5111
TLS Picker updates - Review feedback
manojprasad-ms Feb 19, 2022
3d06638
NSP update
Feb 21, 2022
2b45b3a
NSP update
Feb 21, 2022
258a37b
NSP update
Feb 21, 2022
a208111
NSP update
Feb 21, 2022
009f7ce
Address PR comments
Feb 23, 2022
8834549
Merge branch 'applicationgroup-eh-v2' of https://github.com/SayanMS09…
Feb 23, 2022
2ac0ebe
Fix checks
Feb 23, 2022
c0a9e3d
Revert SASKeyName change
Feb 25, 2022
b2bbd6e
Added required param
Feb 25, 2022
9ae6525
Making model validation fix
damodaravadhani Feb 25, 2022
3eb3588
updated readme.md files
Mar 7, 2022
ece2399
corrected API version in python
Mar 8, 2022
f97a2c3
Update readme.md
BigCat20196 Mar 10, 2022
c8e18d6
Update readme.python.md
BigCat20196 Mar 10, 2022
c9a8e04
corrected example
Mar 14, 2022
a2da1d9
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
Mar 18, 2022
495554c
adding publicNetworkAccess to network
Mar 18, 2022
a9304a8
added SecuredByPerimeter to PublicNetworkAccess enum
Mar 18, 2022
97648b8
Addition of AccessMode Property in NetworkSecurityPerimeterConfiguration
Mar 25, 2022
7400768
added supportsScaling to clusters
Apr 12, 2022
68b72d7
Update specification/eventhub/resource-manager/readme.python.md
Apr 22, 2022
386b9a6
Update specification/eventhub/resource-manager/readme.python.md
Apr 22, 2022
ffd6f22
spell check fix
Apr 22, 2022
276f61c
api tag fix in readme.go.md
May 5, 2022
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,349 @@
{
"swagger": "2.0",
"info": {
"title": "EventHubManagementClient",
"description": "Azure Event Hubs client",
"version": "2022-01-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups": {
"get": {
"tags": [
"ApplicationGroup"
],
"operationId": "ApplicationGroup_ListByNamespace",
"x-ms-examples": {
"ListApplicationGroups": {
"$ref": "./examples/ApplicationGroup/ApplicationGroupListByNamespace.json"
}
},
"description": "Gets a list of application groups for a Namespace.",
"parameters": [
{
"$ref": "../../../common/v1/definitions.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/NamespaceNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "Namespace ApplicationGroups successfully returned.",
"schema": {
"$ref": "#/definitions/ApplicationGroupListResult"
}
},
"default": {
"description": "Eventhub error response describing why the operation failed.",
"schema": {
"$ref": "../../../common/v2/definitions.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName}": {
"put": {
"tags": [
"ApplicationGroup"
],
"operationId": "ApplicationGroup_CreateOrUpdateApplicationGroup",
"x-ms-azure-resource": true,
"x-ms-examples": {
"ApplicationGroupCreate": {
"$ref": "./examples/ApplicationGroup/ApplicationGroupCreate.json"
}
},
"description": "Creates or updates an ApplicationGroup for a Namespace.",
"parameters": [
{
"$ref": "../../../common/v1/definitions.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/NamespaceNameParameter"
},
{
"$ref": "../../../common/v2/definitions.json#/parameters/ApplicationGroupNameParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ApplicationGroup"
},
"description": "The ApplicationGroup."
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "ApplicationGroup successfully created.",
"schema": {
"$ref": "#/definitions/ApplicationGroup"
}
},
"default": {
"description": "Eventhub error response describing why the operation failed.",
"schema": {
"$ref": "../../../common/v2/definitions.json#/definitions/ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"ApplicationGroup"
],
"operationId": "ApplicationGroup_Delete",
"x-ms-examples": {
"ApplicationGroupDelete": {
"$ref": "./examples/ApplicationGroup/ApplicationGroupDelete.json"
}
},
"description": "Deletes an ApplicationGroup for a Namespace.",
"parameters": [
{
"$ref": "../../../common/v1/definitions.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/NamespaceNameParameter"
},
{
"$ref": "../../../common/v2/definitions.json#/parameters/ApplicationGroupNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "ApplicationGroup successfully deleted."
},
"204": {
"description": "No content."
},
"default": {
"description": "Eventhub error response describing why the operation failed.",
"schema": {
"$ref": "../../../common/v2/definitions.json#/definitions/ErrorResponse"
}
}
}
},
"get": {
"tags": [
"ApplicationGroup"
],
"operationId": "ApplicationGroup_Get",
"x-ms-examples": {
"ApplicationGroupGet": {
"$ref": "./examples/ApplicationGroup/ApplicationGroupGet.json"
}
},
"description": "Gets an ApplicationGroup for a Namespace.",
"parameters": [
{
"$ref": "../../../common/v1/definitions.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/NamespaceNameParameter"
},
{
"$ref": "../../../common/v2/definitions.json#/parameters/ApplicationGroupNameParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "Namespace ApplicationGroup returned successfully.",
"schema": {
"$ref": "#/definitions/ApplicationGroup"
}
},
"default": {
"description": "Eventhub error response describing why the operation failed.",
"schema": {
"$ref": "../../../common/v2/definitions.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {
"ApplicationGroupListResult": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/ApplicationGroup"
},
"description": "Result of the List Application Groups operation."
},
"nextLink": {
SayanMS09 marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"description": "Link to the next set of results. Not empty if Value contains an incomplete list of Authorization Rules"
}
},
"description": "The response from the List Application Groups operation."
},
"ApplicationGroup": {
"type": "object",
"properties": {
"properties": {
"type": "object",
"x-ms-client-flatten": true,
"properties": {
"updatedAt": {
"readOnly": true,
"format": "date-time",
"type": "string",
"description": "Exact time the Application Group was updated"
},
"createdAt": {
SayanMS09 marked this conversation as resolved.
Show resolved Hide resolved
"readOnly": true,
"format": "date-time",
"type": "string",
"description": "Exact time the Application Group was created."
},
"isEnabled": {
"type": "boolean",
"description": "Determines if Application Group is allowed to create connection with namespace or not. Once the isEnabled is set to false, all the existing connections of application group gets dropped and no new connections will be allowed"
Copy link
Member

@rkmanda rkmanda Feb 17, 2022

Choose a reason for hiding this comment

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

new connections will be allowed

Will new connections be allowed while the isEnabled flag is still false? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have mentioned "no" new connections will be allowed. Do let me know if you think any fixes need to be made.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I seemed to have read it wrong then. This is good.

},
"clientAppGroupIdentifier": {
"type": "string",
"description": "The Unique identifier for application group.Supports SAS(NamespaceSASKeyName=KeyName or EntitySASKeyName=KeyName) or AAD(AADAppID=Guid)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revert this change on SASKeyName

},
"policies": {
Copy link
Member

@rkmanda rkmanda Feb 19, 2022

Choose a reason for hiding this comment

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

policies

instead of an array why not just model it as policies.rateLimitThresholdPolicy.IncomingBytes
policies.rateLimitThresholdPolicy.OutgoingBytes
policies.rateLimitThresholdPolicy.IncomingMessages
?

Isnt it cleaner this way and you can also save on a lot of validations you might have to implement if you leave it as an array? #Closed

Copy link
Contributor Author

@SayanMS09 SayanMS09 Feb 21, 2022

Choose a reason for hiding this comment

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

I think you are coming from the perspective that there can only be 1 policy based on the metric Id which is applicable?

This makes sense to me, but:

  1. Since there will be different kinds of policies possible, so effectively it will still need to be something like this :
    { "policies": { "ThrottlingPolicy": { "IncomingBytes": 1500, "OutgoingBytes": 2000 }, "SomeOtherPolicy": { "Metric1": 1500, "Metric2": 2000 } } }
  2. Swagger will require a "type" field for inheritance logic which we have in place(which is doable above)
  3. I am not sure how complicated the validation checks will be in an array, since making above change will require service side changes and adding validation checks to an array might be easier - so the current approach might be in better for us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

@rkmanda This is also a smart approach. But it does not look extendable if we have to add more properties related to "throttlingPolicy" for the same metricId e.g if we want to add "throttlingApplicableTill" timestamp field and has the flexibility that it can be applied at individual metricId, then we loose out on that extendibility.

With arrays, yes we need to have certain checks & balances which will be present in service code and will keep getting added as the feature matures.

Copy link
Member

Choose a reason for hiding this comment

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

Ok please be aware that either ways when you add new policies, they will need to be added in a new API version. API version 1 will have to populate the policies specific to that version and API version 2 will have to add a different set on a GET verb.

The other issue with arrays is that when the client wants to modify only a single element, they still have to ensure theres logic in place to manipulate the whole array. So in general we are discouraging teams from using arrays. If you are willing to deal with the validation/ versioning complexities it is fine but pl do so with the understanding of all the implications.

"type": "array",
"items": {
"$ref": "#/definitions/ApplicationGroupPolicy"
},
"x-ms-identifiers": [],
"description": "List of group policies that define the behavior of application group. The policies can support resource governance scenarios such as limiting ingress or egress traffic."
}
}
},
"systemData": {
"readOnly": true,
"description": "The system meta data relating to this resource.",
"$ref": "../../../common/v1/definitions.json#/definitions/systemData"
}
},
"allOf": [
{
"$ref": "../../../common/v2/definitions.json#/definitions/ProxyResource"
}
],
"description": "The Application Group object"
},
"ApplicationGroupPolicy": {
"type": "object",
"discriminator": "type",
"description": "Properties of the Application Group policy",
"properties": {
"name": {
"type": "string",
"description": "The Name of this policy"
},
"type": {
"type": "string",
"enum": [
"ThrottlingPolicy"
],
"x-ms-enum": {
"name": "ApplicationGroupPolicyType",
"modelAsString": true
},
"description": "Application Group Policy types"
}
},
"required": [
"type"
]
},
"ThrottlingPolicy": {
"type": "object",
"x-ms-discriminator-value": "ThrottlingPolicy",
"description": "Properties of the throttling policy",
"properties": {
"rateLimitThreshold": {
"format": "int64",
"type": "integer",
"description": "The Threshold limit above which the application group will be throttled.Rate limit is always per second."
Copy link
Member

Choose a reason for hiding this comment

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

do we have any upper/lower limit, if there is please add in the description.

Copy link
Contributor Author

@SayanMS09 SayanMS09 Jan 31, 2022

Choose a reason for hiding this comment

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

@yogeshgargmsft Is there one? or is it limited it int64 size?

},
"metricId": {
"type": "string",
"description": "Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the Metrics section of Event Hub Namespace inside Azure Portal",
"enum": [
"IncomingBytes",
"OutgoingBytes",
"IncomingMessages"
],
"x-ms-enum": {
"name": "MetricId",
"modelAsString": true
}
}
},
"allOf": [
{
"$ref": "#/definitions/ApplicationGroupPolicy"
}
]
}
},
"parameters": {}
}
Loading