如何获得Autodesk Composite Design的实际大小(从Autodesk数据管理Api中获取) [英] How to get real size of Autodesk Composite Design (from Autodesk data management Api)

查看:77
本文介绍了如何获得Autodesk Composite Design的实际大小(从Autodesk数据管理Api中获取)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从此

From this Api Can I get real size of composite design resource ? For instance: from Api response in "include" entity is shown the "storageSize" of selected main file during the upload of composite design :

{
        "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,有没有办法通过Apis获取此信息?问候朱塞佩.

In download of the resource it will be a zip 63 MB of about size, Is there any way to get this info by Apis ? Regards Giuseppe.

推荐答案

我可以重现此问题.我认为这可能是IAM文件的特殊情况.在Web UI或Forge API调用中显示的其他具有zip扩展名的ZIP文件的文件大小与我测试时的下载大小一致.但是,可以通过API

I can reproduce this issue on my side. I think that might be a special case to IAM file. The file size of other ZIP files with zip extension showing on the Web UI or Forge API call is consistent with the download size as my testings. However, the actual size of the IAM file can be retrieved by API GET buckets/:bucketKey/objects/:objectName/details. Here is a cutline for interacting with the API.

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

For example, the storage id of the IAM file is urn:adsk.objects:os.object:wip.dm.prod/af59f346-ba31-4fd6-96a2-413606493bae.iam otbained from the GET 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 ,则结果为:

So, the bucketKey will be wip.dm.prod, the objectName will be af59f346-ba31-4fd6-96a2-413606493bae.iam, and combination will become buckets/wip.dm.prod/objects/af59f346-ba31-4fd6-96a2-413606493bae.iam, then the result is:

{
    "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,并且与下载大小一致.

Afterward, you will see the actual size is 66329747 bytes. It's equal to 66.3MB in my case, and consistent with the download size.

这篇关于如何获得Autodesk Composite Design的实际大小(从Autodesk数据管理Api中获取)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆