# Коммандная строка YC

Утилита [Yandex Cloud](https://yandex.cloud/ru/docs/cli/cli-ref/managed-services/compute/instance/) позволяет автоматизировать создание инстансов. Ее можно использовать в скриптах.

1. На [странице продукта](https://cloud.yandex.ru/marketplace/products/miko/mikopbx#product-ids) скопируйте значение **image\_id**. В текущем примере ***fd83g1qbk6m3jnl5cvah*** (для версии 2022.3.15). Идентификатор образа следует укзаать в параметре **create-boot-disk image-id**
2. Получим список каталогов

```bash
yc resource-manager folder list
```

Выбираем каталог и указываем его имя в параметре **folder-name**

3. Список зон

```bash
yc compute zone list 
```

Описываем зону в параметре **zone**

4. Запускаем инстанс

```bash
yc compute instance create \
	--folder-name apor-test-catalog \
	--name test\
	--zone ru-central1-c \
	--cores 2 \
	--memory 2gb \
	--create-boot-disk image-id=fd83g1qbk6m3jnl5cvah \
	--ssh-key ~/.ssh/id_rsa.pub \
	--public-ip \
	--create-disk name=storage-test-mikopbx,size=20,auto-delete=1
```

5. Список инстансов обновится

```bash
yc compute instance list                 
+----------------------+-----------------+---------------+---------+-----------------+-------------+
|          ID          |      NAME       |    ZONE ID    | STATUS  |   EXTERNAL IP   | INTERNAL IP |
+----------------------+-----------------+---------------+---------+-----------------+-------------+
| ef38gedvuug8qvv4l74p | test            | ru-central1-c | RUNNING | 51.250.39.55    | 10.130.0.6  |
+----------------------+-----------------+---------------+---------+-----------------+-------------+
```

Используйте **EXTERNAL IP** для входа и **ID** в качестве пароля для пользователя **admin** web интерфейса


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mikopbx.com/mikopbx/setup/cloud/yandex-cloud/yandex-cloud-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
