@nirvana-labs/nirvana-mcp 1.98.3 → 1.98.5
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/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +135 -24
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +135 -24
- 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/local-docs-search.ts +143 -24
- package/src/server.ts +1 -1
package/local-docs-search.mjs
CHANGED
|
@@ -227,9 +227,16 @@ const EMBEDDED_METHODS = [
|
|
|
227
227
|
description: 'List all API keys',
|
|
228
228
|
stainlessPath: '(resource) api_keys > (method) list',
|
|
229
229
|
qualified: 'client.apiKeys.list',
|
|
230
|
-
params: [
|
|
230
|
+
params: [
|
|
231
|
+
'cursor?: string;',
|
|
232
|
+
'limit?: number;',
|
|
233
|
+
'name?: string;',
|
|
234
|
+
'sort?: string;',
|
|
235
|
+
"status?: 'active' | 'inactive' | 'expired';",
|
|
236
|
+
'tags?: string[];',
|
|
237
|
+
],
|
|
231
238
|
response: "{ id: string; created_at: string; expires_at: string; managed: boolean; name: string; permissions: { permission: api_permission_level; resource_type: api_permission_resource_type; }[]; project_ids: string[]; source_ip_rule: { allowed: string[]; blocked: string[]; }; status: 'active' | 'inactive' | 'expired'; tags: string[]; updated_at: string; key?: string; starts_at?: string; }",
|
|
232
|
-
markdown: "## list\n\n`client.apiKeys.list(cursor?: string, limit?: number): { id: string; created_at: string; expires_at: string; managed: boolean; name: string; permissions: api_key_permission[]; project_ids: string[]; source_ip_rule: source_ip_rule_response; status: 'active' | 'inactive' | 'expired'; tags: string[]; updated_at: string; key?: string; starts_at?: string; }`\n\n**get** `/v1/api_keys`\n\nList all API keys\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
239
|
+
markdown: "## list\n\n`client.apiKeys.list(cursor?: string, limit?: number, name?: string, sort?: string, status?: 'active' | 'inactive' | 'expired', tags?: string[]): { id: string; created_at: string; expires_at: string; managed: boolean; name: string; permissions: api_key_permission[]; project_ids: string[]; source_ip_rule: source_ip_rule_response; status: 'active' | 'inactive' | 'expired'; tags: string[]; updated_at: string; key?: string; starts_at?: string; }`\n\n**get** `/v1/api_keys`\n\nList all API keys\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the API key name\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, expires_at\n\n- `status?: 'active' | 'inactive' | 'expired'`\n Filter by API key status, read against the current instant\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; an API key must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; expires_at: string; managed: boolean; name: string; permissions: { permission: api_permission_level; resource_type: api_permission_resource_type; }[]; project_ids: string[]; source_ip_rule: { allowed: string[]; blocked: string[]; }; status: 'active' | 'inactive' | 'expired'; tags: string[]; updated_at: string; key?: string; starts_at?: string; }`\n API Key response.\n\n - `id: string`\n - `created_at: string`\n - `expires_at: string`\n - `managed: boolean`\n - `name: string`\n - `permissions: { permission: 'read' | 'edit'; resource_type: string; }[]`\n - `project_ids: string[]`\n - `source_ip_rule: { allowed: string[]; blocked: string[]; }`\n - `status: 'active' | 'inactive' | 'expired'`\n - `tags: string[]`\n - `updated_at: string`\n - `key?: string`\n - `starts_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 apiKey of client.apiKeys.list()) {\n console.log(apiKey);\n}\n```",
|
|
233
240
|
perLanguage: {
|
|
234
241
|
typescript: {
|
|
235
242
|
method: 'client.apiKeys.list',
|
|
@@ -285,9 +292,20 @@ const EMBEDDED_METHODS = [
|
|
|
285
292
|
description: 'List all operations',
|
|
286
293
|
stainlessPath: '(resource) operations > (method) list',
|
|
287
294
|
qualified: 'client.operations.list',
|
|
288
|
-
params: [
|
|
295
|
+
params: [
|
|
296
|
+
'project_id: string;',
|
|
297
|
+
'created_at_max?: string;',
|
|
298
|
+
'created_at_min?: string;',
|
|
299
|
+
'cursor?: string;',
|
|
300
|
+
'kind?: string;',
|
|
301
|
+
'limit?: number;',
|
|
302
|
+
'resource_id?: string;',
|
|
303
|
+
'sort?: string;',
|
|
304
|
+
"status?: 'pending' | 'running' | 'done' | 'failed' | 'unknown';",
|
|
305
|
+
"type?: 'create' | 'update' | 'delete' | 'restart';",
|
|
306
|
+
],
|
|
289
307
|
response: "{ id: string; created_at: string; details: { changes: operation_changes; }; 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; }",
|
|
290
|
-
markdown: "## list\n\n`client.operations.list(project_id: string, cursor?: string, limit?: number): { id: string; created_at: string; details: operation_details; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**get** `/v1/operations`\n\nList all operations\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; details: { changes: operation_changes; }; 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 - `details: { changes: object; }`\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\n// Automatically fetches more pages as needed.\nfor await (const operation of client.operations.list({ project_id: 'project_id' })) {\n console.log(operation);\n}\n```",
|
|
308
|
+
markdown: "## list\n\n`client.operations.list(project_id: string, created_at_max?: string, created_at_min?: string, cursor?: string, kind?: string, limit?: number, resource_id?: string, sort?: string, status?: 'pending' | 'running' | 'done' | 'failed' | 'unknown', type?: 'create' | 'update' | 'delete' | 'restart'): { id: string; created_at: string; details: operation_details; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**get** `/v1/operations`\n\nList all operations\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `created_at_max?: string`\n Only operations started at or before this RFC 3339 instant\n\n- `created_at_min?: string`\n Only operations started at or after this RFC 3339 instant\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `kind?: string`\n Filter by the kind of resource the operation acts on\n\n- `limit?: number`\n Maximum number of items to return\n\n- `resource_id?: string`\n Filter by the resource the operation acts on\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at\n\n- `status?: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n Filter by operation status\n\n- `type?: 'create' | 'update' | 'delete' | 'restart'`\n Filter by operation type\n\n### Returns\n\n- `{ id: string; created_at: string; details: { changes: operation_changes; }; 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 - `details: { changes: object; }`\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\n// Automatically fetches more pages as needed.\nfor await (const operation of client.operations.list({ project_id: 'project_id' })) {\n console.log(operation);\n}\n```",
|
|
291
309
|
perLanguage: {
|
|
292
310
|
typescript: {
|
|
293
311
|
method: 'client.operations.list',
|
|
@@ -401,9 +419,15 @@ const EMBEDDED_METHODS = [
|
|
|
401
419
|
description: 'List organizations',
|
|
402
420
|
stainlessPath: '(resource) organizations > (method) list',
|
|
403
421
|
qualified: 'client.organizations.list',
|
|
404
|
-
params: [
|
|
422
|
+
params: [
|
|
423
|
+
'cursor?: string;',
|
|
424
|
+
'limit?: number;',
|
|
425
|
+
'name?: string;',
|
|
426
|
+
'sort?: string;',
|
|
427
|
+
"type?: 'personal' | 'company';",
|
|
428
|
+
],
|
|
405
429
|
response: "{ id: string; billing_email: string; billing_state: 'unfunded' | 'active' | 'requires_action' | 'suspended' | 'closed'; billing_state_since: string; charging_model: 'manual' | 'prepaid'; created_at: string; domains: { id: string; domain: string; verified: boolean; }[]; name: string; personal: boolean; services: { cloud: boolean; jit_provisioning: boolean; scim: boolean; siem: boolean; sso: boolean; }; stripe_customer_id: string; type: 'personal' | 'company'; updated_at: string; auth_id?: string; }",
|
|
406
|
-
markdown: "## list\n\n`client.organizations.list(cursor?: string, limit?: number): { id: string; billing_email: string; billing_state: 'unfunded' | 'active' | 'requires_action' | 'suspended' | 'closed'; billing_state_since: string; charging_model: 'manual' | 'prepaid'; created_at: string; domains: organization_domain[]; name: string; personal: boolean; services: organization_services; stripe_customer_id: string; type: organization_type; updated_at: string; auth_id?: string; }`\n\n**get** `/v1/organizations`\n\nList organizations\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
430
|
+
markdown: "## list\n\n`client.organizations.list(cursor?: string, limit?: number, name?: string, sort?: string, type?: 'personal' | 'company'): { id: string; billing_email: string; billing_state: 'unfunded' | 'active' | 'requires_action' | 'suspended' | 'closed'; billing_state_since: string; charging_model: 'manual' | 'prepaid'; created_at: string; domains: organization_domain[]; name: string; personal: boolean; services: organization_services; stripe_customer_id: string; type: organization_type; updated_at: string; auth_id?: string; }`\n\n**get** `/v1/organizations`\n\nList organizations\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the organization name\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name\n\n- `type?: 'personal' | 'company'`\n Filter by organization type\n\n### Returns\n\n- `{ id: string; billing_email: string; billing_state: 'unfunded' | 'active' | 'requires_action' | 'suspended' | 'closed'; billing_state_since: string; charging_model: 'manual' | 'prepaid'; created_at: string; domains: { id: string; domain: string; verified: boolean; }[]; name: string; personal: boolean; services: { cloud: boolean; jit_provisioning: boolean; scim: boolean; siem: boolean; sso: boolean; }; stripe_customer_id: string; type: 'personal' | 'company'; updated_at: string; auth_id?: string; }`\n Organization response.\n\n - `id: string`\n - `billing_email: string`\n - `billing_state: 'unfunded' | 'active' | 'requires_action' | 'suspended' | 'closed'`\n - `billing_state_since: string`\n - `charging_model: 'manual' | 'prepaid'`\n - `created_at: string`\n - `domains: { id: string; domain: string; verified: boolean; }[]`\n - `name: string`\n - `personal: boolean`\n - `services: { cloud: boolean; jit_provisioning: boolean; scim: boolean; siem: boolean; sso: boolean; }`\n - `stripe_customer_id: string`\n - `type: 'personal' | 'company'`\n - `updated_at: string`\n - `auth_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 organization of client.organizations.list()) {\n console.log(organization);\n}\n```",
|
|
407
431
|
perLanguage: {
|
|
408
432
|
typescript: {
|
|
409
433
|
method: 'client.organizations.list',
|
|
@@ -487,9 +511,16 @@ const EMBEDDED_METHODS = [
|
|
|
487
511
|
description: 'List all memberships for an organization',
|
|
488
512
|
stainlessPath: '(resource) organizations.memberships > (method) list',
|
|
489
513
|
qualified: 'client.organizations.memberships.list',
|
|
490
|
-
params: [
|
|
514
|
+
params: [
|
|
515
|
+
'organization_id: string;',
|
|
516
|
+
'cursor?: string;',
|
|
517
|
+
'limit?: number;',
|
|
518
|
+
"role?: 'owner' | 'member';",
|
|
519
|
+
'sort?: string;',
|
|
520
|
+
'user_id?: string;',
|
|
521
|
+
],
|
|
491
522
|
response: "{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }",
|
|
492
|
-
markdown: "## list\n\n`client.organizations.memberships.list(organization_id: string, cursor?: string, limit?: number): { id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n\n**get** `/v1/organizations/{organization_id}/memberships`\n\nList all memberships for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
523
|
+
markdown: "## list\n\n`client.organizations.memberships.list(organization_id: string, cursor?: string, limit?: number, role?: 'owner' | 'member', sort?: string, user_id?: string): { id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n\n**get** `/v1/organizations/{organization_id}/memberships`\n\nList all memberships for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `role?: 'owner' | 'member'`\n Filter by membership role\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, role\n\n- `user_id?: string`\n Filter by the member's user ID\n\n### Returns\n\n- `{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n Organization membership details.\n\n - `id: string`\n - `created_at: string`\n - `organization_id: string`\n - `role: 'owner' | 'member'`\n - `updated_at: string`\n - `user_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 organizationMembership of client.organizations.memberships.list('organization_id')) {\n console.log(organizationMembership);\n}\n```",
|
|
493
524
|
perLanguage: {
|
|
494
525
|
typescript: {
|
|
495
526
|
method: 'client.organizations.memberships.list',
|
|
@@ -667,6 +698,10 @@ const EMBEDDED_METHODS = [
|
|
|
667
698
|
method: 'client.Organizations.Billing.Cost',
|
|
668
699
|
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\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationDailyCost, err := client.Organizations.Billing.Cost(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingCostParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationDailyCost.Currency)\n}\n',
|
|
669
700
|
},
|
|
701
|
+
cli: {
|
|
702
|
+
method: 'billing cost',
|
|
703
|
+
example: "nirvana organizations:billing cost \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
704
|
+
},
|
|
670
705
|
},
|
|
671
706
|
},
|
|
672
707
|
{
|
|
@@ -677,9 +712,19 @@ const EMBEDDED_METHODS = [
|
|
|
677
712
|
description: "List the organization's billing history: prepaid credits, top-ups, and manual adjustments, newest first. Paginated with an opaque cursor.",
|
|
678
713
|
stainlessPath: '(resource) organizations.billing > (method) history',
|
|
679
714
|
qualified: 'client.organizations.billing.history',
|
|
680
|
-
params: [
|
|
715
|
+
params: [
|
|
716
|
+
'organization_id: string;',
|
|
717
|
+
'created_at_max?: string;',
|
|
718
|
+
'created_at_min?: string;',
|
|
719
|
+
'currency?: string;',
|
|
720
|
+
'cursor?: string;',
|
|
721
|
+
'limit?: number;',
|
|
722
|
+
'purpose?: string;',
|
|
723
|
+
'sort?: string;',
|
|
724
|
+
'type?: string;',
|
|
725
|
+
],
|
|
681
726
|
response: '{ items: { id: string; amount: string; created_at: string; currency: string; type: billing_history_entry_type; description?: string; purpose?: string; receipt_url?: string; }[]; pagination: { next_cursor: string; previous_cursor: string; total_count: number; }; }',
|
|
682
|
-
markdown: "## history\n\n`client.organizations.billing.history(organization_id: string, cursor?: string, limit?: number): { items: billing_history_entry[]; pagination: pagination; }`\n\n**get** `/v1/organizations/{organization_id}/billing/history`\n\nList the organization's billing history: prepaid credits, top-ups, and manual adjustments, newest first. Paginated with an opaque cursor.\n\n### Parameters\n\n- `organization_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
727
|
+
markdown: "## history\n\n`client.organizations.billing.history(organization_id: string, created_at_max?: string, created_at_min?: string, currency?: string, cursor?: string, limit?: number, purpose?: string, sort?: string, type?: string): { items: billing_history_entry[]; pagination: pagination; }`\n\n**get** `/v1/organizations/{organization_id}/billing/history`\n\nList the organization's billing history: prepaid credits, top-ups, and manual adjustments, newest first. Paginated with an opaque cursor.\n\n### Parameters\n\n- `organization_id: string`\n\n- `created_at_max?: string`\n Only entries at or before this RFC 3339 instant\n\n- `created_at_min?: string`\n Only entries at or after this RFC 3339 instant\n\n- `currency?: string`\n Filter by currency, as an ISO 4217 code. Case-insensitive.\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `purpose?: string`\n Filter by the funding flow a credit came from\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, amount\n\n- `type?: string`\n Filter by entry type\n\n### Returns\n\n- `{ items: { id: string; amount: string; created_at: string; currency: string; type: billing_history_entry_type; description?: string; purpose?: string; receipt_url?: string; }[]; pagination: { next_cursor: string; previous_cursor: string; total_count: number; }; }`\n\n - `items: { id: string; amount: string; created_at: string; currency: string; type: 'grant' | 'adjustment'; description?: string; purpose?: string; receipt_url?: string; }[]`\n - `pagination: { next_cursor: string; previous_cursor: string; total_count: number; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst billingHistoryEntryList = await client.organizations.billing.history('organization_id');\n\nconsole.log(billingHistoryEntryList);\n```",
|
|
683
728
|
perLanguage: {
|
|
684
729
|
typescript: {
|
|
685
730
|
method: 'client.organizations.billing.history',
|
|
@@ -692,6 +737,10 @@ const EMBEDDED_METHODS = [
|
|
|
692
737
|
method: 'client.Organizations.Billing.History',
|
|
693
738
|
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\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbillingHistoryEntryList, err := client.Organizations.Billing.History(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingHistoryParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", billingHistoryEntryList.Items)\n}\n',
|
|
694
739
|
},
|
|
740
|
+
cli: {
|
|
741
|
+
method: 'billing history',
|
|
742
|
+
example: "nirvana organizations:billing history \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
743
|
+
},
|
|
695
744
|
},
|
|
696
745
|
},
|
|
697
746
|
{
|
|
@@ -717,6 +766,10 @@ const EMBEDDED_METHODS = [
|
|
|
717
766
|
method: 'client.Organizations.Billing.TopUp',
|
|
718
767
|
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\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.TopUp(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingTopUpParams{\n\t\t\tAmount: "50.00",\n\t\t\tIdempotencyKey: "Idempotency-Key",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
719
768
|
},
|
|
769
|
+
cli: {
|
|
770
|
+
method: 'billing top_up',
|
|
771
|
+
example: "nirvana organizations:billing top-up \\\n --api-key 'My API Key' \\\n --organization-id organization_id \\\n --amount 50.00 \\\n --idempotency-key Idempotency-Key",
|
|
772
|
+
},
|
|
720
773
|
},
|
|
721
774
|
},
|
|
722
775
|
{
|
|
@@ -742,6 +795,10 @@ const EMBEDDED_METHODS = [
|
|
|
742
795
|
method: 'client.Organizations.Billing.Recharge',
|
|
743
796
|
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\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.Recharge(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingRechargeParams{\n\t\t\tIdempotencyKey: "Idempotency-Key",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
744
797
|
},
|
|
798
|
+
cli: {
|
|
799
|
+
method: 'billing recharge',
|
|
800
|
+
example: "nirvana organizations:billing recharge \\\n --api-key 'My API Key' \\\n --organization-id organization_id \\\n --idempotency-key Idempotency-Key",
|
|
801
|
+
},
|
|
745
802
|
},
|
|
746
803
|
},
|
|
747
804
|
{
|
|
@@ -767,6 +824,10 @@ const EMBEDDED_METHODS = [
|
|
|
767
824
|
method: 'client.Organizations.Billing.Statements',
|
|
768
825
|
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\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationUsageStatement, err := client.Organizations.Billing.Statements(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingStatementsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationUsageStatement.Currency)\n}\n',
|
|
769
826
|
},
|
|
827
|
+
cli: {
|
|
828
|
+
method: 'billing statements',
|
|
829
|
+
example: "nirvana organizations:billing statements \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
830
|
+
},
|
|
770
831
|
},
|
|
771
832
|
},
|
|
772
833
|
{
|
|
@@ -792,6 +853,10 @@ const EMBEDDED_METHODS = [
|
|
|
792
853
|
method: 'client.Organizations.Billing.RechargePolicy.Get',
|
|
793
854
|
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\torganizationRechargePolicy, err := client.Organizations.Billing.RechargePolicy.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationRechargePolicy.Policy)\n}\n',
|
|
794
855
|
},
|
|
856
|
+
cli: {
|
|
857
|
+
method: 'recharge_policy get',
|
|
858
|
+
example: "nirvana organizations:billing:recharge-policy get \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
859
|
+
},
|
|
795
860
|
},
|
|
796
861
|
},
|
|
797
862
|
{
|
|
@@ -821,6 +886,10 @@ const EMBEDDED_METHODS = [
|
|
|
821
886
|
method: 'client.Organizations.Billing.RechargePolicy.Update',
|
|
822
887
|
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\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationRechargePolicy, err := client.Organizations.Billing.RechargePolicy.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingRechargePolicyUpdateParams{\n\t\t\tPolicy: organizations.RechargePolicyModeAutomatic,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationRechargePolicy.Policy)\n}\n',
|
|
823
888
|
},
|
|
889
|
+
cli: {
|
|
890
|
+
method: 'recharge_policy update',
|
|
891
|
+
example: "nirvana organizations:billing:recharge-policy update \\\n --api-key 'My API Key' \\\n --organization-id organization_id \\\n --policy automatic",
|
|
892
|
+
},
|
|
824
893
|
},
|
|
825
894
|
},
|
|
826
895
|
{
|
|
@@ -917,9 +986,19 @@ const EMBEDDED_METHODS = [
|
|
|
917
986
|
description: 'List per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).',
|
|
918
987
|
stainlessPath: '(resource) usage > (method) list',
|
|
919
988
|
qualified: 'client.usage.list',
|
|
920
|
-
params: [
|
|
989
|
+
params: [
|
|
990
|
+
'active_at_max?: string;',
|
|
991
|
+
'active_at_min?: string;',
|
|
992
|
+
'cursor?: string;',
|
|
993
|
+
'dimension?: string;',
|
|
994
|
+
'limit?: number;',
|
|
995
|
+
'region?: string;',
|
|
996
|
+
'resource_id?: string;',
|
|
997
|
+
'resource_type?: string;',
|
|
998
|
+
'sort?: string;',
|
|
999
|
+
],
|
|
921
1000
|
response: "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }",
|
|
922
|
-
markdown: "## list\n\n`client.usage.list(cursor?: string, limit?: number): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage`\n\nList per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).\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- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }`\n Usage record for a single metered resource.\n\n - `dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; }[]; }[]`\n - `ended_at: string`\n - `project_id: string`\n - `region: 'us-sva-2'`\n - `resource_id: string`\n - `resource_type: string`\n - `started_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 usage of client.usage.list()) {\n console.log(usage);\n}\n```",
|
|
1001
|
+
markdown: "## list\n\n`client.usage.list(active_at_max?: string, active_at_min?: string, cursor?: string, dimension?: string, limit?: number, region?: string, resource_id?: string, resource_type?: string, sort?: string): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage`\n\nList per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).\n\n### Parameters\n\n- `active_at_max?: string`\n Only resources metered at or before this RFC 3339 instant\n\n- `active_at_min?: string`\n Only resources metered at or after this RFC 3339 instant; a window a usage row must overlap\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `dimension?: string`\n Only resources with usage in this dimension\n\n- `limit?: number`\n Maximum number of items to return\n\n- `region?: string`\n Filter by region\n\n- `resource_id?: string`\n Filter by a single resource\n\n- `resource_type?: string`\n Filter by the kind of resource metered\n\n- `sort?: string`\n Sort term as field:asc or field:desc. Field: created_at, the resource's earliest usage row matching the filters\n\n### Returns\n\n- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }`\n Usage record for a single metered resource.\n\n - `dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; }[]; }[]`\n - `ended_at: string`\n - `project_id: string`\n - `region: 'us-sva-2'`\n - `resource_id: string`\n - `resource_type: string`\n - `started_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 usage of client.usage.list()) {\n console.log(usage);\n}\n```",
|
|
923
1002
|
perLanguage: {
|
|
924
1003
|
typescript: {
|
|
925
1004
|
method: 'client.usage.list',
|
|
@@ -975,9 +1054,25 @@ const EMBEDDED_METHODS = [
|
|
|
975
1054
|
description: 'List Audit Log entries for an organization',
|
|
976
1055
|
stainlessPath: '(resource) audit_logs > (method) list',
|
|
977
1056
|
qualified: 'client.auditLogs.list',
|
|
978
|
-
params: [
|
|
1057
|
+
params: [
|
|
1058
|
+
'action?: string;',
|
|
1059
|
+
'actor_id?: string;',
|
|
1060
|
+
"actor_type?: 'user' | 'api_key';",
|
|
1061
|
+
'client_ip?: string;',
|
|
1062
|
+
'created_at_max?: string;',
|
|
1063
|
+
'created_at_min?: string;',
|
|
1064
|
+
'cursor?: string;',
|
|
1065
|
+
'limit?: number;',
|
|
1066
|
+
'method?: string;',
|
|
1067
|
+
'path?: string;',
|
|
1068
|
+
'sort?: string;',
|
|
1069
|
+
'status_code_max?: number;',
|
|
1070
|
+
'status_code_min?: number;',
|
|
1071
|
+
'target_id?: string;',
|
|
1072
|
+
'target_type?: string;',
|
|
1073
|
+
],
|
|
979
1074
|
response: '{ id: string; action: string; actor: { id: string; name: string; type: audit_log_type; }; client_ip: string; created_at: string; method: string; path: string; status_code: number; user_agent: string; target?: { id: string; type: string; }; }',
|
|
980
|
-
markdown: "## list\n\n`client.auditLogs.list(cursor?: string, limit?: number): { id: string; action: string; actor: audit_log_actor; client_ip: string; created_at: string; method: string; path: string; status_code: number; user_agent: string; target?: audit_log_target; }`\n\n**get** `/v1/audit_logs`\n\nList Audit Log entries for an organization\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
1075
|
+
markdown: "## list\n\n`client.auditLogs.list(action?: string, actor_id?: string, actor_type?: 'user' | 'api_key', client_ip?: string, created_at_max?: string, created_at_min?: string, cursor?: string, limit?: number, method?: string, path?: string, sort?: string, status_code_max?: number, status_code_min?: number, target_id?: string, target_type?: string): { id: string; action: string; actor: audit_log_actor; client_ip: string; created_at: string; method: string; path: string; status_code: number; user_agent: string; target?: audit_log_target; }`\n\n**get** `/v1/audit_logs`\n\nList Audit Log entries for an organization\n\n### Parameters\n\n- `action?: string`\n Filter by recorded action\n\n- `actor_id?: string`\n Filter by the acting user or API key\n\n- `actor_type?: 'user' | 'api_key'`\n Filter by the kind of actor that acted\n\n- `client_ip?: string`\n Filter by client IP address, matched exactly\n\n- `created_at_max?: string`\n Only entries at or before this RFC 3339 instant\n\n- `created_at_min?: string`\n Only entries at or after this RFC 3339 instant\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `method?: string`\n Filter by HTTP method\n\n- `path?: string`\n Filter by a case-insensitive substring of the request path\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, status_code\n\n- `status_code_max?: number`\n Only entries with a status code at or below this\n\n- `status_code_min?: number`\n Only entries with a status code at or above this, e.g. 400 for failures only\n\n- `target_id?: string`\n Filter by the resource acted on\n\n- `target_type?: string`\n Filter by the kind of resource acted on\n\n### Returns\n\n- `{ id: string; action: string; actor: { id: string; name: string; type: audit_log_type; }; client_ip: string; created_at: string; method: string; path: string; status_code: number; user_agent: string; target?: { id: string; type: string; }; }`\n Audit log entry.\n\n - `id: string`\n - `action: string`\n - `actor: { id: string; name: string; type: 'user' | 'api_key'; }`\n - `client_ip: string`\n - `created_at: string`\n - `method: string`\n - `path: string`\n - `status_code: number`\n - `user_agent: string`\n - `target?: { id: string; type: 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 auditLog of client.auditLogs.list()) {\n console.log(auditLog);\n}\n```",
|
|
981
1076
|
perLanguage: {
|
|
982
1077
|
typescript: {
|
|
983
1078
|
method: 'client.auditLogs.list',
|
|
@@ -1119,9 +1214,9 @@ const EMBEDDED_METHODS = [
|
|
|
1119
1214
|
description: 'List all projects',
|
|
1120
1215
|
stainlessPath: '(resource) projects > (method) list',
|
|
1121
1216
|
qualified: 'client.projects.list',
|
|
1122
|
-
params: ['cursor?: string;', 'limit?: number;'],
|
|
1217
|
+
params: ['cursor?: string;', 'limit?: number;', 'name?: string;', 'sort?: string;', 'tags?: string[];'],
|
|
1123
1218
|
response: '{ id: string; created_at: string; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }',
|
|
1124
|
-
markdown: "## list\n\n`client.projects.list(cursor?: string, limit?: number): { id: string; created_at: string; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**get** `/v1/projects`\n\nList all projects\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
1219
|
+
markdown: "## list\n\n`client.projects.list(cursor?: string, limit?: number, name?: string, sort?: string, tags?: string[]): { id: string; created_at: string; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**get** `/v1/projects`\n\nList all projects\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Project name\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Project must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }`\n Project response.\n\n - `id: string`\n - `created_at: string`\n - `name: string`\n - `resources: { blockchain: { rpc_nodes_dedicated: number; rpc_nodes_flex: number; }; cloud: { connect_connections: number; nks_clusters: number; nks_node_pools: number; vms: number; volumes: number; vpcs: number; }; }`\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 project of client.projects.list()) {\n console.log(project);\n}\n```",
|
|
1125
1220
|
perLanguage: {
|
|
1126
1221
|
typescript: {
|
|
1127
1222
|
method: 'client.projects.list',
|
|
@@ -1716,7 +1811,7 @@ const EMBEDDED_METHODS = [
|
|
|
1716
1811
|
'start_time?: string;',
|
|
1717
1812
|
],
|
|
1718
1813
|
response: "{ aggregation: 'mean' | 'max' | 'min'; end_time: string; metrics: { metric: string; points: vm_metric_point[]; unit: vm_metric_unit; }[]; period: '5m' | '15m' | '1h' | '6h' | '24h'; start_time: string; vm_id: string; }",
|
|
1719
|
-
markdown: "## list\n\n`client.compute.vms.metrics.list(vm_id: string, aggregation?: 'mean' | 'max' | 'min', end_time?: string, metric?: string[], period?: '5m' | '15m' | '1h' | '6h' | '24h', start_time?: string): { aggregation: 'mean' | 'max' | 'min'; end_time: string; metrics: vm_metric_series[]; period: '5m' | '15m' | '1h' | '6h' | '24h'; start_time: string; vm_id: string; }`\n\n**get** `/v1/compute/vms/{vm_id}/metrics`\n\nRead a VM's resource metrics over an interval. Every series covers the same periods, so they line up index for index, and a period the VM reported no observation for carries a null value.\n\n### Parameters\n\n- `vm_id: string`\n\n- `aggregation?: 'mean' | 'max' | 'min'`\n How the samples inside one period are folded into a single value.\n\n- `end_time?: string`\n End of the interval, exclusive, as an RFC 3339 timestamp. Defaults to now.\n\n- `metric?: string[]`\n Metric to return. Repeat the parameter for several; every metric is returned when it is left out.\n\n- `period?: '5m' | '15m' | '1h' | '6h' | '24h'`\n Width of one period, and so the spacing between points. An interval holding more than 1440 periods is rejected; the error names a period that fits.\n\n- `start_time?: string`\n Start of the interval, inclusive, as an RFC 3339 timestamp. Defaults to an hour before end_time. A start older than the 30 days of history kept is served from where that history begins.\n\n### Returns\n\n- `{ aggregation: 'mean' | 'max' | 'min'; end_time: string; metrics: { metric: string; points: vm_metric_point[]; unit: vm_metric_unit; }[]; period: '5m' | '15m' | '1h' | '6h' | '24h'; start_time: string; vm_id: string; }`\n A VM's metrics over an interval: one series per metric, on a shared grid of periods.\n\n - `aggregation: 'mean' | 'max' | 'min'`\n - `end_time: string`\n - `metrics: { metric: string; points: { timestamp: string; value: number; }[]; unit: 'ratio' | 'bytes' | 'cores'; }[]`\n - `period: '5m' | '15m' | '1h' | '6h' | '24h'`\n - `start_time: string`\n - `vm_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vmMetrics = await client.compute.vms.metrics.list('vm_id');\n\nconsole.log(vmMetrics);\n```",
|
|
1814
|
+
markdown: "## list\n\n`client.compute.vms.metrics.list(vm_id: string, aggregation?: 'mean' | 'max' | 'min', end_time?: string, metric?: string[], period?: '5m' | '15m' | '1h' | '6h' | '24h', start_time?: string): { aggregation: 'mean' | 'max' | 'min'; end_time: string; metrics: vm_metric_series[]; period: '5m' | '15m' | '1h' | '6h' | '24h'; start_time: string; vm_id: string; }`\n\n**get** `/v1/compute/vms/{vm_id}/metrics`\n\nRead a VM's resource metrics over an interval. Every series covers the same periods, so they line up index for index, and a period the VM reported no observation for carries a null value.\n\n### Parameters\n\n- `vm_id: string`\n\n- `aggregation?: 'mean' | 'max' | 'min'`\n How the samples inside one period are folded into a single value.\n\n- `end_time?: string`\n End of the interval, exclusive, as an RFC 3339 timestamp. Defaults to now.\n\n- `metric?: string[]`\n Metric to return. Repeat the parameter for several; every metric is returned when it is left out.\n\n- `period?: '5m' | '15m' | '1h' | '6h' | '24h'`\n Width of one period, and so the spacing between points. An interval holding more than 1440 periods is rejected; the error names a period that fits.\n\n- `start_time?: string`\n Start of the interval, inclusive, as an RFC 3339 timestamp. Defaults to an hour before end_time. A start older than the 30 days of history kept is served from where that history begins.\n\n### Returns\n\n- `{ aggregation: 'mean' | 'max' | 'min'; end_time: string; metrics: { metric: string; points: vm_metric_point[]; unit: vm_metric_unit; }[]; period: '5m' | '15m' | '1h' | '6h' | '24h'; start_time: string; vm_id: string; }`\n A VM's metrics over an interval: one series per metric, on a shared grid of periods.\n\n - `aggregation: 'mean' | 'max' | 'min'`\n - `end_time: string`\n - `metrics: { metric: string; points: { timestamp: string; value: number; }[]; unit: 'ratio' | 'bytes' | 'cores' | 'bytes_per_second' | 'operations_per_second'; }[]`\n - `period: '5m' | '15m' | '1h' | '6h' | '24h'`\n - `start_time: string`\n - `vm_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vmMetrics = await client.compute.vms.metrics.list('vm_id');\n\nconsole.log(vmMetrics);\n```",
|
|
1720
1815
|
perLanguage: {
|
|
1721
1816
|
typescript: {
|
|
1722
1817
|
method: 'client.compute.vms.metrics.list',
|
|
@@ -1744,7 +1839,7 @@ const EMBEDDED_METHODS = [
|
|
|
1744
1839
|
stainlessPath: '(resource) compute.vms.metric_descriptors > (method) list',
|
|
1745
1840
|
qualified: 'client.compute.vms.metricDescriptors.list',
|
|
1746
1841
|
response: '{ items: { description: string; max_value: number; metric: string; min_value: number; nullable: boolean; unit: vm_metric_unit; }[]; pagination: { next_cursor: string; previous_cursor: string; total_count: number; }; }',
|
|
1747
|
-
markdown: "## list\n\n`client.compute.vms.metricDescriptors.list(): { items: vm_metric_descriptor[]; pagination: pagination; }`\n\n**get** `/v1/compute/metric_descriptors`\n\nDescribe every metric a VM reports: its name, unit, the range its values fall in, and whether a value can be null. Read this instead of holding a list of metric names, so a metric published later is picked up without a client change.\n\n### Returns\n\n- `{ items: { description: string; max_value: number; metric: string; min_value: number; nullable: boolean; unit: vm_metric_unit; }[]; pagination: { next_cursor: string; previous_cursor: string; total_count: number; }; }`\n\n - `items: { description: string; max_value: number; metric: string; min_value: number; nullable: boolean; unit: 'ratio' | 'bytes' | 'cores'; }[]`\n - `pagination: { next_cursor: string; previous_cursor: string; total_count: number; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vmMetricDescriptorList = await client.compute.vms.metricDescriptors.list();\n\nconsole.log(vmMetricDescriptorList);\n```",
|
|
1842
|
+
markdown: "## list\n\n`client.compute.vms.metricDescriptors.list(): { items: vm_metric_descriptor[]; pagination: pagination; }`\n\n**get** `/v1/compute/metric_descriptors`\n\nDescribe every metric a VM reports: its name, unit, the range its values fall in, and whether a value can be null. Read this instead of holding a list of metric names, so a metric published later is picked up without a client change.\n\n### Returns\n\n- `{ items: { description: string; max_value: number; metric: string; min_value: number; nullable: boolean; unit: vm_metric_unit; }[]; pagination: { next_cursor: string; previous_cursor: string; total_count: number; }; }`\n\n - `items: { description: string; max_value: number; metric: string; min_value: number; nullable: boolean; unit: 'ratio' | 'bytes' | 'cores' | 'bytes_per_second' | 'operations_per_second'; }[]`\n - `pagination: { next_cursor: string; previous_cursor: string; total_count: number; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vmMetricDescriptorList = await client.compute.vms.metricDescriptors.list();\n\nconsole.log(vmMetricDescriptorList);\n```",
|
|
1748
1843
|
perLanguage: {
|
|
1749
1844
|
typescript: {
|
|
1750
1845
|
method: 'client.compute.vms.metricDescriptors.list',
|
|
@@ -3010,9 +3105,15 @@ const EMBEDDED_METHODS = [
|
|
|
3010
3105
|
description: 'List all Flex Blockchains',
|
|
3011
3106
|
stainlessPath: '(resource) rpc_nodes.flex.blockchains > (method) list',
|
|
3012
3107
|
qualified: 'client.rpcNodes.flex.blockchains.list',
|
|
3013
|
-
params: [
|
|
3108
|
+
params: [
|
|
3109
|
+
'blockchain?: string;',
|
|
3110
|
+
'cursor?: string;',
|
|
3111
|
+
'limit?: number;',
|
|
3112
|
+
'network?: string;',
|
|
3113
|
+
'sort?: string;',
|
|
3114
|
+
],
|
|
3014
3115
|
response: '{ blockchain: string; network: string; }',
|
|
3015
|
-
markdown: "## list\n\n`client.rpcNodes.flex.blockchains.list(cursor?: string, limit?: number): { blockchain: string; network: string; }`\n\n**get** `/v1/rpc_nodes/flex/blockchains`\n\nList all Flex Blockchains\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
3116
|
+
markdown: "## list\n\n`client.rpcNodes.flex.blockchains.list(blockchain?: string, cursor?: string, limit?: number, network?: string, sort?: string): { blockchain: string; network: string; }`\n\n**get** `/v1/rpc_nodes/flex/blockchains`\n\nList all Flex Blockchains\n\n### Parameters\n\n- `blockchain?: string`\n Filter by blockchain\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `network?: string`\n Filter by network\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, blockchain, network\n\n### Returns\n\n- `{ blockchain: string; network: string; }`\n Blockchain supported by the RPC Node Flex.\n\n - `blockchain: string`\n - `network: 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 flexBlockchain of client.rpcNodes.flex.blockchains.list()) {\n console.log(flexBlockchain);\n}\n```",
|
|
3016
3117
|
perLanguage: {
|
|
3017
3118
|
typescript: {
|
|
3018
3119
|
method: 'client.rpcNodes.flex.blockchains.list',
|
|
@@ -3106,9 +3207,15 @@ const EMBEDDED_METHODS = [
|
|
|
3106
3207
|
description: 'List all Dedicated Blockchains',
|
|
3107
3208
|
stainlessPath: '(resource) rpc_nodes.dedicated.blockchains > (method) list',
|
|
3108
3209
|
qualified: 'client.rpcNodes.dedicated.blockchains.list',
|
|
3109
|
-
params: [
|
|
3210
|
+
params: [
|
|
3211
|
+
'blockchain?: string;',
|
|
3212
|
+
'cursor?: string;',
|
|
3213
|
+
'limit?: number;',
|
|
3214
|
+
'network?: string;',
|
|
3215
|
+
'sort?: string;',
|
|
3216
|
+
],
|
|
3110
3217
|
response: '{ blockchain: string; network: string; }',
|
|
3111
|
-
markdown: "## list\n\n`client.rpcNodes.dedicated.blockchains.list(cursor?: string, limit?: number): { blockchain: string; network: string; }`\n\n**get** `/v1/rpc_nodes/dedicated/blockchains`\n\nList all Dedicated Blockchains\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request
|
|
3218
|
+
markdown: "## list\n\n`client.rpcNodes.dedicated.blockchains.list(blockchain?: string, cursor?: string, limit?: number, network?: string, sort?: string): { blockchain: string; network: string; }`\n\n**get** `/v1/rpc_nodes/dedicated/blockchains`\n\nList all Dedicated Blockchains\n\n### Parameters\n\n- `blockchain?: string`\n Filter by blockchain\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `network?: string`\n Filter by network\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, blockchain, network\n\n### Returns\n\n- `{ blockchain: string; network: string; }`\n Blockchain supported by the RPC Node Dedicated.\n\n - `blockchain: string`\n - `network: 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 dedicatedBlockchain of client.rpcNodes.dedicated.blockchains.list()) {\n console.log(dedicatedBlockchain);\n}\n```",
|
|
3112
3219
|
perLanguage: {
|
|
3113
3220
|
typescript: {
|
|
3114
3221
|
method: 'client.rpcNodes.dedicated.blockchains.list',
|
|
@@ -4198,6 +4305,10 @@ const EMBEDDED_METHODS = [
|
|
|
4198
4305
|
method: 'client.NKS.Clusters.Pools.Volumes.List',
|
|
4199
4306
|
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)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Pools.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4200
4307
|
},
|
|
4308
|
+
cli: {
|
|
4309
|
+
method: 'volumes list',
|
|
4310
|
+
example: "nirvana nks:clusters:pools:volumes list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
4311
|
+
},
|
|
4201
4312
|
},
|
|
4202
4313
|
},
|
|
4203
4314
|
];
|
|
@@ -4208,11 +4319,11 @@ const EMBEDDED_READMES = [
|
|
|
4208
4319
|
},
|
|
4209
4320
|
{
|
|
4210
4321
|
language: 'go',
|
|
4211
|
-
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@v1.98.2\'\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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.VolumeTypeABS,\n\t},\n\tInstanceType: "n1-standard-2",\n\tName: "my-vm",\n\tOSImageName: "ubuntu-noble-2025-10-01",\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tPublicIPEnabled: true,\n\tRegion: shared.RegionNameUsSva2,\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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',
|
|
4322
|
+
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@v1.98.4\'\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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.VolumeTypeABS,\n\t},\n\tInstanceType: "n1-standard-2",\n\tName: "my-vm",\n\tOSImageName: "ubuntu-noble-2025-10-01",\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tPublicIPEnabled: true,\n\tRegion: shared.RegionNameUsSva2,\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\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\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',
|
|
4212
4323
|
},
|
|
4213
4324
|
{
|
|
4214
4325
|
language: 'terraform',
|
|
4215
|
-
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 = "~> 1.98.
|
|
4326
|
+
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 = "~> 1.98.4"\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 = "abs"\n tags = ["production", "ethereum"]\n }\n instance_type = "n1-standard-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 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',
|
|
4216
4327
|
},
|
|
4217
4328
|
{
|
|
4218
4329
|
language: 'cli',
|