Skip to main content

instance_console_connections

Creates, updates, deletes, gets or lists an instance_console_connections resource.

Overview​

Nameinstance_console_connections
TypeResource
Idoci.compute.instance_console_connections

Fields​

The following fields are returned by SELECT queries:

The instance console connection was retrieved.

NameDatatypeDescription
idstringThe OCID of the console connection.
compartmentIdstringThe OCID of the compartment to contain the console connection.
connectionStringstringThe SSH connection string for the console connection.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
fingerprintstringThe SSH public key's fingerprint for client authentication to the console connection.
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
instanceIdstringThe OCID of the instance the console connection connects to.
lifecycleStatestringThe current state of the console connection. (ACTIVE, CREATING, DELETED, DELETING, FAILED)
serviceHostKeyFingerprintstringThe SSH public key's fingerprint for the console connection service host.
vncConnectionStringstringThe SSH connection string for the SSH tunnel used to connect to the console connection over VNC.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectinstanceConsoleConnectionId, regionGets the specified instance console connection's information.
listselectcompartmentId, regioninstanceId, limit, pageLists the console connections for the specified compartment or instance.<br /><br />For more information about instance console connections, see [Troubleshooting Instances Using Instance Console Connections](/iaas/Content/Compute/References/serialconsole.htm).<br />
createinsertregion, instanceId, publicKeyopc-retry-tokenCreates a new console connection to the specified instance.<br />After the console connection has been created and is available,<br />you connect to the console using SSH.<br /><br />For more information about instance console connections, see [Troubleshooting Instances Using Instance Console Connections](/iaas/Content/Compute/References/serialconsole.htm).<br />
updateupdateinstanceConsoleConnectionId, regionopc-request-id, if-matchUpdates the defined tags and free-form tags for the specified instance console connection.
deletedeleteinstanceConsoleConnectionId, regionif-matchDeletes the specified instance console connection.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
compartmentIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
instanceConsoleConnectionIdstringThe OCID of the instance console connection.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
instanceIdstringThe OCID of the instance.
limitintegerFor list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 50
opc-request-idstringUnique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringFor list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).

SELECT examples​

Gets the specified instance console connection's information.

SELECT
id,
compartmentId,
connectionString,
definedTags,
fingerprint,
freeformTags,
instanceId,
lifecycleState,
serviceHostKeyFingerprint,
vncConnectionString
FROM oci.compute.instance_console_connections
WHERE instanceConsoleConnectionId = '{{ instanceConsoleConnectionId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new console connection to the specified instance.<br />After the console connection has been created and is available,<br />you connect to the console using SSH.<br /><br />For more information about instance console connections, see [Troubleshooting Instances Using Instance Console Connections](/iaas/Content/Compute/References/serialconsole.htm).<br />

INSERT INTO oci.compute.instance_console_connections (
definedTags,
freeformTags,
instanceId,
publicKey,
region,
opc-retry-token
)
SELECT
'{{ definedTags }}',
'{{ freeformTags }}',
'{{ instanceId }}' /* required */,
'{{ publicKey }}' /* required */,
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
compartmentId,
connectionString,
definedTags,
fingerprint,
freeformTags,
instanceId,
lifecycleState,
serviceHostKeyFingerprint,
vncConnectionString
;

UPDATE examples​

Updates the defined tags and free-form tags for the specified instance console connection.

UPDATE oci.compute.instance_console_connections
SET
definedTags = '{{ definedTags }}',
freeformTags = '{{ freeformTags }}'
WHERE
instanceConsoleConnectionId = '{{ instanceConsoleConnectionId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id}}'
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
connectionString,
definedTags,
fingerprint,
freeformTags,
instanceId,
lifecycleState,
serviceHostKeyFingerprint,
vncConnectionString;

DELETE examples​

Deletes the specified instance console connection.

DELETE FROM oci.compute.instance_console_connections
WHERE instanceConsoleConnectionId = '{{ instanceConsoleConnectionId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;