Giter Site home page Giter Site logo

Comments (10)

dolauli avatar dolauli commented on July 30, 2024 1

@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.

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

ITNOA

@dolauli I have the same problem, Did you can provide solution for this?

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

I ask this question on SO

https://stackoverflow.com/q/77297750/1539100

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

@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.

from autorest.powershell.

dolauli avatar dolauli commented on July 30, 2024

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.
Or, you may set a placeholder in swagger. And then add a handler in our pipeline through customization to replace the host with the real host (set in env variable or a file). Here is an example how to add a handler.

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

related to BSVN/IpTables.Api#22

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

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. Or, you may set a placeholder in swagger. And then add a handler in our pipeline through customization to replace the host with the real host (set in env variable or a file). Here is an example how to add a handler.

@dolauli So How Azure implement Connect-AzAccount?

thanks a lot for helping me :)

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

@dolauli Did you can get me more advice to implementing clean code Connect-AzAccount like cmdlet?

thanks

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

I ask some question about this

Azure/azure-powershell#23233

from autorest.powershell.

soroshsabz avatar soroshsabz commented on July 30, 2024

We can done it, thanks to @dolauli .

All developers can see our example in: BSVN/IpTables.Api#56

from autorest.powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.