oracle / oci-dotnet-sdk

Oracle Cloud Infrastructure SDK for .NET
https://cloud.oracle.com/cloud-infrastructure
Other
53 stars 22 forks source link

Cloud Shell console as a standalone app #252

Open sensboston opened 4 months ago

sensboston commented 4 months ago

Hello, is it possible to create a Cloud Shell console as standalone app? If "yes" could you please provide me a code sample/snippet, how to get connected?

Thank you!

github-anurag commented 4 months ago

@sensboston Can you elaborate on what you mean by Cloud Shell console as a standalone app? Is this something the OCI Dotnet SDK can help with?

sensboston commented 4 months ago

I mean access to the instance console via Cloud Shell: you can access even your ssh or network is broken, it's like a virtual console via serial port access (as far as I understand). Yes, of course it works fine (mostly) via website but standalone app will be also helpful, I think so.

image

github-anurag commented 4 months ago

@sensboston I found this wiki on how to do this locally: https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm#Connecti2

I hope this helps. I am closing this issue as this issue does not fall under the purview of the OCI Dotnet SDK. Please don't hesitate to contact the OCI Customer Support team, if you need any additional help.

sensboston commented 4 months ago

Hmm, you can do whatever you want but your comment isn't helpful at all 😢 Never mind, I'll figure out how to achieve my goals without your SDK and help.

github-anurag commented 4 months ago

@sensboston I apologize for the confusion, I did not see you mention that you wanted to use the OCI Dotnet SDK for this task.

If you wish to use the OCI Dotnet SDK, then you can refer to the OCI API Reference for InstanceConsoleConnection: https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/InstanceConsoleConnection/

The OCI API Reference also has the different APIs we currently support, for example CreateInstanceConsoleConnection

sensboston commented 4 months ago

@github-anurag, do you have any C# ready to work sample or at least snippet instead of pointing me to POST reference? As far as I understand, I should pass authentication first. Also, one more time: I'm not looking for SSH connection (I already and always using SSH connection) implementation; I'm interesting in use Cloud Shell console connection only.

sensboston commented 4 months ago

It seems you don't understand (or don't want to understand), what I'm asking and looking for. I'm not looking for POST samples, or SSH client guide or anything else not related to the Oracle Shell. Oracle has a very nice feature (see screenshot above) called Oracle Cloud Shell console. This web-based console allow you to access your running instance (i.e. virtual machine) "serial" console regardless of SSH or network operating state; it's like a display with keyboard connected to Linux PC, or serial monitor allowing you to access Linux/Ux computer. Yes, Oracle's web implementation is working fine and I used it sometimes to fix non-working firewall or something else (if my SSH daemon stopped working or network blocked). But I would like to have (and I wanna create it) standalone console app (with XTerm abilities) to access Cloud Shell console. What's all; I thought this API (i.e. OCI .NET SDK) should help me with that task.

jodoglevy commented 4 months ago

Cloud Shell is not accessible programatically. If you would like to request Cloud Shell programmatic access, please file a request with Oracle Support -- that would be something the Cloud Shell team would need to support before OCI SDKs can support it.

Instance console connections do not use SSH. From this link:

Instance console connections are for troubleshooting purposes only. To connect to a running instance for administration and general use, instead use a Secure Shell (SSH) or Remote Desktop connection.

This seems to match what you're looking for. From your post above:

You can access even your ssh or network is broken, it's like a virtual console via serial port access (as far as I understand).

sensboston commented 4 months ago

@jodoglevy, thank you for clarification. By the way, if I'm able to access console via browser, that means I can access console from literally everything ;) But of course if no official API exist/exposed, this will take more time...

jodoglevy commented 4 months ago

If you are suggesting sniffing the browser traffic to discover the HTTP calls being made behind the scenes between OCI browser experience and Cloud Shell, to copy that HTTP traffic in your own application -- that does not represent an official, supported OCI API, and could break at any time, since its not meant to be used from anywhere other than the OCI browser experience, today