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

Add Bot Framework Enterprise Channel resources. #3577

Merged
merged 13 commits into from
Sep 5, 2018

Conversation

NickEricson
Copy link
Contributor

@NickEricson NickEricson commented Aug 3, 2018

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Aug 3, 2018

Automation for azure-sdk-for-python

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-python#3252

@AutorestCI
Copy link

AutorestCI commented Aug 3, 2018

Automation for azure-sdk-for-node

Nothing to generate for azure-sdk-for-node

@AutorestCI
Copy link

AutorestCI commented Aug 3, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Aug 3, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@AutorestCI
Copy link

AutorestCI commented Aug 3, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#2606

"api-version": "2018-07-12",
"resourceName": "contoso-dl",
"parameters": {
"location": "West US",
Copy link
Contributor

Choose a reason for hiding this comment

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

So, do enterprise channels have a location? Bots and channels are global. Seems accurate since there will be an app service for them, but want to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enterprise Channels have a location - there are resources associated with just the channel itself and they are deployed to this region.

"properties": {
"nodes": [
{
"id": "00000000-0000-0000-0000-000000000000",
Copy link
Contributor

Choose a reason for hiding this comment

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

How do users know what to put here? I'm curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has to be a guid. I could allow empty on create calls and generate one for them.

After the create they will have one of course - the get will return it.

@@ -1012,6 +1012,283 @@
"nextLinkName": "nextLink"
}
}
},
"/providers/Microsoft.BotService/checkECNameAvailability": {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not full name? There are people that consume the API and readability of the paths is quite valuable. I'd root for checkEnterpriseChannelNameAvailability

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, changed.

"properties": {
"id": {
"type": "string",
"description": "Id of Enterprise Channel Node"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do users set this or do we assign it? Use mutability / readonly attributes to clarify which fields we generate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I set the node id to be readonly since it is generated and cannot be changed by the user.

"type": "string",
"description": "The name of the Enterprise Channel Node"
},
"azureSku": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to declare an enum or a list api for these? What are the options?

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 can probably add this later. We don't have the options yet.

"type": "string",
"description": "The sku of the Enterprise Channel Node"
},
"azureLocation": {
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't location and sku part of the nested resource itself? do we need to repeat them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are different - nodes are deployed in their own locations. So there is an Enterprise Channel deployed in a location that has associated with it a set of nodes deployed in their own locations. They are a single entity - one cannot live without the other.

marstr
marstr previously requested changes Aug 6, 2018
"Enterprise Channel"
],
"description": "Check whether an Enterprise Channel name is available.",
"operationId": "EnterpriseChannels_GetCheckNameAvailability",
Copy link
Member

Choose a reason for hiding this comment

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

Please update the name of this operation group to be singular instead of plural.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, when I try to change the name to EnterpriseChannel_GetCheckNameAvailability I get the following warning.

WARNING (OperationIdNounConflictingModelNames/R2063/SDKViolation): OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'EnterpriseChannelModel'. Consider using the plural form of 'EnterpriseChannel' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
- file:///C:/src/azure-rest-api-specs/specification/botservice/resource-manager/Microsoft.BotService/preview/2018-07-12/botservice.json:1022:8 ($.paths["/providers/Microsoft.BotService/checkEnterpriseChannelNameAvailability"].get.operationId)

What do you suggest?

Copy link
Member

Choose a reason for hiding this comment

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

Ah got it, sorry please ignore my earlier suggestion.

Copy link
Member

Choose a reason for hiding this comment

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

@NickEricson
Regarding this operation - are you sure it should be a GET and not a POST?
According to this PR - maybe it should be POST:
#3781

Additionally - "GetCheckNameAvailability" is a bit of a mouthful - I would change this to just "CheckNameAvailability"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, good catch.

"schema": {
"$ref": "#/definitions/EnterpriseChannel"
},
"description": "The parameters to provide to update the Enterprise Channel."
Copy link
Member

Choose a reason for hiding this comment

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

This will need x-ms-parameter-location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add it to the body parameter? Docs mention that
"This extension can only be applied on global parameters. If this is applied on any parameter in an operation then it will be ignored."

resourceGroupNameParameter and resourceNameParameter have x-ms-parameter-location as method already.

Copy link
Member

Choose a reason for hiding this comment

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

Whoops, sorry ignore this comment as well.

"schema": {
"$ref": "#/definitions/EnterpriseChannel"
},
"description": "The parameters to provide for the new Enterprise Channel."
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}
},
"201": {
"description": "If resource is created successfully, the service should return 201 (Created). Execution to continue asynchronously.",
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will do that. I think I need to add a route to handle the LRO responses.

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 added these:

"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options" : {
"final-state-via": "azure-async-operation"
},

Two questions:

  1. We are using the Azure RP SDK (https://msazure.visualstudio.com/One/_git/AzureUX-ResourceProviderSDK) to build the SDK. Is this the correct "final-state-via" to use when we return ResourceOperationStatus.CompleteAsynchronously from the IManagedGroupWideResourceTypeHandler instance?

  2. Do we need to define the route we are using for returning the Operation Result status when Azure is polling us for completion? We are using the DefaultOperationResultsResourceTypeHandler which seems to hit the route operationresults/{operationResultName}. Looking at some of the current swaggers I do not see that route in them (ie Disk.json).

Copy link
Member

Choose a reason for hiding this comment

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

@shahabhijeet, do you have any insight to offer to @NickEricson on Long Running Operations implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marstr @shahabhijeet Is there anything else we need to do here?

@marstr marstr added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Aug 6, 2018
@marstr marstr requested a review from ravbhatnagar August 6, 2018 21:59
Copy link
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

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

couple of notes.

},
"EnterpriseChannelProperties": {
"properties": {
"state": {
Copy link
Contributor

Choose a reason for hiding this comment

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

please make it an enum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do enums allow null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like I can do Enum as string like ProvisioningState

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

"type": "string",
"description": "The name of the Enterprise Channel Node"
},
"azureSku": {
Copy link
Contributor

Choose a reason for hiding this comment

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

how is this different from the ARM top level sku property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can add nodes to a channel which can have different performance characteristics. Customers will be charged different amount based on the channel sku + sum of the node sku.

Nodes cannot exist without a channel and channels can't exist without a node.

@marstr
Copy link
Member

marstr commented Aug 24, 2018

I'm going to be OOF all next week, so I'm marking this PR for reassignment.

@azuresdkci azuresdkci assigned annatisch and unassigned marstr Aug 24, 2018
@azuresdkci azuresdkci requested a review from annatisch August 24, 2018 21:25
@ravbhatnagar
Copy link
Contributor

Signing off from ARm side.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Aug 28, 2018
Copy link
Member

@annatisch annatisch left a comment

Choose a reason for hiding this comment

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

Just some minor things.

Please be consistent with your descriptions for capitalization, adding periods to the end of sentences, capitalizing abbreviations ("ID") etc - as these descriptions will be used to generate the reference docs for both the API and all the client SDKs :)

@@ -2127,6 +2416,122 @@
"type": "string"
}
}
},
"EnterpriseChannelCheckNameAvailabilityRequestBody": {
Copy link
Member

Choose a reason for hiding this comment

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

We try to avoid REST API terminology in the naming of models - as it is confusing in the client-side user experience - can you please rename this definition? Even if you just remove "Body" from the end, e.g.:
EnterpriseChannelCheckNameAvailabilityRequest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

}
}
},
"EnterpriseChannelCheckNameAvailabilityResponseBody": {
Copy link
Member

Choose a reason for hiding this comment

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

We try to avoid REST API terminology in the naming of models - as it is confusing in the client-side user experience - can you please rename this definition? Even if you just remove "Body" from the end, e.g.:
EnterpriseChannelCheckNameAvailabilityResponse

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

"type": "object",
"properties": {
"name": {
"description": "the name of the Enterprise Channel for which availability needs to be checked.",
Copy link
Member

Choose a reason for hiding this comment

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

Minor grammar: capital 'T'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -2127,6 +2416,122 @@
"type": "string"
}
}
},
"EnterpriseChannelCheckNameAvailabilityRequestBody": {
"description": "The request body for a request to Bot Service Management to check availability of an Enterprise Channel name.",
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid REST API terminology in the parameter descriptions:
e.g. "A request to Bot Service Management to check availability of....."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

}
},
"EnterpriseChannelCheckNameAvailabilityResponseBody": {
"description": "The response body returned for a request to Bot Service Management to check availability of an Enterprise Channel name.",
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid REST API terminology in the parameter descriptions:
e.g. "The name availability response from Bot Service Management for an Enterprise Channel....."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

"type": "object",
"properties": {
"valid": {
"description": "indicates if the Enterprise Channel name is valid.",
Copy link
Member

Choose a reason for hiding this comment

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

Minor grammar: capital 'I'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

"type": "boolean"
},
"message": {
"description": "additional message from the bot management api showing why a bot name is not available",
Copy link
Member

Choose a reason for hiding this comment

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

Minor grammar: capital 'A' and add period '.'

Also, in other places you have capitalized "Bot Service Management" - I would probably just simplify the description, e.g.:
"Additional information about why a bot name is not available."

"description": "Id of Enterprise Channel Node. This is generated by the Bot Framework.",
"readOnly": true
},
"state": {
Copy link
Member

Choose a reason for hiding this comment

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

I see that EnterpriseChannelNode and EnterpriseChannelProperties both have a "state" parameter defined by an enum. Is the intention that these enums are the same? Currently, they both have the name "state", so when generated to a client - they are both referencing the same enum model. Does this sound correct to you? (i.e. both models will use exactly the same values for this parameter).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not want them to reference the same model - they are different enums. We want the properties to have the name state in both of them. Do I change the x-ms-enum to something else ie:

"state": {
"type": "string",
"description": "The current state of the Enterprise Channel Node.",
"enum": ["Creating", "CreateFailed", "Started", "Starting", "StartFailed", "Stopped", "Stopping", "StopFailed", "Deleting", "DeleteFailed"],
"x-ms-enum": {
"name": "nodeState", <-------------- change this.
"modelAsString": true
}
},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That seemed right so I did that. Let me know if I went the wrong way

Copy link
Member

Choose a reason for hiding this comment

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

Yes that's correct - changing "nodeState" to something specific should fix it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to EnterpriseChannelNodeState

"name": "parameters",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
Copy link
Member

Choose a reason for hiding this comment

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

Hi @NickEricson - last question:
Are you sure you wish to flatten out the body parameter here? It's not wrong - but does result in rather a large generated method signature:
https://github.com/Azure/azure-sdk-for-python/pull/3151/files#diff-c30e6c4ddd2d3e8f68fd313d4757fe05R327

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are using it on our other objects as well and would like to be consistent.

@marstr marstr dismissed their stale review September 5, 2018 16:34

Anna's is sufficient!

@annatisch annatisch merged commit 33a02b6 into Azure:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review Reassign
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants