Objects (files) disappears in Buckets after a day. The translated data is still there since I immediately get "success" on the translation status if I upload the same file again.
Is there some time-limit param? Can't find any https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-PUT/
Well, if you get the details of the bucket using the following URL:
https://developer.api.autodesk.com/oss/v2/buckets/:bucketKey/details
Take note of the property policyKey, I got a hunch that if you have been following the autodesk tutorials, you have created a bucket with transient policyKey which marks all model that have existed for 24 hours for deletion.
Extra note: files that are marked for deletion are not immediately deleted based on my past experience.
See also:
Bucket retention policy: https://forge.autodesk.com/en/docs/data/v2/developers_guide/retention-policy/
Creating a bucket: https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-POST/
^Take note of policyKey in the request body
Related
I am following the steps from this tutorial to try to compare the parameter values from the same element but in two different revisions of the same model inside the ACC, using Data Exchange API. The steps I did are as follows:
I've created a Data Exchange inside ACC Docs (which corresponds to the REVISION_1) using a Revit Model A;
I've changed the Revit Model A, adding a new window on it, and after, uploaded the model inside the ACC Docs (which corresponds to the REVISION_2) from the same model;
With my exchangeId and collectionId on my hands, I've collected the Snapshots Revisions successfully from the Data Exchange by doing on Postman:
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGE_ID>/snapshots:exchange/revisions
After that, I collected the changed assets from REVISION_1 to REVISION_2 by doing:
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGE_ID>/assets:sync?filters=exchange.snapshot.fromRevision==<REVISION_1>;exchange.snapshot.toRevision==<REVISION_2>
And again the results are as expected, it shows only the data that has changed between both versions.
So, my main question is: Since now we have two revisions, how to retrieve the original data only from REVISION_1? I've tried several request options unsuccessfully.
By the way, is curious that now retrieving the assets from the current Data Exchange, by doing
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGE_ID>/assets:sync shows only information from REVISION_1, and the modified elements in REVISION_2 seem that have disappeared. Someone knows why does it happen?
I've tried the following requests without success:
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGE_ID>/assets:sync?filters=exchange.snapshot.fromRevision==<REVISION_1>
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGEID>/assets:sync?filters=exchange.snapshot.toRevision==<REVISION_1>
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGEID>/exchange.snapshot.fromRevision==latest-1
https://developer.api.autodesk.com/exchange/v1/collections/<COLLECTION_ID>/exchanges/<EXCHANGEID>/exchange.snapshot.toRevision==latest-1
I expected to retrieve the assets only from REVISION_1, but it seems that since I have a new revision, like REVISION_2, it is overwriting the data from the previous revision in some way.
I'am currently playing around with the Couchbase Sync-Gateway and have built a demo app.
What is the intended behavior if a user logs in with the same username on a different device (which has an empty database) or if he deleted the local database?
I'am expecting that all the data from the server should get synced back to the clients.
Is this correct?
My problem is that if i'am deleting the database or login from a different device, nothing will get synced.
Ok i figured it out and it's exactly how i thought it would be.
If i log in from a different device i get all the data synced automatically.
My problem was the missing sync function. I thought it will use a default and route all documents to the public channel automatically.
I'am now using the following simple sync-function:
"sync": `function (doc, oldDoc) {
channel('!');
access('demo#example.com', '*');
}`
This will simply route all documents to the public channel and grant my demo-user access to it.
I think this shouldn't be used in production but it's a good starting point for playing around.
Now everything is working fine.
Edit: I've now found the missing info:
https://docs.couchbase.com/sync-gateway/current/configuration-properties.html#databases-this_db-sync
If you don't supply a sync function, Sync Gateway uses the following default sync function
...
The channels property is an array of strings that contains the names of the channels to which the document belongs. If you do not include a channels property in a document, the document does not appear in any channels.
I have followed this tutorial and have uploaded my file successfully to: https://developer.api.autodesk.com/oss/v2/buckets/timmyisabucket/objects/audobon_arch.rvt
It has uploaded successfully and I can verify this by calling https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGltbXlpc2FidWNrZXQvYXVkb2Jvbl9hcmNoLnJ2dA==/metadata/c63a6682-a73c-a2a8-a08c-dfeee25781f4/properties which successfully returns all the object properties.
However, when I ask the api to list all the objects inside the bucket, it simply returns an empty list!
The endpoint I'm calling: https://developer.api.autodesk.com/oss/v2/buckets/timmyisabucket/objects
The response:
{
"items": []
}
Where am I going wrong?
Thanks
Just to close this off, the helpful comment by Xiaodong Liang led me to the the fact that my bucket type was created with the incorrect type of "Transient" meaning that all my stuff gets deleted after 24 hours.
It should have been Temporary or Persistent.
Retention policy
Transient
Think of this type of storage as a cache. Use it for
ephemeral results. For example, you might use this for objects that
are part of producing other persistent artifacts, but otherwise are
not required to be available later.
Objects older than 24 hours are removed automatically. Each upload of
an object is considered unique, so, for example, if the same rendering
is uploaded multiple times, each of them will have its own retention
period of 24 hours.
Temporary
This type of storage is suitable for artifacts produced for
user-uploaded content where after some period of activity, the user
may rarely access the artifacts.
When an object has reached 30 days of age, it is deleted.
Persistent
Persistent storage is intended for user data. When a file
is uploaded, the owner should expect this item to be available for as
long as the owner account is active, or until he or she deletes the
item.
When POSTing to https://developer.api.autodesk.com/viewingservice/v1/register I sometiems receive the following error:
{
Diagnostic: The request is rejected as it conflicts with a previous request that is in-progress.,
registerKeys: {},
Result: Conflict
}
How can I find out which job is already in progress so that I can track its progress and get its result?
First, this is the old API, you need to consider using the ModelDerivtive API instead (ie https://developer.autodesk.com/en/docs/model-derivative/v2)
Like Xiaodond said there is no API to collect all jobs currently processing on your account. You need to request each URN manifest to determine how many jobs runs on this model as know you can translate to SVF, but also export to other formats such as obj, stl, ... when it is possible. Manifest end point and documentation here - https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET/
Last, we are working on a webhook solution which will be a better solution as a Webhook will call you back when a job is starting and completes. Webhooks aren't yet available at the time of this post, but you should be notified via the developer newsletter when it will be on production.
Hope that helps,
My application is currently using the Document List API to track file and metadata changes using the Changelist. When we find a file has changed, we grab the metadata, the acl information, and the actual file. Lately we've found that we are getting a number a percentage of files that continually show up in the changelist every time we check.
After a bit of investigating, there is very little metadata that is changing in the file.
Here are examples from two different files that continually show up in the changelists.
Is there anyway I can avoid seeing these files over and over again? I have partially optimized to not download the files again, but it is still taking extra quite a bit of overhead to weed out false-positives from the changelist. Does anyone know if updating my app to use the Drive API will fix this issue?
Here is an example of what I'm seeing:
File 1 - Through the Documents List API
Initial Info
entry:etag=\""CkcaSU1LASt7ImBk"\"
id:...feeds/id/spreadsheet%3A0AgVqS9FfzZOCdGhZSVZ4UEtyT2tmRnZsR3lGNFBrVWc
published:2010-12-13T01:58:22.467Z
updated:2010-12-13T02:03:22.269Z
...
link:rel=\"thumbnail\" type=\"image/jpeg\" href=...?id=0AgVqS9FfzZOCdGhZSVZ4UEtyT2tmRnZsR3lGNFBrVWc&v=1&s=AMedNnoAAAAAUQHGlnP_b5jppjlFLN9OHRY5VSP2KZNR&sz=s220\"
...
/entry
Next Time I looked at the changelist
entry etag=\""CkUFR0sIQyt7ImBk"\"
id:...feeds/id/spreadsheet%3A0AgVqS9FfzZOCdGhZSVZ4UEtyT2tmRnZsR3lGNFBrVWc
published:2010-12-13T01:58:22.467Z
updated:2010-12-13T02:03:22.269Z
...
link:rel=\"thumbnail\" type=\"image/jpeg\" href=\"...?id=0AgVqS9FfzZOCdGhZSVZ4UEtyT2tmRnZsR3lGNFBrVWc&v=1&s=AMedNnoAAAAAUQMH4STQC7QSN1CJivPIl0U5KvMD8eKe&sz=s220\"
...
/entry
The only differences are the etag, updated time, and thumbnail image. The file itself did not change at all.
File 2 - This info I grabbed using the APIs explorer (using the DriveAPI 2 changes.get)
{
"kind": "drive#change",
"id": "21012",
"fileId": "0AgVqS9FfzZOCdGQyQUNjWkF0alVpNGd0WXNLMnpNU2c",
...
"thumbnailLink": ".../feeds/vt?gd=true&id=0AgVqS9FfzZOCdGQyQUNjWkF0alVpNGd0WXNLMnpNU2c&v=1&s=AMedNnoAAAAAUQlhSo3rF73K5WnN7E0qSR0uMhWEqM-t&sz=s220",
...
}
Ran through grabbing changes from the Documents List API, then checked the changelist again.
{
"kind": "drive#change",
"id": "21013",
"fileId": "0AgVqS9FfzZOCdGQyQUNjWkF0alVpNGd0WXNLMnpNU2c",
...
"thumbnailLink": ".../feeds/vt?gd=true&id=0AgVqS9FfzZOCdGQyQUNjWkF0alVpNGd0WXNLMnpNU2c&v=1&s=AMedNnoAAAAAUQlh69m8ZG_MzNujmmu80HN9XJ2jpG61&sz=s220",
...
}
In this case, the thumbnail link had again changed, and there was no longer a change with id 21012.