Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
/CLAUDE.md @vngcloud/platform

# Product CLIs — owned by their product teams.
/go/cmd/vks/ @vngcloud/vks
/docs/commands/vks/ @vngcloud/vks

# When a new product joins, add e.g.:
# /go/cmd/vserver/ @vngcloud/vserver
# /docs/commands/vserver/ @vngcloud/vserver
/go/cmd/vks/ @vngcloud/vks
/docs/commands/vks/ @vngcloud/vks
/go/cmd/vserver/ @vngcloud/vserver
/go/internal/vserverclient/ @vngcloud/vserver
/docs/commands/vserver/ @vngcloud/vserver
6 changes: 5 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ jobs:

- name: Run tests
working-directory: go
run: go test ./... -v
# Use the external (system) linker so test binaries get an LC_UUID load
# command. Go 1.22's internal linker omits it, and recent macOS dyld
# aborts such binaries ("missing LC_UUID load command"). CGO is enabled
# so the system cc (present on both ubuntu and macos runners) links.
run: CGO_ENABLED=1 go test -ldflags='-linkmode=external' ./... -v
119 changes: 119 additions & 0 deletions docs/commands/vserver/flavor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# flavor

Browse available vServer instance flavors (CPU/memory/GPU combinations).

```bash
grn vserver flavor <command> [options]
```

## Commands

| Command | Description |
|---------|-------------|
| [list-families](#list-families) | List available instance families |
| [list-codes](#list-codes) | List available CPU platform codes |
| [list](#list) | List flavors for a family and CPU platform |

## Discovery workflow

Flavors are organized by **family** (e.g. `general-purpose`, `memory-optimized`) and **CPU platform code** (e.g. `Intel`, `AMD`). To find a flavor:

```bash
# Step 1: find available families
grn vserver flavor list-families

# Step 2: find CPU platform codes
grn vserver flavor list-codes

# Step 3: list flavors for the chosen family and code
grn vserver flavor list --family <family> --code <code>
```

---

## list-families

List available instance families.

### Synopsis

```
grn vserver flavor list-families
```

### Examples

```bash
grn vserver flavor list-families
grn vserver flavor list-families --output table
```

---

## list-codes

List available CPU platform codes.

### Synopsis

```
grn vserver flavor list-codes
```

### Examples

```bash
grn vserver flavor list-codes
```

---

## list

List available flavors for a specific instance family and CPU platform code. Only flavors with remaining capacity are shown.

### Synopsis

```
grn vserver flavor list
--family <value>
--code <value>
[--zone-id <value>]
[--page <value>]
[--page-size <value>]
```

### Options

`--family` (required)
: Instance family name. Run `grn vserver flavor list-families` to see options. Omit to see available families printed to stderr.

`--code` (required)
: CPU platform code. Run `grn vserver flavor list-codes` to see options. Omit to see available codes printed to stderr.

`--zone-id` (string)
: Filter flavors by availability zone.

`--page` (integer)
: Page number, 1-based. Default: `1`.

`--page-size` (integer)
: Number of items per page. Default: `50`.

### Examples

```bash
grn vserver flavor list --family general-purpose --code Intel

grn vserver flavor list \
--family memory-optimized \
--code AMD \
--zone-id zone-abc123 \
--output table

# JMESPath to see only IDs and vCPU/RAM
grn vserver flavor list \
--family general-purpose \
--code Intel \
--query "data[].{id: flavorId, cpu: cpu, ram: ram}"
```
61 changes: 61 additions & 0 deletions docs/commands/vserver/image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# image

Browse available vServer OS and GPU images.

```bash
grn vserver image <command> [options]
```

## Commands

| Command | Description |
|---------|-------------|
| [list](#list) | List available images |

---

## list

List available images by type. Use the image ID with `grn vserver server create --image-id`.

### Synopsis

```
grn vserver image list
--type <value>
[--page <value>]
[--page-size <value>]
[--image-version <value>]
```

### Options

`--type` (required)
: Image type. Accepted values: `os`, `gpu`.

`--page` (integer)
: Page number, 1-based. Default: `1`.

`--page-size` (integer)
: Number of items per page. Default: `50`.

`--image-version` (string)
: Filter by image version (client-side substring match, case-insensitive).

### Examples

```bash
# List OS images
grn vserver image list --type os

# List GPU images
grn vserver image list --type gpu

# Filter to Ubuntu images
grn vserver image list --type os --image-version ubuntu

# Table output with JMESPath to extract ID and name
grn vserver image list --type os \
--query "images[].{id: id, name: name, version: imageVersion}" \
--output table
```
69 changes: 69 additions & 0 deletions docs/commands/vserver/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# vServer Commands

VNG Virtual Server (vServer) commands for managing cloud virtual machines and related infrastructure.

```bash
grn vserver <resource> <command> [options]
```

## Available resources

| Resource | Description |
|----------|-------------|
| [server](server.md) | Create and manage vServer instances |
| [volume](volume.md) | Manage block storage volumes |
| [vpc](vpc.md) | Manage VPC networks |
| [subnet](subnet.md) | Manage subnets within a VPC |
| [secgroup](secgroup.md) | Manage security groups and their rules |
| [flavor](flavor.md) | Browse available instance flavors |
| [image](image.md) | Browse available OS/GPU images |
| [volume-type](volume-type.md) | Browse available volume types for a zone |

## Quick start workflow

Creating a server requires several prerequisites. Run these commands in order:

```bash
# 1. Create a VPC
grn vserver vpc create --name my-vpc --cidr 10.0.0.0/16

# 2. Create a subnet inside the VPC
grn vserver subnet create --vpc-id <vpc-id> --cidr 10.0.1.0/24 --zone-id <zone-id>

# 3. Find an available zone (omit --zone-id to see the list)
# Zone IDs are shown when you run any command that requires --zone-id

# 4. Find a flavor
grn vserver flavor list-families
grn vserver flavor list-codes
grn vserver flavor list --family <family> --code <code>

# 5. Find an image
grn vserver image list --type os

# 6. Find a volume type for the zone
grn vserver volume-type list --zone-id <zone-id> --type SSD

# 7. Create the server
grn vserver server create \
--name my-server \
--flavor-id <flavor-id> \
--image-id <image-id> \
--network-id <vpc-id> \
--subnet-id <subnet-id> \
--root-disk-type-id <volume-type-id> \
--zone-id <zone-id>
```

## Common global options

All vserver commands accept these global flags:

| Flag | Description |
|------|-------------|
| `--region` | Override the configured region |
| `--output` | Output format: `json` (default), `table`, `text` |
| `--query` | JMESPath query to filter output |
| `--profile` | Use a specific credentials profile |
| `--endpoint-url` | Override the vServer API endpoint |
| `--debug` | Print raw HTTP requests and responses |
Loading
Loading