【发布时间】:2021-07-16 15:27:36
【问题描述】:
我的 GCP 帐户中运行的 Google 云传输作业很少,它会将数据从 Azure 传输到 GCS 存储桶。
根据本文档 - https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/get?apix_params=%7B%22jobName%22%3A%22transferJobs%2F213858246512856794%22%2C%22projectId%22%3A%22merlincloud-gcp-preprod%22%7D “get”方法可以获取作业的详细信息,例如名称、描述、bucketName、状态、includePrefixes、storageAccount 等。
这是“get”方法的示例输出。
{
"name": "transferJobs/<job_name>",
"description": "<description given while creating job>",
"projectId": "<project_id>",
"transferSpec": {
"gcsDataSink": {
"bucketName": "<destination_bucket>"
},
"objectConditions": {
"includePrefixes": [
"<prefix given while creating job>"
],
"lastModifiedSince": "2021-06-30T18:30:00Z"
},
"transferOptions": {
},
"azureBlobStorageDataSource": {
"storageAccount": "<account_name>",
"container": "<container_name>"
}
},
"schedule": {
"scheduleStartDate": {
"year": 2021,
"month": 7,
"day": 1
},
"startTimeOfDay": {
"hours": 13,
"minutes": 45
},
"repeatInterval": "86400s"
},
"status": "ENABLED",
"creationTime": "2021-07-01T06:08:19.392111916Z",
"lastModificationTime": "2021-07-01T06:13:32.460934533Z",
"latestOperationName": "transferOperations/transferJobs-<job_name>"
}
现在,我如何在 python 中获取特定作业的运行历史详细信息?
“运行历史详细信息”是指 GTS 控制台中显示的指标(数据传输、文件数量、状态、大小、持续时间),如下图所示。
【问题讨论】:
标签: google-cloud-platform google-api google-cloud-storage