すべてのプロダクト
Search
ドキュメントセンター

Simple Log Service:ダッシュボードの一覧表示

最終更新日:Nov 05, 2024

ListDashboard APIを呼び出して、ダッシュボードを一覧表示します。

前提条件

  • Simple Log Serviceが有効化されています。

  • Python用のSimple Log Service SDKが初期化されます。

パラメータ説明

def list_dashboard(self, project, offset=0, size=100):

リクエストパラメーター

パラメーター

タイプ

必須

説明

project

str

必須

プロジェクトの名前。

ali-test-project

オフセット

int

選択可能

クエリの開始行。Starting row for the query. デフォルト値:0

0

サイズ

int

選択可能

ページ化されたクエリの1ページあたりの行数。 デフォルト値:100 最大値: 500。

100

応答パラメーター

詳細については、「ListDashboard」をご参照ください。

サンプルコード

from aliyun.log import LogClient
import os


def main():
    # In this example, the AccessKey ID and AccessKey secret are obtained from environment variables.
    accessKeyId = os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', '')
    accessKey = os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', '')

    # The Simple Log Service endpoint.
    endpoint = "cn-hangzhou.log.aliyuncs.com"

    project = 'ali-test-project'

    client = LogClient(endpoint, accessKeyId, accessKey, "")

    res = client.list_dashboard(project)
    res.log_print()


if __name__ == '__main__':
    main()

レスポンスの例

ListResponse for dashboards:
headers: {'Server': 'AliyunSLS', 'Content-Type': 'application/json', 'Content-Length': '1084', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Date': 'Mon, 28 Oct 2024 08:03:23 GMT', 'x-log-time': '1730102603', 'x-log-requestid': '671F454B1FE738296E13EFA8'}
count: 5
total: 5
dashboards ['dashboard-1727682337978-128169', 'dashboard-1728382185158-140551', 'dashboard-1728452197690-149668', 'internal-alert-analysis', 'internal-alert-analysis-en']

Process finished with exit code 0

関連ドキュメント