Manage API from Cloud Shell Editor - service

I try to manage API keys from Cloud Shell Editor to restore an API (autocreated by Firebase) that I deleted.
I try to run gcloud alpha services api-keys undelete BYuihiuYUIGyugIIHU... but i receive Error: ERROR: (gcloud.alpha.services.api-keys.undelete) NOT_FOUND: Method not found.
I try to run (for testing) gcloud alpha services api-keys list command but I receive error: ERROR: (gcloud.alpha.services.api-keys.list) Projects instance [PROJECT_ID] not found: Method not found.
What I'm wrong?
Thank you so much

thank you so much for answer.
The result of commands is:
version -->
Google Cloud SDK 327.0.0
alpha 2021.02.05
beta 2021.02.05
bq 2.0.64
core 2021.02.05
gsutil 4.58
kpt 0.37.1
minikube 1.17.1
skaffold 1.19.0
Component list -->
Installed │ gcloud Alpha Commands │ alpha │ < 1 MiB
I tried to remove and reinstall gcloud-sdk with:
sudo apt purge --autoremove google-cloud-sdk
and sudo apt-get install google-cloud-sdk but nothing has changed

It is probable that (for some reason), your Cloud Shell is not running the latest version of gcloud (Cloud SDK). The latest version is 328.0.0. My Cloud Shell is running 327.0.0 includes the alpha commands (see below) and the commands work for me.
What is the result of the following in Cloud Shell?
gcloud version
gcloud components list does the list include gcloud Alpha Commands?
I'm confident that gcloud Alpha Commands are installed (by default) on Cloud Shell and so suspect that, for some reason, you're running an outdated version of Cloud SDK.
I'm unsure how you can install gcloud Alpha Commands under Cloud Shell if the component isn't installed because using gcloud commands will error under Cloud Shell but it should (!) tell you which apt-get install command you will need:
gcloud components install alpha
I assumed it was not permitted (since Cloud Shell is managed) but it is possible to self-update Cloud SDK in Cloud Shell. The following update will again tell you that you can't run the command in Cloud Shell but, it should give you a set of apt-get install commands that you can use to perform the update:
gcloud components update
Here's a link to the release notes for Cloud SDK. It's not obvious from these notes when these methods were added.

Related

xray newbie- first docker scan from cli

I'm starting with JFrog Xray.
I created an account on JFrog cloud platform using my Github credentials.
I created an identity token for authentication.
I have a linux box with only terminal (No GUI).
In that I downloaded a project from Github and built a docker image from the source code.
Now I can see the images using command sudo docker images.
Now I installed the JFrog CLI using command
curl -fL https://getcli.jfrog.io\?setup | sh
The cli gets installed but as there is no browser, the integration with cloud does not happen.
Now I run the docker scan using the command
sudo jf docker scan <image-name> --url <url> --access-token <access-token>
The error I receive is as below
Get "api/v1/system/version": unsupported protocol scheme ""
Any help/ guidance is sincerely appreciated.
Thanks
The curl -fL https://getcli.jfrog.io?setup | sh command installs JFrog CLI and then initiates the jf setup command. The jf setup command does the following:
Opens the default browser, and allows you to sign in to a new and free JFrog environment in the cloud.
Configures JFrog CLI with the new JFrog instance connection details.
Since your Linux box includes no browser, I assume step #1 fails.
No worries though - Since the set up of a free JFrog environment requires a browser, here's what you can do to set up an environment and use it on your Linux box:
Set up the free JFrog environment in the cloud from a different machine with a browser installed, using this page - https://jfrog.com/start-free/#saas
Log into your new environment UI
Go to "Integrations" on the left menu panel
Copy the "JFrog CLI" installation command, and run it from your Linux box
This should get JFrog CLI installed and set up with your new JFrog environment.

what's the different between gcloud components tools and the original tools?

As the gcloud components doc said, we can install some tools like: minikube, kubectl using the below command:
gcloud components install minikube
What's the difference between the tools(minikube, kubectl) installed by gcloud components install command and the original tools minikube?
Does gcloud sdk have any customization or restrictions on these tools?
Can I use the original minikube and kubectl(e.g. installed by brew install kubectl command) to replace the gcloud component tools?
As far as I know, the only difference is the package manager and how you installed the component. Cloud SDK pulls the external components based on the latest version of the SDK. As example, by updating to the latest SDK (as of now 315.0.0), you'll be able to install Minikube 1.14.0. Checking the version of this component will also display a commit version that you can check on the official repository.
If you need to work on a feature that is available on the latest version, then I suggest that you continue using Homebrew. However if not, and you want your components managed by Google, then installing it via Cloud SDK is also a good choice.

docker ecs command not found

I am trying to use the new docker ecs feature, but just get an error 'ecs' is not a docker command.
Using the latest version of docker edge on macOS 10.15.7
Do I need some additional steps to activate the docker command?
For anyone who was following documentation they found about docker ecs written previous to some development changes - while it used to be a plugin, ECS integration is now part of the docker cli itself.
This document covers how to set it up using a context
https://docs.docker.com/engine/context/ecs-integration/

Enabling component manager in gcloud CLI

I made a fresh install of gcloud for ubuntu as instructed here. I want to use the additional components offered by gcloud like kubectl and docker.
So, when I tried typing gcloud components install kubectl, I get an error saying that The component manager is disabled for this installation. Here is the full error message:
This is because you installed google-cloud-sdk with a package manager like apt-get or yum.
kubectl:
If you look here you can see how to install additional components. Basically sudo apt-get install kubectl.
If by docker you mean the docker-credential-gcr then I don't know if there's a way to install using a package manager, can't seem to find it. Perhaps ou can try the github repo. Mind you, you don't need this for commands like gcloud docker -- push gcr.io/your-project/your-image:version.
If you mean actual docker for building images and running them locally, that's standalone software which you need to install separately, instructions here.
Alternatively, you can uninstall google-cloud-sdk with apt-get and then reinstall with interactive installer, which will support the suggested gcloud components install *

Installing Cloud Foundry on Ubuntu 16.04

I am trying to install Cloud Foundry on Ubuntu 16.04. Here are my steps:
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar -zx
./cf --version
The result is cf version 6.18.0+b22884b-2016-05-10
I get an error message when I enter cf api https://api.ng.bluemix.net
The program 'cf' is currently not installed. You can install it by typing:
apt install confluence
Am I missing something?
Thanks,
Move the binary you downloaded (./cf) to somewhere on your PATH so you can invoke it just with cf.