Cloud storage files are needed to decompress. DataFlow has a API template to do it. Here is a showcase. I want to unzip cloud files based on a date on url and then store into another cloud storage. For example, I input “2020–01–01” and unzup this date file.

  • PROJECT_ID: the Cloud project ID where you want to run the Dataflow job
  • JOB_NAME: a unique job name of your choice
  • LOCATION: the regional endpoint where you want to deploy your Dataflow job—for example, us-central1
  • VERSION: the version of the template that you want to use

Here is the example after input.

Before do this job, you need access token for your cloud storage authentication OAuth 2.0.

Refer to <https://www.youtube.com/watch?v=tGDn3V-mIOM&t=1097s>

--

--

An HTTP POST request containing a parameter to trigger a cloud function

Use a url to trigger the cf , parameter put on the link after ?

Example: http://asia-esat2-project-id.cloudfunction.net/cfname?date=2020–01–01

def function(request):
args = request.args.to_dict() # request parameter to dict
date = args.date # parameter date
gcs = storage.Client() # get Google Clientbucket = gcs.get_bucket('abc')  # get bucket blobs = bucket.list_blobs() # list all blobsfor blob in blobs:  # each blob   if re.match(r'[], blob.name) # condition search blob.namedest_bucket = gcs.get_bucket('xxx') # get a destination bucketdest_name = "{}/{}/{}" % (log_date, log_type, filename) new_blob = bucket.copy_blob(file, dest_bucket, dest_name) 
# copy blob to the dest bucket

--

--

I have solved my first Leetcode challenge in Python. Coagulation!

I record my thinking process in this ‘Two Sum’ exercise.

First, the three example output are consecutive indices i.e. nums[1] +nums[2]. One for loop is enough for this question.

I got a correct answer after clicking the ‘Run Code’. Great!

However, I neglect one situation that is the slices are not consecutive.

--

--

1.Create a new project in gitlab

2.Create new branchs

3.Push to Git

4.Change to “Google-source”

5.Add ‘File’ and files copy to git file

6.commit those ‘File’

7.Push to Git

Git Command

how to delete file

rm.git

to delete .git

rm-rm.git

to delete file / .git

create new branchs

git.checkout -b develop

create a new branch ‘develop’

check path

pwd

Leave

cd../

go to 上一層

cd

入去

Show Files

ls -al

list all files

Check Status

git status

--

--