Get a specified dashboard
Updated at:
Retrieves information about a specified dashboard by calling the GetDashboard operation.
Prerequisites
Complete the following prerequisites:
Parameters
def get_dashboard(self, project, entity):
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
|
project |
str |
Yes |
The name of the project. |
ali-test-project |
|
entity |
str |
Yes |
The name of the dashboard. |
dashboard-1727682337978-123456 |
Response parameters
For more information about the response parameters, see GetDashboard.
Sample code
from aliyun.log import LogClient
import os
def main():
# 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 Log Service endpoint.
endpoint = "cn-hangzhou.log.aliyuncs.com"
project = 'ali-test-project'
dashboard = 'dashboard-1727682337978-123456'
client = LogClient(endpoint, accessKeyId, accessKey, "")
res = client.get_dashboard(project, dashboard)
res.log_print()
if __name__ == '__main__':
main()
Sample response
header: {'Server': 'AliyunSLS', 'Content-Type': 'application/json', 'Content-Length': '127', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Date': 'Mon, 28 Oct 2024 06:29:42 GMT', 'x-log-time': '1730096982', 'x-log-requestid': '671F2F56509844B232124B6C'}
body: {'attribute': {'type': 'grid'}, 'charts': [], 'dashboardName': 'dashboard-1727682337978-123456', 'description': '', 'displayName': 'test'}
Process finished with exit code 0
References
-
To manage dashboards, see the following API operations:
-
For more examples, see the Aliyun Log Python SDK on GitHub.
Is this page helpful?