#some help
!gsutil --help

#list my buckets 
#(projectId has been set in the gcloud config 
# you can use the parameter -p projectId instead )
!gsutil ls 

#more details
!gsutil ls -L

"""
Explanation: gsutil: exploring cloud storage
End of explanation
"""


#some help
!gsutil mb --help

#creating a new bucket class regional en region wurope-west2
!gsutil mb -c regional -l europe-west2 gs://a-brand-new-bucket-toto/


#checking
!gsutil ls 

"""
Explanation: let's create a new bucket
End of explanation
"""


#some help
!gsutil label --help

#setting label
!gsutil label ch -l env:test gs://a-brand-new-bucket-toto/

#getting the labels
!gsutil label get gs://a-brand-new-bucket-toto/

"""
Explanation: everything is better with labels :-)
End of explanation
"""


#what does the help say?
!gsutil cp --help

#let's copy Formentera.JPG there
!gsutil cp "Formentera.JPG" gs://a-brand-new-bucket-toto/

#checking the result
!gsutil ls gs://a-brand-new-bucket-toto/

#the file is there let's have a look
!gsutil ls -l gs://a-brand-new-bucket-toto/Formentera.JPG

#with more details
!gsutil ls -L gs://a-brand-new-bucket-toto/Formentera.JPG

#let's make it public!
!gsutil acl ch -u AllUsers:R gs://a-brand-new-bucket-toto/Formentera.JPG

"""
Explanation: Upload a nice foto there
![Formentera.JPG](Formentera.JPG)
End of explanation
"""


#let's move it
!gsutil mv gs://a-brand-new-bucket-toto/Formentera.JPG gs://a-brand-new-bucket-toto/formentera.jpeg

#check the result
!gsutil ls gs://a-brand-new-bucket-toto

#delete the file
!gsutil rm gs://a-brand-new-bucket-toto/formentera.jpeg

#deleting the bucket
!gsutil rm -r gs://a-brand-new-bucket-toto

#check the result
!gsutil ls

"""
Explanation: The Photo is there on the internet!
![Formentera.JPG](https://storage.googleapis.com/a-brand-new-bucket-toto/Formentera.JPG)
End of explanation
"""


