Tüm Ürünler
Search
Belge Merkezi

:DescribeTerminalSessions

Son Güncelleme:Oct 02, 2026

Session Manager oturum geçmişini sorgular.

Operation description

Son 30 gün içinde oluşturulan Session Manager oturum kayıtlarını sorgulayabilirsiniz. En fazla 1.000 başarılı kayıt saklanır.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeTerminalSessions

list

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

Bölge kimliği.

cn-hangzhou

InstanceId

string

No

Örnek kimliği.

i-bp1i7gg30r52z2em****

SessionId

string

No

Oturum kimliği.

s-hz023od0x9****

MaxResults

integer

No

Sayfalanmış bir sorgu için sayfa başına maksimum giriş sayısı.

Maksimum değer: 100.

Varsayılan değer: 10.

10

NextToken

string

No

Sayfalama belirteci. Bu parametreyi, önceki API çağrısında döndürülen NextToken değerine ayarlayın.

AAAAAdDWBF2****

Response elements

Element

Type

Description

Example

object

NextToken

string

Bu çağrıda döndürülen sayfalama belirteci.

AAAAAdDWBF2****

RequestId

string

İstek kimliği.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Sessions

object

Session

array<object>

Oturum listesi.

array<object>

Oturum bilgileri.

ClientIP

string

Uzak bağlantının istemci IP adresi.

192.168.1.1

Connections

object

Connection

array<object>

Bağlantı bilgileri listesi.

object

Bağlantı bilgileri.

ClosedReason

string

Bağlantının kapatılma nedeni. Bu parametre yalnızca durum Disconnected, Terminated veya Failed olduğunda döndürülür. Geçerli değerler:

  • InstanceNotExists: Belirtilen örnek mevcut değil veya serbest bırakılmış.

  • InstanceNotRunning: Örnek çalışmıyor.

  • DeliveryTimeout: Bağlantı zaman aşımına uğradı.

  • AgentNeedUpgrade: Cloud Assistant Agent'ın yükseltilmesi gerekiyor.

  • AgentNotOnline: Cloud Assistant Agent sunucuya bağlı değil.

  • MessageFormatInvalid: Mesaj biçimi geçersiz.

  • AgentSocketClosed: Bağlantı normal şekilde kapatıldı.

  • ClientClosed: Oturum yönetimi istemcisi bağlantıyı kapattı.

  • ReadFromTargetPortFailed: StartTerminalSession'da belirtilen PortNumber ile veri yönlendirme sırasında hedef porttan veri okunamadı.

  • ReopenTargetPortFailed: StartTerminalSession'da belirtilen PortNumber ile veri yönlendirme sırasında hedef porta TCP bağlantısı yeniden kurulamadı.

  • OpenTargetPortFailed: StartTerminalSession'da belirtilen PortNumber ile veri yönlendirme sırasında hedef porta TCP bağlantısı kurulamadı.

  • WinptyPermissionDenied: Windows örnekleri için, belirtilen kullanıcıya winpty.dll veya winpty-agent.exe üzerinde okuma ve yürütme izinleri verilemedi.

  • PasswordNameNotFound: StartTerminalSession'da belirtilen PasswordName bulunamadı.

  • ProcessSessionDataError: Oturum verileri işlenemedi.

  • SessionIdDuplicate: Oturum kimliği yineleniyor.

  • SessionTimeout: Oturum zaman aşımına uğradı. 3 saati aşan bir oturum bağlantısı proaktif olarak kesilir.

  • IdleTimeout: Bağlantı zaman aşımına uğradı. 180 saniye boyunca oturum etkileşimi olmayan bir bağlantı boşta kabul edilir ve proaktif olarak kesilir.

  • HomeDirPermissionDenied: Bağlantı kurulacak kullanıcının ana dizini için yetersiz izinler.

  • HomeDirNotFound: Bağlantı kurulacak kullanıcının ana dizini mevcut değil.

  • ShellCommandPermissionDenied: Kabuk programı için yetersiz izinler. bash veya csh yürütme izinleri yok.

  • ShellCommandNotFound: Kabuk programı mevcut değil. Linux'taki bash dosyası, FreeBSD'deki csh dosyası veya Windows'taki powershell.exe dosyası mevcut değil.

  • ObtainUserInfoFailed: Username parametresinin bilgileri (ana dizin bilgileri) alınamadı.

  • ObtainUserIdentityFailed: Username parametresinin kimlik doğrulama bilgileri (uid, gid, groups) alınamadı.

  • UserNotExists: StartTerminalSession'da belirtilen Username mevcut değil.

  • MalformedCommandLine: StartTerminalSession'da belirtilen CommandLine ayrıştırılamadı.

AgentNeedUpgrade

EndTime

string

Bağlantının sona erdiği zaman. Zaman, UTC cinsinden ISO 8601 biçiminde görüntülenir.

2024-01-19T09:16:46Z

FailedDetail

string

Bağlantı hatasının ayrıntıları. Bu parametre yalnızca durum Failed olduğunda döndürülür.

The Session Manager is closed normally.

InstanceId

string

Örnek kimliği.

i-bp1i7gg30r52z2em****

StartTime

string

Bağlantının başladığı zaman. Zaman, UTC cinsinden ISO 8601 biçiminde görüntülenir.

2024-01-19T09:16:40Z

Status

string

Oturum durumu. Geçerli değerler:

  • Connecting: Oturum bağlanıyor.

  • Connected: Oturum bağlandı.

  • Terminated: Oturum sonlandırıldı.

  • Failed: Bağlantı başarısız oldu.

Connecting

CreationTime

string

Oturumun oluşturulduğu zaman. Zaman, UTC cinsinden ISO 8601 biçiminde görüntülenir.

2024-01-19T09:15:46Z

IdentityType

string

Kimlik türü. Geçerli değerler:

  • Account: Alibaba Cloud hesabı.

  • RAMUser: Resource Access Management (RAM) kullanıcısı.

  • AssumedRoleUser: RAM rolü.

RAMUser

PortNumber

integer

Veri yönlendirme için kullanılan ECS örneğinin port numarası. Veri yönlendirme için herhangi bir port numarası yapılandırılmamışsa, bu değer boştur.

22

PrincipalId

string

Kimlik tanımlayıcısı. Değer, IdentityType'a göre değişir:

  • Arayan bir Alibaba Cloud hesabıysa: Alibaba Cloud hesap kimliği döndürülür.

  • Arayan bir Resource Access Management (RAM) kullanıcısıysa: RAM kullanıcı kimliği döndürülür.

  • Arayan API'yi rol üstlenmesi aracılığıyla çağırıyorsa: Rol üstlenmesinin gerçek temsilci kimliği döndürülür.

123456xxxx

SessionId

string

Oturum kimliği.

s-hz023od0x9****

TargetServer

string

Örnek üzerinden erişilen VPC'deki hedef sunucunun adresi.

192.168.0.246

Username

string

Bağlantı için kullanılan kullanıcı adı.

root

Examples

Success response

JSON format

{
  "NextToken": "AAAAAdDWBF2****",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "Sessions": {
    "Session": [
      {
        "ClientIP": "192.168.1.1",
        "Connections": {
          "Connection": [
            {
              "ClosedReason": "AgentNeedUpgrade",
              "EndTime": "2024-01-19T09:16:46Z",
              "FailedDetail": "The Session Manager is closed normally.",
              "InstanceId": "i-bp1i7gg30r52z2em****",
              "StartTime": "2024-01-19T09:16:40Z",
              "Status": "Connecting"
            }
          ]
        },
        "CreationTime": "2024-01-19T09:15:46Z",
        "IdentityType": "RAMUser",
        "PortNumber": 22,
        "PrincipalId": "123456xxxx",
        "SessionId": "s-hz023od0x9****",
        "TargetServer": "192.168.0.246",
        "Username": "root"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.NextToken The specified parameter NextToken is not valid.
400 InvalidParameter.MaxResults The specified parameter MaxResults is not valid.
500 InternalError An error occurred when you dispatched the request.
403 InvalidParameterCharacter The specified parameter %s contains illegal characters.
403 Operation.Forbidden The operation is not permitted.
404 InvalidRegionId.NotFound The specified parameter RegionId does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.