Session

class oci.bastion.models.Session(**kwargs)

Bases: object

A bastion session resource. A bastion session lets authorized users connect to a target resource using a Secure Shell (SSH) for a predetermined amount of time.

Attributes:

KEY_TYPE_PUB

A constant which can be used with the key_type property of a Session.

LIFECYCLE_STATE_ACTIVE

A constant which can be used with the lifecycle_state property of a Session.

LIFECYCLE_STATE_CREATING

A constant which can be used with the lifecycle_state property of a Session.

LIFECYCLE_STATE_DELETED

A constant which can be used with the lifecycle_state property of a Session.

LIFECYCLE_STATE_DELETING

A constant which can be used with the lifecycle_state property of a Session.

LIFECYCLE_STATE_FAILED

A constant which can be used with the lifecycle_state property of a Session.

bastion_id

[Required] Gets the bastion_id of this Session.

bastion_name

[Required] Gets the bastion_name of this Session.

bastion_public_host_key_info

Gets the bastion_public_host_key_info of this Session.

bastion_user_name

Gets the bastion_user_name of this Session.

display_name

Gets the display_name of this Session.

id

[Required] Gets the id of this Session.

key_details

[Required] Gets the key_details of this Session.

key_type

Gets the key_type of this Session.

lifecycle_details

Gets the lifecycle_details of this Session.

lifecycle_state

[Required] Gets the lifecycle_state of this Session.

session_ttl_in_seconds

[Required] Gets the session_ttl_in_seconds of this Session.

ssh_metadata

Gets the ssh_metadata of this Session.

target_resource_details

[Required] Gets the target_resource_details of this Session.

time_created

[Required] Gets the time_created of this Session.

time_updated

Gets the time_updated of this Session.

Methods:

__init__(**kwargs)

Initializes a new Session object with values from keyword arguments.

KEY_TYPE_PUB = 'PUB'

A constant which can be used with the key_type property of a Session. This constant has a value of “PUB”

LIFECYCLE_STATE_ACTIVE = 'ACTIVE'

A constant which can be used with the lifecycle_state property of a Session. This constant has a value of “ACTIVE”

LIFECYCLE_STATE_CREATING = 'CREATING'

A constant which can be used with the lifecycle_state property of a Session. This constant has a value of “CREATING”

LIFECYCLE_STATE_DELETED = 'DELETED'

A constant which can be used with the lifecycle_state property of a Session. This constant has a value of “DELETED”

LIFECYCLE_STATE_DELETING = 'DELETING'

A constant which can be used with the lifecycle_state property of a Session. This constant has a value of “DELETING”

LIFECYCLE_STATE_FAILED = 'FAILED'

A constant which can be used with the lifecycle_state property of a Session. This constant has a value of “FAILED”

__init__(**kwargs)

Initializes a new Session object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • id (str) – The value to assign to the id property of this Session.

  • display_name (str) – The value to assign to the display_name property of this Session.

  • bastion_id (str) – The value to assign to the bastion_id property of this Session.

  • bastion_name (str) – The value to assign to the bastion_name property of this Session.

  • bastion_user_name (str) – The value to assign to the bastion_user_name property of this Session.

  • target_resource_details (oci.bastion.models.TargetResourceDetails) – The value to assign to the target_resource_details property of this Session.

  • ssh_metadata (dict(str, str)) – The value to assign to the ssh_metadata property of this Session.

  • key_type (str) – The value to assign to the key_type property of this Session. Allowed values for this property are: “PUB”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • key_details (oci.bastion.models.PublicKeyDetails) – The value to assign to the key_details property of this Session.

  • bastion_public_host_key_info (str) – The value to assign to the bastion_public_host_key_info property of this Session.

  • time_created (datetime) – The value to assign to the time_created property of this Session.

  • time_updated (datetime) – The value to assign to the time_updated property of this Session.

  • lifecycle_state (str) – The value to assign to the lifecycle_state property of this Session. Allowed values for this property are: “CREATING”, “ACTIVE”, “DELETING”, “DELETED”, “FAILED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • lifecycle_details (str) – The value to assign to the lifecycle_details property of this Session.

  • session_ttl_in_seconds (int) – The value to assign to the session_ttl_in_seconds property of this Session.

property bastion_id

[Required] Gets the bastion_id of this Session. The unique identifier (OCID) of the bastion that is hosting this session.

Returns

The bastion_id of this Session.

Return type

str

property bastion_name

[Required] Gets the bastion_name of this Session. The name of the bastion that is hosting this session.

Returns

The bastion_name of this Session.

Return type

str

property bastion_public_host_key_info

Gets the bastion_public_host_key_info of this Session. The public key of the bastion host. You can use this to verify that you’re connecting to the correct bastion.

Returns

The bastion_public_host_key_info of this Session.

Return type

str

property bastion_user_name

Gets the bastion_user_name of this Session. The username that the session uses to connect to the target resource.

Returns

The bastion_user_name of this Session.

Return type

str

property display_name

Gets the display_name of this Session. The name of the session.

Returns

The display_name of this Session.

Return type

str

property id

[Required] Gets the id of this Session. The unique identifier (OCID) of the session, which can’t be changed after creation.

Returns

The id of this Session.

Return type

str

property key_details

[Required] Gets the key_details of this Session.

Returns

The key_details of this Session.

Return type

oci.bastion.models.PublicKeyDetails

property key_type

Gets the key_type of this Session. The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.

Allowed values for this property are: “PUB”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The key_type of this Session.

Return type

str

property lifecycle_details

Gets the lifecycle_details of this Session. A message describing the current session state in more detail.

Returns

The lifecycle_details of this Session.

Return type

str

property lifecycle_state

[Required] Gets the lifecycle_state of this Session. The current state of the session.

Allowed values for this property are: “CREATING”, “ACTIVE”, “DELETING”, “DELETED”, “FAILED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The lifecycle_state of this Session.

Return type

str

property session_ttl_in_seconds

[Required] Gets the session_ttl_in_seconds of this Session. The amount of time the session can remain active.

Returns

The session_ttl_in_seconds of this Session.

Return type

int

property ssh_metadata

Gets the ssh_metadata of this Session. The connection message for the session.

Returns

The ssh_metadata of this Session.

Return type

dict(str, str)

property target_resource_details

[Required] Gets the target_resource_details of this Session.

Returns

The target_resource_details of this Session.

Return type

oci.bastion.models.TargetResourceDetails

property time_created

[Required] Gets the time_created of this Session. The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Returns

The time_created of this Session.

Return type

datetime

property time_updated

Gets the time_updated of this Session. The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Returns

The time_updated of this Session.

Return type

datetime