1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

boto3のbackup list_backup_jobsのMessageCategoryについてメモ

1
Posted at

Pythonでboto3を使ってAWS Backupの直近24時間なジョブ結果一覧を取得する処理を書いていて気が付いたのでメモ

list_backup_jobsでレスポンス項目について

ジョブの結果を確認するのに、MessageCategoryの項目を使おうと考え。
実装して、いくつかの実行環境で動かしてみた所、MessageCategoryがあるはずなのにレスポンスに含まれてこない環境がありました。

実行しているboto3のバージョンを確認した所、実行環境によってboto3のバージョンが異なっており。

ドキュメントを確認した所、boto3のbackpuのlist_backup_jobsにMessageCategoryが追加されたのはboto3 1.29.1からのようです。

boto3 1.28.85 document - list_backup_jobs

boto3 1.29.1 document - list_backup_jobs

boto3 1.28.85 document - list_backup_jobs
{
    'BackupJobs': [
        {
            'AccountId': 'string',
            'BackupJobId': 'string',
            'BackupVaultName': 'string',
            'BackupVaultArn': 'string',
            'RecoveryPointArn': 'string',
            'ResourceArn': 'string',
            'CreationDate': datetime(2015, 1, 1),
            'CompletionDate': datetime(2015, 1, 1),
            'State': 'CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED'|'PARTIAL',
            'StatusMessage': 'string',
            'PercentDone': 'string',
            'BackupSizeInBytes': 123,
            'IamRoleArn': 'string',
            'CreatedBy': {
                'BackupPlanId': 'string',
                'BackupPlanArn': 'string',
                'BackupPlanVersion': 'string',
                'BackupRuleId': 'string'
            },
            'ExpectedCompletionDate': datetime(2015, 1, 1),
            'StartBy': datetime(2015, 1, 1),
            'ResourceType': 'string',
            'BytesTransferred': 123,
            'BackupOptions': {
                'string': 'string'
            },
            'BackupType': 'string',
            'ParentJobId': 'string',
            'IsParent': True|False,
            'ResourceName': 'string'
        },
    ],
    'NextToken': 'string'
}
boto3 1.29.1 document - list_backup_jobs
{
    'BackupJobs': [
        {
            'AccountId': 'string',
            'BackupJobId': 'string',
            'BackupVaultName': 'string',
            'BackupVaultArn': 'string',
            'RecoveryPointArn': 'string',
            'ResourceArn': 'string',
            'CreationDate': datetime(2015, 1, 1),
            'CompletionDate': datetime(2015, 1, 1),
            'State': 'CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED'|'PARTIAL',
            'StatusMessage': 'string',
            'PercentDone': 'string',
            'BackupSizeInBytes': 123,
            'IamRoleArn': 'string',
            'CreatedBy': {
                'BackupPlanId': 'string',
                'BackupPlanArn': 'string',
                'BackupPlanVersion': 'string',
                'BackupRuleId': 'string'
            },
            'ExpectedCompletionDate': datetime(2015, 1, 1),
            'StartBy': datetime(2015, 1, 1),
            'ResourceType': 'string',
            'BytesTransferred': 123,
            'BackupOptions': {
                'string': 'string'
            },
            'BackupType': 'string',
            'ParentJobId': 'string',
            'IsParent': True|False,
            'ResourceName': 'string',
            'MessageCategory': 'string'
        },
    ],
    'NextToken': 'string'
}

総評

MessageCategoryとか普通に使いそうな項目が少し古いboto3のバージョンにはないのは少し驚きました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?