如何获取Autodesk Composite Design的真实尺寸(来自Autodesk数据管理Api)

How to get real size of Autodesk Composite Design (from Autodesk data management Api)

从这个Api我可以得到复合设计资源的实际大小吗? 例如: 来自 "include" 实体中的 Api 响应显示复合设计上传期间所选主文件的 "storageSize" :

{
        "type": "versions",
        "id": "urn:adsk.wipprod:fs.file:vf.wuknEcO8TjiWoHMfXUwuPQ?version=1",
        "attributes": {
            "name": "V8 Engine.iam",
            "displayName": "V8 Engine.iam",
            "createTime": "2017-10-25T09:04:39.0000000Z",
            "createUserId": "QY23PAJ2YB4G",
            "createUserName": "bot@autodesk360.com",
            "lastModifiedTime": "2017-10-25T09:04:39.0000000Z",
            "lastModifiedUserId": "QY23PAJ2YB4G",
            "lastModifiedUserName": "bot@autodesk360.com",
            "versionNumber": 1,
            "mimeType": "application/vnd.autodesk.inventor.assembly",
            "storageSize": 7998976,
            "fileType": "iam",
            "extension": {
                "type": "versions:autodesk.a360:CompositeDesign",
                "version": "1.0",
                "schema": {
                    "href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.a360:CompositeDesign-1.0"
                },
                "data": {
                    "parentFile": "V8 Engine/V8 Engine.iam"
                }
            }
        }

在资源的下载中,它将是一个大小约为 63 MB 的 zip, 有什么方法可以通过 Apis 获取此信息吗? 问候朱塞佩。

我可以在我这边重现这个问题。我认为这可能是 IAM 文件的特例。 Web UI 或 Forge API 调用中显示的其他带有 zip 扩展名的 ZIP 文件的文件大小与我测试的下载大小一致。然而,IAM 文件的实际大小可以通过 API GET buckets/:bucketKey/objects/:objectName/details 检索。这是与 API.

交互的切线

例如,IAM 文件的存储 ID urn:adsk.objects:os.object:wip.dm.prod/af59f346-ba31-4fd6-96a2-413606493bae.iamGET projects/:project_id/folders/:folder_id/contents.

中获取

那么,bucketKey就是wip.dm.prod,objectName就是af59f346-ba31-4fd6-96a2-413606493bae.iam,组合就是buckets/wip.dm.prod/objects/af59f346-ba31-4fd6-96a2-413606493bae.iam,那么结果就是:

{
    "bucketKey": "wip.dm.prod",
    "objectId": "urn:adsk.objects:os.object:wip.dm.prod/af59f346-ba31-4fd6-96a2-413606493bae.iam",
    "objectKey": "af59f346-ba31-4fd6-96a2-413606493bae.iam",
    "sha1": "12504df0c2dbcf52501ae7371781241f8a8d4f36",
    "size": 66329747,
    "contentType": "application/octet-stream",
    "location": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/af59f346-ba31-4fd6-96a2-413606493bae.iam",
    "blockSizes": [
        2048
    ],
    "deltas": []
}

之后,您将看到实际大小为 66329747 字节。在我的例子中它等于 66.3MB,并且与下载大小一致。