Retrieving web view link of a Google shared drive folder - google-api

I am trying to get the webviewlink of google shared
API: https://www.googleapis.com/drive/v3/files
am unable to get webviewlink of particular shared drive folder.
my input will be the folder id:
{
"id": "1Vat7pdwnpg8i2xMzhic4dOVbadZNv0OJ"
}
how can i achieve this?

Without seeing the exact request you are making its hard to help but i can say this apears to work fine. I can get the the record for a google drive directory shared with me and that directory contains a web view link which has the same file id as the one i sent.
Request
curl \
'https://www.googleapis.com/drive/v3/files/1nhladm_nRRee6rVER9ZA5QqnyKwfG7l?fields=*&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
response
{
"kind": "drive#file",
"id": "1nhladm_nRRee6rVER9ZA5QqnyKwfG7l",
"name": "ML GDE Model Deployment Project",
"mimeType": "application/vnd.google-apps.folder",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"parents": [
"1OYYiVmqFp9ZvuRSuVgC_ihkdYirLnu"
],
"spaces": [
"drive"
],
"version": "461",
"webViewLink": "https://drive.google.com/drive/folders/1nhladm_nRRee6rVER9ZA5QqnyKwfG7li",
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.folder+shared",
"hasThumbnail": false,
"thumbnailVersion": "0",
"viewedByMe": false,
"createdTime": "2020-04-02T04:21:47.275Z",
"modifiedTime": "2020-11-02T13:58:51.042Z",
"modifiedByMe": false,
"owners": [
{
.....
}
],
"lastModifyingUser": {
"kind": "drive#user",
},
"shared": true,
"ownedByMe": false,
"capabilities": {
"canAddChildren": false,
"canAddMyDriveParent": false,
"canChangeCopyRequiresWriterPermission": false,
"canChangeViewersCanCopyContent": false,
"canComment": false,
"canCopy": false,
"canDelete": false,
"canDownload": true,
"canEdit": false,
"canListChildren": true,
"canModifyContent": false,
"canMoveChildrenWithinDrive": false,
"canMoveItemIntoTeamDrive": false,
"canMoveItemOutOfDrive": false,
"canMoveItemWithinDrive": false,
"canReadRevisions": false,
"canRemoveChildren": false,
"canRemoveMyDriveParent": true,
"canRename": false,
"canShare": false,
"canTrash": false,
"canUntrash": false
},
"viewersCanCopyContent": true,
"copyRequiresWriterPermission": false,
"writersCanShare": true,
"folderColorRgb": "#8f8f8f",
"quotaBytesUsed": "0",
"isAppAuthorized": false
}
The web view link for this request is https://drive.google.com/drive/folders/1nhladm_nRRee6rVER9ZA5QqnyKwfG7l which is the same as the file id that i sent it.
File Ids change as do the web view links and its possible that they are out of sync.

Related

How to create or verify ElementRangeIndexes in Marklogic from Flyway script

How to create or verify ElementRangeIndexes in Marklogic from Flyway script. It is a pain to remember the elementRangeIndex to be manually don eon every Marklogic DB we migrate.
You may be able to use the Flyway gradle plugin, to execute ml-gradle configuration scripts.
Alternatively, you can use gradle to execute curl commands and create the indexes using the MarkLogic Management API endpoints.
An example of using Curl to define an index taken from Learning the MarkLogic REST API:
curl -X PUT --anyauth --user admin:admin --header "Content-Type:application/json" \
-d '{"word-positions": true,
"element-word-positions": true,
"range-element-index":
[ { "scalar-type": "string",
"namespace-uri": "",
"localname": "SPEAKER",
"collation": "http://marklogic.com/collation/",
"range-value-positions": false,
"invalid-values": "reject"
},
{ "scalar-type": "string",
"namespace-uri": "",
"localname": "affiliation",
"collation": "http://marklogic.com/collation/",
"range-value-positions": false,
"invalid-values": "reject"
},
{ "scalar-type": "int",
"namespace-uri": "",
"localname": "contentRating",
"collation": "",
"range-value-positions": false,
"invalid-values": "reject"
},
{ "scalar-type": "unsignedLong",
"namespace-uri": "http://marklogic.com/filter",
"localname": "size",
"collation": "",
"range-value-positions": false,
"invalid-values": "reject"
},
{ "scalar-type": "string",
"namespace-uri": "http://marklogic.com/filter",
"localname": "Exposure_Time",
"collation": "http://marklogic.com/collation/",
"range-value-positions": false,
"invalid-values": "reject"
}]}' \
http://localhost:8002/manage/v2/databases/TutorialDB/properties

How can new docker image have dependent child images

I am new to Docker and want to understand image management better. A new image that I just created using
docker image build -t jefe/mh_db:v.1.1.0 ./
When I try to delete using
docker image rm d4c0c9225252
where d4c0c9225252 is the Image ID, returns
Error response from daemon: conflict: unable to delete d4c0c9225252 (cannot be forced) - image has dependent child images
Yes it's related to other posts regarding cannot delete. But I want to understand why a dependency exists.
How can this child image have images that are dependent upon it? I literally just created it
The dockerfile that is used in building the image
FROM mysql:5.7.27
MAINTAINER jefe
# Specify ports
EXPOSE 3306
Update
docker image ls | grep d4c0c9225252
jefe/mh_db v.1.1.0 d4c0c9225252 2 hours ago 373MB
Additionally
docker inspect d4c0c9225252
[
{
"Id": "sha256:d4c0c922525201d62e49ac73d03e27653e77e2ac5e3f11334a7a09d7c6d977fe",
"RepoTags": [
"jefe/mh_db:v.1.1.0"
],
"RepoDigests": [],
"Parent": "sha256:b0fead29523e498fd0f990abcc2b2bbb46952ad3361fbebcc304e31be69bd840",
"Comment": "",
"Created": "2019-08-08T15:24:57.324861036Z",
"Container": "6abc71375823faeb4819720a09ae348b0da4d9ae213c167c3911ca706d7c8b92",
"ContainerConfig": {
"Hostname": "6abc71375823",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.27-1debian9"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"EXPOSE 3306"
],
"ArgsEscaped": true,
"Image": "sha256:b0fead29523e498fd0f990abcc2b2bbb46952ad3361fbebcc304e31be69bd840",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"DockerVersion": "19.03.1",
"Author": "jefe",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.27-1debian9"
],
"Cmd": [
"mysqld"
],
"ArgsEscaped": true,
"Image": "sha256:b0fead29523e498fd0f990abcc2b2bbb46952ad3361fbebcc304e31be69bd840",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": null
},
"Architecture": "amd64",
"Os": "linux",
"Size": 373273403,
"VirtualSize": 373273403,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/11891a42dc63fb6851e3fb12a1dd7e7285d18df83ecfd1f5aa40e44466921c58/diff:/var/lib/docker/overlay2/e0c695335789cba5a8e6524804bd1c2d1836db16650105e6863e7023bc289753/diff:/var/lib/docker/overlay2/2b4e10627f78a0185f8975b62b954a14e79fc6fb71a3caae07180e8e00f51b44/diff:/var/lib/docker/overlay2/f9dd057675e39a3eab99143f07bcb7df8a44eba5d1f1d15e567471a7c3a9e491/diff:/var/lib/docker/overlay2/c28612d7a8d1b187ddb7fc995c5fe733e0c18def13df798f1de5af2bdac9d3f4/diff:/var/lib/docker/overlay2/f8e41886d7ae8d8939ae2dc11b4ff941ef931aa18bc2f8cb0f724cc9e270ab3c/diff:/var/lib/docker/overlay2/8796390ee625b42b56d7822d128cc50bf88fbfd1f7f5ac9e7ecda9e721944946/diff:/var/lib/docker/overlay2/86552fa54367c794979383dbba257f1292f2a137dae0304d1eb036ba2249bc7b/diff:/var/lib/docker/overlay2/168353bdf70d8140026c2cf58da64eee7409f710832be601dad3e0cc6a02c01a/diff:/var/lib/docker/overlay2/ac908915344e5f65df6e0121f77bd48fdaa822974317cdb83a59f0618893ddb2/diff",
"MergedDir": "/var/lib/docker/overlay2/1826972009d9ce18265129a2d4928b708bf6780370530e4c1be8b1efd096b2cd/merged",
"UpperDir": "/var/lib/docker/overlay2/1826972009d9ce18265129a2d4928b708bf6780370530e4c1be8b1efd096b2cd/diff",
"WorkDir": "/var/lib/docker/overlay2/1826972009d9ce18265129a2d4928b708bf6780370530e4c1be8b1efd096b2cd/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:d56055da3352f918f4d8a42350385ea5b10d0906e746a8fbb4b850f9284deee5",
"sha256:b78ec9586b345b0efdb0297261c0044652563045a28a7cc6d27dd314eda1e0eb",
"sha256:c6926fcee1912ebb41215a70b1d0ed77e3b8db38cfe69b936d18b346096e144c",
"sha256:007a7f930352c0fd98663021fb1ee08768462eb5bc9045342da9e9f73fd79a7f",
"sha256:2f1b41b24201f4ae635819b1d7717ab04c000f04e7708de3bb012a60d3ef630b",
"sha256:77737de99484a6e2e2ae4bea0cf7ec4d3063827a6dd49a243694ef00929350d2",
"sha256:7e7fffcdabb3e0655bf46756dd04018ce051f81fbaba8bff3703ac987def88be",
"sha256:83bba64580292cc5af1fd3cabb74b18c143e05cd45d882c9e09edc8ff79a1119",
"sha256:94f63a189eef2bdb32668faa0ce08dc5da01eccb91ad548f28052048e810e5f8",
"sha256:0c3e10ddbe75e0a4efcee6aa06716b651227ceb358e78922b9fe9ea7f5a63992",
"sha256:5572431ce4dea5defe6a0d0586ad3b25a74d59bfbbb05c2a257c5d71a27eba4c"
]
},
"Metadata": {
"LastTagTime": "2019-08-08T15:24:57.393863976Z"
}
}
Docker wont let you delete an image if you have more than one tag on it. To find out the tags you can filter the output of docker image ls
docker image ls | grep d4c0c9225252

Sublime FTP/SFTP

I am trying to connect to my cpanel server using sublime text 3.
Server is added successfully. And remote path is also validated successfully.
But when try to Sync Remote->Local it is just not happening.
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "XXXXXX",
"user": "XXXXX",
"password": "XXXXXXX",
"port": "21",
"remote_path": "XXXXXX",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}
And in the console I finally got this:
"Select via quick panel? No".
And the process got terminated by itself.
SFTP has some options for that to put on your sftp-config.json file at the root of your folder :
Set those values like this:
"confirm_downloads":false,
"confirm_sync":false,
"confirm_overwrite_newer":true

Sublime is uploading files into root instead of sub directories

Probably a simple solution, just never encountered the problem before.
I try to upload lets say welcome.blade.php which is located in
resources/views/welcome.blade.php
but sublime is just uploading to the root instead.
I'm using the SFTP package for this and have not encountered this issue before.
The stftp-config file remote path is correct..so I cant figure out what this could be.
Here is the sftp-config file
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"save_before_upload": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "their_host",
"user": "their_user",
"password": "",
//"port": "22",
"remote_path": "/domains/theirsitename.com/html/",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
"allow_config_upload": true,
}

Google Admin SDK Directory Users List returns group as a user

I'm using the Admin SDK Directory api to read users out of a domain. Everything works fine except for the fact that the users.list is returning groups as part of that list. While not devastating it causes some confusion when users are using my app.
The method in question can be found here.
https://developers.google.com/admin-sdk/directory/v1/reference/users/list
I don't even use the scopes for groups. I have authorization for the https://www.googleapis.com/auth/admin.directory.user.readonly scope only, not any related to groups.
Here is an example of a user entry returned (with names and such obviously changed):
{
"kind": "admin#directory#user",
"id": "someId",
"etag": "\"An etag\"",
"primaryEmail": "group#domain.com",
"isAdmin": false,
"isDelegatedAdmin": false,
"lastLoginTime": "1970-01-01T00:00:00.000Z",
"creationTime": "1970-01-01T00:00:00.000Z",
"agreedToTerms": false,
"suspended": false,
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"emails": [
{
"address": "group#domain.com",
"primary": true
}
],
"customerId": "customer",
"orgUnitPath": "/",
"isMailboxSetup": true,
"includeInGlobalAddressList": true
}
This is due to a bug in the API. This bug is being tracked on the Google Apps APIs Issue Tracker:
https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3654

Resources