softlayer / softlayer-python

A set of Python libraries that assist in calling the SoftLayer API.
http://softlayer.github.io/softlayer-python/
MIT License
152 stars 195 forks source link

slcli image detail missing transaction data #1449

Closed allmightyspiff closed 3 years ago

allmightyspiff commented 3 years ago

slcli image detail doesn't show active_transactions for an image, because the transactions themselves show up on the images' children.

So lets make the following changes:

  1. Datacenters should show a sub-table of
DC size transaction
dal10 20G -
dal13 20G doing something
  1. Change disk_space to total size, and sum up all the child sizes.

Overall the purpose of this issue is to allow users to see when things are happening to templates, and get an idea of if their template is ready to be used or not.

allmightyspiff commented 3 years ago

Change also needs to be made to https://github.ibm.com/Bluemix/bluemix-cli/issues/3594

allmightyspiff commented 3 years ago

Some notes:

$ slcli -v --format=table image detail 8730058
Calling: SoftLayer_Virtual_Guest_Block_Device_Template_Group::getObject(id=8730058, mask='id,accountId,name,globalIdentifier,parentId,publicFlag,flexImageFlag,imageType,children[id,blockDevicesDiskSpaceTotal,datacenter],note,createDate,status,transaction', filter='None', args=(), limit=None, offset=None))
:....................:......................................:
:               name : value                                :
:....................:......................................:
:                 id : 8730058                              :
:  global_identifier : c811d763-f732-4a56-90b4-3fe0ad3f4891 :
:               name : cgallo-test-transaction              :
:             status : Active                               :
: active_transaction : -                                    :
:            account : 307608                               :
:         visibility : Private                              :
:               type : System                               :
:               flex : False                                :
:               note : None                                 :
:            created : 2021-04-06T07:37:56-06:00            :
:         disk_space : 2.34G                                :
:        datacenters : dal09,dal13                          :
:....................:......................................:

(py38)
allmi@SPF-WIN10 MINGW64 ~/Source/softlayer-python (issues1474)
$ slcli -v --format=json call-api SoftLayer_Virtual_Guest_Block_Device_Template_Group getObject --id=8730058 --mask="mask[children[transaction]]"
Calling: SoftLayer_Virtual_Guest_Block_Device_Template_Group::getObject(id=8730058, mask='mask[children[transaction]]', filter='{}', args=(), limit=None, offset=None))
{
    "accountId": 307608,
    "createDate": "2021-04-06T07:37:56-06:00",
    "id": 8730058,
    "name": "cgallo-test-transaction",
    "parentId": null,
    "publicFlag": 0,
    "statusId": 1,
    "transactionId": null,
    "userRecordId": 167758,
    "children": [
        {
            "accountId": 307608,
            "createDate": "2021-04-06T07:37:57-06:00",
            "id": 8730060,
            "name": "cgallo-test-transaction",
            "parentId": 8730058,
            "publicFlag": 0,
            "statusId": 1,
            "transaction": {
                "createDate": "2021-04-26T12:37:55-06:00",
                "elapsedSeconds": 20,
                "guestId": null,
                "hardwareId": null,
                "id": 241651606,
                "modifyDate": "2021-04-26T12:38:15-06:00",
                "statusChangeDate": "2021-04-26T12:37:59-06:00",
                "transactionStatus": {
                    "averageDuration": "5.39",
                    "friendlyName": "Check Cloud Disk Template Transfer",
                    "name": "CHECK_CLOUD_DISK_TEMPLATE_TRANSFER"
                }
            },
            "transactionId": 241651606,
            "userRecordId": 167758
        },
        {
            "accountId": 307608,
            "createDate": "2021-04-26T12:37:55-06:00",
            "id": 8980332,
            "name": "cgallo-test-transaction",
            "parentId": 8730058,
            "publicFlag": 0,
            "statusId": 1,
            "transaction": {
                "createDate": "2021-04-26T12:37:55-06:00",
                "elapsedSeconds": 20,
                "guestId": null,
                "hardwareId": null,
                "id": 241651606,
                "modifyDate": "2021-04-26T12:38:15-06:00",
                "statusChangeDate": "2021-04-26T12:37:59-06:00",
                "transactionStatus": {
                    "averageDuration": "5.39",
                    "friendlyName": "Check Cloud Disk Template Transfer",
                    "name": "CHECK_CLOUD_DISK_TEMPLATE_TRANSFER"
                }
            },
            "transactionId": 241651606,
            "userRecordId": 167758
        }
    ],
    "globalIdentifier": "c811d763-f732-4a56-90b4-3fe0ad3f4891"
}