Hi Amit,
I have some suggestion for you Kindly go though it might helps you
Follow below steps
Import the necessary packages:
go
Copy code
import (
"context"
"fmt"
"google.golang.org/api/compute/v1"
"google.golang.org/api/option"
)
Create a client and authenticate:
go
Copy code
ctx := context.Background()
client, err := compute.NewService(ctx, option.WithCredentialsFile("path/to/your/credentials.json"))
if err != nil {
// Handle error
}
Make sure to replace "path/to/your/credentials.json" with the actual path to your Google Cloud credentials file.
Retrieve the instance information:
go
Copy code
project := "your-project-id"
zone := "your-zone"
instance := "your-instance-name"
resp, err := client.Instances.Get(project, zone, instance).Do()
if err != nil {
// Handle error
}
Replace "your-project-id", "your-zone", and "your-instance-name" with the appropriate values for your instance.
Extract the architecture type: [TellHappyStar](https://www.tellhappystar.org/)
go
Copy code
architecture := resp.CpuPlatform
fmt.Printf("VM Architecture: %s\n", architecture)
Thanks and regards
derrickharrison