Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the ability to download DBs via the API. #40

Closed
wants to merge 3 commits into from
Closed

Conversation

typhonius
Copy link
Owner

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 98.896% when pulling 6838ab5 on download-db into 60e6bbc on master.

@coveralls
Copy link

coveralls commented Jan 8, 2020

Coverage Status

Coverage increased (+0.02%) to 98.896% when pulling e4de092 on download-db into b20496d on master.

@typhonius
Copy link
Owner Author

A consumer would approach this in the following way:

$backup = new DatabaseBackups($client);
$download = $backup->download('UUID', 'default', '1');
$download->rewind();
$contents = $download->getContents();

$tmpFile = tempnam(sys_get_temp_dir(), 'database') . '.sql.gz';
file_put_contents($tmpFile, $aliases, LOCK_EX);

@weitzman
Copy link

weitzman commented Jan 8, 2020

I'm seeing a curl error shortly after the the database starts downloading. Its working for you? Is your DB large? Some relevant discussion of this error guzzle/guzzle#1600 and https://stackoverflow.com/questions/1759956/curl-error-18-transfer-closed-with-outstanding-read-data-remaining/1847591

cURL error 18: transfer closed with 1755079179 bytes remaining to read (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

@typhonius typhonius changed the title Adds the ability to download logs via the API. Adds the ability to download DBs via the API. Jan 13, 2020
@typhonius
Copy link
Owner Author

With further investigation, the above issue looks like it was limited to a single subscription so this PR should work.

@weitzman
Copy link

Yes, PR likely works. My subscription still doesn't work sadly. The engineers are "investigating"

@typhonius
Copy link
Owner Author

Merged in 2afdfb3

@typhonius typhonius deleted the download-db branch April 5, 2020 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants