简体   繁体   English

有没有办法链接Autodesk Forge Buckets?

[英]Is there a way to link Autodesk Forge Buckets?

I have created two buckets in the Autodesk Forge storage ( myprojectbucket and myscenariobucket ) but is there anyway I can link them together? 我已经在Autodesk Forge存储中创建了两个存储桶( myprojectbucketmyscenariobucket ),但是仍然可以将它们链接在一起吗? For example, if I delete the myprojectbucket bucket, I would also like it to delete the myscenariobucket bucket. 例如,如果我删除myprojectbucket存储桶,我也希望它删除myscenariobucket存储桶。 Is there a way for the program to identify which bucket is linked? 程序是否有办法识别链接的存储桶?

I have tried to differentiate them by having the project bucket act similar to a main project and the scenario bucket will act like a folder where files can be uploaded to. 我试图通过具有区分他们project相似,主要项目和水桶行为scenario斗会像这里的文件可以上传到一个文件夹。

Project bucket 项目桶

{
    "bucketKey": "myprojectbucket",
    "createdDate": "1555586879197",
    "policyKey": "transient"
}

Scenario bucket 场景桶

{
    "bucketKey": "myscenariobucket",
    "createdDate": "1555586121454",
    "policyKey": "transient"
}

File inside Scenario bucket 方案存储桶中的文件

[
    {
        "bucketKey": "myscenariobucket",
        "objectId": "urn:adsk.objects:os.object:myscenariobucket/MyNewFile.txt",
        "objectKey": "MyNewFile.txt",
        "sha1": "6ebea95f436eca94a9e541878db7b37b01cc5300",
        "size": 23,
        "contentType": "application/octet-stream",
        "location": "https://developer.api.autodesk.com/oss/v2/buckets/myscenariobucket/objects/MyNewFile.txt",
        "blockSizes": [],
        "deltas": [],
        "status": "OK"
    }
]

If I delete myscenariobucket , it should delete MyNewFile.txt file stored inside. 如果删除myscenariobucket ,则应删除MyNewFile.txt存储的MyNewFile.txt文件。 This currently works as expected. 目前,这按预期工作。 However, if I delete myprojectbucket , I would like it to delete both myscenariobucket and MyNewFile.txt . 但是,如果删除myprojectbucket ,我希望它同时删除myscenariobucketMyNewFile.txt

No, Forge buckets work like AWS S3 or Azure Objects. 不,Forge存储桶的工作方式类似于AWS S3或Azure对象。 So you cannot expect to get one deleted one when another one is deleted. 因此,您不能指望在删除另一个时删除一个。 I noticed that you bucket policy is "policyKey": "transient", so your files will be deleted automatically after 24 hours. 我注意到您的存储桶策略是“ policyKey”:“ transient”,因此您的文件将在24小时后自动删除。 That means if you post a file in each bucket at the same time, they'll be both deleted 24 hours later. 这意味着,如果您同时在每个存储分区中发布文件,则它们都将在24小时后被删除。

Now, you could do the following to get the same result as your request; 现在,您可以执行以下操作以获得与请求相同的结果; store your files like below with a prefix; 像下面一样用前缀存储文件; so when the bucket gets deleted, everything is. 因此,当删除存储分区时,一切都将完成。

Get only one bucket 只拿一个桶

{
    "bucketKey": "mybucket",
    "createdDate": "1555586879197",
    "policyKey": "transient"
}

Store all files in it with a prefix scenario/ or project/ 将所有文件存储在其中,并带有一个前缀方案/或项目/

[
    {
        "bucketKey": "mybucket",
        "objectId": "urn:adsk.objects:os.object:mybucket/project/MyNewFile.txt",
        "objectKey": "project/MyNewFile.txt",
        "sha1": "6ebea95f436eca94a9e541878db7b37b01cc5300",
        "size": 23,
        "contentType": "application/octet-stream",
        "location": "https://developer.api.autodesk.com/oss/v2/buckets/mybucket/objects/project/MyNewFile.txt",
        "blockSizes": [],
        "deltas": [],
        "status": "OK"
    },
    {
        "bucketKey": "mybucket",
        "objectId": "urn:adsk.objects:os.object:mybucket/scenario/MyNewFile.txt",
        "objectKey": "scenario/MyNewFile.txt",
        "sha1": "6ebea95f436eca94a9e541878db7b37b01cc5300",
        "size": 23,
        "contentType": "application/octet-stream",
        "location": "https://developer.api.autodesk.com/oss/v2/buckets/mybucket/objects/scenario/MyNewFile.txt",
        "blockSizes": [],
        "deltas": [],
        "status": "OK"
    }
]

Hope that helps, 希望能有所帮助,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM