Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
003 [Hands-on] Cloud Shell - 2
Abdullah Manzoor
Follow
8/5/2024
Category
😹
Fun
Transcript
Display full video transcript
00:00
Alright everyone, so let's just continue our discussion on Google Cloud Shell.
00:09
We have seen many of the features it can provide to us directly inside the browser.
00:14
Let's see a few more things about the Google Cloud Shell.
00:18
So, what I'm gonna do, let me press clear and we'll have a little more real estate.
00:25
Now I want to focus upon one utility like a G Cloud.
00:30
Now if I just write G Cloud, G Cloud is by default installed.
00:35
You can see with respect to AI and machine learning, API and platform, you can just press
00:40
enter and you will be able to see all those things like a compute related, data analytics
00:46
related, database.
00:48
So every single services you can interact, you can modify, you can update, you can provision
00:54
your resource directly from this G Cloud utility.
00:59
Now as a demo, in this video, what we are gonna see, we have already created one bucket.
01:08
So this is the bucket.
01:09
I can just directly go to storage from here.
01:14
I can just directly go to storage from here or I can just go from this hamburger menu
01:21
and from here we have a storage and browser.
01:24
Now make sure that when you have already opened this particular cloud shell, you do not refresh
01:33
your page.
01:34
The moment you refresh your page, that means new session of cloud shell terminal will open.
01:40
So we have one bucket which we have created directly from this cloud web console.
01:46
Now we are going to create exactly the same thing but from the command line utility.
01:51
That is nothing but from your cloud shell.
01:54
Now we are inside the cloud shell.
01:56
Now to create a new bucket, there will be one utility available like a Gsutil.
02:02
This particular G Cloud has lots of lots of functionality.
02:06
I am not going into detail because it is something like it doesn't make sense at this moment.
02:12
But as we progress, as we learn about more and more service, most of the times we are
02:17
going to use this cloud shell.
02:19
So Gsutil, a Google storage utility.
02:23
So from this particular utility, you can create your bucket.
02:28
Now most important thing about this particular utility G Cloud, Gsutil, same way for other
02:36
services like BigQuery, we have a BQ, then for Kubernetes, we have Kubeflow, and there
02:42
are many more things available.
02:45
If you don't get anything that how to write the command, just simply type "-help".
02:51
And immediately you, so Gsutil is requesting your credential to make a GCP API call.
02:58
Because indirectly whatever Gsutil has been installed inside your cloud shell that wants
03:04
to authorize an authentication to create something on this Google storage.
03:12
Alright, so these are the things you can do it.
03:17
So something like a cat command we have, we have a hashing, we have CP for copying files,
03:25
we have a MB.
03:27
So that is for the make bucket.
03:29
So we are not going into detail about different options.
03:33
But at this shot, what I'm going to do, I'm just going to use Gsutil MB.
03:43
Now after MB, I don't know what are the options I need to write.
03:47
I can just simply use Gsutil make bucket help.
03:51
I don't know what to do next.
03:54
So there are a hell lot of options are available that where you want to provision your resources
04:00
and what is the location type, we have a storage class, but we haven't learned about anything.
04:05
So in a simple term, what I'm going to do, let me just write Gsutil MB and just provide
04:16
your bucket name with all those default parameters, it will create a brand new bucket for us.
04:22
So exactly on the same line, I'm going to write name bk- instead of web console, now
04:28
I'm going to use this cloud shell because we are creating from the cloud shell.
04:33
Let me just press enter.
04:38
And you can see command exception that MB command doesn't support this kind of file
04:44
you are in.
04:45
So purposely I just written it because the moment you are trying to access any kind of
04:51
file in your local system, it has to be generally start with this one.
04:56
And when you do not provide anything, the Google assume that you are trying to access
05:01
file, colon, double slash.
05:04
But that is not the protocol on which this Google Cloud Storage works.
05:09
So they are expecting you to write this one.
05:13
So instead of writing name this way, the Google Cloud Storage, every single file has to be
05:20
accessed with this way, Gs, Google Storage.
05:25
Let me just press enter.
05:27
And you can see creating this particular bucket.
05:31
Now don't try to refresh it, otherwise the new session of Google Cloud Shell will be
05:36
open.
05:37
So what I would suggest you to just refresh and you will be able to see we got created
05:43
our new bucket bk-cloudshell.
05:48
Now earlier in the last video in a web console, if you just go, we uploaded one file like
05:55
a cat1.jpg.
05:56
Same way, through command line utility, this gsutil, we want to put one file cat1.jpg or
06:05
any other file.
06:06
What are the files available?
06:07
Yes, we have same cat1.jpg is available here.
06:11
Now you can understand that why I uploaded this cat1.jpg here.
06:15
I can upload some other files also.
06:17
So let me just provide cat2.jpg.
06:23
So on a bottom right, you can see with this green tick indicates that successfully transferred.
06:28
So let me just close in and let's type ls.
06:33
So ls will give you the information that what are the current files and folders are available
06:38
in current working directory.
06:40
So we have a cat2.jpg also.
06:42
Now I want to transfer this cat2.jpg to this particular bucket.
06:47
So what I am going to do, gsutil, simple.
06:53
Then we saw one option associated with this one like a copy.
06:57
So you are going to copy this cat2.jpg from your local machine.
07:07
Now in this case, the local machine will be your cloud shell.
07:10
For you, everything will be in a cloud, but you are accessing this cat2.jpg from the same
07:16
machine.
07:17
So I am just writing here cat2.jpg, no particular protocol or anything.
07:22
By default, it will take care like this one, file.
07:28
So this is where it is trying to access it.
07:31
So from this particular location, cat2.jpg, I am going to transfer it to this gs-bk-cloud-shell.
07:40
So I just select it.
07:41
That means it got copied.
07:43
Press Ctrl-V. So simple.
07:46
Let me just press Enter.
07:49
And you can see it's just started copying file.
07:52
So by default, it has a prefix this file colon double slash.
07:57
And transferred it to this particular bucket location.
08:02
Now if you want to see what are the contents are available inside this bk-cloud-shell.
08:09
And you can see cat2.jpg file got uploaded.
08:15
If you just click upon it, you will be able to see the complete URL.
08:21
Now there is few more things I want to highlight at this level.
08:25
What we are gonna do, let me just copy this complete URL.
08:30
And earlier also I showed that this is the image.
08:35
Now let me open the notepad.
08:38
And I want to show you this particular URL.
08:42
And focus upon this URL.
08:44
Now when we created first time this bucket, there is one thing we need to take care that
08:55
it has to be globally unique.
08:57
Now you can see this particular part storage.cloud.google.com will always remain same whenever you are
09:04
trying to access any of the resources through HTTP protocol over the internet or whatever
09:10
objects are available to access any objects are available in this storage bucket.
09:16
But this storage bucket if it is unique, how can two URLs should exist for the one single
09:23
thing.
09:24
Or maybe for two different things the same URL exists.
09:28
So, if it is not unique, it is not going to work.
09:31
It is something like for google.com there will be two websites exist.
09:36
Or for apple.com there will be two websites exist.
09:39
So, that's why this is the logical reason behind that the cloud bucket name has to be
09:46
globally unique.
09:47
Now, this particular bucket name nobody can take throughout this world.
09:51
Even if you change any single character inside that, that will be a completely different
09:55
bucket name.
09:56
So, that is the reason behind your bucket name has to be globally unique.
10:01
Otherwise, your URL will not be unique.
10:04
Alright.
10:05
Let me just close it.
10:08
One more tips I want to share with you that whenever you try to learn any of the service
10:13
and there is some URL associated, try to grab more and more information directly from the
10:19
URL.
10:20
Now, this storage.cloud that means you are trying to access a storage related stuff.
10:27
Don't save it.
10:28
Alright.
10:29
So, from the command line also, we have used the two commands.
10:34
First one will be make buckets.
10:36
You can practice yourself and there will be one more like a gsutil.
10:40
Now, you can see there is no authorization authentication happens.
10:46
All calls are completely authorized and authentication.
10:49
But when we try to access the very first time this gsutil, it has automatically asked for
10:54
our permission to call for this API directly inside the storage bucket.
11:01
Alright.
11:02
So, that is all about the cloud shell.
11:06
In the next video, there is one more important thing, although I haven't discussed in much
11:11
more detail.
11:12
So, I would think that that's a very important thing and I'm going to discuss in the next
11:17
video related to cloud shell.
11:20
See you in the next video.
Recommended
9:19
|
Up next
009 GCloud command for Module - 1
Abdullah Manzoor
8/9/2024
6:04
007 [Hands-on] Cloud SDK Part - III
Abdullah Manzoor
8/9/2024
9:23
006 [Hands-on] Cloud SDK Part - II
Abdullah Manzoor
8/9/2024
6:43
005 [Hands-on] Cloud SDK Part - I
Abdullah Manzoor
8/9/2024
10:05
004 [Hands-on] Cloud Shell - 3
Abdullah Manzoor
8/9/2024
11:30
001 [Hands-on] Creating projects
Abdullah Manzoor
8/5/2024
23:44
002 [Hands-on] Assigning users to predefined IAM roles within a project
Abdullah Manzoor
8/5/2024
17:35
003 [Hands-on] Managing users in Cloud Identity (manually and automated)
Abdullah Manzoor
8/5/2024
5:22
002 [Hands-on] Establishing billing budgets and alerts
Abdullah Manzoor
8/5/2024
6:26
003 [Hands-on] Setting up billing exports to estimate dailymonthly charges
Abdullah Manzoor
8/5/2024
9:13
001 [Hands-on] Creating one or more billing accounts & Link projects
Abdullah Manzoor
8/5/2024
8:36
004 [Hands-on] Enabling APIs within projects
Abdullah Manzoor
8/5/2024
16:11
002 [Hands-on] Cloud Shell - 1
Abdullah Manzoor
8/5/2024
3:24
001 Section Introduction
Abdullah Manzoor
8/5/2024
5:01
004 Services & Availability Zones
Abdullah Manzoor
7/24/2024
6:12
003 Different GCP Services
Abdullah Manzoor
7/24/2024
8:39
002 [NEW] GCP Region & Zones
Abdullah Manzoor
7/24/2024
5:05
001 [NEW] What is GCP - Google Cloud Computing Platform & Why
Abdullah Manzoor
7/24/2024
1:35
funny video
Abdullah Manzoor
7/23/2024
0:57
tiktok 1
Abdullah Manzoor
7/23/2024
4:02
001 Course Introduction
Abdullah Manzoor
7/10/2024
2:29
005 Create GCP Free Tier Account
Abdullah Manzoor
7/10/2024
13:45
Quran:020 - سورة طه - القارئ: رعد الكردي - Surat Ta-Ha - recitation by: Raad A
Abdullah Manzoor
7/29/2024
39:30
Quran:017 - سورة الإسراء - القارئ: رعد الكردي - Surat Al-Isra - recitatio
Abdullah Manzoor
7/29/2024
0:14
quran-verses-beautiful-quran-recitation-quranrecitation-quranicvers-islam-quran-shorts
Abdullah Manzoor
7/29/2024