8.2.34 | Linux | www-data (uid:33)
👁 View: unlock.py
📁 /snap/google-cloud-cli/current/lib/surface/unlock.py
# -*- coding: utf-8 -*- # # Copyright 2023 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Unlock secrets and surprises coming soon to Google Cloud.""" import os import shutil import sys from googlecloudsdk.calliope import base from googlecloudsdk.core.util import encoding import requests _UNLOCK_URL = "https://gcloud-unlock-api-gsaaz6raqa-uc.a.run.app/api/unlock/" class SurpriseError(Exception): pass @base.Hidden @base.ReleaseTracks(base.ReleaseTrack.GA) class EnableAlpha(base.SilentCommand): """Unlock secrets and surprises coming soon to Google Cloud.""" @staticmethod def Args(parser): parser.add_argument("SURPRISE", help="ID of the surprise to be unlocked.") def Run(self, args): istty = sys.stdout.isatty() size = shutil.get_terminal_size(fallback=(80, 25)) width, height = size.columns, size.lines terminal_type = encoding.GetEncodedValue(os.environ, "TERM", "unknown") unlock_request = { "args": [args.SURPRISE], # No command arguments to pass "options": {}, # No command options to pass "terminfo": { "istty": istty, "width": width, "height": height, "term": terminal_type, }, } try: response = requests.post(_UNLOCK_URL, json=unlock_request) response.raise_for_status() # Assuming the response's content is JSON and has a 'content' field response_content = response.json().get("content", "") print(response_content) except requests.exceptions.HTTPError as http_err: raise SurpriseError("{http_err}".format(http_err=http_err))
← Back
💻 Terminal
📤 Upload
📂
Click or Drag & Drop
📁 /snap/google-cloud-cli/current/lib/surface
NameSizePermModifiedActions
📁 __pycache__/-07752026-09-29 12:17🗑 Delete
📁 access_approval/-07752026-09-29 12:17🗑 Delete
📁 access_context_manager/-07752026-09-29 12:17🗑 Delete
📁 active_directory/-07752026-09-29 12:17🗑 Delete
📁 agent_identity/-07752026-09-29 12:17🗑 Delete
📁 agent_registry/-07752026-09-29 12:17🗑 Delete
📁 agentic_applications/-07752026-09-29 12:17🗑 Delete
📁 ai/-07752026-09-29 12:17🗑 Delete
📁 ai_platform/-07752026-09-29 12:17🗑 Delete
📁 alloydb/-07752026-09-29 12:17🗑 Delete
📁 alpha/-07752026-09-29 12:17🗑 Delete
📁 anthos/-07752026-09-29 12:17🗑 Delete
📁 api_gateway/-07752026-09-29 12:17🗑 Delete
📁 api_registry/-07752026-09-29 12:17🗑 Delete
📁 apigee/-07752026-09-29 12:17🗑 Delete
📁 apihub/-07752026-09-29 12:17🗑 Delete
📁 app/-07752026-09-29 12:17🗑 Delete
📁 app_lifecycle_manager/-07752026-09-29 12:17🗑 Delete
📁 app_optimize/-07752026-09-29 12:17🗑 Delete
📁 app_topology/-07752026-09-29 12:17🗑 Delete
📁 apphub/-07752026-09-29 12:17🗑 Delete
📁 artifacts/-07752026-09-29 12:17🗑 Delete
📁 asset/-07752026-09-29 12:17🗑 Delete
📁 assured/-07752026-09-29 12:17🗑 Delete
📁 audit_manager/-07752026-09-29 12:17🗑 Delete
📁 auth/-07752026-09-29 12:17🗑 Delete
📁 authz_toolkit/-07752026-09-29 12:17🗑 Delete
📁 backup_dr/-07752026-09-29 12:17🗑 Delete
📁 batch/-07752026-09-29 12:17🗑 Delete
📁 beta/-07752026-09-29 12:17🗑 Delete
📁 beyondcorp/-07752026-09-29 12:17🗑 Delete
📁 biglake/-07752026-09-29 12:17🗑 Delete
📁 bigtable/-07752026-09-29 12:17🗑 Delete
📁 billing/-07752026-09-29 12:17🗑 Delete
📁 blockchain_node_engine/-07752026-09-29 12:17🗑 Delete
📁 blockchain_validator/-07752026-09-29 12:17🗑 Delete
📁 bms/-07752026-09-29 12:17🗑 Delete
📁 bq/-07752026-09-29 12:17🗑 Delete
📁 builds/-07752026-09-29 12:17🗑 Delete
📁 cbrs_spectrum_access/-07752026-09-29 12:17🗑 Delete
📁 certificate_manager/-07752026-09-29 12:17🗑 Delete
📁 cloud_shell/-07752026-09-29 12:17🗑 Delete
📁 cloudlocationfinder/-07752026-09-29 12:17🗑 Delete
📁 cluster_director/-07752026-09-29 12:17🗑 Delete
📁 code/-07752026-09-29 12:17🗑 Delete
📁 colab/-07752026-09-29 12:17🗑 Delete
📁 commerce_procurement/-07752026-09-29 12:17🗑 Delete
📁 compliance_manager/-07752026-09-29 12:17🗑 Delete
📁 components/-07752026-09-29 12:17🗑 Delete
📁 composer/-07752026-09-29 12:17🗑 Delete
📁 compute/-07752026-09-29 12:17🗑 Delete
📁 config/-07752026-09-29 12:17🗑 Delete
📁 container/-07752026-09-29 12:17🗑 Delete
📁 data_catalog/-07752026-09-29 12:17🗑 Delete
📁 data_fusion/-07752026-09-29 12:17🗑 Delete
📁 database_migration/-07752026-09-29 12:17🗑 Delete
📁 dataflow/-07752026-09-29 12:17🗑 Delete
📁 datalineage/-07752026-09-29 12:17🗑 Delete
📁 datapipelines/-07752026-09-29 12:17🗑 Delete
📁 dataplex/-07752026-09-29 12:17🗑 Delete
📁 dataproc/-07752026-09-29 12:17🗑 Delete
📁 dataproc_gdc/-07752026-09-29 12:17🗑 Delete
📁 datastore/-07752026-09-29 12:17🗑 Delete
📁 datastream/-07752026-09-29 12:17🗑 Delete
📁 deploy/-07752026-09-29 12:17🗑 Delete
📁 deployment_manager/-07752026-09-29 12:17🗑 Delete
📁 design_center/-07752026-09-29 12:17🗑 Delete
📁 developer_connect/-07752026-09-29 12:17🗑 Delete
📁 developer_knowledge/-07752026-09-29 12:17🗑 Delete
📁 device_run/-07752026-09-29 12:17🗑 Delete
📁 dialogflow/-07752026-09-29 12:17🗑 Delete
📁 dlp/-07752026-09-29 12:17🗑 Delete
📁 dns/-07752026-09-29 12:17🗑 Delete
📁 domains/-07752026-09-29 12:17🗑 Delete
📁 edge_cache/-07752026-09-29 12:17🗑 Delete
📁 edge_cloud/-07752026-09-29 12:17🗑 Delete
📁 emulators/-07752026-09-29 12:17🗑 Delete
📁 endpoints/-07752026-09-29 12:17🗑 Delete
📁 error_reporting/-07752026-09-29 12:17🗑 Delete
📁 essential_contacts/-07752026-09-29 12:17🗑 Delete
📁 eventarc/-07752026-09-29 12:17🗑 Delete
📁 fault_testing/-07752026-09-29 12:17🗑 Delete
📁 filestore/-07752026-09-29 12:17🗑 Delete
📁 firebase/-07752026-09-29 12:17🗑 Delete
📁 firebase_data_connect/-07752026-09-29 12:17🗑 Delete
📁 firestore/-07752026-09-29 12:17🗑 Delete
📁 functions/-07752026-09-29 12:17🗑 Delete
📁 gemini/-07752026-09-29 12:17🗑 Delete
📁 genomics/-07752026-09-29 12:17🗑 Delete
📁 healthcare/-07752026-09-29 12:17🗑 Delete
📁 iam/-07752026-09-29 12:17🗑 Delete
📁 iap/-07752026-09-29 12:17🗑 Delete
📁 identity/-07752026-09-29 12:17🗑 Delete
📁 ids/-07752026-09-29 12:17🗑 Delete
📁 immersive_stream/-07752026-09-29 12:17🗑 Delete
📁 infra_manager/-07752026-09-29 12:17🗑 Delete
📁 kms/-07752026-09-29 12:17🗑 Delete
📁 logging/-07752026-09-29 12:17🗑 Delete
📁 looker/-07752026-09-29 12:17🗑 Delete
📁 lustre/-07752026-09-29 12:17🗑 Delete
📁 managed_flink/-07752026-09-29 12:17🗑 Delete
📁 managed_kafka/-07752026-09-29 12:17🗑 Delete
📁 media/-07752026-09-29 12:17🗑 Delete
📁 memcache/-07752026-09-29 12:17🗑 Delete
📁 memorystore/-07752026-09-29 12:17🗑 Delete
📁 meta/-07752026-09-29 12:17🗑 Delete
📁 metastore/-07752026-09-29 12:17🗑 Delete
📁 microservices/-07752026-09-29 12:17🗑 Delete
📁 migration/-07752026-09-29 12:17🗑 Delete
📁 ml/-07752026-09-29 12:17🗑 Delete
📁 mldiagnostics/-07752026-09-29 12:17🗑 Delete
📁 model_armor/-07752026-09-29 12:17🗑 Delete
📁 monitoring/-07752026-09-29 12:17🗑 Delete
📁 mps/-07752026-09-29 12:17🗑 Delete
📁 netapp/-07752026-09-29 12:17🗑 Delete
📁 network_connectivity/-07752026-09-29 12:17🗑 Delete
📁 network_management/-07752026-09-29 12:17🗑 Delete
📁 network_security/-07752026-09-29 12:17🗑 Delete
📁 network_services/-07752026-09-29 12:17🗑 Delete
📁 notebooks/-07752026-09-29 12:17🗑 Delete
📁 number_registry/-07752026-09-29 12:17🗑 Delete
📁 observability/-07752026-09-29 12:17🗑 Delete
📁 onboarding/-07752026-09-29 12:17🗑 Delete
📁 oracle_database/-07752026-09-29 12:17🗑 Delete
📁 orchestration_pipelines/-07752026-09-29 12:17🗑 Delete
📁 org_policies/-07752026-09-29 12:17🗑 Delete
📁 organizations/-07752026-09-29 12:17🗑 Delete
📁 orglifecycle/-07752026-09-29 12:17🗑 Delete
📁 pam/-07752026-09-29 12:17🗑 Delete
📁 parallelstore/-07752026-09-29 12:17🗑 Delete
📁 parametermanager/-07752026-09-29 12:17🗑 Delete
📁 policy_intelligence/-07752026-09-29 12:17🗑 Delete
📁 policy_troubleshoot/-07752026-09-29 12:17🗑 Delete
📁 preview/-07752026-09-29 12:17🗑 Delete
📁 privateca/-07752026-09-29 12:17🗑 Delete
📁 projects/-07752026-09-29 12:17🗑 Delete
📁 publicca/-07752026-09-29 12:17🗑 Delete
📁 pubsub/-07752026-09-29 12:17🗑 Delete
📁 quotas/-07752026-09-29 12:17🗑 Delete
📁 recaptcha/-07752026-09-29 12:17🗑 Delete
📁 recommender/-07752026-09-29 12:17🗑 Delete
📁 redis/-07752026-09-29 12:17🗑 Delete
📁 remote_build_execution/-07752026-09-29 12:17🗑 Delete
📁 resource_config/-07752026-09-29 12:17🗑 Delete
📁 resource_manager/-07752026-09-29 12:17🗑 Delete
📁 run/-07752026-09-29 12:17🗑 Delete
📁 runtime_config/-07752026-09-29 12:17🗑 Delete
📁 scc/-07752026-09-29 12:17🗑 Delete
📁 scheduler/-07752026-09-29 12:17🗑 Delete
📁 seclm/-07752026-09-29 12:17🗑 Delete
📁 secrets/-07752026-09-29 12:17🗑 Delete
📁 service_directory/-07752026-09-29 12:17🗑 Delete
📁 service_extensions/-07752026-09-29 12:17🗑 Delete
📁 service_health/-07752026-09-29 12:17🗑 Delete
📁 services/-07752026-09-29 12:17🗑 Delete
📁 software_delivery_trust/-07752026-09-29 12:17🗑 Delete
📁 source/-07752026-09-29 12:17🗑 Delete
📁 source_manager/-07752026-09-29 12:17🗑 Delete
📁 spanner/-07752026-09-29 12:17🗑 Delete
📁 spectrum_access/-07752026-09-29 12:17🗑 Delete
📁 sql/-07752026-09-29 12:17🗑 Delete
📁 storage/-07752026-09-29 12:17🗑 Delete
📁 support/-07752026-09-29 12:17🗑 Delete
📁 tasks/-07752026-09-29 12:17🗑 Delete
📁 telco_automation/-07752026-09-29 12:17🗑 Delete
📁 terraform/-07752026-09-29 12:17🗑 Delete
📁 topic/-07752026-09-29 12:17🗑 Delete
📁 trace/-07752026-09-29 12:17🗑 Delete
📁 transcoder/-07752026-09-29 12:17🗑 Delete
📁 transfer/-07752026-09-29 12:17🗑 Delete
📁 vector_search/-07752026-09-29 12:17🗑 Delete
📁 vmware/-07752026-09-29 12:17🗑 Delete
📁 web_security_scanner/-07752026-09-29 12:17🗑 Delete
📁 workbench/-07752026-09-29 12:17🗑 Delete
📁 workflows/-07752026-09-29 12:17🗑 Delete
📁 workload_identity/-07752026-09-29 12:17🗑 Delete
📁 workspace_add_ons/-07752026-09-29 12:17🗑 Delete
📁 workstations/-07752026-09-29 12:17🗑 Delete
📁 zone_management/-07752026-09-29 12:17🗑 Delete
__init__.py7.5K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
cheat_sheet.py5.9K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
docker.py6.2K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
feedback.py5.3K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
help.py5K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
info.py3.9K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
init.py23.4K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
interactive.py10.4K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
survey.py3K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
unlock.py2.1K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del
version.py2.1K06441980-01-01 08:00👁 View ✏️ Edit 📝 Rename 📦 Move 🗑 Del