### Install Go Dependencies Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-valkey/operations/connect/non-sharded-code-examples.md Before running the Go examples, install the necessary dependencies using go mod init and go get. ```bash sudo apt update && sudo apt install --yes golang git && \ go mod init github.com/go-redis/redis && \ go get github.com/go-redis/redis/v7 ``` -------------------------------- ### Start SAP installation Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/tutorials/infrastructure-management/sap.md Executes the SAP installation script. ```bash ./install.sh ``` -------------------------------- ### Directory structure for installation Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/storage-onprem/v-1-0/install/setup-install-params.md Create a copy of the example directory to customize your installation parameters. ```text stands/ ├─ example/ └─ my-onprem/ ├─ env └─ pillar.sls ``` -------------------------------- ### Install Go and Git Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-clickhouse/operations/connect/code-examples.md Install Go and Git on Ubuntu systems before running Go examples. ```bash sudo apt update && sudo apt install --yes golang git ``` -------------------------------- ### Install Go dependencies Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-mysql/operations/connect/code-examples.md Before connecting, install the necessary Go dependencies using apt and go get. ```bash sudo apt update && sudo apt install --yes golang git && \ go get github.com/go-sql-driver/mysql ``` -------------------------------- ### Clone Node.js SDK Examples Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/overview/sdk/quickstart.md Get the example repository for Yandex Cloud SDK for Node.js to start quickly. ```bash git clone https://github.com/yandex-cloud-examples/yc-sdk-quickstart-node-js.git ``` -------------------------------- ### Install Go Dependencies Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-valkey/operations/connect/sharded-code-examples.md Before running the Go examples, ensure you have Go and Git installed. Then, initialize your Go module and fetch the necessary Redis client library. ```bash sudo apt update && sudo apt install --yes golang git && \ go mod init github.com/go-redis/redis && \ go get github.com/redis/go-redis/v9 ``` -------------------------------- ### Check yc-guest-agent Service Status Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/compute/operations/vm-guest-agent/check.md Use this PowerShell command to check if the yc-guest-agent service is installed and running. If stopped, it can be started with `Start-Service`. If not installed, follow the installation guide. ```powershell Get-Service "yc-guest-agent" ``` ```powershell Start-Service "yc-guest-agent" ``` -------------------------------- ### Install Go Dependencies Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-greenplum/operations/connect/code-examples.md Before running the Go examples, ensure you have Go installed and fetch the necessary pgx library. This command initializes a Go module and downloads the pgx package. ```bash sudo apt update && sudo apt install --yes golang git && \ go mod init example && go get github.com/jackc/pgx/v4 ``` -------------------------------- ### Clone Project Repository Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/api-gateway/tutorials/ci-cd-serverless.md Clone the example project repository to your local machine to get started. ```bash git clone https://github.com/yandex-cloud-examples/yc-serverless-gitlab-ci-cd.git ``` -------------------------------- ### Gwin Controller Logs Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/smartwebsecurity/tutorials/alb-ingress-with-sws-profile.md This is an example of the expected log output after successfully starting the Gwin controller. It indicates successful server setup and the initiation of ALB observation and address updating. ```text level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:467 msg="Server setup completed successfully" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:488 msg="Starting ALB observer" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:490 msg="ALB observer started successfully" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:492 msg="Starting address updater" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:494 msg="Address updater started successfully" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:496 msg="All services configured successfully, starting controller manager" ``` -------------------------------- ### Verify Gwin Controller Installation Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/application-load-balancer/tutorials/alb-ingress-with-sws-profile.md Check the logs of the Gwin deployment to confirm successful installation and startup. Ensure the logs indicate that the server setup and controller manager have started successfully. ```bash kubectl logs deployment.apps/gwin -n gwin-space ``` ```text level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:467 msg="Server setup completed successfully" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:488 msg="Starting ALB observer" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:490 msg="ALB observer started successfully" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:492 msg="Starting address updater" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:494 msg="Address updater started successfully" level=INFO source=/yc_gwin/cmd/gwin/app/serve.go:496 msg="All services configured successfully, starting controller manager" ``` -------------------------------- ### Install Dependencies and Create Project for C# Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-valkey/operations/connect/sharded-code-examples.md Before running the C# code examples, you need to install the .NET SDK and set up your project directory. This includes creating a new project and adding the necessary StackExchange.Redis package. ```bash sudo apt update && sudo apt install --yes apt-transport-https dotnet-sdk-6.0 ``` ```bash cd ~ && mkdir cs-project && cd cs-project ``` ```xml Exe net6.0 ``` -------------------------------- ### Clone Firebase JWT Authorizer Project Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/storage/tutorials/jwt-authorizer-firebase.md Clone the example project repository to get started with the Firebase JWT authorizer. ```bash git clone https://github.com/yandex-cloud-examples/yc-serverless-apigw-jwt-authorizer-firebase.git ``` -------------------------------- ### Initialize Yandex Cloud CLI Profile Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/storage/tools/yc-cli.md Run this command to start the interactive setup for your Yandex Cloud CLI profile. It guides you through authentication and default settings. ```bash yc init ``` -------------------------------- ### Execute the Installation Script Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/cloud-desktop/tutorials/desktop-linux-printer.md Make the installation script executable and run it with the necessary parameters for user, directory, and printer name. ```bash sudo chmod +x install-printdrop-backend.sh sudo ./install-printdrop-backend.sh \ --user <имя_пользователя_стола> \ --dir <путь_к_папке> \ --printer <имя_принтера> ``` -------------------------------- ### Clone Bitrix Shop Terraform Configuration Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-mysql/tutorials/bitrix-shop/terraform.md Clone the repository containing the pre-configured Terraform files for deploying a Bitrix shop. This is a quick way to get started with the infrastructure setup. ```bash git clone https://github.com/yandex-cloud-examples/yc-bitrix-website.git ``` -------------------------------- ### Install Go Dependencies Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-ytsaurus/operations/connect.md Installs Go and initializes a new Go module, then fetches the YTsaurus Go SDK. This is a prerequisite for using the Go connection example. ```bash sudo apt update && sudo apt install --yes golang git && \ go mod init example && go get go.ytsaurus.tech/yt/go ``` -------------------------------- ### Install and Start GitLab Runner Service Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-gitlab/tutorials/application-testing-with-gitlab.md Install the GitLab Runner as a service and start it. This command prepares the runner to be registered with a GitLab instance. ```bash gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner ``` ```bash gitlab-runner start ``` -------------------------------- ### Example of creating an OS Login profile Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/organization/operations/os-login-profile-create.md This example demonstrates the output after successfully creating an OS Login profile with specified parameters. ```text id: aje6ddct3de5******** organization_id: bpf1smsil5q0******** subject_id: rser11gh89el******** login: new-os-login uid: "100500" home_directory: home/username shell: bin/bash ``` -------------------------------- ### Start Instance Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/compute/cli-ref/v0/instance/index.md Starts a specified virtual machine instance. ```APIDOC ## yc compute v0 instance start ### Description Start the specified virtual machine instance ### Command Usage `yc compute instance start --id [--async] ``` -------------------------------- ### Network Get CLI Output Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/tutorials/infrastructure-management/autoscale-monitoring.md Example output from the 'yc vpc network get' command, showing the network's ID and other details. ```text id: enpabce123hd******** folder_id: b0g12ga82bcv******** created_at: "2021-10-04T16:28:15.905337847Z" name: queue-autoscale-network ``` -------------------------------- ### Build Output Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/storage/tutorials/jwt-authorizer-firebase.md Example output after running the build command, showing gzipped file sizes and deployment information. ```text File sizes after gzip: 96.05 kB build\static\js\main.de7af71f.js 672 B build\static\css\main.021818e9.css The project was built assuming it is hosted at /. You can control this with the homepage field in your package.json. The build folder is ready to be deployed. ``` -------------------------------- ### Get Log Group gRPC API Response Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/logging/operations/get-group.md This is an example of the JSON response received when using the gRPC API to get log group details. ```json { "id": "e23u2vn449av********", "folderId": "b1g3f9i71bpm********", "cloudId": "b1gvlrnlei4l********", "createdAt": "2023-11-15T12:48:46.321Z", "name": "default", "description": "Auto-created default group", "status": "ACTIVE", "retentionPeriod": "259200s" } ``` -------------------------------- ### fstab Configuration Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/tutorials/infrastructure-management/sap.md Example of how to add entries to `/etc/fstab` for persistent mounting of the SAP data partitions. ```text LABEL=ROOT / xfs defaults 0 1 /dev/vdb1 /distr ext4 defaults 1 1 /dev/vdb2 /usr/sap ext4 defaults 1 1 ``` -------------------------------- ### Configure and Run Web Server Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/application-load-balancer/tutorials/webapp-on-bms-behind-sws.md Sets up an HTTP server with middleware for compression and logging. Includes graceful shutdown handling using context and signals. ```go mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d", cacheDuration)) w.Write(htmlContent) }) // Middleware chain := handlers.CompressHandler( handlers.CombinedLoggingHandler(os.Stdout, mux), ) // Конфигурация сервера server := &http.Server{ Addr: ":80", Handler: chain, ReadTimeout: serverTimeout, WriteTimeout: serverTimeout, IdleTimeout: serverTimeout * 2, } // Graceful shutdown ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) defer stop() go func() { <-ctx.Done() shutdownCtx, cancel := context.WithTimeout( context.Background(), 5*time.Second) defer cancel() server.Shutdown(shutdownCtx) }() fmt.Println("Server started") if err := server.ListenAndServe(); err != http.ErrServerClosed { fmt.Printf("Server error: %v\n", err) } ``` -------------------------------- ### Ingress-NGINX Installation Output Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-kubernetes/operations/create-load-balancer-with-ingress-nginx.md Example output after successfully installing the Ingress-NGINX controller. ```text NAME: ingress-nginx LAST DEPLOYED: Sun Jul 18 22:55:37 2022 NAMESPACE: default ... The ingress-nginx controller has been installed. It may take a few minutes for the LoadBalancer IP to be available. You can watch the status by running 'kubectl --namespace default get services -o wide -w ingress-nginx-controller' ... ``` -------------------------------- ### Start Virtual Machine with Idempotency Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/api-design-guide/concepts/idempotency.md This example shows how to start a virtual machine using the `Idempotency-Key` header. If the request is repeated with the same key, the server will return the existing operation status instead of restarting the VM. ```http POST /compute/v1/instances/e0m97h0gbq0foeuis03:start HTTP/1.1 Host: compute.api.cloud.yandex.net Idempotency-Key: c1700de3-b8cb-4d8a-9990-e4ebf052e9aa ``` -------------------------------- ### Install PHP Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-clickhouse/operations/connect/code-examples.md Installs the PHP package on Debian-based systems. Ensure PHP is installed before proceeding with PHP connection examples. ```bash sudo apt update && sudo apt install --yes php ``` -------------------------------- ### VM Creation Output Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/tutorials/security/audit-trails-events-to-kuma/console.md This is an example of the output received after successfully creating a virtual machine using the CLI. It includes details like instance ID, folder ID, creation timestamp, name, zone, and platform. ```text id: epd4vr5ra728******** folder_id: b1g681qpemb4******** created_at: "2024-11-27T23:00:38Z" name: kuma-server zone_id: ru-central1-b platform_id: standard-v2 resources: memory: "2147483648" ``` -------------------------------- ### Install Ruby Dependencies Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-valkey/operations/connect/sharded-code-examples.md Before running the Ruby connection examples, install the Redis gem. ```bash sudo apt update && sudo apt install --yes ruby && \ sudo gem install redis ``` -------------------------------- ### Initialize Go module Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/serverless-containers/tutorials/functions-framework-to-container.md Initializes a new Go module for your project. Replace 'example.com/helloWorld' with your desired module path. ```bash go mod init example.com/helloWorld ``` -------------------------------- ### Install Ruby Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-clickhouse/operations/connect/code-examples.md Install the Ruby programming language. This is a prerequisite for using the Ruby examples. ```bash sudo apt update && sudo apt install --yes ruby ``` -------------------------------- ### Install and enable Apache HTTP Server Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/managed-postgresql/tutorials/joomla-postgresql/console.md Install the Apache web server and enable it to start automatically on boot. ```bash sudo apt install apache2 sudo systemctl start apache2 && sudo systemctl enable apache2 ``` -------------------------------- ### Create Website Directory and Set Permissions Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/cdn/tutorials/protected-access-to-content/terraform.md Set up the directory structure for your website and assign ownership to the web server user (`www-data`). Replace `<имя_домена>` with your actual domain name. ```bash sudo mkdir -p /var/www/<имя_домена>/public_html sudo chown www-data:www-data /var/www/<имя_домена>/public_html ``` -------------------------------- ### Start Fluent Bit Service Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/storage/tutorials/replicate-logs-to-storage.md Start the Fluent Bit system service after installation. ```bash sudo systemctl start fluent-bit ``` -------------------------------- ### Install and Start UUIDD Daemon Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/compute/tutorials/sap.md Installs the UUIDD daemon, which is required for SAP to function. Ensure you have the necessary permissions to install packages. ```bash zypper install uuidd service uuidd start ``` -------------------------------- ### Install and Run Nginx with Cloud-Init Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/compute/operations/vm-create/create-with-cloud-init-scripts.md Use this script to install Nginx, start the service, and customize the default index page with the VM's hostname. Ensure you replace placeholders for username and SSH public key. ```yaml #cloud-config datasource: Ec2: strict_id: false ssh_pwauth: no users: - name: <имя_пользователя> sudo: 'ALL=(ALL) NOPASSWD:ALL' shell: /bin/bash ssh_authorized_keys: - <публичный_SSH-ключ> write_files: - path: "/usr/local/etc/startup.sh" permissions: "755" content: | #!/bin/bash apt-get update apt-get install -y nginx service nginx start sed -i -- "s/ nginx/ Yandex Cloud - ${HOSTNAME}/" /var/www/html/index.nginx-debian.html defer: true runcmd: - ["/usr/local/etc/startup.sh"] ``` -------------------------------- ### Object Storage installation example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/storage-onprem/v-1-0/install/setup-install-params.md Example configuration for Object Storage installation, including name, IP type, host details, IP pools for management services, and dataplane redundancy settings. ```yaml # Уникальное имя инсталляции (буквы, цифры, _) name: my_onprem # "ipv4" или "ipv6"; по умолчанию ipv4 ipType: ipv4 # Список хостов стенда # Для каждого указывается: # - name: FQDN хоста # - intIP: IP-адрес internal-интерфейсов # - dc: имя дата-центра (зоны доступности). hosts: - name: onprem01.local intIP: "10.0.0.11" dc: dc1 - name: onprem02.local intIP: "10.0.0.12" dc: dc2 - name: onprem03.local intIP: "10.0.0.13" dc: dc3 ipPools: # Подсеть для management сервисов (консоль, API для CLI, метрики, и т.д.) # Рекомендуется выделить не менее 16 адресов management: - "10.0.2.0/24" # Настройки dataplane dataplane: # Класс избыточности: R3 или EC4+2 redundancy: R3 ``` -------------------------------- ### VM Creation Output Example Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/audit-trails/tutorials/audit-trails-events-to-kuma/console.md This is an example of the output you might receive after successfully creating a VM using the CLI. It includes details like VM ID, name, zone, and resources. ```text id: epd4vr5ra728******** folder_id: b1g681qpemb4******** created_at: "2024-11-27T23:00:38Z" name: kuma-server zone_id: ru-central1-b platform_id: standard-v2 resources: memory: "2147483648" ``` -------------------------------- ### Get help for starting a desktop with Yandex Cloud CLI Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/cloud-desktop/operations/desktops/start-stop.md View the command-line interface help for starting a desktop to understand all available options and parameters. ```bash yc desktops desktop start --help ``` -------------------------------- ### Example ALB Route Configuration Source: https://github.com/yandex-cloud/docs/blob/master/md-docs/application-load-balancer/operations/manage-routes.md This example demonstrates a virtual host configuration with two routes. The first route matches any path starting with '/' and directs traffic to a backend group with a 60-second timeout. The second route specifically matches GET, POST, and OPTIONS methods for the exact path '/' and includes a rate limit per IP, along with disabling the security profile. ```text name: test-virtual-host authority: - example.com routes: - name: my-first-route http: match: path: prefix_match: / route: backend_group_id: ds7dnf2s5dco******** timeout: 60s auto_host_rewrite: false - name: my-second-route http: match: http_method: - GET - POST - OPTIONS path: exact_match: / route: backend_group_id: ds7dnf2s5dco******** timeout: 2s idle_timeout: 5s rate_limit: requests_per_ip: per_second: "10" disable_security_profile: true modify_request_headers: - name: Accept-Language append: ru-RU route_options: security_profile_id: fevu5fnuk6vf******** rate_limit: all_requests: per_second: "100" ```