### Full example for creating a gateway VM Source: https://docs.nebius.com/vpc/routing/custom-nat-gateway This is a comprehensive example demonstrating the creation of a gateway VM, including disk creation and cloud-init configuration for user setup and SSH access. It uses `jq` to extract the disk ID. ```bash VM_BOOT_DISK_ID=$(nebius compute disk create \ --name gateway-boot-disk \ --size-gibibytes 50 \ --type network_ssd \ --source-image-family-image-family ubuntu24.04-cuda12 \ --block-size-bytes 4096 \ --format json | jq -r ".metadata.id") nebius compute instance create \ --name gateway-vm-example \ --resources-platform cpu-d3 \ --resources-preset 4vcpu-16gb \ --boot-disk-existing-disk-id $VM_BOOT_DISK_ID \ --boot-disk-attach-mode read_write \ --boot-disk-device-id boot-disk \ --network-interfaces "[{ \ \"name\": \"eth0\", \ \"ip_address\": { \ \"allocation_id\": \"\" \ }, \ \"subnet_id\": \"\", \ \"public_ip_address\": {} \ }]" \ --cloud-init-user-data "users: - name: $USER sudo: ALL=(ALL) NOPASSWD:ALL shell: /bin/bash ssh_authorized_keys: - $(cat ~/.ssh/id_ed25519.pub)" ``` -------------------------------- ### Get VPC Pool using CopyPaste Friendly JSON Source: https://docs.nebius.com/cli/reference/vpc/pool/get This example demonstrates how to use a copy-paste friendly JSON format to specify the VPC pool ID for the get command. ```bash nebius vpc pool get \ '{ "id": "" }' ``` -------------------------------- ### Example: Connect to VM from Internet Source: https://docs.nebius.com/compute/virtual-machines/connect A complete example demonstrating how to retrieve the public IP address of a specific VM named 'training-instance' and then connect to it via SSH. ```bash export PUBLIC_IP_ADDRESS=$(nebius compute instance get-by-name \ --name training-instance \ --format json \ | jq -r '.status.network_interfaces[0].public_ip_address.address | split("/"[0]') ssh $USER@$PUBLIC_IP_ADDRESS ``` -------------------------------- ### Start and Enable Update Services Source: https://docs.nebius.com/compute/storage/automatic-updates Unmask, enable, and start the systemd services and timers responsible for daily apt updates and upgrades. This ensures that the system will automatically check for and install security updates. ```bash sudo systemctl unmask apt-daily.service apt-daily-upgrade.service sudo systemctl enable apt-daily.timer apt-daily-upgrade.timer sudo systemctl start apt-daily.timer apt-daily-upgrade.timer ``` -------------------------------- ### Example: Create an Object Storage Bucket Source: https://docs.nebius.com/object-storage/interfaces/aws-cli.md Example of creating a bucket named 'example-bucket'. ```bash aws s3 mb s3://example-bucket ``` -------------------------------- ### Get Quota Allowance by Name with JSON Schema Source: https://docs.nebius.com/cli/reference/quotas/quota-allowance/get-by-name This example shows the full JSON schema for input arguments when retrieving a quota allowance by name. It includes required fields like name, parent_id, and region with their descriptions and examples. ```json { "name": string, // [required] // Name of the quota. // Example: "compute.disk.size.network-ssd". "parent_id": string, // [required] // ID of the Container to list quotas for. "region": string // [required] // Name of the region where the quota is allocated. // Example: "eu-north1". } ``` -------------------------------- ### Interactive VM Creation Example Session Source: https://docs.nebius.com/cli/interactive An example session demonstrating the interactive prompts for creating a virtual machine, including metadata, required, and optional parameters like network interfaces and boot disks. ```bash cloud-init-user-data (string): file: ./user-data.txt ``` ```bash ... parent-id (required) (string): project-*** Human readable name for the resource. name (string): example-vm Labels associated with the resource. labels (map) string=string[,string=string]: Populate required fields resources-platform (required) (string): gpu-l40s-d resources-preset (required) (string): 1gpu-16vcpu-96gb network-interfaces-0-subnet-id (required) (string): vpcsubnet-*** network-interfaces-0-name (required) (string): eth0 Do you want to populate the network-interfaces-0-ip-address message ? [Y/n]: y network-interfaces-0-ip-address-allocation-id (string): vpcallocation-*** Do you want to populate the network-interfaces-0-public-ip-address message ? [Y/n]: y network-interfaces-0-public-ip-address-allocation-id (string): vpcallocation-*** network-interfaces-0-public-ip-address-static (bool): true Do you want to populate the network-interfaces-0-aliases message ? [Y/n]: n Do you want to populate the network-interfaces-0-security-groups message ? [Y/n]: n Add another entry to the network-interfaces list? [Y/n]: n Do you want to populate the optional fields? [y/N]: y ... Do you want to populate the boot-disk message ? [Y/n]: y boot-disk-attach-mode (required) (enum): READ_WRITE Select one of (boot-disk-type (required)): boot-disk-existing-disk (message) Do you want to populate the boot-disk-existing-disk message ? [Y/n]: y boot-disk-existing-disk-id (required) (string): computedisk-*** boot-disk-device-id (string): dev-1 ... ``` -------------------------------- ### Instance Creation with Options Source: https://docs.nebius.com/cli/reference/compute/instance/create This example demonstrates creating an instance with various configuration options such as timeouts, retries, and disk attachments. ```APIDOC ## create instance ### Description Creates a new compute instance with specified configurations. ### Method POST ### Endpoint /compute/instance ### Parameters #### Query Parameters - **--per-retry-timeout** (duration: 2h30m10s) - Optional - Set the timeout for each retry attempt, default is 20s. - **--retries** (uint) - Optional - Set the number of retry attempts, 1 is disable retries, default is 3. - **--timeout** (duration: 2h30m10s) - Optional - Set the timeout for the main request, default is 1m0s. - **--no-check-update** (bool) - Optional - Suppress check for updates. - **--no-progress** (bool) - Optional - Suppress progress indicators and spinners. #### Request Body - **metadata** (object) - Optional - Metadata for the resource. - **labels** (map[string]string) - Optional - Labels associated with the resource. - **name** (string) - Optional - Human readable name for the resource. - **parent_id** (string) - Required - Identifier of the parent resource to which the resource belongs. - **resource_version** (int64) - Optional - Version of the resource for safe concurrent modifications and consistent reads. - **spec** (object) - Optional - Specification for the instance. - **boot_disk** (object) - Required - Specified boot disk attached to the instance. - **attach_mode** (enum) - Required - Attach mode for the boot disk (UNSPECIFIED, READ_ONLY, READ_WRITE). - **device_id** (string) - Optional - User-defined identifier for the device path. - **existing_disk** (object) - Optional - Attach an existing disk. - **id** (string) - Required - Identifier of the existing disk. - **managed_disk** (object) - Optional - Attach a managed disk. - **name** (string) - Required - Name of the managed disk. - **spec** (object) - Required - Specification for the managed disk. ### Request Example ```json { "metadata": { "parent_id": "projects/my-project", "name": "my-instance" }, "spec": { "boot_disk": { "attach_mode": "READ_WRITE", "managed_disk": { "name": "my-managed-disk", "spec": { "type": "pd-standard", "size_gb": 100 } } } } } ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the created instance. - **status** (string) - Current status of the instance. #### Response Example ```json { "id": "instance-12345", "status": "PROVISIONING" } ``` ``` -------------------------------- ### Get Cilium Helm Status Source: https://docs.nebius.com/kubernetes/networking/add-ons Retrieve the Helm status for the Cilium add-on to identify the specific version installed in your cluster. ```bash helm status -n kube-system cilium ``` -------------------------------- ### Example: Copying hello-world Image Source: https://docs.nebius.com/container-registry/images/copy This example demonstrates copying the 'hello-world:hello' image from a Nebius AI Cloud registry to a GitHub Packages registry. It includes pulling the image, tagging it for the destination, and pushing it. ```bash docker pull cr.eu-north1.nebius.cloud/my-registry/hello-world:hello docker tag \ cr.eu-north1.nebius.cloud/my-registry/hello-world:hello \ ghcr.io/octocat/hello-world:hello docker push ghcr.io/octocat/hello-world:hello ``` -------------------------------- ### Get Service Account with JSON Input Source: https://docs.nebius.com/cli/reference/iam/service-account/get This example demonstrates how to pass the service account ID directly within a JSON object for the command. ```bash nebius iam service-account get \ '{ "id": "" }' ``` -------------------------------- ### Get mk8s cluster with JSON schema Source: https://docs.nebius.com/cli/reference/mk8s/cluster/get Example of how to retrieve an mk8s cluster using its ID and resource version, with the input defined by a JSON schema. ```json { "id": string, // [required] "resource_version": string } ``` -------------------------------- ### Create Working Directory and Navigate Source: https://docs.nebius.com/serverless/tutorials/tts Sets up the necessary directory structure for the voice demo and navigates into it. Ensure you are in this directory for subsequent commands. ```bash mkdir -p ~/voice-demo-upload/input/raw cd ~/voice-demo-upload ``` -------------------------------- ### Create VM Instance with CLI Source: https://docs.nebius.com/serverless/tutorials/tts Creates a VM instance with specified resources, attaching an existing boot disk and configuring network interfaces. Ensure you replace `` and `` with your actual IDs. ```bash nebius compute instance create \ --name my-vm \ --boot-disk-existing-disk-id \ --boot-disk-attach-mode READ_WRITE \ --resources-platform cpu-d3 \ --resources-preset 16vcpu-64gb \ --network-interfaces "[{"name": "eth0", "subnet_id": "", "ip_address": {}, "public_ip_address": {}}]" \ --cloud-init-user-data "$USER_DATA" ``` -------------------------------- ### Get Service Account with Copy-Paste Friendly JSON Source: https://docs.nebius.com/cli/reference/iam/service-account/get This example provides a copy-paste friendly format for specifying the service account ID using JSON. ```bash nebius iam service-account get \ --id "" ``` -------------------------------- ### Instance Creation Parameters Source: https://docs.nebius.com/cli/reference/compute/instance/create This section outlines various parameters for creating an instance, including boot disk configurations, size options, source images, and filesystem attachments. ```APIDOC ## create instance ### Description Creates a new compute instance with specified configurations. ### Parameters #### Boot Disk Options - `--boot-disk-name` (string) - Name of a dependent disk. Mutually exclusive with `--boot-disk-existing-disk-id`. - `--boot-disk-existing-disk-id` (string) - ID of an existing disk to use for the boot disk. Mutually exclusive with other boot disk configuration flags. #### Boot Disk Managed Disk Size - `--boot-disk-managed-disk-size-bytes` (int64) - Size in bytes. Mutually exclusive with other size units and `--boot-disk-existing-disk-id`. - `--boot-disk-managed-disk-size-gibibytes` (int64) - Size in gibibytes. Mutually exclusive with other size units and `--boot-disk-existing-disk-id`. - `--boot-disk-managed-disk-size-kibibytes` (int64) - Size in kibibytes. Mutually exclusive with other size units and `--boot-disk-existing-disk-id`. - `--boot-disk-managed-disk-size-mebibytes` (int64) - Size in mebibytes. Mutually exclusive with other size units and `--boot-disk-existing-disk-id`. #### Boot Disk Managed Disk Source Image - `--boot-disk-managed-disk-source-image-family-image-family` (string) - Source image family name. Mutually exclusive with `--boot-disk-existing-disk-id` and `--boot-disk-managed-disk-source-image-id`. - `--boot-disk-managed-disk-source-image-family-parent-id` (string) - Parent ID for the image family. Mutually exclusive with `--boot-disk-existing-disk-id` and `--boot-disk-managed-disk-source-image-id`. - `--boot-disk-managed-disk-source-image-id` (string) - Source image ID. Mutually exclusive with `--boot-disk-existing-disk-id` and source image family options. #### Boot Disk Managed Disk Type - `--boot-disk-managed-disk-type` (string) - Type of the boot disk. Possible values: `unspecified`, `network_ssd`, `network_hdd`, `network_ssd_non_replicated`, `network_ssd_io_m3`. Mutually exclusive with `--boot-disk-existing-disk-id`. #### Cloud-Init User Data - `--cloud-init-user-data` (string) - User data in cloud-init format for instance initialization. #### Filesystems - `--filesystems` (json) - List of Shared Filesystems to attach to the instance. - `attach_mode` (string) - Required. Must be one of: `"unspecified"`, `"read_only"`, `"read_write"`. - `existing_filesystem` (structure) - Details of the existing filesystem. - `id` (string) - Required. The ID of the existing filesystem. ``` -------------------------------- ### Get Subnet ID Source: https://docs.nebius.com/serverless/tutorials/deploy-model Retrieve the ID of a subnet within your VPC to be used for the endpoint's network configuration. This example assumes the first subnet listed is suitable. ```bash export SUBNET_ID=$(nebius vpc subnet list --format jsonpath='{.items[0].metadata.id}') echo "SUBNET_ID=$SUBNET_ID" ``` -------------------------------- ### Filter Metrics by Name Source: https://docs.nebius.com/observability/metrics/prometheus Customize the data Prometheus collects by filtering metrics using the 'match[]' parameter. This example shows how to collect metrics with names starting with 'disk'. ```yaml match[]: - '{__name__=~"^disk.*"}' ``` -------------------------------- ### Create a disk Source: https://docs.nebius.com/cli/reference/compute/disk/create This example demonstrates how to create a disk with specified parameters. ```APIDOC ## create disk ### Description Creates a new disk with the specified configuration. ### Method POST ### Endpoint /compute/v1/disks ### Parameters #### Request Body - **metadata** (object) - Required - Metadata for the disk. - **labels** (object) - Optional - Labels to apply to the disk. - **name** (string) - Required - The name of the disk. - **parent_id** (string) - Required - The ID of the parent resource (e.g., folder or project). - **resource_version** (int64) - Optional - The version of the resource. - **spec** (object) - Required - Specification for the disk. - **block_size_bytes** (int64) - Optional - The block size of the disk in bytes. Defaults to 4096 bytes (4 KiB). - **disk_encryption** (object) - Optional - Defines how data on the disk is encrypted. By default, no encryption is applied. - **type** (enum) - Required - The type of disk encryption. Possible values: `DISK_ENCRYPTION_UNSPECIFIED`, `DISK_ENCRYPTION_MANAGED`. - **forbid_deletion** (bool) - Optional - Prevents deletion whilst set. - **size_bytes** (int64) - Optional - The size of the disk in bytes. Cannot be set together with size_kibibytes, size_mebibytes, or size_gibibytes. - **size_gibibytes** (int64) - Optional - The size of the disk in gibibytes. Cannot be set together with size_bytes, size_kibibytes, or size_mebibytes. - **size_kibibytes** (int64) - Optional - The size of the disk in kibibytes. Cannot be set together with size_bytes, size_mebibytes, or size_gibibytes. - **size_mebibytes** (int64) - Optional - The size of the disk in mebibytes. Cannot be set together with size_bytes, size_kibibytes, or size_gibibytes. - **source_image_family** (object) - Optional - Specifies the source image family for the disk. Cannot be set together with source_image_id. - **image_family** (string) - Required - The name of the image family. - **parent_id** (string) - Optional - The ID of the parent resource for the image family. - **source_image_id** (string) - Optional - The ID of the source image. Cannot be set together with source_image_family. - **type** (enum) - Required - The type of disk. Possible values: `UNSPECIFIED`, `NETWORK_SSD`, `NETWORK_HDD`, `NETWORK_SSD_NON_REPLICATED`, `NETWORK_SSD_IO_M3`. ### Request Example ```json { "metadata": { "labels": { "key": "value" }, "name": "my-disk", "parent_id": "projects/my-project" }, "spec": { "size_gibibytes": 100, "type": "NETWORK_SSD", "disk_encryption": { "type": "DISK_ENCRYPTION_MANAGED" } } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created disk. - **name** (string) - The name of the disk. - **status** (string) - The current status of the disk. #### Response Example ```json { "id": "disk-12345", "name": "my-disk", "status": "CREATING" } ``` ``` -------------------------------- ### Upload Object to Bucket using AWS CLI Source: https://docs.nebius.com/object-storage/quickstart Creates a 'test.txt' file with 'Hello world!' content and uploads it to the 'quickstart-bucket' as 'test.txt'. ```bash echo 'Hello world!' > test.txt ``` ```bash aws s3 cp test.txt s3://quickstart-bucket/test.txt ``` -------------------------------- ### Get Federation Certificate with JSON Schema Source: https://docs.nebius.com/cli/reference/iam/federation-certificate/get This example shows how to retrieve a federation certificate by providing the ID within a JSON object. This is useful for scripting and automated workflows. ```json { "id": string } ``` ```bash nebius iam federation-certificate get ' { "id": "" } ' ``` -------------------------------- ### Get VM Public IP Address for Internet Connection Source: https://docs.nebius.com/compute/virtual-machines/connect Retrieve the public IP address of a VM to connect from the internet. This command assumes you have the Nebius CLI installed and configured. ```bash export PUBLIC_IP_ADDRESS=$(nebius compute instance get-by-name \ --name \ --format json \ | jq -r '.status.network_interfaces[0].public_ip_address.address | split("/"[0]') ``` -------------------------------- ### Instance Creation with Disk Specification Source: https://docs.nebius.com/cli/reference/compute/instance/create This example demonstrates how to create an instance with a specified disk, including options for deletion protection and disk labels. ```APIDOC ## create instance ### Description Creates a new compute instance with specified configurations. ### Parameters #### Request Body - **name** (string) - Required - Name of the instance. - **spec** (structure) - Required - Specification of the instance. - **disk** (structure) - Required - Specification of the disk to be created. - **name** (string) - Required - Name of a dependent disk. Use it to convert an ExistingDisk to a dependent disk. Changing the name will replace the disk and cause data loss. - **labels** (map) - Optional - Labels associated with the disk resource. - **key** (string) - The key for the label. - **value** (string) - The value for the label. - **spec** (structure) - Required - Specification of a dependent disk to be created. - **block_size_bytes** (int64) - Immutable - Block size in bytes. Must be a power of two between 4096 and 131072. Defaults to 4096. - **disk_encryption** (structure) - Immutable - Defines how data on the disk is encrypted. By default, no encryption is applied. - **type** (string) - The type of disk encryption. Must be one of: `"disk_encryption_unspecified"`, `"disk_encryption_managed"`. - **forbid_deletion** (bool) - Optional - Prevents deletion whilst set. - **size_bytes** (int64) - Optional - Size of the disk in bytes. Mutually exclusive with size_gibibytes, size_kibibytes, size_mebibytes. - **size_gibibytes** (int64) - Optional - Size of the disk in gibibytes. Mutually exclusive with size_bytes, size_kibibytes, size_mebibytes. - **size_kibibytes** (int64) - Optional - Size of the disk in kibibytes. Mutually exclusive with size_bytes, size_gibibytes, size_mebibytes. - **size_mebibytes** (int64) - Optional - Size of the disk in mebibytes. Mutually exclusive with size_bytes, size_gibibytes, size_kibibytes. - **source_image_family** (structure) - Immutable - Mutually exclusive with source_image_id. - **source_image_id** (string) - Immutable - Mutually exclusive with source_image_family. ### Notes - Deletion protection: Switching ExistingDisk to ManagedDisk fails if `Disk.spec.deletion_protection` is enabled. Deleting an instance that has a ManagedDisk fails if `Disk.spec.deletion_protection` is enabled. - Mutually exclusive with: `existing_disk`. ``` -------------------------------- ### Get Bucket Command with Copy-Paste Friendly JSON Source: https://docs.nebius.com/cli/reference/storage/bucket/get This example provides a copy-paste friendly format for retrieving a storage bucket using a JSON object to specify the required ID. ```bash nebius storage bucket get ' { "id": "" } ' ``` -------------------------------- ### Job creation example Source: https://docs.nebius.com/serverless/jobs/manage Example of creating a training job with specific image, command, platform, preset, timeout, and subnet. ```bash nebius ai job create \ --name training-job \ --image nvidia/cuda:13.1.1-runtime-ubuntu24.04 \ --container-command bash \ --args "-c nvidia-smi" \ --platform gpu-l40s-a \ --preset 1gpu-8vcpu-32gb \ --timeout 1h \ --subnet-id vpcsubnet-e*** ``` -------------------------------- ### Get Capacity Interval with Copy-Paste Friendly JSON Source: https://docs.nebius.com/cli/reference/capacity/capacity-interval/get This example provides a copy-paste friendly format for retrieving a capacity interval using its ID. Ensure the 'id' field is populated. ```bash nebius capacity capacity-interval get \ '{ "id": "" }' ``` -------------------------------- ### List Instances Example Source: https://docs.nebius.com/grpc-api/calls/invoke-methods Example of how to list virtual machines (VMs) in a project using gRPCurl. ```APIDOC ## List Instances This example demonstrates how to list virtual machines (VMs) in a project using `grpcurl`. ### Request To get a list of VMs, you can use the following `grpcurl` command: ```bash grpcurl -rpc-header "Authorization: Bearer " \ -d '{ "parent_id": "project-e***" }' \ compute.api.nebius.cloud:443 \ nebius.compute.v1.InstanceService/List ``` **Explanation:** * `-rpc-header "Authorization: Bearer "`: Sets the authorization header with your obtained access token. * `-d '{ "parent_id": "project-e***" }'`: Specifies the request body. For listing instances, this typically includes the `parent_id` of the project. * `compute.api.nebius.cloud:443`: The endpoint for the Compute service. * `nebius.compute.v1.InstanceService/List`: The gRPC service and method to invoke. ``` -------------------------------- ### Create a Boot Disk for Training VM Source: https://docs.nebius.com/compute/quickstart Creates a 200 GiB SSD boot disk with an Ubuntu image pre-installed with NVIDIA GPU drivers. Ensure the image family is compatible with your GPU requirements. ```bash export TR_VM_BOOT_DISK_ID=$(nebius compute disk create \ --name training-vm-disk-1 \ --size-gibibytes 200 \ --type network_ssd \ --source-image-family-image-family ubuntu24.04-cuda13.0 \ --block-size-bytes 4096 \ --format json | jq -r ".metadata.id") ``` -------------------------------- ### Example PromQL Query for Underutilized CPUs Source: https://docs.nebius.com/observability/metrics/grafana This PromQL query helps identify virtual machines with consistently low CPU utilization over a 15-minute period. It filters for instances starting with 'computeinstance-'. ```promql {"system.cpu.load_average.15m", instance_id=~"computeinstance-.*"} ``` -------------------------------- ### Get Security Rule by Name using JSON Schema Source: https://docs.nebius.com/cli/reference/vpc/security-rule/get-by-name This example shows how to specify the security rule name and its parent security group ID using a JSON schema for the input. ```json { "name": string, // [required] "parent_id": string // [required] // ID of the Security Group. } ``` -------------------------------- ### Create an 8-GPU VM for Training Source: https://docs.nebius.com/compute/quickstart Launches a training VM with 8 GPUs, 128 vCPUs, and 1600 GB of RAM. It attaches the previously created boot disk and shared filesystem, and configures network interfaces. User data includes SSH key setup for access. ```bash export NETWORK_INTERFACE_NAME=single-gpu-node-compute-api-network-interface export USER_DATA=$(printf "users:\n - name: user\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n ssh_authorized_keys:\n - $(cat ~/.ssh/id_ed25519.pub)" | jq -Rs '.') export TR_VM_ID=$(nebius compute instance create \ --format json \ ${GPU_CLUSTER_ID:+--gpu-cluster-id} ${GPU_CLUSTER_ID:+"$GPU_CLUSTER_ID"} \ - < lorem-ipsum/lorem.txt ``` ```bash echo 'Euismod porta phasellus bibendum urna dolor tincidunt dapibus eu maecenas. Aliquet eget gravida; tempus curae potenti class. Lectus nibh nam donec sagittis donec felis posuere libero. Suspendisse accumsan suscipit blandit orci platea iaculis ac. Suspendisse egestas aptent aliquam sapien ut maximus. Litora ridiculus augue mi, ut aliquam amet. Fusce dignissim nulla venenatis dis himenaeos habitasse. Blandit primis massa eros gravida rhoncus nascetur nulla' > lorem-ipsum/euismod.txt ``` ```bash echo 'Litora integer iaculis libero dui pretium porta scelerisque. Dis laoreet ipsum porta viverra ipsum sem feugiat. Arcu ex natoque commodo faucibus facilisis vivamus sagittis; ultricies quis. Senectus vivamus nec cras porttitor penatibus. Ipsum vitae integer elementum; sem gravida etiam. Vivamus purus nunc nunc et aenean class. Tempor sagittis sociosqu erat class laoreet iaculis nec. Tempus ligula pellentesque a molestie fames elit vivamus.' > lorem-ipsum/litora.txt ``` -------------------------------- ### Get Secret Payload using JSON Schema Source: https://docs.nebius.com/cli/reference/mysterybox/payload/get-by-key This example shows the JSON schema for input arguments when retrieving a secret's payload. The `key` is required, while `secret_id` and `version_id` are optional. ```json { "key": string, // [required] // Payload's key to be retrieved. "secret_id": string, "version_id": string // [non_empty_default] // Desired version of the secret. If not provided, the primary version of the secret will be returned. } ``` -------------------------------- ### Create a VM with a boot disk and filesystem using CLI Source: https://docs.nebius.com/compute/virtual-machines/manage Use the Nebius AI Cloud CLI to create a boot disk, a filesystem, and then a VM, attaching both to the instance. Ensure filesystems are mounted after VM creation. ```bash nebius compute disk create \ --name \ --size-gibibytes 50 \ --type network_ssd \ --source-image-family-image-family ubuntu22.04-cuda12 \ --block-size-bytes 4096 ``` ```bash nebius compute filesystem create \ --name \ --size-gibibytes 10 \ --type network_ssd \ --block-size-bytes 4096 ``` ```bash nebius compute instance create \ --name \ --stopped \ --resources-platform \ --resources-preset \ --boot-disk-existing-disk-id \ --boot-disk-attach-mode \ --boot-disk-device-id \ --filesystems '[{"existing_filesystem": {"id": ""}, "attach_mode": "READ_WRITE", "mount_tag": ""}]' \ --network-interfaces '[{"name": "eth0", "ip_address": {}, "public_ip_address": {}, "subnet_id": ""}]' ``` -------------------------------- ### Get Compatibility Matrix with JSON Schema (Full) Source: https://docs.nebius.com/cli/reference/mk8s/node-group/get-compatibility-matrix This example shows the full JSON schema for the input arguments required by the `get-compatibility-matrix` command. It includes the required `cluster_kubernetes_version` and the optional `platform`. ```json { "cluster_kubernetes_version": string, // [required] // Cluster kubernetes version. "platform": string // Hardware platform for which the capabilities are requested. } ``` -------------------------------- ### Get Export Operation Status with JSON Schema (Full) Source: https://docs.nebius.com/cli/reference/logging/export/get This example shows the full JSON schema for providing the export operation ID when making the request. The `export_operation_id` field is mandatory. ```json { "export_operation_id": string // [required] // ID of the export operation to look up, as returned by `create` or shown by `list`. } ``` -------------------------------- ### Create a VM instance Source: https://docs.nebius.com/compute/virtual-machines/manage Create the virtual machine instance by specifying its name, project ID, whether it should start stopped, and the required resources including platform and preset. ```hcl resource "nebius_compute_v1_instance" "my_vm" { name = "" parent_id = "" stopped = resources = { platform = "" preset = "" } } ``` -------------------------------- ### Start Instance with Full JSON Schema Source: https://docs.nebius.com/cli/reference/compute/instance/start Use this format to start an instance by providing the instance ID within a JSON object. This is useful for scripting and automation. ```bash nebius compute instance start \ --id '{ "id": string }' ``` -------------------------------- ### Create a PostgreSQL cluster Source: https://docs.nebius.com/postgresql/clusters/manage Use this command to create a new PostgreSQL cluster. Ensure you have installed and configured the Nebius AI Cloud CLI. All parameters are required for a complete cluster setup. ```bash nebius msp postgresql v1alpha1 cluster create \ --name \ --description "" \ --network-id \ --config-version 16 \ --config-pooler-config-pooling-mode \ --config-pooler-config-max-pool-size \ --config-public-access= \ --config-template-resources-platform cpu-e2 \ --config-template-resources-preset \ --config-template-disk-type network-ssd \ --config-template-disk-size-gibibytes \ --config-template-hosts-count \ --bootstrap-db-name \ --bootstrap-user-name \ --bootstrap-user-password \ --backup-backup-window-start "" \ --backup-retention-policy d \ ``` -------------------------------- ### Start Instance with Copy-Paste Friendly JSON Source: https://docs.nebius.com/cli/reference/compute/instance/start This provides a convenient JSON structure for starting an instance, suitable for direct copy-pasting into a command line. Ensure you replace 'string' with the actual instance ID. ```bash nebius compute instance start \ --id '{ "id": "" }' ``` -------------------------------- ### Get Access Key by AWS ID Command Source: https://docs.nebius.com/cli/reference/iam/v2/access-key/get-by-aws-id Use this command to retrieve an access key associated with a specific AWS access key ID. Ensure you have the Nebius CLI installed and configured. ```bash nebius iam v2 access-key get-by-aws-id --aws-access-key-id ``` -------------------------------- ### Get all events in a tenant using Nebius CLI Source: https://docs.nebius.com/audit-logs/events/view Retrieve all audit events within a specified tenant for a given time range. Ensure the start and end times are in ISO 8601 format. ```bash nebius audit v2 audit-event list \ --parent-id \ --start \ --end ``` -------------------------------- ### List VM Instances with JSON Schema Input Source: https://docs.nebius.com/cli/reference/compute/instance/list This example shows how to provide input arguments for listing VM instances using a JSON schema. It specifies the structure for page size, token, and parent ID. ```json { "page_size": int64, "page_token": string, "parent_id": string } ``` -------------------------------- ### Get Mystery Box Payload with JSON Schema (Copy-Paste Friendly) Source: https://docs.nebius.com/cli/reference/mysterybox/payload/get This example provides a copy-paste friendly format for invoking the command with JSON input, specifying the secret ID and version ID. ```bash nebius mysterybox payload get ' { "secret_id": "", "version_id": "" } ' ``` -------------------------------- ### Login Node Prompt Example Source: https://docs.nebius.com/slurm-soperator/clusters/connect This is an example of the command prompt you will see after successfully connecting to a login node. ```text username@login-0:~$ ``` -------------------------------- ### Copy-Paste Friendly Command Example Source: https://docs.nebius.com/cli/reference/vpc/network/create-default A command-line example for creating a default VPC network, pre-formatted for easy copying and pasting into the terminal. It includes placeholder values for the required metadata fields. ```bash nebius vpc network create-default ' { "metadata": { "id": "", "labels": { "": "" }, "name": "", "parent_id": "", "resource_version": 0 } }' ``` -------------------------------- ### Get IAM Group Membership With Attributes Using CopyPaste Friendly JSON Source: https://docs.nebius.com/cli/reference/iam/group-membership/get-with-attributes This example provides a copy-paste friendly format for the 'get-with-attributes' command, allowing you to quickly input the required group ID. ```bash nebius iam group-membership get-with-attributes \ '{ "id": "" }' ``` -------------------------------- ### Get Federated Credentials by Name with JSON Schema Source: https://docs.nebius.com/cli/reference/iam/federated-credentials/get-by-name This example shows how to retrieve federated credentials by name using a JSON object for the parameters. Ensure the `name` and `parent_id` fields are correctly populated. ```json { "name": string, // [required] // Federated credentials name. "parent_id": string // [required] // Container (project), which contains desired credentials. } ``` -------------------------------- ### List Tenants with Options Source: https://docs.nebius.com/cli/reference/iam/v2/tenant/list Demonstrates the available options for listing tenants, including filtering, pagination, and listing all tenants. ```bash nebius iam v2 tenant list \ --filter \ --page-size \ --page-token \ --all \ -i, --interactive ``` -------------------------------- ### Create a VM with specific configurations Source: https://docs.nebius.com/compute/virtual-machines/manage Use this command to create a virtual machine with detailed specifications for disks, networking, and other resources. Ensure all required parameters are provided. ```bash yc compute instance create \ --name \ --zone-id \ --network-interface \ subnet-name=, \ ipv4-address= \ --create-boot-disk \ image-id= \ --ssh-key \ --metadata \ user-data="$(cat cloud-init.yaml)" \ --gpu-cluster-id \ --hostname --reservation-policy-policy --reservation-policy-reservation-ids --recovery-policy --preemptible-priority <1...5> --preemptible-on-preemption stop --service-account-id ``` -------------------------------- ### Get Compute Platform By Name with Copy-Paste JSON Source: https://docs.nebius.com/cli/reference/compute/platform/get-by-name This example demonstrates how to provide the compute platform name and parent ID using a copy-paste friendly JSON format directly in the command line. ```bash nebius compute platform get-by-name ' { "name": "", "parent_id": "" } ' ``` -------------------------------- ### Get Capacity Block Group with JSON Schema Source: https://docs.nebius.com/cli/reference/capacity/capacity-block-group/get This example shows how to specify the Capacity Block Group ID using a JSON schema for the input. This is useful for programmatic access or complex configurations. ```json { "id": string // [required] [identifier] // ID of the Capacity Block Group. } ``` -------------------------------- ### Create a bucket with specific configurations Source: https://docs.nebius.com/object-storage/buckets Examples of creating buckets with various configurations, including maximum size, object lifecycle rules, and default storage class. ```APIDOC ## Create Bucket Examples ### Description Demonstrates creating buckets with different configurations using the Nebius AI Cloud CLI. ### Method `nebius storage bucket create` ### Examples 1. **Create a bucket with a maximum size limit:** ```bash nebius storage bucket create --name --max-size-bytes 268435456000 ``` 2. **Create a bucket with an object lifecycle rule to delete objects after 90 days:** ```bash nebius storage bucket create --name --lifecycle-configuration-rules '[{ "id": "lifecycle-delete-90-days-objects", "status": "ENABLED", "filter": { "prefix": "" }, "expiration": { "days": 90 } }]' ``` 3. **Create a bucket with a forced Standard default storage class:** ```bash nebius storage bucket create --name --default-storage-class standard --force-storage-class ``` ### Parameters (common for examples) - `--name` (string) - Required - The name of the bucket. - `--max-size-bytes` (integer) - Optional - The maximum size of the bucket in bytes. - `--lifecycle-configuration-rules` (string) - Optional - A JSON string defining lifecycle rules. - `--default-storage-class` (string) - Optional - The default storage class for the bucket (e.g., `standard`). - `--force-storage-class` - Optional - Flag to force the default storage class for all objects. ### Response #### Success Response (200) Indicates the bucket was created successfully. #### Response Example (No specific response body example provided in source) ```