@nirvana-labs/nirvana-mcp 1.98.2 → 1.98.4
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 +111 -24
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +111 -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 +111 -24
- package/src/server.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AAs8JF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AAs8JF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
package/local-docs-search.js
CHANGED
|
@@ -266,9 +266,16 @@ const EMBEDDED_METHODS = [
|
|
|
266
266
|
description: 'List all API keys',
|
|
267
267
|
stainlessPath: '(resource) api_keys > (method) list',
|
|
268
268
|
qualified: 'client.apiKeys.list',
|
|
269
|
-
params: [
|
|
269
|
+
params: [
|
|
270
|
+
'cursor?: string;',
|
|
271
|
+
'limit?: number;',
|
|
272
|
+
'name?: string;',
|
|
273
|
+
'sort?: string;',
|
|
274
|
+
"status?: 'active' | 'inactive' | 'expired';",
|
|
275
|
+
'tags?: string[];',
|
|
276
|
+
],
|
|
270
277
|
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; }",
|
|
271
|
-
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
|
|
278
|
+
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```",
|
|
272
279
|
perLanguage: {
|
|
273
280
|
typescript: {
|
|
274
281
|
method: 'client.apiKeys.list',
|
|
@@ -324,9 +331,20 @@ const EMBEDDED_METHODS = [
|
|
|
324
331
|
description: 'List all operations',
|
|
325
332
|
stainlessPath: '(resource) operations > (method) list',
|
|
326
333
|
qualified: 'client.operations.list',
|
|
327
|
-
params: [
|
|
334
|
+
params: [
|
|
335
|
+
'project_id: string;',
|
|
336
|
+
'created_at_max?: string;',
|
|
337
|
+
'created_at_min?: string;',
|
|
338
|
+
'cursor?: string;',
|
|
339
|
+
'kind?: string;',
|
|
340
|
+
'limit?: number;',
|
|
341
|
+
'resource_id?: string;',
|
|
342
|
+
'sort?: string;',
|
|
343
|
+
"status?: 'pending' | 'running' | 'done' | 'failed' | 'unknown';",
|
|
344
|
+
"type?: 'create' | 'update' | 'delete' | 'restart';",
|
|
345
|
+
],
|
|
328
346
|
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; }",
|
|
329
|
-
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```",
|
|
347
|
+
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```",
|
|
330
348
|
perLanguage: {
|
|
331
349
|
typescript: {
|
|
332
350
|
method: 'client.operations.list',
|
|
@@ -440,9 +458,15 @@ const EMBEDDED_METHODS = [
|
|
|
440
458
|
description: 'List organizations',
|
|
441
459
|
stainlessPath: '(resource) organizations > (method) list',
|
|
442
460
|
qualified: 'client.organizations.list',
|
|
443
|
-
params: [
|
|
461
|
+
params: [
|
|
462
|
+
'cursor?: string;',
|
|
463
|
+
'limit?: number;',
|
|
464
|
+
'name?: string;',
|
|
465
|
+
'sort?: string;',
|
|
466
|
+
"type?: 'personal' | 'company';",
|
|
467
|
+
],
|
|
444
468
|
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; }",
|
|
445
|
-
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
|
|
469
|
+
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```",
|
|
446
470
|
perLanguage: {
|
|
447
471
|
typescript: {
|
|
448
472
|
method: 'client.organizations.list',
|
|
@@ -526,9 +550,16 @@ const EMBEDDED_METHODS = [
|
|
|
526
550
|
description: 'List all memberships for an organization',
|
|
527
551
|
stainlessPath: '(resource) organizations.memberships > (method) list',
|
|
528
552
|
qualified: 'client.organizations.memberships.list',
|
|
529
|
-
params: [
|
|
553
|
+
params: [
|
|
554
|
+
'organization_id: string;',
|
|
555
|
+
'cursor?: string;',
|
|
556
|
+
'limit?: number;',
|
|
557
|
+
"role?: 'owner' | 'member';",
|
|
558
|
+
'sort?: string;',
|
|
559
|
+
'user_id?: string;',
|
|
560
|
+
],
|
|
530
561
|
response: "{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }",
|
|
531
|
-
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
|
|
562
|
+
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```",
|
|
532
563
|
perLanguage: {
|
|
533
564
|
typescript: {
|
|
534
565
|
method: 'client.organizations.memberships.list',
|
|
@@ -716,9 +747,19 @@ const EMBEDDED_METHODS = [
|
|
|
716
747
|
description: "List the organization's billing history: prepaid credits, top-ups, and manual adjustments, newest first. Paginated with an opaque cursor.",
|
|
717
748
|
stainlessPath: '(resource) organizations.billing > (method) history',
|
|
718
749
|
qualified: 'client.organizations.billing.history',
|
|
719
|
-
params: [
|
|
750
|
+
params: [
|
|
751
|
+
'organization_id: string;',
|
|
752
|
+
'created_at_max?: string;',
|
|
753
|
+
'created_at_min?: string;',
|
|
754
|
+
'currency?: string;',
|
|
755
|
+
'cursor?: string;',
|
|
756
|
+
'limit?: number;',
|
|
757
|
+
'purpose?: string;',
|
|
758
|
+
'sort?: string;',
|
|
759
|
+
'type?: string;',
|
|
760
|
+
],
|
|
720
761
|
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; }; }',
|
|
721
|
-
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
|
|
762
|
+
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```",
|
|
722
763
|
perLanguage: {
|
|
723
764
|
typescript: {
|
|
724
765
|
method: 'client.organizations.billing.history',
|
|
@@ -956,9 +997,19 @@ const EMBEDDED_METHODS = [
|
|
|
956
997
|
description: 'List per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).',
|
|
957
998
|
stainlessPath: '(resource) usage > (method) list',
|
|
958
999
|
qualified: 'client.usage.list',
|
|
959
|
-
params: [
|
|
1000
|
+
params: [
|
|
1001
|
+
'active_at_max?: string;',
|
|
1002
|
+
'active_at_min?: string;',
|
|
1003
|
+
'cursor?: string;',
|
|
1004
|
+
'dimension?: string;',
|
|
1005
|
+
'limit?: number;',
|
|
1006
|
+
'region?: string;',
|
|
1007
|
+
'resource_id?: string;',
|
|
1008
|
+
'resource_type?: string;',
|
|
1009
|
+
'sort?: string;',
|
|
1010
|
+
],
|
|
960
1011
|
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; }",
|
|
961
|
-
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```",
|
|
1012
|
+
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```",
|
|
962
1013
|
perLanguage: {
|
|
963
1014
|
typescript: {
|
|
964
1015
|
method: 'client.usage.list',
|
|
@@ -1014,9 +1065,25 @@ const EMBEDDED_METHODS = [
|
|
|
1014
1065
|
description: 'List Audit Log entries for an organization',
|
|
1015
1066
|
stainlessPath: '(resource) audit_logs > (method) list',
|
|
1016
1067
|
qualified: 'client.auditLogs.list',
|
|
1017
|
-
params: [
|
|
1068
|
+
params: [
|
|
1069
|
+
'action?: string;',
|
|
1070
|
+
'actor_id?: string;',
|
|
1071
|
+
"actor_type?: 'user' | 'api_key';",
|
|
1072
|
+
'client_ip?: string;',
|
|
1073
|
+
'created_at_max?: string;',
|
|
1074
|
+
'created_at_min?: string;',
|
|
1075
|
+
'cursor?: string;',
|
|
1076
|
+
'limit?: number;',
|
|
1077
|
+
'method?: string;',
|
|
1078
|
+
'path?: string;',
|
|
1079
|
+
'sort?: string;',
|
|
1080
|
+
'status_code_max?: number;',
|
|
1081
|
+
'status_code_min?: number;',
|
|
1082
|
+
'target_id?: string;',
|
|
1083
|
+
'target_type?: string;',
|
|
1084
|
+
],
|
|
1018
1085
|
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; }; }',
|
|
1019
|
-
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
|
|
1086
|
+
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```",
|
|
1020
1087
|
perLanguage: {
|
|
1021
1088
|
typescript: {
|
|
1022
1089
|
method: 'client.auditLogs.list',
|
|
@@ -1158,9 +1225,9 @@ const EMBEDDED_METHODS = [
|
|
|
1158
1225
|
description: 'List all projects',
|
|
1159
1226
|
stainlessPath: '(resource) projects > (method) list',
|
|
1160
1227
|
qualified: 'client.projects.list',
|
|
1161
|
-
params: ['cursor?: string;', 'limit?: number;'],
|
|
1228
|
+
params: ['cursor?: string;', 'limit?: number;', 'name?: string;', 'sort?: string;', 'tags?: string[];'],
|
|
1162
1229
|
response: '{ id: string; created_at: string; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }',
|
|
1163
|
-
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
|
|
1230
|
+
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```",
|
|
1164
1231
|
perLanguage: {
|
|
1165
1232
|
typescript: {
|
|
1166
1233
|
method: 'client.projects.list',
|
|
@@ -1755,7 +1822,7 @@ const EMBEDDED_METHODS = [
|
|
|
1755
1822
|
'start_time?: string;',
|
|
1756
1823
|
],
|
|
1757
1824
|
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; }",
|
|
1758
|
-
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```",
|
|
1825
|
+
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```",
|
|
1759
1826
|
perLanguage: {
|
|
1760
1827
|
typescript: {
|
|
1761
1828
|
method: 'client.compute.vms.metrics.list',
|
|
@@ -1768,6 +1835,10 @@ const EMBEDDED_METHODS = [
|
|
|
1768
1835
|
method: 'client.Compute.VMs.Metrics.List',
|
|
1769
1836
|
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)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvmMetrics, err := client.Compute.VMs.Metrics.List(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMMetricListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vmMetrics.VMID)\n}\n',
|
|
1770
1837
|
},
|
|
1838
|
+
cli: {
|
|
1839
|
+
method: 'metrics list',
|
|
1840
|
+
example: "nirvana compute:vms:metrics list \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1841
|
+
},
|
|
1771
1842
|
},
|
|
1772
1843
|
},
|
|
1773
1844
|
{
|
|
@@ -1779,7 +1850,7 @@ const EMBEDDED_METHODS = [
|
|
|
1779
1850
|
stainlessPath: '(resource) compute.vms.metric_descriptors > (method) list',
|
|
1780
1851
|
qualified: 'client.compute.vms.metricDescriptors.list',
|
|
1781
1852
|
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; }; }',
|
|
1782
|
-
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```",
|
|
1853
|
+
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```",
|
|
1783
1854
|
perLanguage: {
|
|
1784
1855
|
typescript: {
|
|
1785
1856
|
method: 'client.compute.vms.metricDescriptors.list',
|
|
@@ -1792,6 +1863,10 @@ const EMBEDDED_METHODS = [
|
|
|
1792
1863
|
method: 'client.Compute.VMs.MetricDescriptors.List',
|
|
1793
1864
|
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\tvmMetricDescriptorList, err := client.Compute.VMs.MetricDescriptors.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vmMetricDescriptorList.Items)\n}\n',
|
|
1794
1865
|
},
|
|
1866
|
+
cli: {
|
|
1867
|
+
method: 'metric_descriptors list',
|
|
1868
|
+
example: "nirvana compute:vms:metric-descriptors list \\\n --api-key 'My API Key'",
|
|
1869
|
+
},
|
|
1795
1870
|
},
|
|
1796
1871
|
},
|
|
1797
1872
|
{
|
|
@@ -3041,9 +3116,15 @@ const EMBEDDED_METHODS = [
|
|
|
3041
3116
|
description: 'List all Flex Blockchains',
|
|
3042
3117
|
stainlessPath: '(resource) rpc_nodes.flex.blockchains > (method) list',
|
|
3043
3118
|
qualified: 'client.rpcNodes.flex.blockchains.list',
|
|
3044
|
-
params: [
|
|
3119
|
+
params: [
|
|
3120
|
+
'blockchain?: string;',
|
|
3121
|
+
'cursor?: string;',
|
|
3122
|
+
'limit?: number;',
|
|
3123
|
+
'network?: string;',
|
|
3124
|
+
'sort?: string;',
|
|
3125
|
+
],
|
|
3045
3126
|
response: '{ blockchain: string; network: string; }',
|
|
3046
|
-
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
|
|
3127
|
+
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```",
|
|
3047
3128
|
perLanguage: {
|
|
3048
3129
|
typescript: {
|
|
3049
3130
|
method: 'client.rpcNodes.flex.blockchains.list',
|
|
@@ -3137,9 +3218,15 @@ const EMBEDDED_METHODS = [
|
|
|
3137
3218
|
description: 'List all Dedicated Blockchains',
|
|
3138
3219
|
stainlessPath: '(resource) rpc_nodes.dedicated.blockchains > (method) list',
|
|
3139
3220
|
qualified: 'client.rpcNodes.dedicated.blockchains.list',
|
|
3140
|
-
params: [
|
|
3221
|
+
params: [
|
|
3222
|
+
'blockchain?: string;',
|
|
3223
|
+
'cursor?: string;',
|
|
3224
|
+
'limit?: number;',
|
|
3225
|
+
'network?: string;',
|
|
3226
|
+
'sort?: string;',
|
|
3227
|
+
],
|
|
3141
3228
|
response: '{ blockchain: string; network: string; }',
|
|
3142
|
-
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
|
|
3229
|
+
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```",
|
|
3143
3230
|
perLanguage: {
|
|
3144
3231
|
typescript: {
|
|
3145
3232
|
method: 'client.rpcNodes.dedicated.blockchains.list',
|
|
@@ -4239,11 +4326,11 @@ const EMBEDDED_READMES = [
|
|
|
4239
4326
|
},
|
|
4240
4327
|
{
|
|
4241
4328
|
language: 'go',
|
|
4242
|
-
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.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.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',
|
|
4329
|
+
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.3\'\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',
|
|
4243
4330
|
},
|
|
4244
4331
|
{
|
|
4245
4332
|
language: 'terraform',
|
|
4246
|
-
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.
|
|
4333
|
+
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.3"\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',
|
|
4247
4334
|
},
|
|
4248
4335
|
{
|
|
4249
4336
|
language: 'cli',
|