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

How to upload data from memory to Cloud Storage? #1197

Closed
stefanluptak opened this issue Apr 3, 2019 · 4 comments
Closed

How to upload data from memory to Cloud Storage? #1197

stefanluptak opened this issue Apr 3, 2019 · 4 comments
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@stefanluptak
Copy link
Contributor

Is it possible to upload data to Cloud Storage directly from memory without providing local file path?

I would like to do something like this:

conn = GoogleApi.Storage.V1.Connection.new("SOME_TOKEN")

{:ok, object} =
  GoogleApi.Storage.V1.Api.Objects.storage_objects_insert_simple(
    conn,
    "SOME_BUCKET",
    "multipart",
    %{name: "file.txt"},
    "Hello, World! This is the content of the file."
)

I searched the documentation, even tried to look into the source code, but with no luck.

Thanks a lot. :-)

@stefanluptak
Copy link
Contributor Author

OK, I figured it out. I just needed to use this:

conn = GoogleApi.Storage.V1.Connection.new("TOKEN")

{:ok, object} =
  GoogleApi.Storage.V1.Api.Objects.storage_objects_insert(
    conn,
    "BUCKET_NAME",
    body: "Hello, World! This is the content of the file.",
    name: "file.txt"
  )

I was confused by error message happening because of the #972 - any idea when the fix will be released?

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 4, 2019
@dazuma
Copy link
Member

dazuma commented Apr 4, 2019

We have a bunch of updates queued up and expect to do a general release in the next week or two. It may have to come after the GCP Next conference is over because most of us are working there.

@stefanluptak
Copy link
Contributor Author

Thanks for the info @dazuma
I am using a modified google_api_storage as a local dependency until then without a problem.

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 8, 2019
@JustinBeckwith JustinBeckwith added the type: question Request for information or clarification. Not an issue. label Jun 8, 2019
@yoshi-automation yoshi-automation removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Jun 8, 2019
@fhinkel
Copy link

fhinkel commented Dec 7, 2020

Greetings, we're closing this. Looks like the issue got resolved. Please let us know if the issue needs to be reopened.

@fhinkel fhinkel closed this as completed Dec 7, 2020
@fhinkel fhinkel self-assigned this Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants