Git Product home page Git Product logo

besapi's People

Contributors

hansen-m avatar jgstew avatar rustymyers avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

subramanyamcs

besapi's Issues

Enhance custom site backup to GIT

There is existing functionality for export_all_sites that can be used to "backup" custom content on a regular basis to GIT.

It should be enhanced to only export contents if the last_modified time is newer in the origin site than in the already exported file.

The goal is to allow one way "backup" of custom site(s) to GIT, then allow one way ingestion of the same site from GIT.

Related:

enhance file upload to not upload existing files

When using the BigFix REST API to upload a file to the BigFix Server, you can just send the file to the root and if it already exists with the exact same SHA1 and filename, then it will not create a duplicate file on the remote server.

Before sending the file to the root server, the file could be hashed locally to determine it's SHA1 hash value, then use that value along with the filename in order to determine if the file should be uploaded again, or if an existing copy of the file already exists and that step can be skipped.

Doing this check should save time for any file over a fairly small size, and also have less impact on the root server than sending it a file that it must first hash on the root server itself in order to determine the file's SHA1 hash value in order to determine if the file already exists on the root itself.

Can get the full list of all uploads on the root using: https://bigfix:52311/api/uploads but this could be slow if there are large number of uploads already there.

It should be faster to look for the specific upload in question like this: https://bigfix:52311/api/upload/092bd8ef7b91507bb3848640ef47bb392e7d95b1/test_besapi_upload.txt

The besapi.upload() function should have a parameter added that would be the file's sha1. If the sha1 isn't provided, then the file should be hashed to determine it, otherwise use the provided hash in case we have already hashed the file previously and do not need to do it again, which would be slow for large files.

Use the SHA1 hash of the file, along with it's filename in order to query the root to see if we need to upload the file or not.

The previous behavior of always sending the file each time could be achieved by giving an invalid sha1 value in the parameter, since it would never match a real file, though perhaps it should do that without querying the root first if it knows the sha1 is not valid.


Upload RESTAPI reference:

Approximate location for upload function in the code:

Examples that uses besapi to upload files:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.