Cloud Files API with Indexable Meta Data - amazon-s3

I would like to use a cloud file system that supports adding meta-data that is searchable. I want to use this meta-data to store keys from my application to associate the document.
E.g.
File:
/XYZ/image.png
Meta Data:
Person-Id:12345
Group-Id:23456
Other-Id:3456
I would then like to use a API to search (v.fast) documents by Person-Id or Group-Id. I understand that I could create this table mapping myself (in mysql within the app) but is there a cloud files solution (google drive, rackspace, amazon) that supports this use case already?
Thanks

You can make use of the Directory API of Google to insert data onto the Google Drive which is hosted on cloud.
Send a POST request like this:
POST https://www.googleapis.com/admin/directory/v1/groups/groupKey/members
The require parameters include the groupKey which Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
You can directly try this with this official documentation.
For inserting a single member visit this official documentation.

Related

How to query Google Cloud logs by scope/storage via api or java libs

I have defined log sinks to various storage buckets.
In GCP Logs explorer (https://console.cloud.google.com/logs/query) I can specify query scope by project or by specified bucket storages.
How to achieve the same feature (scope by specified storages) using GCP logs api and/or google java libraries ?
Aby links to docs ?
You can achieve the same feature using GCP logs api, by using resourceNames[] Query parameter. Here BUCKET_ID refers to Log bucket ID not storage bucket ID. Refer to this documentation for information.
In resource-oriented APIs, resources are named entities, and resource names are their identifiers. Each resource must have its own unique resource name. The resource name is made up of the ID of the resource itself, the IDs of any parent resources, and its API service name.
gRPC APIs should use scheme-less URIs for resource names. They generally follow the REST URL conventions and behave much like network file paths. They can be easily mapped to REST URLs: see the Standard Methods section for details.

How to access Bigquery using key

I was given a key which happens to be a .json file to access a bigquery data but I have no idea where to put it and how I should use it. I tried to go to the bigquery console but I can't seem to find where I can place the key to view their data. I have no experience using bigquery so I tried to search for any tutorials to no avail.
I can assume that you have created service account key with assigned roles (i.e. roles/bigquery.admin) and downloaded a JSON file that contains your key.
You will need to use it only whenever you decide to use BigQuery API by using client libraries, such as Python or Java. As you can see in the documentation, you need to set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your service account key to be able to access Bigquery resources.
When using the web UI in the Google Cloud Console, you don't need to use JSON key file. You only need to take care of assigning appropriate roles to the service account you have created. Please take a look for the following documentation.
Additionally, I would like to share with you the introduction to authentication, which is really important.
I hope you find the above pieces of information useful.

Headers are not picking up from the Google sheet in Google big query

I am trying to upload a google sheet to my dataset in the google bigquery. Below are the settings
Uploading configuration snap
I have made the "Header rows to skip" = 1 and =0 as well
Result doesn't pick the header on the top. It shows "string_field_0"
Here is the file with just one header column and 3 values https://docs.google.com/spreadsheets/d/1mnYBiDe-eOauhVa5QbM-BRelW2iwlhQD9lPMR50A9Lk/edit?usp=sharing
What am I doing wrong?
I was getting the same error. Then I realized that I got it because all the columns are in string format. After adding a field in integer format the issue was resolved.
It is important to follow the steps from the official documentation.
We need to take care of:
Retrieving the Google Drive URI by getting shareable link.
Enabling Google Drive access, because accessing data hosted within Google Drive requires an additional OAuth scope. We can use following command to authenticate with Google Drive:
gcloud auth login --enable-gdrive-access
Check if we are granted with required permissions and scopes. Finally, we can create a table.
Keep in mind that for JSON or CSV files, you can check the Auto-detect option to enable schema auto-detect. Schema auto-detection in the web UI is not currently supported for Google Sheets (though it is available using the bq command-line tool and the API).
I hope you find the above pieces of information useful.

How can I obtain an API-key for my Fusion Tables

Yep, newbie question here, but it's bothering me for some days now, trying to read all the docs on google developer site, but I'm spinning in circles.
I've created a Fusion Table and set the access to 'public' and got an ID.
According to Goolge I should have an API key to access the data from a REST-call. Google suggests:
Go to the Google Developers Console.
Select a project, or create a new one.
In the sidebar on the left, expand APIs & auth. Next, click APIs. In the list of APIs, make sure the status is ON for the Fusion Tables API.
In the sidebar on the left, select Credentials.
I can do that all I've got an API-key, but how does this relates to the Fusion Table I've created? Can I use that API key for
this is really simple API key give the ability to do the most of mysql request type SELECT,INSERT,UPDATE,DELETE using GET and POST also PUT request , for GET you can use the navigator for that but the most effective way for your case is the use of curl librairie for php or jaira for java ... so you can send post or put request with a simple script.
So, what you can do with fusion table is automating the process of manipulating data and the option to share those data with someone else.
Edit: procedures changed since this post. Your mileage may vary
Head to the Google Developers Console
Create a project
Under Explore other services click "Enable APIs and get credentials like keys"
Search for Fusion Tables
Enable Fusion Tables API as a service under APIs & Auth --> APIs
You probably want the browser key. Grab the API key.
Happy Mapping...
API-keys are not related to specific Fusion Tables, they are related to projects.
You may use the key to request data from any public and downloadable FusionTable(not only your own Tables ), the key basically is used to identify your project(google-account) .
So when you have problems with requesting data from a public table, check if the table is downloadable too(click on the table-name on top-left->reuse access->allow downloads ).

How can i get file's properties for a file in OneDrive?

I am using the REST API for OneDrive. I have a name of a file in the users storage. I want to obtain the properties for this file. According the documentation file's properties can be retrieved
if you have the file ID.(http://msdn.microsoft.com/en-us/library/dn659731.aspx) So I need the file ID and the only way I see to obtain it is to search the whole storage which is really unnecessary.
Is there a way to find properties of a file(with a known name) with a single request to the service?
Ideally the API would support access by path which would do what you require (assuming you have the full path and not just the name). Unfortunately, to my knowledge that isn't supported.
There is a heavy handed approach that may work for you though - you can use the search capabilities of the API to find files with the name you specify:
GET /[userid]/skydrive/search?q=MyVideo.mp4
The documentation is available at the link below:
http://msdn.microsoft.com/en-us/library/dn631847.aspx