-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
Automation for azure-sdk-for-pythonA 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: |
Automation for azure-sdk-for-nodeNothing to generate for azure-sdk-for-node |
Automation for azure-sdk-for-rubyNothing to generate for azure-sdk-for-ruby |
Automation for azure-sdk-for-javaNothing to generate for azure-sdk-for-java |
Can one of the admins verify this patch? |
Automation for azure-sdk-for-goThe initial PR has been merged into your service PR: |
"api-version": "2018-07-12", | ||
"resourceName": "contoso-dl", | ||
"parameters": { | ||
"location": "West US", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
"Enterprise Channel" | ||
], | ||
"description": "Check whether an Enterprise Channel name is available.", | ||
"operationId": "EnterpriseChannels_GetCheckNameAvailability", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that you're conforming to LRO semantics? https://github.com/Azure/autorest/tree/master/docs/extensions#x-ms-long-running-operation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
-
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?
-
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this 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": { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do enums allow null?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
I'm going to be OOF all next week, so I'm marking this PR for reassignment. |
Signing off from ARm side. |
There was a problem hiding this 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": { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
} | ||
}, | ||
"EnterpriseChannelCheckNameAvailabilityResponseBody": { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammar: capital 'T'
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
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....."
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
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....."
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammar: capital 'I'
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
}
},
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
api-version
in the path should match theapi-version
in the spec).Quality of Swagger