@nirvana-labs/nirvana-mcp 1.74.0 → 1.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +2 -1
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +2 -1
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.js +1 -1
- package/code-tool.mjs +1 -1
- package/local-docs-search.js +93 -93
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +93 -93
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-worker.ts +2 -1
- package/src/code-tool.ts +1 -1
- package/src/local-docs-search.ts +93 -93
- package/src/server.ts +1 -1
package/local-docs-search.mjs
CHANGED
|
@@ -720,22 +720,22 @@ const EMBEDDED_METHODS = [
|
|
|
720
720
|
qualified: 'client.regions.get',
|
|
721
721
|
params: ['name: string;'],
|
|
722
722
|
response: "{ availability: 'live' | 'preview' | 'maintenance' | 'sunset'; compute: { vms: boolean; }; name: string; networking: { connect: boolean; vpcs: boolean; }; nks: { clusters: boolean; }; storage: { abs: boolean; local_nvme: boolean; }; }",
|
|
723
|
-
markdown: "## get\n\n`client.regions.get(name: string): { availability: region_availability; compute: object; name: string; networking: object; nks: object; storage: object; }`\n\n**get** `/v1/regions/{name}`\n\nGet a region by name\n\n### Parameters\n\n- `name: string`\n\n### Returns\n\n- `{ availability: 'live' | 'preview' | 'maintenance' | 'sunset'; compute: { vms: boolean; }; name: string; networking: { connect: boolean; vpcs: boolean; }; nks: { clusters: boolean; }; storage: { abs: boolean; local_nvme: boolean; }; }`\n Region response with product availability.\n\n - `availability: 'live' | 'preview' | 'maintenance' | 'sunset'`\n - `compute: { vms: boolean; }`\n - `name: string`\n - `networking: { connect: boolean; vpcs: boolean; }`\n - `nks: { clusters: boolean; }`\n - `storage: { abs: boolean; local_nvme: boolean; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst region = await client.regions.get('us-
|
|
723
|
+
markdown: "## get\n\n`client.regions.get(name: string): { availability: region_availability; compute: object; name: string; networking: object; nks: object; storage: object; }`\n\n**get** `/v1/regions/{name}`\n\nGet a region by name\n\n### Parameters\n\n- `name: string`\n\n### Returns\n\n- `{ availability: 'live' | 'preview' | 'maintenance' | 'sunset'; compute: { vms: boolean; }; name: string; networking: { connect: boolean; vpcs: boolean; }; nks: { clusters: boolean; }; storage: { abs: boolean; local_nvme: boolean; }; }`\n Region response with product availability.\n\n - `availability: 'live' | 'preview' | 'maintenance' | 'sunset'`\n - `compute: { vms: boolean; }`\n - `name: string`\n - `networking: { connect: boolean; vpcs: boolean; }`\n - `nks: { clusters: boolean; }`\n - `storage: { abs: boolean; local_nvme: boolean; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst region = await client.regions.get('us-sva-2');\n\nconsole.log(region);\n```",
|
|
724
724
|
perLanguage: {
|
|
725
725
|
cli: {
|
|
726
726
|
method: 'regions get',
|
|
727
|
-
example: "nirvana regions get \\\n --api-key 'My API Key' \\\n --name us-
|
|
727
|
+
example: "nirvana regions get \\\n --api-key 'My API Key' \\\n --name us-sva-2",
|
|
728
728
|
},
|
|
729
729
|
go: {
|
|
730
730
|
method: 'client.Regions.Get',
|
|
731
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tregion, err := client.Regions.Get(context.TODO(), "us-
|
|
731
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tregion, err := client.Regions.Get(context.TODO(), "us-sva-2")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", region.Availability)\n}\n',
|
|
732
732
|
},
|
|
733
733
|
http: {
|
|
734
734
|
example: 'curl https://api.nirvanalabs.io/v1/regions/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
735
735
|
},
|
|
736
736
|
typescript: {
|
|
737
737
|
method: 'client.regions.get',
|
|
738
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst region = await client.regions.get('us-
|
|
738
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst region = await client.regions.get('us-sva-2');\n\nconsole.log(region.availability);",
|
|
739
739
|
},
|
|
740
740
|
},
|
|
741
741
|
},
|
|
@@ -776,9 +776,9 @@ const EMBEDDED_METHODS = [
|
|
|
776
776
|
description: 'Get an instance type by region and name',
|
|
777
777
|
stainlessPath: '(resource) instance_types > (method) get',
|
|
778
778
|
qualified: 'client.instanceTypes.get',
|
|
779
|
-
params: ["region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
780
|
-
response: "{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
781
|
-
markdown: "## get\n\n`client.instanceTypes.get(region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
779
|
+
params: ["region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';", 'name: string;'],
|
|
780
|
+
response: "{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; series: string; updated_at: string; vcpu: number; }",
|
|
781
|
+
markdown: "## get\n\n`client.instanceTypes.get(region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', name: string): { chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: region_name; series: string; updated_at: string; vcpu: number; }`\n\n**get** `/v1/instance_types/{region}/{name}`\n\nGet an instance type by region and name\n\n### Parameters\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n\n- `name: string`\n\n### Returns\n\n- `{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; series: string; updated_at: string; vcpu: number; }`\n Instance type.\n\n - `chipset: string`\n - `created_at: string`\n - `family: string`\n - `memory_gb: number`\n - `name: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `series: string`\n - `updated_at: string`\n - `vcpu: number`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst instanceType = await client.instanceTypes.get('n1-standard-8', { region: 'us-sva-2' });\n\nconsole.log(instanceType);\n```",
|
|
782
782
|
perLanguage: {
|
|
783
783
|
cli: {
|
|
784
784
|
method: 'instance_types get',
|
|
@@ -806,8 +806,8 @@ const EMBEDDED_METHODS = [
|
|
|
806
806
|
stainlessPath: '(resource) instance_types > (method) list',
|
|
807
807
|
qualified: 'client.instanceTypes.list',
|
|
808
808
|
params: ['cursor?: string;', 'limit?: number;'],
|
|
809
|
-
response: "{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
810
|
-
markdown: "## list\n\n`client.instanceTypes.list(cursor?: string, limit?: number): { chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: region_name; series: string; updated_at: string; vcpu: number; }`\n\n**get** `/v1/instance_types`\n\nList instance types\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
809
|
+
response: "{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; series: string; updated_at: string; vcpu: number; }",
|
|
810
|
+
markdown: "## list\n\n`client.instanceTypes.list(cursor?: string, limit?: number): { chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: region_name; series: string; updated_at: string; vcpu: number; }`\n\n**get** `/v1/instance_types`\n\nList instance types\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ chipset: string; created_at: string; family: string; memory_gb: number; name: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; series: string; updated_at: string; vcpu: number; }`\n Instance type.\n\n - `chipset: string`\n - `created_at: string`\n - `family: string`\n - `memory_gb: number`\n - `name: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `series: string`\n - `updated_at: string`\n - `vcpu: number`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const instanceType of client.instanceTypes.list()) {\n console.log(instanceType);\n}\n```",
|
|
811
811
|
perLanguage: {
|
|
812
812
|
cli: {
|
|
813
813
|
method: 'instance_types list',
|
|
@@ -842,29 +842,29 @@ const EMBEDDED_METHODS = [
|
|
|
842
842
|
'os_image_name: string;',
|
|
843
843
|
'project_id: string;',
|
|
844
844
|
'public_ip_enabled: boolean;',
|
|
845
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
845
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
846
846
|
'ssh_key: { public_key: string; };',
|
|
847
847
|
'subnet_id: string;',
|
|
848
848
|
"data_volumes?: { name: string; size: number; type: 'nvme' | 'abs'; tags?: string[]; }[];",
|
|
849
849
|
'tags?: string[];',
|
|
850
850
|
],
|
|
851
851
|
response: "{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
852
|
-
markdown: "## create\n\n`client.compute.vms.create(boot_volume: { size: number; type: 'nvme' | 'abs'; tags?: string[]; }, cpu_config: { vcpu: number; }, memory_config: { size: number; }, name: string, os_image_name: string, project_id: string, public_ip_enabled: boolean, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
852
|
+
markdown: "## create\n\n`client.compute.vms.create(boot_volume: { size: number; type: 'nvme' | 'abs'; tags?: string[]; }, cpu_config: { vcpu: number; }, memory_config: { size: number; }, name: string, os_image_name: string, project_id: string, public_ip_enabled: boolean, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', ssh_key: { public_key: string; }, subnet_id: string, data_volumes?: { name: string; size: number; type: 'nvme' | 'abs'; tags?: string[]; }[], tags?: string[]): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/compute/vms`\n\nCreate a VM\n\n### Parameters\n\n- `boot_volume: { size: number; type: 'nvme' | 'abs'; tags?: string[]; }`\n Boot volume for the VM.\n - `size: number`\n Size of the Volume in GB.\n - `type: 'nvme' | 'abs'`\n Type of the Volume.\n - `tags?: string[]`\n Tags to attach to the Volume.\n\n- `cpu_config: { vcpu: number; }`\n CPU configuration for the VM.\n - `vcpu: number`\n Number of virtual CPUs.\n\n- `memory_config: { size: number; }`\n Memory configuration for the VM.\n - `size: number`\n Size of the memory in GB.\n\n- `name: string`\n Name of the VM.\n\n- `os_image_name: string`\n Name of the OS Image to use for the VM.\n\n- `project_id: string`\n Project ID to create the VM in.\n\n- `public_ip_enabled: boolean`\n Whether to enable public IP for the VM.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `ssh_key: { public_key: string; }`\n Public SSH key configuration for the VM.\n - `public_key: string`\n Public key to and and use to access the VM.\n\n- `subnet_id: string`\n ID of the subnet to use for the VM.\n\n- `data_volumes?: { name: string; size: number; type: 'nvme' | 'abs'; tags?: string[]; }[]`\n Data volumes for the VM.\n\n- `tags?: string[]`\n Tags to attach to the VM.\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-2',\n ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation);\n```",
|
|
853
853
|
perLanguage: {
|
|
854
854
|
cli: {
|
|
855
855
|
method: 'vms create',
|
|
856
|
-
example: "nirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --cpu-config '{vcpu: 2}' \\\n --memory-config '{size: 2}' \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-
|
|
856
|
+
example: "nirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --cpu-config '{vcpu: 2}' \\\n --memory-config '{size: 2}' \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000",
|
|
857
857
|
},
|
|
858
858
|
go: {
|
|
859
859
|
method: 'client.Compute.VMs.New',
|
|
860
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.
|
|
860
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
861
861
|
},
|
|
862
862
|
http: {
|
|
863
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "cpu_config": {\n "vcpu": 2\n },\n "memory_config": {\n "size": 2\n },\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-
|
|
863
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "cpu_config": {\n "vcpu": 2\n },\n "memory_config": {\n "size": 2\n },\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-sva-2",\n "ssh_key": {\n "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n },\n "subnet_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
864
864
|
},
|
|
865
865
|
typescript: {
|
|
866
866
|
method: 'client.compute.vms.create',
|
|
867
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-
|
|
867
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-2',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);",
|
|
868
868
|
},
|
|
869
869
|
},
|
|
870
870
|
},
|
|
@@ -877,8 +877,8 @@ const EMBEDDED_METHODS = [
|
|
|
877
877
|
stainlessPath: '(resource) compute.vms > (method) get',
|
|
878
878
|
qualified: 'client.compute.vms.get',
|
|
879
879
|
params: ['vm_id: string;'],
|
|
880
|
-
response: "{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
881
|
-
markdown: "## get\n\n`client.compute.vms.get(vm_id: string): { id: string; boot_volume_id: string; cpu_config: cpu_config; created_at: string; data_volume_ids: string[]; memory_config: memory_config; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: region_name; status: resource_status; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }`\n\n**get** `/v1/compute/vms/{vm_id}`\n\nGet details about a VM\n\n### Parameters\n\n- `vm_id: string`\n\n### Returns\n\n- `{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
880
|
+
response: "{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }",
|
|
881
|
+
markdown: "## get\n\n`client.compute.vms.get(vm_id: string): { id: string; boot_volume_id: string; cpu_config: cpu_config; created_at: string; data_volume_ids: string[]; memory_config: memory_config; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: region_name; status: resource_status; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }`\n\n**get** `/v1/compute/vms/{vm_id}`\n\nGet details about a VM\n\n### Parameters\n\n- `vm_id: string`\n\n### Returns\n\n- `{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }`\n VM details.\n\n - `id: string`\n - `boot_volume_id: string`\n - `cpu_config: { vcpu: number; }`\n - `created_at: string`\n - `data_volume_ids: string[]`\n - `memory_config: { size: number; }`\n - `name: string`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `public_ip_enabled: boolean`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `subnet_id: string`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n - `vpc_name: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vm = await client.compute.vms.get('vm_id');\n\nconsole.log(vm);\n```",
|
|
882
882
|
perLanguage: {
|
|
883
883
|
cli: {
|
|
884
884
|
method: 'vms get',
|
|
@@ -971,8 +971,8 @@ const EMBEDDED_METHODS = [
|
|
|
971
971
|
stainlessPath: '(resource) compute.vms > (method) list',
|
|
972
972
|
qualified: 'client.compute.vms.list',
|
|
973
973
|
params: ['project_id: string;', 'cursor?: string;', 'limit?: number;'],
|
|
974
|
-
response: "{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
975
|
-
markdown: "## list\n\n`client.compute.vms.list(project_id: string, cursor?: string, limit?: number): { id: string; boot_volume_id: string; cpu_config: cpu_config; created_at: string; data_volume_ids: string[]; memory_config: memory_config; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: region_name; status: resource_status; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }`\n\n**get** `/v1/compute/vms`\n\nList all VMs\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
974
|
+
response: "{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }",
|
|
975
|
+
markdown: "## list\n\n`client.compute.vms.list(project_id: string, cursor?: string, limit?: number): { id: string; boot_volume_id: string; cpu_config: cpu_config; created_at: string; data_volume_ids: string[]; memory_config: memory_config; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: region_name; status: resource_status; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }`\n\n**get** `/v1/compute/vms`\n\nList all VMs\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; boot_volume_id: string; cpu_config: { vcpu: number; }; created_at: string; data_volume_ids: string[]; memory_config: { size: number; }; name: string; private_ip: string; project_id: string; public_ip: string; public_ip_enabled: boolean; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet_id: string; tags: string[]; updated_at: string; vpc_id: string; vpc_name: string; }`\n VM details.\n\n - `id: string`\n - `boot_volume_id: string`\n - `cpu_config: { vcpu: number; }`\n - `created_at: string`\n - `data_volume_ids: string[]`\n - `memory_config: { size: number; }`\n - `name: string`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `public_ip_enabled: boolean`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `subnet_id: string`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n - `vpc_name: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const vm of client.compute.vms.list({ project_id: 'project_id' })) {\n console.log(vm);\n}\n```",
|
|
976
976
|
perLanguage: {
|
|
977
977
|
cli: {
|
|
978
978
|
method: 'vms list',
|
|
@@ -1036,28 +1036,28 @@ const EMBEDDED_METHODS = [
|
|
|
1036
1036
|
'os_image_name: string;',
|
|
1037
1037
|
'project_id: string;',
|
|
1038
1038
|
'public_ip_enabled: boolean;',
|
|
1039
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1039
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
1040
1040
|
'ssh_key: { public_key: string; };',
|
|
1041
1041
|
'subnet_id: string;',
|
|
1042
1042
|
"data_volumes?: { name: string; size: number; type: 'nvme' | 'abs'; tags?: string[]; }[];",
|
|
1043
1043
|
'tags?: string[];',
|
|
1044
1044
|
],
|
|
1045
|
-
markdown: "## create\n\n`client.compute.vms.availability.create(boot_volume: { size: number; type: 'nvme' | 'abs'; tags?: string[]; }, cpu_config: { vcpu: number; }, memory_config: { size: number; }, name: string, os_image_name: string, project_id: string, public_ip_enabled: boolean, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1045
|
+
markdown: "## create\n\n`client.compute.vms.availability.create(boot_volume: { size: number; type: 'nvme' | 'abs'; tags?: string[]; }, cpu_config: { vcpu: number; }, memory_config: { size: number; }, name: string, os_image_name: string, project_id: string, public_ip_enabled: boolean, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', ssh_key: { public_key: string; }, subnet_id: string, data_volumes?: { name: string; size: number; type: 'nvme' | 'abs'; tags?: string[]; }[], tags?: string[]): void`\n\n**post** `/v1/compute/vms/availability`\n\nCheck VM Create Availability\n\n### Parameters\n\n- `boot_volume: { size: number; type: 'nvme' | 'abs'; tags?: string[]; }`\n Boot volume for the VM.\n - `size: number`\n Size of the Volume in GB.\n - `type: 'nvme' | 'abs'`\n Type of the Volume.\n - `tags?: string[]`\n Tags to attach to the Volume.\n\n- `cpu_config: { vcpu: number; }`\n CPU configuration for the VM.\n - `vcpu: number`\n Number of virtual CPUs.\n\n- `memory_config: { size: number; }`\n Memory configuration for the VM.\n - `size: number`\n Size of the memory in GB.\n\n- `name: string`\n Name of the VM.\n\n- `os_image_name: string`\n Name of the OS Image to use for the VM.\n\n- `project_id: string`\n Project ID to create the VM in.\n\n- `public_ip_enabled: boolean`\n Whether to enable public IP for the VM.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `ssh_key: { public_key: string; }`\n Public SSH key configuration for the VM.\n - `public_key: string`\n Public key to and and use to access the VM.\n\n- `subnet_id: string`\n ID of the subnet to use for the VM.\n\n- `data_volumes?: { name: string; size: number; type: 'nvme' | 'abs'; tags?: string[]; }[]`\n Data volumes for the VM.\n\n- `tags?: string[]`\n Tags to attach to the VM.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.compute.vms.availability.create({\n boot_volume: { size: 100, type: 'abs' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-2',\n ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```",
|
|
1046
1046
|
perLanguage: {
|
|
1047
1047
|
cli: {
|
|
1048
1048
|
method: 'availability create',
|
|
1049
|
-
example: "nirvana compute:vms:availability create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --cpu-config '{vcpu: 2}' \\\n --memory-config '{size: 2}' \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-
|
|
1049
|
+
example: "nirvana compute:vms:availability create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --cpu-config '{vcpu: 2}' \\\n --memory-config '{size: 2}' \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000",
|
|
1050
1050
|
},
|
|
1051
1051
|
go: {
|
|
1052
1052
|
method: 'client.Compute.VMs.Availability.New',
|
|
1053
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.VMs.Availability.New(context.TODO(), compute.VMAvailabilityNewParams{\n\t\tBootVolume: compute.VMAvailabilityNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.
|
|
1053
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.VMs.Availability.New(context.TODO(), compute.VMAvailabilityNewParams{\n\t\tBootVolume: compute.VMAvailabilityNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
1054
1054
|
},
|
|
1055
1055
|
http: {
|
|
1056
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "cpu_config": {\n "vcpu": 2\n },\n "memory_config": {\n "size": 2\n },\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-
|
|
1056
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "cpu_config": {\n "vcpu": 2\n },\n "memory_config": {\n "size": 2\n },\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-sva-2",\n "ssh_key": {\n "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n },\n "subnet_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1057
1057
|
},
|
|
1058
1058
|
typescript: {
|
|
1059
1059
|
method: 'client.compute.vms.availability.create',
|
|
1060
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.vms.availability.create({\n boot_volume: { size: 100, type: 'abs' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-
|
|
1060
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.vms.availability.create({\n boot_volume: { size: 100, type: 'abs' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-2',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n});",
|
|
1061
1061
|
},
|
|
1062
1062
|
},
|
|
1063
1063
|
},
|
|
@@ -1105,8 +1105,8 @@ const EMBEDDED_METHODS = [
|
|
|
1105
1105
|
stainlessPath: '(resource) compute.vms.volumes > (method) list',
|
|
1106
1106
|
qualified: 'client.compute.vms.volumes.list',
|
|
1107
1107
|
params: ['vm_id: string;', 'cursor?: string;', 'limit?: number;'],
|
|
1108
|
-
response: "{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1109
|
-
markdown: "## list\n\n`client.compute.vms.volumes.list(vm_id: string, cursor?: string, limit?: number): { id: string; created_at: string; kind: volume_kind; name: string; project_id: string; region: region_name; size: number; status: resource_status; tags: string[]; type: volume_type; updated_at: string; vm_id: string; vm_name: string; }`\n\n**get** `/v1/compute/vms/{vm_id}/volumes`\n\nList VM's Volumes\n\n### Parameters\n\n- `vm_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1108
|
+
response: "{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; size: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; type: 'nvme' | 'abs'; updated_at: string; vm_id: string; vm_name: string; }",
|
|
1109
|
+
markdown: "## list\n\n`client.compute.vms.volumes.list(vm_id: string, cursor?: string, limit?: number): { id: string; created_at: string; kind: volume_kind; name: string; project_id: string; region: region_name; size: number; status: resource_status; tags: string[]; type: volume_type; updated_at: string; vm_id: string; vm_name: string; }`\n\n**get** `/v1/compute/vms/{vm_id}/volumes`\n\nList VM's Volumes\n\n### Parameters\n\n- `vm_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; size: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; type: 'nvme' | 'abs'; updated_at: string; vm_id: string; vm_name: string; }`\n Volume details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'boot' | 'data'`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `size: number`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `type: 'nvme' | 'abs'`\n - `updated_at: string`\n - `vm_id: string`\n - `vm_name: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const volume of client.compute.vms.volumes.list('vm_id')) {\n console.log(volume);\n}\n```",
|
|
1110
1110
|
perLanguage: {
|
|
1111
1111
|
cli: {
|
|
1112
1112
|
method: 'volumes list',
|
|
@@ -1165,29 +1165,29 @@ const EMBEDDED_METHODS = [
|
|
|
1165
1165
|
params: [
|
|
1166
1166
|
'name: string;',
|
|
1167
1167
|
'project_id: string;',
|
|
1168
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1168
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
1169
1169
|
'size: number;',
|
|
1170
1170
|
"type: 'nvme' | 'abs';",
|
|
1171
1171
|
'tags?: string[];',
|
|
1172
1172
|
'vm_id?: string;',
|
|
1173
1173
|
],
|
|
1174
1174
|
response: "{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
1175
|
-
markdown: "## create\n\n`client.compute.volumes.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1175
|
+
markdown: "## create\n\n`client.compute.volumes.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', size: number, type: 'nvme' | 'abs', tags?: string[], vm_id?: string): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/compute/volumes`\n\nCreate a Volume. Only data volumes can be created.\n\n### Parameters\n\n- `name: string`\n Name of the Volume.\n\n- `project_id: string`\n Project ID the Volume belongs to.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `size: number`\n Size of the Volume in GB.\n\n- `type: 'nvme' | 'abs'`\n Type of the Volume.\n\n- `tags?: string[]`\n Tags to attach to the Volume.\n\n- `vm_id?: string`\n ID of the VM the Volume is attached to.\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.compute.volumes.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n size: 100,\n type: 'abs',\n});\n\nconsole.log(operation);\n```",
|
|
1176
1176
|
perLanguage: {
|
|
1177
1177
|
cli: {
|
|
1178
1178
|
method: 'volumes create',
|
|
1179
|
-
example: "nirvana compute:volumes create \\\n --api-key 'My API Key' \\\n --name my-data-volume \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-
|
|
1179
|
+
example: "nirvana compute:volumes create \\\n --api-key 'My API Key' \\\n --name my-data-volume \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --size 100 \\\n --type abs",
|
|
1180
1180
|
},
|
|
1181
1181
|
go: {
|
|
1182
1182
|
method: 'client.Compute.Volumes.New',
|
|
1183
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.New(context.TODO(), compute.VolumeNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.
|
|
1183
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.New(context.TODO(), compute.VolumeNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
1184
1184
|
},
|
|
1185
1185
|
http: {
|
|
1186
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-
|
|
1186
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "size": 100,\n "type": "abs",\n "tags": [\n "production",\n "ethereum"\n ],\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1187
1187
|
},
|
|
1188
1188
|
typescript: {
|
|
1189
1189
|
method: 'client.compute.volumes.create',
|
|
1190
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-
|
|
1190
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n size: 100,\n type: 'abs',\n});\n\nconsole.log(operation.id);",
|
|
1191
1191
|
},
|
|
1192
1192
|
},
|
|
1193
1193
|
},
|
|
@@ -1200,8 +1200,8 @@ const EMBEDDED_METHODS = [
|
|
|
1200
1200
|
stainlessPath: '(resource) compute.volumes > (method) get',
|
|
1201
1201
|
qualified: 'client.compute.volumes.get',
|
|
1202
1202
|
params: ['volume_id: string;'],
|
|
1203
|
-
response: "{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1204
|
-
markdown: "## get\n\n`client.compute.volumes.get(volume_id: string): { id: string; created_at: string; kind: volume_kind; name: string; project_id: string; region: region_name; size: number; status: resource_status; tags: string[]; type: volume_type; updated_at: string; vm_id: string; vm_name: string; }`\n\n**get** `/v1/compute/volumes/{volume_id}`\n\nGet a Volume.\n\n### Parameters\n\n- `volume_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1203
|
+
response: "{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; size: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; type: 'nvme' | 'abs'; updated_at: string; vm_id: string; vm_name: string; }",
|
|
1204
|
+
markdown: "## get\n\n`client.compute.volumes.get(volume_id: string): { id: string; created_at: string; kind: volume_kind; name: string; project_id: string; region: region_name; size: number; status: resource_status; tags: string[]; type: volume_type; updated_at: string; vm_id: string; vm_name: string; }`\n\n**get** `/v1/compute/volumes/{volume_id}`\n\nGet a Volume.\n\n### Parameters\n\n- `volume_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; size: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; type: 'nvme' | 'abs'; updated_at: string; vm_id: string; vm_name: string; }`\n Volume details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'boot' | 'data'`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `size: number`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `type: 'nvme' | 'abs'`\n - `updated_at: string`\n - `vm_id: string`\n - `vm_name: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst volume = await client.compute.volumes.get('volume_id');\n\nconsole.log(volume);\n```",
|
|
1205
1205
|
perLanguage: {
|
|
1206
1206
|
cli: {
|
|
1207
1207
|
method: 'volumes get',
|
|
@@ -1287,8 +1287,8 @@ const EMBEDDED_METHODS = [
|
|
|
1287
1287
|
stainlessPath: '(resource) compute.volumes > (method) list',
|
|
1288
1288
|
qualified: 'client.compute.volumes.list',
|
|
1289
1289
|
params: ['project_id: string;', 'cursor?: string;', 'limit?: number;'],
|
|
1290
|
-
response: "{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1291
|
-
markdown: "## list\n\n`client.compute.volumes.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; kind: volume_kind; name: string; project_id: string; region: region_name; size: number; status: resource_status; tags: string[]; type: volume_type; updated_at: string; vm_id: string; vm_name: string; }`\n\n**get** `/v1/compute/volumes`\n\nList all volumes\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1290
|
+
response: "{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; size: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; type: 'nvme' | 'abs'; updated_at: string; vm_id: string; vm_name: string; }",
|
|
1291
|
+
markdown: "## list\n\n`client.compute.volumes.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; kind: volume_kind; name: string; project_id: string; region: region_name; size: number; status: resource_status; tags: string[]; type: volume_type; updated_at: string; vm_id: string; vm_name: string; }`\n\n**get** `/v1/compute/volumes`\n\nList all volumes\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'boot' | 'data'; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; size: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; type: 'nvme' | 'abs'; updated_at: string; vm_id: string; vm_name: string; }`\n Volume details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'boot' | 'data'`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `size: number`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `type: 'nvme' | 'abs'`\n - `updated_at: string`\n - `vm_id: string`\n - `vm_name: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const volume of client.compute.volumes.list({ project_id: 'project_id' })) {\n console.log(volume);\n}\n```",
|
|
1292
1292
|
perLanguage: {
|
|
1293
1293
|
cli: {
|
|
1294
1294
|
method: 'volumes list',
|
|
@@ -1376,28 +1376,28 @@ const EMBEDDED_METHODS = [
|
|
|
1376
1376
|
params: [
|
|
1377
1377
|
'name: string;',
|
|
1378
1378
|
'project_id: string;',
|
|
1379
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1379
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
1380
1380
|
'size: number;',
|
|
1381
1381
|
"type: 'nvme' | 'abs';",
|
|
1382
1382
|
'tags?: string[];',
|
|
1383
1383
|
'vm_id?: string;',
|
|
1384
1384
|
],
|
|
1385
|
-
markdown: "## create\n\n`client.compute.volumes.availability.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1385
|
+
markdown: "## create\n\n`client.compute.volumes.availability.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', size: number, type: 'nvme' | 'abs', tags?: string[], vm_id?: string): void`\n\n**post** `/v1/compute/volumes/availability`\n\nCheck Volume Create Availability\n\n### Parameters\n\n- `name: string`\n Name of the Volume.\n\n- `project_id: string`\n Project ID the Volume belongs to.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `size: number`\n Size of the Volume in GB.\n\n- `type: 'nvme' | 'abs'`\n Type of the Volume.\n\n- `tags?: string[]`\n Tags to attach to the Volume.\n\n- `vm_id?: string`\n ID of the VM the Volume is attached to.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.compute.volumes.availability.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n size: 100,\n type: 'abs',\n})\n```",
|
|
1386
1386
|
perLanguage: {
|
|
1387
1387
|
cli: {
|
|
1388
1388
|
method: 'availability create',
|
|
1389
|
-
example: "nirvana compute:volumes:availability create \\\n --api-key 'My API Key' \\\n --name my-data-volume \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-
|
|
1389
|
+
example: "nirvana compute:volumes:availability create \\\n --api-key 'My API Key' \\\n --name my-data-volume \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --size 100 \\\n --type abs",
|
|
1390
1390
|
},
|
|
1391
1391
|
go: {
|
|
1392
1392
|
method: 'client.Compute.Volumes.Availability.New',
|
|
1393
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.Volumes.Availability.New(context.TODO(), compute.VolumeAvailabilityNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.
|
|
1393
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.Volumes.Availability.New(context.TODO(), compute.VolumeAvailabilityNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
1394
1394
|
},
|
|
1395
1395
|
http: {
|
|
1396
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-
|
|
1396
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "size": 100,\n "type": "abs",\n "tags": [\n "production",\n "ethereum"\n ],\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1397
1397
|
},
|
|
1398
1398
|
typescript: {
|
|
1399
1399
|
method: 'client.compute.volumes.availability.create',
|
|
1400
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.volumes.availability.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-
|
|
1400
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.volumes.availability.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n size: 100,\n type: 'abs',\n});",
|
|
1401
1401
|
},
|
|
1402
1402
|
},
|
|
1403
1403
|
},
|
|
@@ -1440,27 +1440,27 @@ const EMBEDDED_METHODS = [
|
|
|
1440
1440
|
params: [
|
|
1441
1441
|
'name: string;',
|
|
1442
1442
|
'project_id: string;',
|
|
1443
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1443
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
1444
1444
|
'subnet_name: string;',
|
|
1445
1445
|
'tags?: string[];',
|
|
1446
1446
|
],
|
|
1447
1447
|
response: "{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
1448
|
-
markdown: "## create\n\n`client.networking.vpcs.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1448
|
+
markdown: "## create\n\n`client.networking.vpcs.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', subnet_name: string, tags?: string[]): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/networking/vpcs`\n\nCreate a VPC\n\n### Parameters\n\n- `name: string`\n Name of the VPC.\n\n- `project_id: string`\n Project ID the VPC belongs to.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `subnet_name: string`\n Name of the subnet to create.\n\n- `tags?: string[]`\n Tags to attach to the VPC.\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.networking.vpcs.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n subnet_name: 'my-subnet',\n});\n\nconsole.log(operation);\n```",
|
|
1449
1449
|
perLanguage: {
|
|
1450
1450
|
cli: {
|
|
1451
1451
|
method: 'vpcs create',
|
|
1452
|
-
example: "nirvana networking:vpcs create \\\n --api-key 'My API Key' \\\n --name my-vpc \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-
|
|
1452
|
+
example: "nirvana networking:vpcs create \\\n --api-key 'My API Key' \\\n --name my-vpc \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --subnet-name my-subnet",
|
|
1453
1453
|
},
|
|
1454
1454
|
go: {
|
|
1455
1455
|
method: 'client.Networking.VPCs.New',
|
|
1456
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.New(context.TODO(), networking.VPCNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.
|
|
1456
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.New(context.TODO(), networking.VPCNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSubnetName: "my-subnet",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
1457
1457
|
},
|
|
1458
1458
|
http: {
|
|
1459
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-
|
|
1459
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1460
1460
|
},
|
|
1461
1461
|
typescript: {
|
|
1462
1462
|
method: 'client.networking.vpcs.create',
|
|
1463
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.vpcs.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-
|
|
1463
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.vpcs.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n subnet_name: 'my-subnet',\n});\n\nconsole.log(operation.id);",
|
|
1464
1464
|
},
|
|
1465
1465
|
},
|
|
1466
1466
|
},
|
|
@@ -1473,8 +1473,8 @@ const EMBEDDED_METHODS = [
|
|
|
1473
1473
|
stainlessPath: '(resource) networking.vpcs > (method) get',
|
|
1474
1474
|
qualified: 'client.networking.vpcs.get',
|
|
1475
1475
|
params: ['vpc_id: string;'],
|
|
1476
|
-
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1477
|
-
markdown: "## get\n\n`client.networking.vpcs.get(vpc_id: string): { id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}`\n\nGet details about a VPC\n\n### Parameters\n\n- `vpc_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1476
|
+
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }",
|
|
1477
|
+
markdown: "## get\n\n`client.networking.vpcs.get(vpc_id: string): { id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}`\n\nGet details about a VPC\n\n### Parameters\n\n- `vpc_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }`\n VPC details.\n\n - `id: string`\n - `created_at: string`\n - `firewall_rule_ids: string[]`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vpc = await client.networking.vpcs.get('vpc_id');\n\nconsole.log(vpc);\n```",
|
|
1478
1478
|
perLanguage: {
|
|
1479
1479
|
cli: {
|
|
1480
1480
|
method: 'vpcs get',
|
|
@@ -1560,8 +1560,8 @@ const EMBEDDED_METHODS = [
|
|
|
1560
1560
|
stainlessPath: '(resource) networking.vpcs > (method) list',
|
|
1561
1561
|
qualified: 'client.networking.vpcs.list',
|
|
1562
1562
|
params: ['project_id: string;', 'cursor?: string;', 'limit?: number;'],
|
|
1563
|
-
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1564
|
-
markdown: "## list\n\n`client.networking.vpcs.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs`\n\nList all VPCs\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1563
|
+
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }",
|
|
1564
|
+
markdown: "## list\n\n`client.networking.vpcs.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs`\n\nList all VPCs\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; name: string; project_id: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }`\n VPC details.\n\n - `id: string`\n - `created_at: string`\n - `firewall_rule_ids: string[]`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const vpc of client.networking.vpcs.list({ project_id: 'project_id' })) {\n console.log(vpc);\n}\n```",
|
|
1565
1565
|
perLanguage: {
|
|
1566
1566
|
cli: {
|
|
1567
1567
|
method: 'vpcs list',
|
|
@@ -1591,26 +1591,26 @@ const EMBEDDED_METHODS = [
|
|
|
1591
1591
|
params: [
|
|
1592
1592
|
'name: string;',
|
|
1593
1593
|
'project_id: string;',
|
|
1594
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1594
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
1595
1595
|
'subnet_name: string;',
|
|
1596
1596
|
'tags?: string[];',
|
|
1597
1597
|
],
|
|
1598
|
-
markdown: "## create\n\n`client.networking.vpcs.availability.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1598
|
+
markdown: "## create\n\n`client.networking.vpcs.availability.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', subnet_name: string, tags?: string[]): void`\n\n**post** `/v1/networking/vpcs/availability`\n\nCheck if a VPC can be created\n\n### Parameters\n\n- `name: string`\n Name of the VPC.\n\n- `project_id: string`\n Project ID the VPC belongs to.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `subnet_name: string`\n Name of the subnet to create.\n\n- `tags?: string[]`\n Tags to attach to the VPC.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.networking.vpcs.availability.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n subnet_name: 'my-subnet',\n})\n```",
|
|
1599
1599
|
perLanguage: {
|
|
1600
1600
|
cli: {
|
|
1601
1601
|
method: 'availability create',
|
|
1602
|
-
example: "nirvana networking:vpcs:availability create \\\n --api-key 'My API Key' \\\n --name my-vpc \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-
|
|
1602
|
+
example: "nirvana networking:vpcs:availability create \\\n --api-key 'My API Key' \\\n --name my-vpc \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --subnet-name my-subnet",
|
|
1603
1603
|
},
|
|
1604
1604
|
go: {
|
|
1605
1605
|
method: 'client.Networking.VPCs.Availability.New',
|
|
1606
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Networking.VPCs.Availability.New(context.TODO(), networking.VPCAvailabilityNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.
|
|
1606
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Networking.VPCs.Availability.New(context.TODO(), networking.VPCAvailabilityNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSubnetName: "my-subnet",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
1607
1607
|
},
|
|
1608
1608
|
http: {
|
|
1609
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-
|
|
1609
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1610
1610
|
},
|
|
1611
1611
|
typescript: {
|
|
1612
1612
|
method: 'client.networking.vpcs.availability.create',
|
|
1613
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.networking.vpcs.availability.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-
|
|
1613
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.networking.vpcs.availability.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n subnet_name: 'my-subnet',\n});",
|
|
1614
1614
|
},
|
|
1615
1615
|
},
|
|
1616
1616
|
},
|
|
@@ -1818,27 +1818,27 @@ const EMBEDDED_METHODS = [
|
|
|
1818
1818
|
'name: string;',
|
|
1819
1819
|
'project_id: string;',
|
|
1820
1820
|
'provider_cidrs: string[];',
|
|
1821
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1821
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
1822
1822
|
'aws?: { account_id: string; region: string; };',
|
|
1823
1823
|
'tags?: string[];',
|
|
1824
1824
|
],
|
|
1825
1825
|
response: "{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
1826
|
-
markdown: "## create\n\n`client.networking.connect.connections.create(bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000, cidrs: string[], name: string, project_id: string, provider_cidrs: string[], region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1826
|
+
markdown: "## create\n\n`client.networking.connect.connections.create(bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000, cidrs: string[], name: string, project_id: string, provider_cidrs: string[], region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', aws?: { account_id: string; region: string; }, tags?: string[]): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/networking/connect/connections`\n\nCreate a Connect Connection\n\n### Parameters\n\n- `bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000`\n Connect Connection speed in Mbps\n\n- `cidrs: string[]`\n CIDRs for the Connect Connection. Must be in network-aligned/canonical form.\n\n- `name: string`\n Name of the Connect Connection\n\n- `project_id: string`\n Project ID the Connect Connection belongs to\n\n- `provider_cidrs: string[]`\n Provider CIDRs. Must be in network-aligned/canonical form.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `aws?: { account_id: string; region: string; }`\n AWS provider configuration\n - `account_id: string`\n AWS account id\n - `region: string`\n AWS region where the connection will be established\n\n- `tags?: string[]`\n Tags to attach to the Connect Connection\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.networking.connect.connections.create({\n bandwidth_mbps: 50,\n cidrs: ['10.0.0.0/16'],\n name: 'my-connect-connection',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n provider_cidrs: ['172.16.0.0/16'],\n region: 'us-sva-2',\n});\n\nconsole.log(operation);\n```",
|
|
1827
1827
|
perLanguage: {
|
|
1828
1828
|
cli: {
|
|
1829
1829
|
method: 'connections create',
|
|
1830
|
-
example: "nirvana networking:connect:connections create \\\n --api-key 'My API Key' \\\n --bandwidth-mbps 50 \\\n --cidr 10.0.0.0/16 \\\n --name my-connect-connection \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --provider-cidr 172.16.0.0/16 \\\n --region us-
|
|
1830
|
+
example: "nirvana networking:connect:connections create \\\n --api-key 'My API Key' \\\n --bandwidth-mbps 50 \\\n --cidr 10.0.0.0/16 \\\n --name my-connect-connection \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --provider-cidr 172.16.0.0/16 \\\n --region us-sva-2",
|
|
1831
1831
|
},
|
|
1832
1832
|
go: {
|
|
1833
1833
|
method: 'client.Networking.Connect.Connections.New',
|
|
1834
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.Connect.Connections.New(context.TODO(), networking.ConnectConnectionNewParams{\n\t\tBandwidthMbps: 50,\n\t\tCIDRs: []string{"10.0.0.0/16"},\n\t\tName: "my-connect-connection",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tProviderCIDRs: []string{"172.16.0.0/16"},\n\t\tRegion: shared.
|
|
1834
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.Connect.Connections.New(context.TODO(), networking.ConnectConnectionNewParams{\n\t\tBandwidthMbps: 50,\n\t\tCIDRs: []string{"10.0.0.0/16"},\n\t\tName: "my-connect-connection",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tProviderCIDRs: []string{"172.16.0.0/16"},\n\t\tRegion: shared.RegionNameUsSva2,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
1835
1835
|
},
|
|
1836
1836
|
http: {
|
|
1837
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "bandwidth_mbps": 50,\n "cidrs": [\n "10.0.0.0/16"\n ],\n "name": "my-connect-connection",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "provider_cidrs": [\n "172.16.0.0/16"\n ],\n "region": "us-
|
|
1837
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "bandwidth_mbps": 50,\n "cidrs": [\n "10.0.0.0/16"\n ],\n "name": "my-connect-connection",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "provider_cidrs": [\n "172.16.0.0/16"\n ],\n "region": "us-sva-2",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1838
1838
|
},
|
|
1839
1839
|
typescript: {
|
|
1840
1840
|
method: 'client.networking.connect.connections.create',
|
|
1841
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.connect.connections.create({\n bandwidth_mbps: 50,\n cidrs: ['10.0.0.0/16'],\n name: 'my-connect-connection',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n provider_cidrs: ['172.16.0.0/16'],\n region: 'us-
|
|
1841
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.connect.connections.create({\n bandwidth_mbps: 50,\n cidrs: ['10.0.0.0/16'],\n name: 'my-connect-connection',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n provider_cidrs: ['172.16.0.0/16'],\n region: 'us-sva-2',\n});\n\nconsole.log(operation.id);",
|
|
1842
1842
|
},
|
|
1843
1843
|
},
|
|
1844
1844
|
},
|
|
@@ -1851,8 +1851,8 @@ const EMBEDDED_METHODS = [
|
|
|
1851
1851
|
stainlessPath: '(resource) networking.connect.connections > (method) get',
|
|
1852
1852
|
qualified: 'client.networking.connect.connections.get',
|
|
1853
1853
|
params: ['connection_id: string;'],
|
|
1854
|
-
response: "{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1855
|
-
markdown: "## get\n\n`client.networking.connect.connections.get(connection_id: string): { id: string; asn: number; aws: connect_connection_aws_config; bandwidth_mbps: connect_bandwidth_mbps; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: region_name; router_ip: string; status: resource_status; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/connect/connections/{connection_id}`\n\nGet Connect Connection details\n\n### Parameters\n\n- `connection_id: string`\n\n### Returns\n\n- `{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1854
|
+
response: "{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; router_ip: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }",
|
|
1855
|
+
markdown: "## get\n\n`client.networking.connect.connections.get(connection_id: string): { id: string; asn: number; aws: connect_connection_aws_config; bandwidth_mbps: connect_bandwidth_mbps; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: region_name; router_ip: string; status: resource_status; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/connect/connections/{connection_id}`\n\nGet Connect Connection details\n\n### Parameters\n\n- `connection_id: string`\n\n### Returns\n\n- `{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; router_ip: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }`\n Connect Connection details.\n\n - `id: string`\n - `asn: number`\n - `aws: { region: string; }`\n - `bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000`\n - `cidrs: string[]`\n - `created_at: string`\n - `name: string`\n - `project_id: string`\n - `provider_asn: number`\n - `provider_cidrs: string[]`\n - `provider_router_ip: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `router_ip: string`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst connectConnection = await client.networking.connect.connections.get('connection_id');\n\nconsole.log(connectConnection);\n```",
|
|
1856
1856
|
perLanguage: {
|
|
1857
1857
|
cli: {
|
|
1858
1858
|
method: 'connections get',
|
|
@@ -1938,8 +1938,8 @@ const EMBEDDED_METHODS = [
|
|
|
1938
1938
|
stainlessPath: '(resource) networking.connect.connections > (method) list',
|
|
1939
1939
|
qualified: 'client.networking.connect.connections.list',
|
|
1940
1940
|
params: ['project_id: string;', 'cursor?: string;', 'limit?: number;'],
|
|
1941
|
-
response: "{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1942
|
-
markdown: "## list\n\n`client.networking.connect.connections.list(project_id: string, cursor?: string, limit?: number): { id: string; asn: number; aws: connect_connection_aws_config; bandwidth_mbps: connect_bandwidth_mbps; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: region_name; router_ip: string; status: resource_status; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/connect/connections`\n\nList all Connect Connections\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1941
|
+
response: "{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; router_ip: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }",
|
|
1942
|
+
markdown: "## list\n\n`client.networking.connect.connections.list(project_id: string, cursor?: string, limit?: number): { id: string; asn: number; aws: connect_connection_aws_config; bandwidth_mbps: connect_bandwidth_mbps; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: region_name; router_ip: string; status: resource_status; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/connect/connections`\n\nList all Connect Connections\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; asn: number; aws: { region: string; }; bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000; cidrs: string[]; created_at: string; name: string; project_id: string; provider_asn: number; provider_cidrs: string[]; provider_router_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; router_ip: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }`\n Connect Connection details.\n\n - `id: string`\n - `asn: number`\n - `aws: { region: string; }`\n - `bandwidth_mbps: 50 | 200 | 500 | 1000 | 2000`\n - `cidrs: string[]`\n - `created_at: string`\n - `name: string`\n - `project_id: string`\n - `provider_asn: number`\n - `provider_cidrs: string[]`\n - `provider_router_ip: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `router_ip: string`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const connectConnection of client.networking.connect.connections.list({ project_id: 'project_id' })) {\n console.log(connectConnection);\n}\n```",
|
|
1943
1943
|
perLanguage: {
|
|
1944
1944
|
cli: {
|
|
1945
1945
|
method: 'connections list',
|
|
@@ -1967,8 +1967,8 @@ const EMBEDDED_METHODS = [
|
|
|
1967
1967
|
stainlessPath: '(resource) networking.connect.routes > (method) list',
|
|
1968
1968
|
qualified: 'client.networking.connect.routes.list',
|
|
1969
1969
|
params: ['cursor?: string;', 'limit?: number;'],
|
|
1970
|
-
response: "{ nirvana_region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1971
|
-
markdown: "## list\n\n`client.networking.connect.routes.list(cursor?: string, limit?: number): { nirvana_region: region_name; provider: string; provider_region: string; }`\n\n**get** `/v1/networking/connect/routes`\n\nList all supported routes with regions for Connect.\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ nirvana_region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
1970
|
+
response: "{ nirvana_region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; provider: string; provider_region: string; }",
|
|
1971
|
+
markdown: "## list\n\n`client.networking.connect.routes.list(cursor?: string, limit?: number): { nirvana_region: region_name; provider: string; provider_region: string; }`\n\n**get** `/v1/networking/connect/routes`\n\nList all supported routes with regions for Connect.\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ nirvana_region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; provider: string; provider_region: string; }`\n Routes supported for Connect.\n\n - `nirvana_region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `provider: string`\n - `provider_region: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const connectRoute of client.networking.connect.routes.list()) {\n console.log(connectRoute);\n}\n```",
|
|
1972
1972
|
perLanguage: {
|
|
1973
1973
|
cli: {
|
|
1974
1974
|
method: 'routes list',
|
|
@@ -2264,27 +2264,27 @@ const EMBEDDED_METHODS = [
|
|
|
2264
2264
|
params: [
|
|
2265
2265
|
'name: string;',
|
|
2266
2266
|
'project_id: string;',
|
|
2267
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2267
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
2268
2268
|
'vpc_id: string;',
|
|
2269
2269
|
'tags?: string[];',
|
|
2270
2270
|
],
|
|
2271
2271
|
response: "{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
2272
|
-
markdown: "## create\n\n`client.nks.clusters.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2272
|
+
markdown: "## create\n\n`client.nks.clusters.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', vpc_id: string, tags?: string[]): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/nks/clusters`\n\nCreate an NKS Cluster\n\n### Parameters\n\n- `name: string`\n Name of the Cluster.\n\n- `project_id: string`\n Project ID to create the Cluster in.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `vpc_id: string`\n ID of the VPC to use for the Cluster.\n\n- `tags?: string[]`\n Tags to attach to the Cluster.\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.nks.clusters.create({\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n vpc_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation);\n```",
|
|
2273
2273
|
perLanguage: {
|
|
2274
2274
|
cli: {
|
|
2275
2275
|
method: 'clusters create',
|
|
2276
|
-
example: "nirvana nks:clusters create \\\n --api-key 'My API Key' \\\n --name my-cluster \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-
|
|
2276
|
+
example: "nirvana nks:clusters create \\\n --api-key 'My API Key' \\\n --name my-cluster \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --vpc-id 123e4567-e89b-12d3-a456-426614174000",
|
|
2277
2277
|
},
|
|
2278
2278
|
go: {
|
|
2279
2279
|
method: 'client.NKS.Clusters.New',
|
|
2280
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.New(context.TODO(), nks.ClusterNewParams{\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.
|
|
2280
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.New(context.TODO(), nks.ClusterNewParams{\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tVPCID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2281
2281
|
},
|
|
2282
2282
|
http: {
|
|
2283
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-
|
|
2283
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "vpc_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2284
2284
|
},
|
|
2285
2285
|
typescript: {
|
|
2286
2286
|
method: 'client.nks.clusters.create',
|
|
2287
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.create({\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-
|
|
2287
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.create({\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n vpc_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);",
|
|
2288
2288
|
},
|
|
2289
2289
|
},
|
|
2290
2290
|
},
|
|
@@ -2297,8 +2297,8 @@ const EMBEDDED_METHODS = [
|
|
|
2297
2297
|
stainlessPath: '(resource) nks.clusters > (method) get',
|
|
2298
2298
|
qualified: 'client.nks.clusters.get',
|
|
2299
2299
|
params: ['cluster_id: string;'],
|
|
2300
|
-
response: "{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2301
|
-
markdown: "## get\n\n`client.nks.clusters.get(cluster_id: string): { id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters/{cluster_id}`\n\nGet details about an NKS cluster\n\n### Parameters\n\n- `cluster_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2300
|
+
response: "{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
2301
|
+
markdown: "## get\n\n`client.nks.clusters.get(cluster_id: string): { id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters/{cluster_id}`\n\nGet details about an NKS cluster\n\n### Parameters\n\n- `cluster_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n NKS Cluster details.\n\n - `id: string`\n - `created_at: string`\n - `name: string`\n - `pool_ids: string[]`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst nksCluster = await client.nks.clusters.get('cluster_id');\n\nconsole.log(nksCluster);\n```",
|
|
2302
2302
|
perLanguage: {
|
|
2303
2303
|
cli: {
|
|
2304
2304
|
method: 'clusters get',
|
|
@@ -2326,8 +2326,8 @@ const EMBEDDED_METHODS = [
|
|
|
2326
2326
|
stainlessPath: '(resource) nks.clusters > (method) update',
|
|
2327
2327
|
qualified: 'client.nks.clusters.update',
|
|
2328
2328
|
params: ['cluster_id: string;', 'name?: string;', 'tags?: string[];'],
|
|
2329
|
-
response: "{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2330
|
-
markdown: "## update\n\n`client.nks.clusters.update(cluster_id: string, name?: string, tags?: string[]): { id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**patch** `/v1/nks/clusters/{cluster_id}`\n\nUpdate an NKS cluster\n\n### Parameters\n\n- `cluster_id: string`\n\n- `name?: string`\n Name of the Cluster.\n\n- `tags?: string[]`\n Tags to attach to the Cluster.\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2329
|
+
response: "{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
2330
|
+
markdown: "## update\n\n`client.nks.clusters.update(cluster_id: string, name?: string, tags?: string[]): { id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**patch** `/v1/nks/clusters/{cluster_id}`\n\nUpdate an NKS cluster\n\n### Parameters\n\n- `cluster_id: string`\n\n- `name?: string`\n Name of the Cluster.\n\n- `tags?: string[]`\n Tags to attach to the Cluster.\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n NKS Cluster details.\n\n - `id: string`\n - `created_at: string`\n - `name: string`\n - `pool_ids: string[]`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst nksCluster = await client.nks.clusters.update('cluster_id');\n\nconsole.log(nksCluster);\n```",
|
|
2331
2331
|
perLanguage: {
|
|
2332
2332
|
cli: {
|
|
2333
2333
|
method: 'clusters update',
|
|
@@ -2384,8 +2384,8 @@ const EMBEDDED_METHODS = [
|
|
|
2384
2384
|
stainlessPath: '(resource) nks.clusters > (method) list',
|
|
2385
2385
|
qualified: 'client.nks.clusters.list',
|
|
2386
2386
|
params: ['project_id: string;', 'cursor?: string;', 'limit?: number;'],
|
|
2387
|
-
response: "{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2388
|
-
markdown: "## list\n\n`client.nks.clusters.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters`\n\nList all NKS clusters\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2387
|
+
response: "{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
2388
|
+
markdown: "## list\n\n`client.nks.clusters.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters`\n\nList all NKS clusters\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n NKS Cluster details.\n\n - `id: string`\n - `created_at: string`\n - `name: string`\n - `pool_ids: string[]`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const nksCluster of client.nks.clusters.list({ project_id: 'project_id' })) {\n console.log(nksCluster);\n}\n```",
|
|
2389
2389
|
perLanguage: {
|
|
2390
2390
|
cli: {
|
|
2391
2391
|
method: 'clusters list',
|
|
@@ -2415,26 +2415,26 @@ const EMBEDDED_METHODS = [
|
|
|
2415
2415
|
params: [
|
|
2416
2416
|
'name: string;',
|
|
2417
2417
|
'project_id: string;',
|
|
2418
|
-
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2418
|
+
"region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1';",
|
|
2419
2419
|
'vpc_id: string;',
|
|
2420
2420
|
'tags?: string[];',
|
|
2421
2421
|
],
|
|
2422
|
-
markdown: "## create\n\n`client.nks.clusters.availability.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'
|
|
2422
|
+
markdown: "## create\n\n`client.nks.clusters.availability.create(name: string, project_id: string, region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1', vpc_id: string, tags?: string[]): void`\n\n**post** `/v1/nks/clusters/availability`\n\nCheck if an NKS cluster can be created\n\n### Parameters\n\n- `name: string`\n Name of the Cluster.\n\n- `project_id: string`\n Project ID to create the Cluster in.\n\n- `region: 'us-sva-1' | 'us-sva-2' | 'us-chi-1'`\n Region the resource is in.\n\n- `vpc_id: string`\n ID of the VPC to use for the Cluster.\n\n- `tags?: string[]`\n Tags to attach to the Cluster.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.nks.clusters.availability.create({\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n vpc_id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```",
|
|
2423
2423
|
perLanguage: {
|
|
2424
2424
|
cli: {
|
|
2425
2425
|
method: 'availability create',
|
|
2426
|
-
example: "nirvana nks:clusters:availability create \\\n --api-key 'My API Key' \\\n --name my-cluster \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-
|
|
2426
|
+
example: "nirvana nks:clusters:availability create \\\n --api-key 'My API Key' \\\n --name my-cluster \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --vpc-id 123e4567-e89b-12d3-a456-426614174000",
|
|
2427
2427
|
},
|
|
2428
2428
|
go: {
|
|
2429
2429
|
method: 'client.NKS.Clusters.Availability.New',
|
|
2430
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Availability.New(context.TODO(), nks.ClusterAvailabilityNewParams{\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.
|
|
2430
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Availability.New(context.TODO(), nks.ClusterAvailabilityNewParams{\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tVPCID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
2431
2431
|
},
|
|
2432
2432
|
http: {
|
|
2433
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-
|
|
2433
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "vpc_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2434
2434
|
},
|
|
2435
2435
|
typescript: {
|
|
2436
2436
|
method: 'client.nks.clusters.availability.create',
|
|
2437
|
-
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.nks.clusters.availability.create({\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-
|
|
2437
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.nks.clusters.availability.create({\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n vpc_id: '123e4567-e89b-12d3-a456-426614174000',\n});",
|
|
2438
2438
|
},
|
|
2439
2439
|
},
|
|
2440
2440
|
},
|
|
@@ -3107,19 +3107,19 @@ const EMBEDDED_METHODS = [
|
|
|
3107
3107
|
const EMBEDDED_READMES = [
|
|
3108
3108
|
{
|
|
3109
3109
|
language: 'go',
|
|
3110
|
-
content: '# Nirvana Labs Go API Library\n\n<a href="https://pkg.go.dev/github.com/nirvana-labs/nirvana-go"><img src="https://pkg.go.dev/badge/github.com/nirvana-labs/nirvana-go.svg" alt="Go Reference"></a>\n\nThe Nirvana Labs Go library provides convenient access to the [Nirvana Labs REST API](https://docs.nirvanalabs.io)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/nirvana-labs/nirvana-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/nirvana-labs/nirvana-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("NIRVANA_LABS_API_KEY")\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsWdc1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Compute.VMs.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/nirvana-labs/nirvana-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Compute.VMs.ListAutoPaging(context.TODO(), compute.VMListParams{\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tLimit: nirvana.Int(10),\n})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tvm := iter.Current()\n\tfmt.Printf("%+v\\n", vm)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Compute.VMs.List(context.TODO(), compute.VMListParams{\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tLimit: nirvana.Int(10),\n})\nfor page != nil {\n\tfor _, vm := range page.Items {\n\t\tfmt.Printf("%+v\\n", vm)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\tBootVolume: compute.VMNewParamsBootVolume{\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeNvme,\n\t},\n\tCPUConfig: compute.CPUConfigRequestParam{\n\t\tVcpu: 2,\n\t},\n\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\tSize: 2,\n\t},\n\tName: "my-vm",\n\tOSImageName: "ubuntu-noble-2025-10-01",\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tPublicIPEnabled: true,\n\tRegion: shared.RegionNameUsWdc1,\n\tSSHKey: compute.SSHKeyRequestParam{\n\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t},\n\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n})\nif err != nil {\n\tvar apierr *nirvana.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v1/compute/vms": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Compute.VMs.New(\n\tctx,\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsWdc1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := nirvana.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Compute.VMs.New(\n\tcontext.TODO(),\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsWdc1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\noperation, err := client.Compute.VMs.New(\n\tcontext.TODO(),\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsWdc1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", operation)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
3110
|
+
content: '# Nirvana Labs Go API Library\n\n<a href="https://pkg.go.dev/github.com/nirvana-labs/nirvana-go"><img src="https://pkg.go.dev/badge/github.com/nirvana-labs/nirvana-go.svg" alt="Go Reference"></a>\n\nThe Nirvana Labs Go library provides convenient access to the [Nirvana Labs REST API](https://docs.nirvanalabs.io)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/nirvana-labs/nirvana-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/nirvana-labs/nirvana-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("NIRVANA_LABS_API_KEY")\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Compute.VMs.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/nirvana-labs/nirvana-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Compute.VMs.ListAutoPaging(context.TODO(), compute.VMListParams{\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tLimit: nirvana.Int(10),\n})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tvm := iter.Current()\n\tfmt.Printf("%+v\\n", vm)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Compute.VMs.List(context.TODO(), compute.VMListParams{\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tLimit: nirvana.Int(10),\n})\nfor page != nil {\n\tfor _, vm := range page.Items {\n\t\tfmt.Printf("%+v\\n", vm)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\tBootVolume: compute.VMNewParamsBootVolume{\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeNvme,\n\t},\n\tCPUConfig: compute.CPUConfigRequestParam{\n\t\tVcpu: 2,\n\t},\n\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\tSize: 2,\n\t},\n\tName: "my-vm",\n\tOSImageName: "ubuntu-noble-2025-10-01",\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tPublicIPEnabled: true,\n\tRegion: shared.RegionNameUsSva1,\n\tSSHKey: compute.SSHKeyRequestParam{\n\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t},\n\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n})\nif err != nil {\n\tvar apierr *nirvana.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v1/compute/vms": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Compute.VMs.New(\n\tctx,\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := nirvana.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Compute.VMs.New(\n\tcontext.TODO(),\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\noperation, err := client.Compute.VMs.New(\n\tcontext.TODO(),\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeNvme,\n\t\t},\n\t\tCPUConfig: compute.CPUConfigRequestParam{\n\t\t\tVcpu: 2,\n\t\t},\n\t\tMemoryConfig: compute.MemoryConfigRequestParam{\n\t\t\tSize: 2,\n\t\t},\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva1,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", operation)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
3111
3111
|
},
|
|
3112
3112
|
{
|
|
3113
3113
|
language: 'terraform',
|
|
3114
|
-
content: '# Nirvana Labs Terraform Provider\n\nThe [Nirvana Labs Terraform provider](https://registry.terraform.io/providers/nirvana-labs/nirvana/latest/docs) provides convenient access to\nthe [Nirvana Labs REST API](https://docs.nirvanalabs.io) from Terraform.\n\n\n\n## Requirements\n\nThis provider requires Terraform CLI 1.0 or later. You can [install it for your system](https://developer.hashicorp.com/terraform/install)\non Hashicorp\'s website.\n\n## Usage\n\nAdd the following to your `main.tf` file:\n\n<!-- x-release-please-start-version -->\n\n```hcl\n# Declare the provider and version\nterraform {\n required_providers {\n SDK_ProviderTypeName = {\n source = "nirvana-labs/nirvana"\n version = "~> 0.0.1"\n }\n }\n}\n\n# Initialize the provider\nprovider "nirvana" {\n api_key = "My API Key" # or set NIRVANA_LABS_API_KEY env variable\n}\n\n# Configure a resource\nresource "nirvana_compute_vm" "example_compute_vm" {\n boot_volume = {\n size = 100\n type = "nvme"\n tags = ["production", "ethereum"]\n }\n cpu_config = {\n vcpu = 2\n }\n memory_config = {\n size = 2\n }\n name = "my-vm"\n os_image_name = "ubuntu-noble-2025-10-01"\n project_id = "123e4567-e89b-12d3-a456-426614174000"\n public_ip_enabled = true\n region = "us-
|
|
3114
|
+
content: '# Nirvana Labs Terraform Provider\n\nThe [Nirvana Labs Terraform provider](https://registry.terraform.io/providers/nirvana-labs/nirvana/latest/docs) provides convenient access to\nthe [Nirvana Labs REST API](https://docs.nirvanalabs.io) from Terraform.\n\n\n\n## Requirements\n\nThis provider requires Terraform CLI 1.0 or later. You can [install it for your system](https://developer.hashicorp.com/terraform/install)\non Hashicorp\'s website.\n\n## Usage\n\nAdd the following to your `main.tf` file:\n\n<!-- x-release-please-start-version -->\n\n```hcl\n# Declare the provider and version\nterraform {\n required_providers {\n SDK_ProviderTypeName = {\n source = "nirvana-labs/nirvana"\n version = "~> 0.0.1"\n }\n }\n}\n\n# Initialize the provider\nprovider "nirvana" {\n api_key = "My API Key" # or set NIRVANA_LABS_API_KEY env variable\n}\n\n# Configure a resource\nresource "nirvana_compute_vm" "example_compute_vm" {\n boot_volume = {\n size = 100\n type = "nvme"\n tags = ["production", "ethereum"]\n }\n cpu_config = {\n vcpu = 2\n }\n memory_config = {\n size = 2\n }\n name = "my-vm"\n os_image_name = "ubuntu-noble-2025-10-01"\n project_id = "123e4567-e89b-12d3-a456-426614174000"\n public_ip_enabled = true\n region = "us-sva-1"\n ssh_key = {\n public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n }\n subnet_id = "123e4567-e89b-12d3-a456-426614174000"\n data_volumes = [{\n name = "my-data-volume"\n size = 100\n type = "abs"\n tags = ["production", "ethereum"]\n }]\n tags = ["production", "ethereum"]\n}\n```\n\n<!-- x-release-please-end -->\n\nInitialize your project by running `terraform init` in the directory.\n\nAdditional examples can be found in the [./examples](./examples) folder within this repository, and you can\nrefer to the full documentation on [the Terraform Registry](https://registry.terraform.io/providers/nirvana-labs/nirvana/latest/docs).\n\n### Provider Options\nWhen you initialize the provider, the following options are supported. It is recommended to use environment variables for sensitive values like access tokens.\nIf an environment variable is provided, then the option does not need to be set in the terraform source.\n\n| Property | Environment variable | Required | Default value |\n| -------- | ---------------------- | -------- | ------------- |\n| api_key | `NIRVANA_LABS_API_KEY` | true | — |\n\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/terraform-provider-nirvana/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
3115
3115
|
},
|
|
3116
3116
|
{
|
|
3117
3117
|
language: 'typescript',
|
|
3118
|
-
content: "# Nirvana Labs TypeScript API Library\n\n[)](https://npmjs.org/package/@nirvana-labs/nirvana) \n\nThis library provides convenient access to the Nirvana Labs REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.nirvanalabs.io](https://docs.nirvanalabs.io). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @nirvana-labs/nirvana\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: NirvanaLabs.Compute.VMCreateParams = {\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n};\nconst operation: NirvanaLabs.Operation = await client.compute.vms.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst operation = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: {\n public_key:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .catch(async (err) => {\n if (err instanceof NirvanaLabs.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the NirvanaLabs API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllVMs(params) {\n const allVMs = [];\n // Automatically fetches more pages as needed.\n for await (const vm of client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n })) {\n allVMs.push(vm);\n }\n return allVMs;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n});\nfor (const vm of page.items) {\n console.log(vm);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new NirvanaLabs();\n\nconst response = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: {\n public_key:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: operation, response: raw } = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-wdc-1',\n ssh_key: {\n public_key:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(operation.id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `NIRVANA_LABS_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new NirvanaLabs({\n logger: logger.child({ name: 'NirvanaLabs' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.compute.vms.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport fetch from 'my-fetch';\n\nconst client = new NirvanaLabs({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new NirvanaLabs({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport NirvanaLabs from 'npm:@nirvana-labs/nirvana';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new NirvanaLabs({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
3118
|
+
content: "# Nirvana Labs TypeScript API Library\n\n[)](https://npmjs.org/package/@nirvana-labs/nirvana) \n\nThis library provides convenient access to the Nirvana Labs REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.nirvanalabs.io](https://docs.nirvanalabs.io). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @nirvana-labs/nirvana\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: NirvanaLabs.Compute.VMCreateParams = {\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n};\nconst operation: NirvanaLabs.Operation = await client.compute.vms.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst operation = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: {\n public_key:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .catch(async (err) => {\n if (err instanceof NirvanaLabs.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the NirvanaLabs API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllVMs(params) {\n const allVMs = [];\n // Automatically fetches more pages as needed.\n for await (const vm of client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n })) {\n allVMs.push(vm);\n }\n return allVMs;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n});\nfor (const vm of page.items) {\n console.log(vm);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new NirvanaLabs();\n\nconst response = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: {\n public_key:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: operation, response: raw } = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'nvme' },\n cpu_config: { vcpu: 2 },\n memory_config: { size: 2 },\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-1',\n ssh_key: {\n public_key:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(operation.id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `NIRVANA_LABS_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new NirvanaLabs({\n logger: logger.child({ name: 'NirvanaLabs' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.compute.vms.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport fetch from 'my-fetch';\n\nconst client = new NirvanaLabs({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new NirvanaLabs({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport NirvanaLabs from 'npm:@nirvana-labs/nirvana';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new NirvanaLabs({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
3119
3119
|
},
|
|
3120
3120
|
{
|
|
3121
3121
|
language: 'cli',
|
|
3122
|
-
content: "# Nirvana Labs CLI\n\nThe official CLI for the [Nirvana Labs REST API](https://docs.nirvanalabs.io).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install nirvana-labs/tap/nirvana\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/nirvana-labs/nirvana-cli/cmd/nirvana@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nnirvana [resource] <command> [flags...]\n~~~\n\n~~~sh\nnirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: nvme}' \\\n --cpu-config '{vcpu: 2}' \\\n --memory-config '{size: 2}' \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-
|
|
3122
|
+
content: "# Nirvana Labs CLI\n\nThe official CLI for the [Nirvana Labs REST API](https://docs.nirvanalabs.io).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install nirvana-labs/tap/nirvana\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/nirvana-labs/nirvana-cli/cmd/nirvana@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nnirvana [resource] <command> [flags...]\n~~~\n\n~~~sh\nnirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: nvme}' \\\n --cpu-config '{vcpu: 2}' \\\n --memory-config '{size: 2}' \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-sva-1 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required |\n| ---------------------- | -------- |\n| `NIRVANA_LABS_API_KEY` | yes |\n\n### Global flags\n\n- `--api-key` (can also be set with `NIRVANA_LABS_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nnirvana <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nnirvana <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nnirvana <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\nnirvana <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nnirvana <command> --arg @data://file.txt\n~~~\n",
|
|
3123
3123
|
},
|
|
3124
3124
|
];
|
|
3125
3125
|
const INDEX_OPTIONS = {
|