-
Notifications
You must be signed in to change notification settings - Fork 88
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
Create connect function #1252
Comments
ITNOA @dolauli I have the same problem, Did you can provide solution for this? |
I ask this question on SO |
@siadatism You do not need to do that, since we have created a shared httpclient in a file like https://github.com/Azure/azure-powershell/blob/main/src/Databricks/generated/Module.cs. Besides I do not think you will need to check server availability, since it is rare case and the check will take some additional cost, even if the server/service is not avail and we do not have the check, the request will also fail and an error will be reported to users. |
@dolauli So, how to specify URL when I call cmdlet? For example I have a CLI for some services that host on appliance, so when I want to call CLI, I want to specify which appliance, must be response to me. |
You may use https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-parameterized-host in your swagger, by doing that, we could generate host for you to input for each cmdlet. |
related to BSVN/IpTables.Api#22 |
@dolauli So How Azure implement thanks a lot for helping me :) |
@dolauli Did you can get me more advice to implementing clean code thanks |
I ask some question about this |
We can done it, thanks to @dolauli . All developers can see our example in: BSVN/IpTables.Api#56 |
I used Autorest to create a Powershell CLI for my Rest API using its swagger. I want to have a connect function to get the server address (host) and save it for later commands like an open session. It's nice to check the server availability in the connect function as well.
Is there anything like this in the generated CLI? If not, how can I add this functionality to it? Thanks.
The text was updated successfully, but these errors were encountered: