@nirvana-labs/nirvana-mcp 1.91.0 → 1.91.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +3 -0
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +3 -0
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +2 -53
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +3 -54
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +1 -41
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +1 -41
- package/docs-search-tool.mjs.map +1 -1
- package/instructions.d.mts.map +1 -1
- package/instructions.d.ts.map +1 -1
- package/instructions.js +2 -18
- package/instructions.js.map +1 -1
- package/instructions.mjs +2 -18
- package/instructions.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +437 -330
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +437 -330
- package/local-docs-search.mjs.map +1 -1
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/methods.js +187 -169
- package/methods.js.map +1 -1
- package/methods.mjs +187 -169
- package/methods.mjs.map +1 -1
- package/options.d.mts +2 -2
- package/options.d.mts.map +1 -1
- package/options.d.ts +2 -2
- package/options.d.ts.map +1 -1
- package/options.js +6 -6
- package/options.js.map +1 -1
- package/options.mjs +6 -6
- package/options.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +2 -2
- package/server.js.map +1 -1
- package/server.mjs +2 -2
- package/server.mjs.map +1 -1
- package/src/code-tool-worker.ts +3 -0
- package/src/code-tool.ts +4 -83
- package/src/docs-search-tool.ts +2 -61
- package/src/instructions.ts +2 -28
- package/src/local-docs-search.ts +560 -435
- package/src/methods.ts +187 -169
- package/src/options.ts +9 -9
- package/src/server.ts +2 -2
package/local-docs-search.js
CHANGED
|
@@ -58,6 +58,9 @@ const EMBEDDED_METHODS = [
|
|
|
58
58
|
method: 'client.user.get',
|
|
59
59
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst user = await client.user.get();\n\nconsole.log(user.id);",
|
|
60
60
|
},
|
|
61
|
+
http: {
|
|
62
|
+
example: 'curl https://api.nirvanalabs.io/v1/user \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
63
|
+
},
|
|
61
64
|
go: {
|
|
62
65
|
method: 'client.User.Get',
|
|
63
66
|
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\tuser, err := client.User.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", user.ID)\n}\n',
|
|
@@ -66,9 +69,6 @@ const EMBEDDED_METHODS = [
|
|
|
66
69
|
method: 'user get',
|
|
67
70
|
example: "nirvana user get \\\n --api-key 'My API Key'",
|
|
68
71
|
},
|
|
69
|
-
http: {
|
|
70
|
-
example: 'curl https://api.nirvanalabs.io/v1/user \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
71
|
-
},
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
{
|
|
@@ -86,6 +86,9 @@ const EMBEDDED_METHODS = [
|
|
|
86
86
|
method: 'client.user.security.get',
|
|
87
87
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst userSecurity = await client.user.security.get();\n\nconsole.log(userSecurity.source_ip_rule);",
|
|
88
88
|
},
|
|
89
|
+
http: {
|
|
90
|
+
example: 'curl https://api.nirvanalabs.io/v1/user/security \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
91
|
+
},
|
|
89
92
|
go: {
|
|
90
93
|
method: 'client.User.Security.Get',
|
|
91
94
|
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\tuserSecurity, err := client.User.Security.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", userSecurity.SourceIPRule)\n}\n',
|
|
@@ -94,9 +97,6 @@ const EMBEDDED_METHODS = [
|
|
|
94
97
|
method: 'security get',
|
|
95
98
|
example: "nirvana user:security get \\\n --api-key 'My API Key'",
|
|
96
99
|
},
|
|
97
|
-
http: {
|
|
98
|
-
example: 'curl https://api.nirvanalabs.io/v1/user/security \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
99
|
-
},
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
102
|
{
|
|
@@ -115,6 +115,9 @@ const EMBEDDED_METHODS = [
|
|
|
115
115
|
method: 'client.user.security.update',
|
|
116
116
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst userSecurity = await client.user.security.update();\n\nconsole.log(userSecurity.source_ip_rule);",
|
|
117
117
|
},
|
|
118
|
+
http: {
|
|
119
|
+
example: "curl https://api.nirvanalabs.io/v1/user/security \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $NIRVANA_LABS_API_KEY\" \\\n -d '{}'",
|
|
120
|
+
},
|
|
118
121
|
go: {
|
|
119
122
|
method: 'client.User.Security.Update',
|
|
120
123
|
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/user"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tuserSecurity, err := client.User.Security.Update(context.TODO(), user.SecurityUpdateParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", userSecurity.SourceIPRule)\n}\n',
|
|
@@ -123,9 +126,6 @@ const EMBEDDED_METHODS = [
|
|
|
123
126
|
method: 'security update',
|
|
124
127
|
example: "nirvana user:security update \\\n --api-key 'My API Key'",
|
|
125
128
|
},
|
|
126
|
-
http: {
|
|
127
|
-
example: "curl https://api.nirvanalabs.io/v1/user/security \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $NIRVANA_LABS_API_KEY\" \\\n -d '{}'",
|
|
128
|
-
},
|
|
129
129
|
},
|
|
130
130
|
},
|
|
131
131
|
{
|
|
@@ -152,6 +152,9 @@ const EMBEDDED_METHODS = [
|
|
|
152
152
|
method: 'client.apiKeys.create',
|
|
153
153
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst apiKey = await client.apiKeys.create({\n expires_at: '2025-12-31T23:59:59Z',\n name: 'My API Key',\n permissions: [{ permission: 'edit', resource_type: 'vm' }],\n project_ids: ['123e4567-e89b-12d3-a456-426614174000', '123e4567-e89b-12d3-a456-426614174001'],\n});\n\nconsole.log(apiKey.id);",
|
|
154
154
|
},
|
|
155
|
+
http: {
|
|
156
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "expires_at": "2025-12-31T23:59:59Z",\n "name": "My API Key",\n "permissions": [\n {\n "permission": "edit",\n "resource_type": "vm"\n }\n ],\n "project_ids": [\n "123e4567-e89b-12d3-a456-426614174000",\n "123e4567-e89b-12d3-a456-426614174001"\n ],\n "starts_at": "2025-01-01T00:00:00Z",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
157
|
+
},
|
|
155
158
|
go: {
|
|
156
159
|
method: 'client.APIKeys.New',
|
|
157
160
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/api_keys"\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\tapiKey, err := client.APIKeys.New(context.TODO(), api_keys.APIKeyNewParams{\n\t\tExpiresAt: time.Now(),\n\t\tName: "My API Key",\n\t\tPermissions: []api_keys.APIKeyNewParamsPermission{{\n\t\t\tPermission: api_keys.APIPermissionLevelEdit,\n\t\t\tResourceType: api_keys.APIPermissionResourceTypeVM,\n\t\t}},\n\t\tProjectIDs: []string{"123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiKey.ID)\n}\n',
|
|
@@ -160,9 +163,6 @@ const EMBEDDED_METHODS = [
|
|
|
160
163
|
method: 'api_keys create',
|
|
161
164
|
example: "nirvana api-keys create \\\n --api-key 'My API Key' \\\n --expires-at \"'2025-12-31T23:59:59Z'\" \\\n --name 'My API Key' \\\n --permission '{permission: edit, resource_type: vm}' \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --project-id 123e4567-e89b-12d3-a456-426614174001",
|
|
162
165
|
},
|
|
163
|
-
http: {
|
|
164
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "expires_at": "2025-12-31T23:59:59Z",\n "name": "My API Key",\n "permissions": [\n {\n "permission": "edit",\n "resource_type": "vm"\n }\n ],\n "project_ids": [\n "123e4567-e89b-12d3-a456-426614174000",\n "123e4567-e89b-12d3-a456-426614174001"\n ],\n "starts_at": "2025-01-01T00:00:00Z",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
165
|
-
},
|
|
166
166
|
},
|
|
167
167
|
},
|
|
168
168
|
{
|
|
@@ -181,6 +181,9 @@ const EMBEDDED_METHODS = [
|
|
|
181
181
|
method: 'client.apiKeys.get',
|
|
182
182
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst apiKey = await client.apiKeys.get('api_key_id');\n\nconsole.log(apiKey.id);",
|
|
183
183
|
},
|
|
184
|
+
http: {
|
|
185
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
186
|
+
},
|
|
184
187
|
go: {
|
|
185
188
|
method: 'client.APIKeys.Get',
|
|
186
189
|
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\tapiKey, err := client.APIKeys.Get(context.TODO(), "api_key_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiKey.ID)\n}\n',
|
|
@@ -189,9 +192,6 @@ const EMBEDDED_METHODS = [
|
|
|
189
192
|
method: 'api_keys get',
|
|
190
193
|
example: "nirvana api-keys get \\\n --api-key 'My API Key' \\\n --api-key-id api_key_id",
|
|
191
194
|
},
|
|
192
|
-
http: {
|
|
193
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
194
|
-
},
|
|
195
195
|
},
|
|
196
196
|
},
|
|
197
197
|
{
|
|
@@ -217,6 +217,9 @@ const EMBEDDED_METHODS = [
|
|
|
217
217
|
method: 'client.apiKeys.update',
|
|
218
218
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst apiKey = await client.apiKeys.update('api_key_id');\n\nconsole.log(apiKey.id);",
|
|
219
219
|
},
|
|
220
|
+
http: {
|
|
221
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Updated API Key",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
222
|
+
},
|
|
220
223
|
go: {
|
|
221
224
|
method: 'client.APIKeys.Update',
|
|
222
225
|
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/api_keys"\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\tapiKey, err := client.APIKeys.Update(\n\t\tcontext.TODO(),\n\t\t"api_key_id",\n\t\tapi_keys.APIKeyUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiKey.ID)\n}\n',
|
|
@@ -225,9 +228,6 @@ const EMBEDDED_METHODS = [
|
|
|
225
228
|
method: 'api_keys update',
|
|
226
229
|
example: "nirvana api-keys update \\\n --api-key 'My API Key' \\\n --api-key-id api_key_id",
|
|
227
230
|
},
|
|
228
|
-
http: {
|
|
229
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Updated API Key",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
230
|
-
},
|
|
231
231
|
},
|
|
232
232
|
},
|
|
233
233
|
{
|
|
@@ -245,6 +245,9 @@ const EMBEDDED_METHODS = [
|
|
|
245
245
|
method: 'client.apiKeys.delete',
|
|
246
246
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.apiKeys.delete('api_key_id');",
|
|
247
247
|
},
|
|
248
|
+
http: {
|
|
249
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
250
|
+
},
|
|
248
251
|
go: {
|
|
249
252
|
method: 'client.APIKeys.Delete',
|
|
250
253
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.APIKeys.Delete(context.TODO(), "api_key_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -253,9 +256,6 @@ const EMBEDDED_METHODS = [
|
|
|
253
256
|
method: 'api_keys delete',
|
|
254
257
|
example: "nirvana api-keys delete \\\n --api-key 'My API Key' \\\n --api-key-id api_key_id",
|
|
255
258
|
},
|
|
256
|
-
http: {
|
|
257
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
258
|
-
},
|
|
259
259
|
},
|
|
260
260
|
},
|
|
261
261
|
{
|
|
@@ -274,6 +274,9 @@ const EMBEDDED_METHODS = [
|
|
|
274
274
|
method: 'client.apiKeys.list',
|
|
275
275
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const apiKey of client.apiKeys.list()) {\n console.log(apiKey.id);\n}",
|
|
276
276
|
},
|
|
277
|
+
http: {
|
|
278
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
279
|
+
},
|
|
277
280
|
go: {
|
|
278
281
|
method: 'client.APIKeys.List',
|
|
279
282
|
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/api_keys"\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.APIKeys.List(context.TODO(), api_keys.APIKeyListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -282,9 +285,6 @@ const EMBEDDED_METHODS = [
|
|
|
282
285
|
method: 'api_keys list',
|
|
283
286
|
example: "nirvana api-keys list \\\n --api-key 'My API Key'",
|
|
284
287
|
},
|
|
285
|
-
http: {
|
|
286
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
287
|
-
},
|
|
288
288
|
},
|
|
289
289
|
},
|
|
290
290
|
{
|
|
@@ -303,6 +303,9 @@ const EMBEDDED_METHODS = [
|
|
|
303
303
|
method: 'client.operations.get',
|
|
304
304
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.operations.get('operation_id');\n\nconsole.log(operation.id);",
|
|
305
305
|
},
|
|
306
|
+
http: {
|
|
307
|
+
example: 'curl https://api.nirvanalabs.io/v1/operations/$OPERATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
308
|
+
},
|
|
306
309
|
go: {
|
|
307
310
|
method: 'client.Operations.Get',
|
|
308
311
|
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\toperation, err := client.Operations.Get(context.TODO(), "operation_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -311,9 +314,6 @@ const EMBEDDED_METHODS = [
|
|
|
311
314
|
method: 'operations get',
|
|
312
315
|
example: "nirvana operations get \\\n --api-key 'My API Key' \\\n --operation-id operation_id",
|
|
313
316
|
},
|
|
314
|
-
http: {
|
|
315
|
-
example: 'curl https://api.nirvanalabs.io/v1/operations/$OPERATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
316
|
-
},
|
|
317
317
|
},
|
|
318
318
|
},
|
|
319
319
|
{
|
|
@@ -332,6 +332,9 @@ const EMBEDDED_METHODS = [
|
|
|
332
332
|
method: 'client.operations.list',
|
|
333
333
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const operation of client.operations.list({ project_id: 'project_id' })) {\n console.log(operation.id);\n}",
|
|
334
334
|
},
|
|
335
|
+
http: {
|
|
336
|
+
example: 'curl https://api.nirvanalabs.io/v1/operations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
337
|
+
},
|
|
335
338
|
go: {
|
|
336
339
|
method: 'client.Operations.List',
|
|
337
340
|
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/operations"\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.Operations.List(context.TODO(), operations.OperationListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -340,9 +343,6 @@ const EMBEDDED_METHODS = [
|
|
|
340
343
|
method: 'operations list',
|
|
341
344
|
example: "nirvana operations list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
342
345
|
},
|
|
343
|
-
http: {
|
|
344
|
-
example: 'curl https://api.nirvanalabs.io/v1/operations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
345
|
-
},
|
|
346
346
|
},
|
|
347
347
|
},
|
|
348
348
|
{
|
|
@@ -361,6 +361,9 @@ const EMBEDDED_METHODS = [
|
|
|
361
361
|
method: 'client.organizations.create',
|
|
362
362
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organization = await client.organizations.create({ name: 'My Organization' });\n\nconsole.log(organization.id);",
|
|
363
363
|
},
|
|
364
|
+
http: {
|
|
365
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Organization",\n "billing_email": "billing@example.com"\n }\'',
|
|
366
|
+
},
|
|
364
367
|
go: {
|
|
365
368
|
method: 'client.Organizations.New',
|
|
366
369
|
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\torganization, err := client.Organizations.New(context.TODO(), organizations.OrganizationNewParams{\n\t\tName: "My Organization",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organization.ID)\n}\n',
|
|
@@ -369,9 +372,6 @@ const EMBEDDED_METHODS = [
|
|
|
369
372
|
method: 'organizations create',
|
|
370
373
|
example: "nirvana organizations create \\\n --api-key 'My API Key' \\\n --name 'My Organization'",
|
|
371
374
|
},
|
|
372
|
-
http: {
|
|
373
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Organization",\n "billing_email": "billing@example.com"\n }\'',
|
|
374
|
-
},
|
|
375
375
|
},
|
|
376
376
|
},
|
|
377
377
|
{
|
|
@@ -390,6 +390,9 @@ const EMBEDDED_METHODS = [
|
|
|
390
390
|
method: 'client.organizations.get',
|
|
391
391
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organization = await client.organizations.get('organization_id');\n\nconsole.log(organization.id);",
|
|
392
392
|
},
|
|
393
|
+
http: {
|
|
394
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
395
|
+
},
|
|
393
396
|
go: {
|
|
394
397
|
method: 'client.Organizations.Get',
|
|
395
398
|
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\torganization, err := client.Organizations.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organization.ID)\n}\n',
|
|
@@ -398,9 +401,6 @@ const EMBEDDED_METHODS = [
|
|
|
398
401
|
method: 'organizations get',
|
|
399
402
|
example: "nirvana organizations get \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
400
403
|
},
|
|
401
|
-
http: {
|
|
402
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
403
|
-
},
|
|
404
404
|
},
|
|
405
405
|
},
|
|
406
406
|
{
|
|
@@ -419,6 +419,9 @@ const EMBEDDED_METHODS = [
|
|
|
419
419
|
method: 'client.organizations.update',
|
|
420
420
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organization = await client.organizations.update('organization_id');\n\nconsole.log(organization.id);",
|
|
421
421
|
},
|
|
422
|
+
http: {
|
|
423
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "billing_email": "billing@example.com",\n "name": "My Updated Organization"\n }\'',
|
|
424
|
+
},
|
|
422
425
|
go: {
|
|
423
426
|
method: 'client.Organizations.Update',
|
|
424
427
|
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\torganization, err := client.Organizations.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.OrganizationUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organization.ID)\n}\n',
|
|
@@ -427,9 +430,6 @@ const EMBEDDED_METHODS = [
|
|
|
427
430
|
method: 'organizations update',
|
|
428
431
|
example: "nirvana organizations update \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
429
432
|
},
|
|
430
|
-
http: {
|
|
431
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "billing_email": "billing@example.com",\n "name": "My Updated Organization"\n }\'',
|
|
432
|
-
},
|
|
433
433
|
},
|
|
434
434
|
},
|
|
435
435
|
{
|
|
@@ -448,6 +448,9 @@ const EMBEDDED_METHODS = [
|
|
|
448
448
|
method: 'client.organizations.list',
|
|
449
449
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const organization of client.organizations.list()) {\n console.log(organization.id);\n}",
|
|
450
450
|
},
|
|
451
|
+
http: {
|
|
452
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
453
|
+
},
|
|
451
454
|
go: {
|
|
452
455
|
method: 'client.Organizations.List',
|
|
453
456
|
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\tpage, err := client.Organizations.List(context.TODO(), organizations.OrganizationListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -456,9 +459,6 @@ const EMBEDDED_METHODS = [
|
|
|
456
459
|
method: 'organizations list',
|
|
457
460
|
example: "nirvana organizations list \\\n --api-key 'My API Key'",
|
|
458
461
|
},
|
|
459
|
-
http: {
|
|
460
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
461
|
-
},
|
|
462
462
|
},
|
|
463
463
|
},
|
|
464
464
|
{
|
|
@@ -476,6 +476,9 @@ const EMBEDDED_METHODS = [
|
|
|
476
476
|
method: 'client.organizations.leave',
|
|
477
477
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.organizations.leave('organization_id');",
|
|
478
478
|
},
|
|
479
|
+
http: {
|
|
480
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/leave \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
481
|
+
},
|
|
479
482
|
go: {
|
|
480
483
|
method: 'client.Organizations.Leave',
|
|
481
484
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Organizations.Leave(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -484,9 +487,6 @@ const EMBEDDED_METHODS = [
|
|
|
484
487
|
method: 'organizations leave',
|
|
485
488
|
example: "nirvana organizations leave \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
486
489
|
},
|
|
487
|
-
http: {
|
|
488
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/leave \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
489
|
-
},
|
|
490
490
|
},
|
|
491
491
|
},
|
|
492
492
|
{
|
|
@@ -505,6 +505,9 @@ const EMBEDDED_METHODS = [
|
|
|
505
505
|
method: 'client.organizations.memberships.get',
|
|
506
506
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organizationMembership = await client.organizations.memberships.get('membership_id', {\n organization_id: 'organization_id',\n});\n\nconsole.log(organizationMembership.id);",
|
|
507
507
|
},
|
|
508
|
+
http: {
|
|
509
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships/$MEMBERSHIP_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
510
|
+
},
|
|
508
511
|
go: {
|
|
509
512
|
method: 'client.Organizations.Memberships.Get',
|
|
510
513
|
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\torganizationMembership, err := client.Organizations.Memberships.Get(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\t"membership_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationMembership.ID)\n}\n',
|
|
@@ -513,9 +516,6 @@ const EMBEDDED_METHODS = [
|
|
|
513
516
|
method: 'memberships get',
|
|
514
517
|
example: "nirvana organizations:memberships get \\\n --api-key 'My API Key' \\\n --organization-id organization_id \\\n --membership-id membership_id",
|
|
515
518
|
},
|
|
516
|
-
http: {
|
|
517
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships/$MEMBERSHIP_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
518
|
-
},
|
|
519
519
|
},
|
|
520
520
|
},
|
|
521
521
|
{
|
|
@@ -534,6 +534,9 @@ const EMBEDDED_METHODS = [
|
|
|
534
534
|
method: 'client.organizations.memberships.list',
|
|
535
535
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const organizationMembership of client.organizations.memberships.list(\n 'organization_id',\n)) {\n console.log(organizationMembership.id);\n}",
|
|
536
536
|
},
|
|
537
|
+
http: {
|
|
538
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
539
|
+
},
|
|
537
540
|
go: {
|
|
538
541
|
method: 'client.Organizations.Memberships.List',
|
|
539
542
|
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\tpage, err := client.Organizations.Memberships.List(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.MembershipListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -542,8 +545,112 @@ const EMBEDDED_METHODS = [
|
|
|
542
545
|
method: 'memberships list',
|
|
543
546
|
example: "nirvana organizations:memberships list \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
544
547
|
},
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: 'create',
|
|
552
|
+
endpoint: '/v1/organizations/{organization_id}/address',
|
|
553
|
+
httpMethod: 'post',
|
|
554
|
+
summary: 'Create Organization Address',
|
|
555
|
+
description: 'Create the address for an organization',
|
|
556
|
+
stainlessPath: '(resource) organizations.address > (method) create',
|
|
557
|
+
qualified: 'client.organizations.address.create',
|
|
558
|
+
params: [
|
|
559
|
+
'organization_id: string;',
|
|
560
|
+
'city: string;',
|
|
561
|
+
'country: string;',
|
|
562
|
+
'line1: string;',
|
|
563
|
+
'postal_code: string;',
|
|
564
|
+
'line2?: string;',
|
|
565
|
+
'state?: string;',
|
|
566
|
+
'tax_id?: string;',
|
|
567
|
+
'tax_id_type?: string;',
|
|
568
|
+
],
|
|
569
|
+
response: '{ id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }',
|
|
570
|
+
markdown: "## create\n\n`client.organizations.address.create(organization_id: string, city: string, country: string, line1: string, postal_code: string, line2?: string, state?: string, tax_id?: string, tax_id_type?: string): { id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }`\n\n**post** `/v1/organizations/{organization_id}/address`\n\nCreate the address for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n- `city: string`\n City or locality.\n\n- `country: string`\n Two-letter ISO 3166-1 alpha-2 country code.\n\n- `line1: string`\n First line of the street address.\n\n- `postal_code: string`\n Postal or ZIP code.\n\n- `line2?: string`\n Second line of the street address (suite, unit, building).\n\n- `state?: string`\n State, province, or region. Required by some tax jurisdictions (e.g. US, CA).\n\n- `tax_id?: string`\n Tax identification number (e.g. VAT, EIN, ABN). Optional.\n\n- `tax_id_type?: string`\n Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn). Optional.\n\n### Returns\n\n- `{ id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }`\n Organization address details.\n\n - `id: string`\n - `city: string`\n - `country: string`\n - `created_at: string`\n - `line1: string`\n - `line2: string`\n - `organization_id: string`\n - `postal_code: string`\n - `state: string`\n - `tax_id: string`\n - `tax_id_type: string`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst organizationAddress = await client.organizations.address.create('organization_id', {\n city: 'San Francisco',\n country: 'US',\n line1: '123 Main St',\n postal_code: '94105',\n});\n\nconsole.log(organizationAddress);\n```",
|
|
571
|
+
perLanguage: {
|
|
572
|
+
typescript: {
|
|
573
|
+
method: 'client.organizations.address.create',
|
|
574
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organizationAddress = await client.organizations.address.create('organization_id', {\n city: 'San Francisco',\n country: 'US',\n line1: '123 Main St',\n postal_code: '94105',\n});\n\nconsole.log(organizationAddress.id);",
|
|
575
|
+
},
|
|
545
576
|
http: {
|
|
546
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/
|
|
577
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/address \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "city": "San Francisco",\n "country": "US",\n "line1": "123 Main St",\n "postal_code": "94105",\n "line2": "Suite 400",\n "state": "CA",\n "tax_id": "EU372000000",\n "tax_id_type": "eu_vat"\n }\'',
|
|
578
|
+
},
|
|
579
|
+
go: {
|
|
580
|
+
method: 'client.Organizations.Address.New',
|
|
581
|
+
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\torganizationAddress, err := client.Organizations.Address.New(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.AddressNewParams{\n\t\t\tCity: "San Francisco",\n\t\t\tCountry: "US",\n\t\t\tLine1: "123 Main St",\n\t\t\tPostalCode: "94105",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationAddress.ID)\n}\n',
|
|
582
|
+
},
|
|
583
|
+
cli: {
|
|
584
|
+
method: 'address create',
|
|
585
|
+
example: "nirvana organizations:address create \\\n --api-key 'My API Key' \\\n --organization-id organization_id \\\n --city 'San Francisco' \\\n --country US \\\n --line1 '123 Main St' \\\n --postal-code 94105",
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: 'get',
|
|
591
|
+
endpoint: '/v1/organizations/{organization_id}/address',
|
|
592
|
+
httpMethod: 'get',
|
|
593
|
+
summary: 'Get Organization Address',
|
|
594
|
+
description: 'Get the address for an organization',
|
|
595
|
+
stainlessPath: '(resource) organizations.address > (method) get',
|
|
596
|
+
qualified: 'client.organizations.address.get',
|
|
597
|
+
params: ['organization_id: string;'],
|
|
598
|
+
response: '{ id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }',
|
|
599
|
+
markdown: "## get\n\n`client.organizations.address.get(organization_id: string): { id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }`\n\n**get** `/v1/organizations/{organization_id}/address`\n\nGet the address for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n### Returns\n\n- `{ id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }`\n Organization address details.\n\n - `id: string`\n - `city: string`\n - `country: string`\n - `created_at: string`\n - `line1: string`\n - `line2: string`\n - `organization_id: string`\n - `postal_code: string`\n - `state: string`\n - `tax_id: string`\n - `tax_id_type: string`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst organizationAddress = await client.organizations.address.get('organization_id');\n\nconsole.log(organizationAddress);\n```",
|
|
600
|
+
perLanguage: {
|
|
601
|
+
typescript: {
|
|
602
|
+
method: 'client.organizations.address.get',
|
|
603
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organizationAddress = await client.organizations.address.get('organization_id');\n\nconsole.log(organizationAddress.id);",
|
|
604
|
+
},
|
|
605
|
+
http: {
|
|
606
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/address \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
607
|
+
},
|
|
608
|
+
go: {
|
|
609
|
+
method: 'client.Organizations.Address.Get',
|
|
610
|
+
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\torganizationAddress, err := client.Organizations.Address.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationAddress.ID)\n}\n',
|
|
611
|
+
},
|
|
612
|
+
cli: {
|
|
613
|
+
method: 'address get',
|
|
614
|
+
example: "nirvana organizations:address get \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
615
|
+
},
|
|
616
|
+
},
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
name: 'update',
|
|
620
|
+
endpoint: '/v1/organizations/{organization_id}/address',
|
|
621
|
+
httpMethod: 'patch',
|
|
622
|
+
summary: 'Update Organization Address',
|
|
623
|
+
description: 'Update the address for an organization',
|
|
624
|
+
stainlessPath: '(resource) organizations.address > (method) update',
|
|
625
|
+
qualified: 'client.organizations.address.update',
|
|
626
|
+
params: [
|
|
627
|
+
'organization_id: string;',
|
|
628
|
+
'city?: string;',
|
|
629
|
+
'country?: string;',
|
|
630
|
+
'line1?: string;',
|
|
631
|
+
'line2?: string;',
|
|
632
|
+
'postal_code?: string;',
|
|
633
|
+
'state?: string;',
|
|
634
|
+
'tax_id?: string;',
|
|
635
|
+
'tax_id_type?: string;',
|
|
636
|
+
],
|
|
637
|
+
response: '{ id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }',
|
|
638
|
+
markdown: "## update\n\n`client.organizations.address.update(organization_id: string, city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, tax_id?: string, tax_id_type?: string): { id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }`\n\n**patch** `/v1/organizations/{organization_id}/address`\n\nUpdate the address for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n- `city?: string`\n City or locality.\n\n- `country?: string`\n Two-letter ISO 3166-1 alpha-2 country code.\n\n- `line1?: string`\n First line of the street address.\n\n- `line2?: string`\n Second line of the street address (suite, unit, building). Omit to leave\nunchanged, send null to clear, or send a value to set it.\n\n- `postal_code?: string`\n Postal or ZIP code.\n\n- `state?: string`\n State, province, or region. Omit to leave unchanged, send null to clear,\nor send a value to set it.\n\n- `tax_id?: string`\n Tax identification number (e.g. VAT, EIN, ABN). Omit to leave unchanged,\nsend null to clear, or send a value to set it.\n\n- `tax_id_type?: string`\n Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn).\nOmit to leave unchanged, send null to clear, or send a value to set it.\n\n### Returns\n\n- `{ id: string; city: string; country: string; created_at: string; line1: string; line2: string; organization_id: string; postal_code: string; state: string; tax_id: string; tax_id_type: string; updated_at: string; }`\n Organization address details.\n\n - `id: string`\n - `city: string`\n - `country: string`\n - `created_at: string`\n - `line1: string`\n - `line2: string`\n - `organization_id: string`\n - `postal_code: string`\n - `state: string`\n - `tax_id: string`\n - `tax_id_type: string`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst organizationAddress = await client.organizations.address.update('organization_id');\n\nconsole.log(organizationAddress);\n```",
|
|
639
|
+
perLanguage: {
|
|
640
|
+
typescript: {
|
|
641
|
+
method: 'client.organizations.address.update',
|
|
642
|
+
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst organizationAddress = await client.organizations.address.update('organization_id');\n\nconsole.log(organizationAddress.id);",
|
|
643
|
+
},
|
|
644
|
+
http: {
|
|
645
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/address \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "city": "San Francisco",\n "country": "US",\n "line1": "123 Main St",\n "line2": "Suite 400",\n "postal_code": "94105",\n "state": "CA",\n "tax_id": "EU372000000",\n "tax_id_type": "eu_vat"\n }\'',
|
|
646
|
+
},
|
|
647
|
+
go: {
|
|
648
|
+
method: 'client.Organizations.Address.Update',
|
|
649
|
+
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\torganizationAddress, err := client.Organizations.Address.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.AddressUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationAddress.ID)\n}\n',
|
|
650
|
+
},
|
|
651
|
+
cli: {
|
|
652
|
+
method: 'address update',
|
|
653
|
+
example: "nirvana organizations:address update \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
547
654
|
},
|
|
548
655
|
},
|
|
549
656
|
},
|
|
@@ -563,6 +670,9 @@ const EMBEDDED_METHODS = [
|
|
|
563
670
|
method: 'client.quotas.get',
|
|
564
671
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst quota = await client.quotas.get('us-sva-2');\n\nconsole.log(quota.compute);",
|
|
565
672
|
},
|
|
673
|
+
http: {
|
|
674
|
+
example: 'curl https://api.nirvanalabs.io/v1/quotas/$REGION \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
675
|
+
},
|
|
566
676
|
go: {
|
|
567
677
|
method: 'client.Quotas.Get',
|
|
568
678
|
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/quotas"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tquota, err := client.Quotas.Get(context.TODO(), quotas.QuotaGetParamsRegionUsSva2)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quota.Compute)\n}\n',
|
|
@@ -571,9 +681,6 @@ const EMBEDDED_METHODS = [
|
|
|
571
681
|
method: 'quotas get',
|
|
572
682
|
example: "nirvana quotas get \\\n --api-key 'My API Key' \\\n --region us-sva-2",
|
|
573
683
|
},
|
|
574
|
-
http: {
|
|
575
|
-
example: 'curl https://api.nirvanalabs.io/v1/quotas/$REGION \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
576
|
-
},
|
|
577
684
|
},
|
|
578
685
|
},
|
|
579
686
|
{
|
|
@@ -591,6 +698,9 @@ const EMBEDDED_METHODS = [
|
|
|
591
698
|
method: 'client.quotas.list',
|
|
592
699
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst quotaList = await client.quotas.list();\n\nconsole.log(quotaList.items);",
|
|
593
700
|
},
|
|
701
|
+
http: {
|
|
702
|
+
example: 'curl https://api.nirvanalabs.io/v1/quotas \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
703
|
+
},
|
|
594
704
|
go: {
|
|
595
705
|
method: 'client.Quotas.List',
|
|
596
706
|
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\tquotaList, err := client.Quotas.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quotaList.Items)\n}\n',
|
|
@@ -599,9 +709,6 @@ const EMBEDDED_METHODS = [
|
|
|
599
709
|
method: 'quotas list',
|
|
600
710
|
example: "nirvana quotas list \\\n --api-key 'My API Key'",
|
|
601
711
|
},
|
|
602
|
-
http: {
|
|
603
|
-
example: 'curl https://api.nirvanalabs.io/v1/quotas \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
604
|
-
},
|
|
605
712
|
},
|
|
606
713
|
},
|
|
607
714
|
{
|
|
@@ -620,6 +727,9 @@ const EMBEDDED_METHODS = [
|
|
|
620
727
|
method: 'client.usage.get',
|
|
621
728
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst usage = await client.usage.get('123e4567-e89b-12d3-a456-426614174000');\n\nconsole.log(usage.project_id);",
|
|
622
729
|
},
|
|
730
|
+
http: {
|
|
731
|
+
example: 'curl https://api.nirvanalabs.io/v1/usage/$RESOURCE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
732
|
+
},
|
|
623
733
|
go: {
|
|
624
734
|
method: 'client.Usage.Get',
|
|
625
735
|
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\tusage, err := client.Usage.Get(context.TODO(), "123e4567-e89b-12d3-a456-426614174000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", usage.ProjectID)\n}\n',
|
|
@@ -628,9 +738,6 @@ const EMBEDDED_METHODS = [
|
|
|
628
738
|
method: 'usage get',
|
|
629
739
|
example: "nirvana usage get \\\n --api-key 'My API Key' \\\n --resource-id 123e4567-e89b-12d3-a456-426614174000",
|
|
630
740
|
},
|
|
631
|
-
http: {
|
|
632
|
-
example: 'curl https://api.nirvanalabs.io/v1/usage/$RESOURCE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
633
|
-
},
|
|
634
741
|
},
|
|
635
742
|
},
|
|
636
743
|
{
|
|
@@ -649,6 +756,9 @@ const EMBEDDED_METHODS = [
|
|
|
649
756
|
method: 'client.usage.list',
|
|
650
757
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const usage of client.usage.list()) {\n console.log(usage.project_id);\n}",
|
|
651
758
|
},
|
|
759
|
+
http: {
|
|
760
|
+
example: 'curl https://api.nirvanalabs.io/v1/usage \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
761
|
+
},
|
|
652
762
|
go: {
|
|
653
763
|
method: 'client.Usage.List',
|
|
654
764
|
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/usage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Usage.List(context.TODO(), usage.UsageListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -657,9 +767,6 @@ const EMBEDDED_METHODS = [
|
|
|
657
767
|
method: 'usage list',
|
|
658
768
|
example: "nirvana usage list \\\n --api-key 'My API Key'",
|
|
659
769
|
},
|
|
660
|
-
http: {
|
|
661
|
-
example: 'curl https://api.nirvanalabs.io/v1/usage \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
662
|
-
},
|
|
663
770
|
},
|
|
664
771
|
},
|
|
665
772
|
{
|
|
@@ -678,6 +785,9 @@ const EMBEDDED_METHODS = [
|
|
|
678
785
|
method: 'client.auditLogs.get',
|
|
679
786
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst auditLog = await client.auditLogs.get('audit_log_id');\n\nconsole.log(auditLog.id);",
|
|
680
787
|
},
|
|
788
|
+
http: {
|
|
789
|
+
example: 'curl https://api.nirvanalabs.io/v1/audit_logs/$AUDIT_LOG_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
790
|
+
},
|
|
681
791
|
go: {
|
|
682
792
|
method: 'client.AuditLogs.Get',
|
|
683
793
|
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\tauditLog, err := client.AuditLogs.Get(context.TODO(), "audit_log_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", auditLog.ID)\n}\n',
|
|
@@ -686,9 +796,6 @@ const EMBEDDED_METHODS = [
|
|
|
686
796
|
method: 'audit_logs get',
|
|
687
797
|
example: "nirvana audit-logs get \\\n --api-key 'My API Key' \\\n --audit-log-id audit_log_id",
|
|
688
798
|
},
|
|
689
|
-
http: {
|
|
690
|
-
example: 'curl https://api.nirvanalabs.io/v1/audit_logs/$AUDIT_LOG_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
691
|
-
},
|
|
692
799
|
},
|
|
693
800
|
},
|
|
694
801
|
{
|
|
@@ -707,6 +814,9 @@ const EMBEDDED_METHODS = [
|
|
|
707
814
|
method: 'client.auditLogs.list',
|
|
708
815
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const auditLog of client.auditLogs.list()) {\n console.log(auditLog.id);\n}",
|
|
709
816
|
},
|
|
817
|
+
http: {
|
|
818
|
+
example: 'curl https://api.nirvanalabs.io/v1/audit_logs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
819
|
+
},
|
|
710
820
|
go: {
|
|
711
821
|
method: 'client.AuditLogs.List',
|
|
712
822
|
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/audit_logs"\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.AuditLogs.List(context.TODO(), audit_logs.AuditLogListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -715,9 +825,6 @@ const EMBEDDED_METHODS = [
|
|
|
715
825
|
method: 'audit_logs list',
|
|
716
826
|
example: "nirvana audit-logs list \\\n --api-key 'My API Key'",
|
|
717
827
|
},
|
|
718
|
-
http: {
|
|
719
|
-
example: 'curl https://api.nirvanalabs.io/v1/audit_logs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
720
|
-
},
|
|
721
828
|
},
|
|
722
829
|
},
|
|
723
830
|
{
|
|
@@ -736,6 +843,9 @@ const EMBEDDED_METHODS = [
|
|
|
736
843
|
method: 'client.projects.create',
|
|
737
844
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst project = await client.projects.create({ name: 'My Project' });\n\nconsole.log(project.id);",
|
|
738
845
|
},
|
|
846
|
+
http: {
|
|
847
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Project",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
848
|
+
},
|
|
739
849
|
go: {
|
|
740
850
|
method: 'client.Projects.New',
|
|
741
851
|
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/projects"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tproject, err := client.Projects.New(context.TODO(), projects.ProjectNewParams{\n\t\tName: "My Project",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", project.ID)\n}\n',
|
|
@@ -744,9 +854,6 @@ const EMBEDDED_METHODS = [
|
|
|
744
854
|
method: 'projects create',
|
|
745
855
|
example: "nirvana projects create \\\n --api-key 'My API Key' \\\n --name 'My Project'",
|
|
746
856
|
},
|
|
747
|
-
http: {
|
|
748
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Project",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
749
|
-
},
|
|
750
857
|
},
|
|
751
858
|
},
|
|
752
859
|
{
|
|
@@ -765,6 +872,9 @@ const EMBEDDED_METHODS = [
|
|
|
765
872
|
method: 'client.projects.get',
|
|
766
873
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst project = await client.projects.get('project_id');\n\nconsole.log(project.id);",
|
|
767
874
|
},
|
|
875
|
+
http: {
|
|
876
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
877
|
+
},
|
|
768
878
|
go: {
|
|
769
879
|
method: 'client.Projects.Get',
|
|
770
880
|
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\tproject, err := client.Projects.Get(context.TODO(), "project_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", project.ID)\n}\n',
|
|
@@ -773,9 +883,6 @@ const EMBEDDED_METHODS = [
|
|
|
773
883
|
method: 'projects get',
|
|
774
884
|
example: "nirvana projects get \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
775
885
|
},
|
|
776
|
-
http: {
|
|
777
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
778
|
-
},
|
|
779
886
|
},
|
|
780
887
|
},
|
|
781
888
|
{
|
|
@@ -794,6 +901,9 @@ const EMBEDDED_METHODS = [
|
|
|
794
901
|
method: 'client.projects.update',
|
|
795
902
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst project = await client.projects.update('project_id');\n\nconsole.log(project.id);",
|
|
796
903
|
},
|
|
904
|
+
http: {
|
|
905
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Updated Project",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
906
|
+
},
|
|
797
907
|
go: {
|
|
798
908
|
method: 'client.Projects.Update',
|
|
799
909
|
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/projects"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tproject, err := client.Projects.Update(\n\t\tcontext.TODO(),\n\t\t"project_id",\n\t\tprojects.ProjectUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", project.ID)\n}\n',
|
|
@@ -802,9 +912,6 @@ const EMBEDDED_METHODS = [
|
|
|
802
912
|
method: 'projects update',
|
|
803
913
|
example: "nirvana projects update \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
804
914
|
},
|
|
805
|
-
http: {
|
|
806
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "My Updated Project",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
807
|
-
},
|
|
808
915
|
},
|
|
809
916
|
},
|
|
810
917
|
{
|
|
@@ -822,6 +929,9 @@ const EMBEDDED_METHODS = [
|
|
|
822
929
|
method: 'client.projects.delete',
|
|
823
930
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.projects.delete('project_id');",
|
|
824
931
|
},
|
|
932
|
+
http: {
|
|
933
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
934
|
+
},
|
|
825
935
|
go: {
|
|
826
936
|
method: 'client.Projects.Delete',
|
|
827
937
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Projects.Delete(context.TODO(), "project_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -830,9 +940,6 @@ const EMBEDDED_METHODS = [
|
|
|
830
940
|
method: 'projects delete',
|
|
831
941
|
example: "nirvana projects delete \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
832
942
|
},
|
|
833
|
-
http: {
|
|
834
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
835
|
-
},
|
|
836
943
|
},
|
|
837
944
|
},
|
|
838
945
|
{
|
|
@@ -851,6 +958,9 @@ const EMBEDDED_METHODS = [
|
|
|
851
958
|
method: 'client.projects.list',
|
|
852
959
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const project of client.projects.list()) {\n console.log(project.id);\n}",
|
|
853
960
|
},
|
|
961
|
+
http: {
|
|
962
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
963
|
+
},
|
|
854
964
|
go: {
|
|
855
965
|
method: 'client.Projects.List',
|
|
856
966
|
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/projects"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Projects.List(context.TODO(), projects.ProjectListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -859,9 +969,6 @@ const EMBEDDED_METHODS = [
|
|
|
859
969
|
method: 'projects list',
|
|
860
970
|
example: "nirvana projects list \\\n --api-key 'My API Key'",
|
|
861
971
|
},
|
|
862
|
-
http: {
|
|
863
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
864
|
-
},
|
|
865
972
|
},
|
|
866
973
|
},
|
|
867
974
|
{
|
|
@@ -880,6 +987,9 @@ const EMBEDDED_METHODS = [
|
|
|
880
987
|
method: 'client.regions.get',
|
|
881
988
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst region = await client.regions.get('us-sva-2');\n\nconsole.log(region.availability);",
|
|
882
989
|
},
|
|
990
|
+
http: {
|
|
991
|
+
example: 'curl https://api.nirvanalabs.io/v1/regions/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
992
|
+
},
|
|
883
993
|
go: {
|
|
884
994
|
method: 'client.Regions.Get',
|
|
885
995
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tregion, err := client.Regions.Get(context.TODO(), "us-sva-2")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", region.Availability)\n}\n',
|
|
@@ -888,9 +998,6 @@ const EMBEDDED_METHODS = [
|
|
|
888
998
|
method: 'regions get',
|
|
889
999
|
example: "nirvana regions get \\\n --api-key 'My API Key' \\\n --name us-sva-2",
|
|
890
1000
|
},
|
|
891
|
-
http: {
|
|
892
|
-
example: 'curl https://api.nirvanalabs.io/v1/regions/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
893
|
-
},
|
|
894
1001
|
},
|
|
895
1002
|
},
|
|
896
1003
|
{
|
|
@@ -909,6 +1016,9 @@ const EMBEDDED_METHODS = [
|
|
|
909
1016
|
method: 'client.regions.list',
|
|
910
1017
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const region of client.regions.list()) {\n console.log(region.availability);\n}",
|
|
911
1018
|
},
|
|
1019
|
+
http: {
|
|
1020
|
+
example: 'curl https://api.nirvanalabs.io/v1/regions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1021
|
+
},
|
|
912
1022
|
go: {
|
|
913
1023
|
method: 'client.Regions.List',
|
|
914
1024
|
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/regions"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Regions.List(context.TODO(), regions.RegionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -917,9 +1027,6 @@ const EMBEDDED_METHODS = [
|
|
|
917
1027
|
method: 'regions list',
|
|
918
1028
|
example: "nirvana regions list \\\n --api-key 'My API Key'",
|
|
919
1029
|
},
|
|
920
|
-
http: {
|
|
921
|
-
example: 'curl https://api.nirvanalabs.io/v1/regions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
922
|
-
},
|
|
923
1030
|
},
|
|
924
1031
|
},
|
|
925
1032
|
{
|
|
@@ -938,6 +1045,9 @@ const EMBEDDED_METHODS = [
|
|
|
938
1045
|
method: 'client.instanceTypes.get',
|
|
939
1046
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst instanceType = await client.instanceTypes.get('n1-standard-8', { region: 'us-sva-2' });\n\nconsole.log(instanceType.network_bandwidth_gbps);",
|
|
940
1047
|
},
|
|
1048
|
+
http: {
|
|
1049
|
+
example: 'curl https://api.nirvanalabs.io/v1/instance_types/$REGION/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1050
|
+
},
|
|
941
1051
|
go: {
|
|
942
1052
|
method: 'client.InstanceTypes.Get',
|
|
943
1053
|
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/instance_types"\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\tinstanceType, err := client.InstanceTypes.Get(\n\t\tcontext.TODO(),\n\t\tinstance_types.InstanceTypeGetParamsRegionUsSva2,\n\t\t"n1-standard-8",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", instanceType.NetworkBandwidthGbps)\n}\n',
|
|
@@ -946,9 +1056,6 @@ const EMBEDDED_METHODS = [
|
|
|
946
1056
|
method: 'instance_types get',
|
|
947
1057
|
example: "nirvana instance-types get \\\n --api-key 'My API Key' \\\n --region us-sva-2 \\\n --name n1-standard-8",
|
|
948
1058
|
},
|
|
949
|
-
http: {
|
|
950
|
-
example: 'curl https://api.nirvanalabs.io/v1/instance_types/$REGION/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
951
|
-
},
|
|
952
1059
|
},
|
|
953
1060
|
},
|
|
954
1061
|
{
|
|
@@ -967,6 +1074,9 @@ const EMBEDDED_METHODS = [
|
|
|
967
1074
|
method: 'client.instanceTypes.list',
|
|
968
1075
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const instanceType of client.instanceTypes.list()) {\n console.log(instanceType.network_bandwidth_gbps);\n}",
|
|
969
1076
|
},
|
|
1077
|
+
http: {
|
|
1078
|
+
example: 'curl https://api.nirvanalabs.io/v1/instance_types \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1079
|
+
},
|
|
970
1080
|
go: {
|
|
971
1081
|
method: 'client.InstanceTypes.List',
|
|
972
1082
|
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/instance_types"\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.InstanceTypes.List(context.TODO(), instance_types.InstanceTypeListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -975,9 +1085,6 @@ const EMBEDDED_METHODS = [
|
|
|
975
1085
|
method: 'instance_types list',
|
|
976
1086
|
example: "nirvana instance-types list \\\n --api-key 'My API Key'",
|
|
977
1087
|
},
|
|
978
|
-
http: {
|
|
979
|
-
example: 'curl https://api.nirvanalabs.io/v1/instance_types \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
980
|
-
},
|
|
981
1088
|
},
|
|
982
1089
|
},
|
|
983
1090
|
{
|
|
@@ -1008,6 +1115,9 @@ const EMBEDDED_METHODS = [
|
|
|
1008
1115
|
method: 'client.compute.vms.create',
|
|
1009
1116
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\n instance_type: 'n1-standard-8',\n name: 'my-vm',\n os_image_name: 'ubuntu-noble-2025-10-01',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n public_ip_enabled: true,\n region: 'us-sva-2',\n ssh_key: {\n public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);",
|
|
1010
1117
|
},
|
|
1118
|
+
http: {
|
|
1119
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-sva-2",\n "ssh_key": {\n "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n },\n "subnet_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1120
|
+
},
|
|
1011
1121
|
go: {
|
|
1012
1122
|
method: 'client.Compute.VMs.New',
|
|
1013
1123
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-8",\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',
|
|
@@ -1016,9 +1126,6 @@ const EMBEDDED_METHODS = [
|
|
|
1016
1126
|
method: 'vms create',
|
|
1017
1127
|
example: "nirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --instance-type n1-standard-8 \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000",
|
|
1018
1128
|
},
|
|
1019
|
-
http: {
|
|
1020
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-sva-2",\n "ssh_key": {\n "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n },\n "subnet_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1021
|
-
},
|
|
1022
1129
|
},
|
|
1023
1130
|
},
|
|
1024
1131
|
{
|
|
@@ -1037,6 +1144,9 @@ const EMBEDDED_METHODS = [
|
|
|
1037
1144
|
method: 'client.compute.vms.get',
|
|
1038
1145
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst vm = await client.compute.vms.get('vm_id');\n\nconsole.log(vm.id);",
|
|
1039
1146
|
},
|
|
1147
|
+
http: {
|
|
1148
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1149
|
+
},
|
|
1040
1150
|
go: {
|
|
1041
1151
|
method: 'client.Compute.VMs.Get',
|
|
1042
1152
|
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\tvm, err := client.Compute.VMs.Get(context.TODO(), "vm_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vm.ID)\n}\n',
|
|
@@ -1045,9 +1155,6 @@ const EMBEDDED_METHODS = [
|
|
|
1045
1155
|
method: 'vms get',
|
|
1046
1156
|
example: "nirvana compute:vms get \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1047
1157
|
},
|
|
1048
|
-
http: {
|
|
1049
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1050
|
-
},
|
|
1051
1158
|
},
|
|
1052
1159
|
},
|
|
1053
1160
|
{
|
|
@@ -1072,6 +1179,9 @@ const EMBEDDED_METHODS = [
|
|
|
1072
1179
|
method: 'client.compute.vms.update',
|
|
1073
1180
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.update('vm_id');\n\nconsole.log(operation.id);",
|
|
1074
1181
|
},
|
|
1182
|
+
http: {
|
|
1183
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "public_ip_enabled": true,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1184
|
+
},
|
|
1075
1185
|
go: {
|
|
1076
1186
|
method: 'client.Compute.VMs.Update',
|
|
1077
1187
|
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\toperation, err := client.Compute.VMs.Update(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1080,9 +1190,6 @@ const EMBEDDED_METHODS = [
|
|
|
1080
1190
|
method: 'vms update',
|
|
1081
1191
|
example: "nirvana compute:vms update \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1082
1192
|
},
|
|
1083
|
-
http: {
|
|
1084
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "public_ip_enabled": true,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1085
|
-
},
|
|
1086
1193
|
},
|
|
1087
1194
|
},
|
|
1088
1195
|
{
|
|
@@ -1101,6 +1208,9 @@ const EMBEDDED_METHODS = [
|
|
|
1101
1208
|
method: 'client.compute.vms.delete',
|
|
1102
1209
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.delete('vm_id');\n\nconsole.log(operation.id);",
|
|
1103
1210
|
},
|
|
1211
|
+
http: {
|
|
1212
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1213
|
+
},
|
|
1104
1214
|
go: {
|
|
1105
1215
|
method: 'client.Compute.VMs.Delete',
|
|
1106
1216
|
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\toperation, err := client.Compute.VMs.Delete(context.TODO(), "vm_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1109,9 +1219,6 @@ const EMBEDDED_METHODS = [
|
|
|
1109
1219
|
method: 'vms delete',
|
|
1110
1220
|
example: "nirvana compute:vms delete \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1111
1221
|
},
|
|
1112
|
-
http: {
|
|
1113
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1114
|
-
},
|
|
1115
1222
|
},
|
|
1116
1223
|
},
|
|
1117
1224
|
{
|
|
@@ -1130,6 +1237,9 @@ const EMBEDDED_METHODS = [
|
|
|
1130
1237
|
method: 'client.compute.vms.list',
|
|
1131
1238
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vm of client.compute.vms.list({ project_id: 'project_id' })) {\n console.log(vm.id);\n}",
|
|
1132
1239
|
},
|
|
1240
|
+
http: {
|
|
1241
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1242
|
+
},
|
|
1133
1243
|
go: {
|
|
1134
1244
|
method: 'client.Compute.VMs.List',
|
|
1135
1245
|
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\tpage, err := client.Compute.VMs.List(context.TODO(), compute.VMListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -1138,9 +1248,6 @@ const EMBEDDED_METHODS = [
|
|
|
1138
1248
|
method: 'vms list',
|
|
1139
1249
|
example: "nirvana compute:vms list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
1140
1250
|
},
|
|
1141
|
-
http: {
|
|
1142
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1143
|
-
},
|
|
1144
1251
|
},
|
|
1145
1252
|
},
|
|
1146
1253
|
{
|
|
@@ -1159,6 +1266,9 @@ const EMBEDDED_METHODS = [
|
|
|
1159
1266
|
method: 'client.compute.vms.restart',
|
|
1160
1267
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.restart('vm_id');\n\nconsole.log(operation.id);",
|
|
1161
1268
|
},
|
|
1269
|
+
http: {
|
|
1270
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/restart \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1271
|
+
},
|
|
1162
1272
|
go: {
|
|
1163
1273
|
method: 'client.Compute.VMs.Restart',
|
|
1164
1274
|
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\toperation, err := client.Compute.VMs.Restart(context.TODO(), "vm_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1167,9 +1277,6 @@ const EMBEDDED_METHODS = [
|
|
|
1167
1277
|
method: 'vms restart',
|
|
1168
1278
|
example: "nirvana compute:vms restart \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1169
1279
|
},
|
|
1170
|
-
http: {
|
|
1171
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/restart \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1172
|
-
},
|
|
1173
1280
|
},
|
|
1174
1281
|
},
|
|
1175
1282
|
{
|
|
@@ -1199,6 +1306,9 @@ const EMBEDDED_METHODS = [
|
|
|
1199
1306
|
method: 'client.compute.vms.availability.create',
|
|
1200
1307
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.vms.availability.create({\n boot_volume: { size: 100, type: 'abs' },\n instance_type: 'n1-standard-8',\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});",
|
|
1201
1308
|
},
|
|
1309
|
+
http: {
|
|
1310
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-sva-2",\n "ssh_key": {\n "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n },\n "subnet_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1311
|
+
},
|
|
1202
1312
|
go: {
|
|
1203
1313
|
method: 'client.Compute.VMs.Availability.New',
|
|
1204
1314
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.VMs.Availability.New(context.TODO(), compute.VMAvailabilityNewParams{\n\t\tBootVolume: compute.VMAvailabilityNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-8",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -1207,9 +1317,6 @@ const EMBEDDED_METHODS = [
|
|
|
1207
1317
|
method: 'availability create',
|
|
1208
1318
|
example: "nirvana compute:vms:availability create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --instance-type n1-standard-8 \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000",
|
|
1209
1319
|
},
|
|
1210
|
-
http: {
|
|
1211
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "os_image_name": "ubuntu-noble-2025-10-01",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "public_ip_enabled": true,\n "region": "us-sva-2",\n "ssh_key": {\n "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n },\n "subnet_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1212
|
-
},
|
|
1213
1320
|
},
|
|
1214
1321
|
},
|
|
1215
1322
|
{
|
|
@@ -1233,6 +1340,9 @@ const EMBEDDED_METHODS = [
|
|
|
1233
1340
|
method: 'client.compute.vms.availability.update',
|
|
1234
1341
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.vms.availability.update('vm_id');",
|
|
1235
1342
|
},
|
|
1343
|
+
http: {
|
|
1344
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "public_ip_enabled": true,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1345
|
+
},
|
|
1236
1346
|
go: {
|
|
1237
1347
|
method: 'client.Compute.VMs.Availability.Update',
|
|
1238
1348
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.VMs.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -1241,9 +1351,6 @@ const EMBEDDED_METHODS = [
|
|
|
1241
1351
|
method: 'availability update',
|
|
1242
1352
|
example: "nirvana compute:vms:availability update \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1243
1353
|
},
|
|
1244
|
-
http: {
|
|
1245
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "instance_type": "n1-standard-8",\n "name": "my-vm",\n "public_ip_enabled": true,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1246
|
-
},
|
|
1247
1354
|
},
|
|
1248
1355
|
},
|
|
1249
1356
|
{
|
|
@@ -1262,6 +1369,9 @@ const EMBEDDED_METHODS = [
|
|
|
1262
1369
|
method: 'client.compute.vms.volumes.list',
|
|
1263
1370
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const volume of client.compute.vms.volumes.list('vm_id')) {\n console.log(volume.id);\n}",
|
|
1264
1371
|
},
|
|
1372
|
+
http: {
|
|
1373
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1374
|
+
},
|
|
1265
1375
|
go: {
|
|
1266
1376
|
method: 'client.Compute.VMs.Volumes.List',
|
|
1267
1377
|
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\tpage, err := client.Compute.VMs.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -1270,9 +1380,6 @@ const EMBEDDED_METHODS = [
|
|
|
1270
1380
|
method: 'volumes list',
|
|
1271
1381
|
example: "nirvana compute:vms:volumes list \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1272
1382
|
},
|
|
1273
|
-
http: {
|
|
1274
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1275
|
-
},
|
|
1276
1383
|
},
|
|
1277
1384
|
},
|
|
1278
1385
|
{
|
|
@@ -1291,6 +1398,9 @@ const EMBEDDED_METHODS = [
|
|
|
1291
1398
|
method: 'client.compute.vms.osImages.list',
|
|
1292
1399
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const osImage of client.compute.vms.osImages.list()) {\n console.log(osImage.created_at);\n}",
|
|
1293
1400
|
},
|
|
1401
|
+
http: {
|
|
1402
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/os_images \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1403
|
+
},
|
|
1294
1404
|
go: {
|
|
1295
1405
|
method: 'client.Compute.VMs.OSImages.List',
|
|
1296
1406
|
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\tpage, err := client.Compute.VMs.OSImages.List(context.TODO(), compute.VMOSImageListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -1299,9 +1409,6 @@ const EMBEDDED_METHODS = [
|
|
|
1299
1409
|
method: 'os_images list',
|
|
1300
1410
|
example: "nirvana compute:vms:os-images list \\\n --api-key 'My API Key'",
|
|
1301
1411
|
},
|
|
1302
|
-
http: {
|
|
1303
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/os_images \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1304
|
-
},
|
|
1305
1412
|
},
|
|
1306
1413
|
},
|
|
1307
1414
|
{
|
|
@@ -1328,6 +1435,9 @@ const EMBEDDED_METHODS = [
|
|
|
1328
1435
|
method: 'client.compute.volumes.create',
|
|
1329
1436
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n size: 100,\n type: 'abs',\n});\n\nconsole.log(operation.id);",
|
|
1330
1437
|
},
|
|
1438
|
+
http: {
|
|
1439
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "size": 100,\n "type": "abs",\n "tags": [\n "production",\n "ethereum"\n ],\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1440
|
+
},
|
|
1331
1441
|
go: {
|
|
1332
1442
|
method: 'client.Compute.Volumes.New',
|
|
1333
1443
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.New(context.TODO(), compute.VolumeNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1336,9 +1446,6 @@ const EMBEDDED_METHODS = [
|
|
|
1336
1446
|
method: 'volumes create',
|
|
1337
1447
|
example: "nirvana compute:volumes create \\\n --api-key 'My API Key' \\\n --name my-data-volume \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --size 100 \\\n --type abs",
|
|
1338
1448
|
},
|
|
1339
|
-
http: {
|
|
1340
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "size": 100,\n "type": "abs",\n "tags": [\n "production",\n "ethereum"\n ],\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1341
|
-
},
|
|
1342
1449
|
},
|
|
1343
1450
|
},
|
|
1344
1451
|
{
|
|
@@ -1357,6 +1464,9 @@ const EMBEDDED_METHODS = [
|
|
|
1357
1464
|
method: 'client.compute.volumes.get',
|
|
1358
1465
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst volume = await client.compute.volumes.get('volume_id');\n\nconsole.log(volume.id);",
|
|
1359
1466
|
},
|
|
1467
|
+
http: {
|
|
1468
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1469
|
+
},
|
|
1360
1470
|
go: {
|
|
1361
1471
|
method: 'client.Compute.Volumes.Get',
|
|
1362
1472
|
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\tvolume, err := client.Compute.Volumes.Get(context.TODO(), "volume_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", volume.ID)\n}\n',
|
|
@@ -1365,9 +1475,6 @@ const EMBEDDED_METHODS = [
|
|
|
1365
1475
|
method: 'volumes get',
|
|
1366
1476
|
example: "nirvana compute:volumes get \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1367
1477
|
},
|
|
1368
|
-
http: {
|
|
1369
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1370
|
-
},
|
|
1371
1478
|
},
|
|
1372
1479
|
},
|
|
1373
1480
|
{
|
|
@@ -1386,6 +1493,9 @@ const EMBEDDED_METHODS = [
|
|
|
1386
1493
|
method: 'client.compute.volumes.update',
|
|
1387
1494
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.update('volume_id');\n\nconsole.log(operation.id);",
|
|
1388
1495
|
},
|
|
1496
|
+
http: {
|
|
1497
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "size": 100,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1498
|
+
},
|
|
1389
1499
|
go: {
|
|
1390
1500
|
method: 'client.Compute.Volumes.Update',
|
|
1391
1501
|
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\toperation, err := client.Compute.Volumes.Update(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1394,9 +1504,6 @@ const EMBEDDED_METHODS = [
|
|
|
1394
1504
|
method: 'volumes update',
|
|
1395
1505
|
example: "nirvana compute:volumes update \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1396
1506
|
},
|
|
1397
|
-
http: {
|
|
1398
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "size": 100,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1399
|
-
},
|
|
1400
1507
|
},
|
|
1401
1508
|
},
|
|
1402
1509
|
{
|
|
@@ -1415,6 +1522,9 @@ const EMBEDDED_METHODS = [
|
|
|
1415
1522
|
method: 'client.compute.volumes.delete',
|
|
1416
1523
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.delete('volume_id');\n\nconsole.log(operation.id);",
|
|
1417
1524
|
},
|
|
1525
|
+
http: {
|
|
1526
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1527
|
+
},
|
|
1418
1528
|
go: {
|
|
1419
1529
|
method: 'client.Compute.Volumes.Delete',
|
|
1420
1530
|
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\toperation, err := client.Compute.Volumes.Delete(context.TODO(), "volume_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1423,9 +1533,6 @@ const EMBEDDED_METHODS = [
|
|
|
1423
1533
|
method: 'volumes delete',
|
|
1424
1534
|
example: "nirvana compute:volumes delete \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1425
1535
|
},
|
|
1426
|
-
http: {
|
|
1427
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1428
|
-
},
|
|
1429
1536
|
},
|
|
1430
1537
|
},
|
|
1431
1538
|
{
|
|
@@ -1444,6 +1551,9 @@ const EMBEDDED_METHODS = [
|
|
|
1444
1551
|
method: 'client.compute.volumes.list',
|
|
1445
1552
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const volume of client.compute.volumes.list({ project_id: 'project_id' })) {\n console.log(volume.id);\n}",
|
|
1446
1553
|
},
|
|
1554
|
+
http: {
|
|
1555
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1556
|
+
},
|
|
1447
1557
|
go: {
|
|
1448
1558
|
method: 'client.Compute.Volumes.List',
|
|
1449
1559
|
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\tpage, err := client.Compute.Volumes.List(context.TODO(), compute.VolumeListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -1452,9 +1562,6 @@ const EMBEDDED_METHODS = [
|
|
|
1452
1562
|
method: 'volumes list',
|
|
1453
1563
|
example: "nirvana compute:volumes list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
1454
1564
|
},
|
|
1455
|
-
http: {
|
|
1456
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1457
|
-
},
|
|
1458
1565
|
},
|
|
1459
1566
|
},
|
|
1460
1567
|
{
|
|
@@ -1473,6 +1580,9 @@ const EMBEDDED_METHODS = [
|
|
|
1473
1580
|
method: 'client.compute.volumes.attach',
|
|
1474
1581
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.attach('volume_id', {\n vm_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);",
|
|
1475
1582
|
},
|
|
1583
|
+
http: {
|
|
1584
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/attach \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1585
|
+
},
|
|
1476
1586
|
go: {
|
|
1477
1587
|
method: 'client.Compute.Volumes.Attach',
|
|
1478
1588
|
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\toperation, err := client.Compute.Volumes.Attach(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeAttachParams{\n\t\t\tVMID: "123e4567-e89b-12d3-a456-426614174000",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1481,9 +1591,6 @@ const EMBEDDED_METHODS = [
|
|
|
1481
1591
|
method: 'volumes attach',
|
|
1482
1592
|
example: "nirvana compute:volumes attach \\\n --api-key 'My API Key' \\\n --volume-id volume_id \\\n --vm-id 123e4567-e89b-12d3-a456-426614174000",
|
|
1483
1593
|
},
|
|
1484
|
-
http: {
|
|
1485
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/attach \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1486
|
-
},
|
|
1487
1594
|
},
|
|
1488
1595
|
},
|
|
1489
1596
|
{
|
|
@@ -1502,6 +1609,9 @@ const EMBEDDED_METHODS = [
|
|
|
1502
1609
|
method: 'client.compute.volumes.detach',
|
|
1503
1610
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.volumes.detach('volume_id');\n\nconsole.log(operation.id);",
|
|
1504
1611
|
},
|
|
1612
|
+
http: {
|
|
1613
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/detach \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1614
|
+
},
|
|
1505
1615
|
go: {
|
|
1506
1616
|
method: 'client.Compute.Volumes.Detach',
|
|
1507
1617
|
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\toperation, err := client.Compute.Volumes.Detach(context.TODO(), "volume_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1510,9 +1620,6 @@ const EMBEDDED_METHODS = [
|
|
|
1510
1620
|
method: 'volumes detach',
|
|
1511
1621
|
example: "nirvana compute:volumes detach \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1512
1622
|
},
|
|
1513
|
-
http: {
|
|
1514
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/detach \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1515
|
-
},
|
|
1516
1623
|
},
|
|
1517
1624
|
},
|
|
1518
1625
|
{
|
|
@@ -1538,6 +1645,9 @@ const EMBEDDED_METHODS = [
|
|
|
1538
1645
|
method: 'client.compute.volumes.availability.create',
|
|
1539
1646
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.volumes.availability.create({\n name: 'my-data-volume',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n size: 100,\n type: 'abs',\n});",
|
|
1540
1647
|
},
|
|
1648
|
+
http: {
|
|
1649
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "size": 100,\n "type": "abs",\n "tags": [\n "production",\n "ethereum"\n ],\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1650
|
+
},
|
|
1541
1651
|
go: {
|
|
1542
1652
|
method: 'client.Compute.Volumes.Availability.New',
|
|
1543
1653
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.Volumes.Availability.New(context.TODO(), compute.VolumeAvailabilityNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -1546,9 +1656,6 @@ const EMBEDDED_METHODS = [
|
|
|
1546
1656
|
method: 'availability create',
|
|
1547
1657
|
example: "nirvana compute:volumes:availability create \\\n --api-key 'My API Key' \\\n --name my-data-volume \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --size 100 \\\n --type abs",
|
|
1548
1658
|
},
|
|
1549
|
-
http: {
|
|
1550
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "size": 100,\n "type": "abs",\n "tags": [\n "production",\n "ethereum"\n ],\n "vm_id": "123e4567-e89b-12d3-a456-426614174000"\n }\'',
|
|
1551
|
-
},
|
|
1552
1659
|
},
|
|
1553
1660
|
},
|
|
1554
1661
|
{
|
|
@@ -1566,6 +1673,9 @@ const EMBEDDED_METHODS = [
|
|
|
1566
1673
|
method: 'client.compute.volumes.availability.update',
|
|
1567
1674
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.compute.volumes.availability.update('volume_id');",
|
|
1568
1675
|
},
|
|
1676
|
+
http: {
|
|
1677
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "size": 100,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1678
|
+
},
|
|
1569
1679
|
go: {
|
|
1570
1680
|
method: 'client.Compute.Volumes.Availability.Update',
|
|
1571
1681
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.Volumes.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -1574,9 +1684,6 @@ const EMBEDDED_METHODS = [
|
|
|
1574
1684
|
method: 'availability update',
|
|
1575
1685
|
example: "nirvana compute:volumes:availability update \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1576
1686
|
},
|
|
1577
|
-
http: {
|
|
1578
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-data-volume",\n "size": 100,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1579
|
-
},
|
|
1580
1687
|
},
|
|
1581
1688
|
},
|
|
1582
1689
|
{
|
|
@@ -1601,6 +1708,9 @@ const EMBEDDED_METHODS = [
|
|
|
1601
1708
|
method: 'client.networking.vpcs.create',
|
|
1602
1709
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.vpcs.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n subnet_name: 'my-subnet',\n});\n\nconsole.log(operation.id);",
|
|
1603
1710
|
},
|
|
1711
|
+
http: {
|
|
1712
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1713
|
+
},
|
|
1604
1714
|
go: {
|
|
1605
1715
|
method: 'client.Networking.VPCs.New',
|
|
1606
1716
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.New(context.TODO(), networking.VPCNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSubnetName: "my-subnet",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1609,9 +1719,6 @@ const EMBEDDED_METHODS = [
|
|
|
1609
1719
|
method: 'vpcs create',
|
|
1610
1720
|
example: "nirvana networking:vpcs create \\\n --api-key 'My API Key' \\\n --name my-vpc \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --subnet-name my-subnet",
|
|
1611
1721
|
},
|
|
1612
|
-
http: {
|
|
1613
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1614
|
-
},
|
|
1615
1722
|
},
|
|
1616
1723
|
},
|
|
1617
1724
|
{
|
|
@@ -1630,6 +1737,9 @@ const EMBEDDED_METHODS = [
|
|
|
1630
1737
|
method: 'client.networking.vpcs.get',
|
|
1631
1738
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst vpc = await client.networking.vpcs.get('vpc_id');\n\nconsole.log(vpc.id);",
|
|
1632
1739
|
},
|
|
1740
|
+
http: {
|
|
1741
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1742
|
+
},
|
|
1633
1743
|
go: {
|
|
1634
1744
|
method: 'client.Networking.VPCs.Get',
|
|
1635
1745
|
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\tvpc, err := client.Networking.VPCs.Get(context.TODO(), "vpc_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vpc.ID)\n}\n',
|
|
@@ -1638,9 +1748,6 @@ const EMBEDDED_METHODS = [
|
|
|
1638
1748
|
method: 'vpcs get',
|
|
1639
1749
|
example: "nirvana networking:vpcs get \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1640
1750
|
},
|
|
1641
|
-
http: {
|
|
1642
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1643
|
-
},
|
|
1644
1751
|
},
|
|
1645
1752
|
},
|
|
1646
1753
|
{
|
|
@@ -1659,6 +1766,9 @@ const EMBEDDED_METHODS = [
|
|
|
1659
1766
|
method: 'client.networking.vpcs.update',
|
|
1660
1767
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.vpcs.update('vpc_id');\n\nconsole.log(operation.id);",
|
|
1661
1768
|
},
|
|
1769
|
+
http: {
|
|
1770
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1771
|
+
},
|
|
1662
1772
|
go: {
|
|
1663
1773
|
method: 'client.Networking.VPCs.Update',
|
|
1664
1774
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.VPCUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1667,9 +1777,6 @@ const EMBEDDED_METHODS = [
|
|
|
1667
1777
|
method: 'vpcs update',
|
|
1668
1778
|
example: "nirvana networking:vpcs update \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1669
1779
|
},
|
|
1670
|
-
http: {
|
|
1671
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1672
|
-
},
|
|
1673
1780
|
},
|
|
1674
1781
|
},
|
|
1675
1782
|
{
|
|
@@ -1688,6 +1795,9 @@ const EMBEDDED_METHODS = [
|
|
|
1688
1795
|
method: 'client.networking.vpcs.delete',
|
|
1689
1796
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.vpcs.delete('vpc_id');\n\nconsole.log(operation.id);",
|
|
1690
1797
|
},
|
|
1798
|
+
http: {
|
|
1799
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1800
|
+
},
|
|
1691
1801
|
go: {
|
|
1692
1802
|
method: 'client.Networking.VPCs.Delete',
|
|
1693
1803
|
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\toperation, err := client.Networking.VPCs.Delete(context.TODO(), "vpc_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1696,9 +1806,6 @@ const EMBEDDED_METHODS = [
|
|
|
1696
1806
|
method: 'vpcs delete',
|
|
1697
1807
|
example: "nirvana networking:vpcs delete \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1698
1808
|
},
|
|
1699
|
-
http: {
|
|
1700
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1701
|
-
},
|
|
1702
1809
|
},
|
|
1703
1810
|
},
|
|
1704
1811
|
{
|
|
@@ -1717,6 +1824,9 @@ const EMBEDDED_METHODS = [
|
|
|
1717
1824
|
method: 'client.networking.vpcs.list',
|
|
1718
1825
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vpc of client.networking.vpcs.list({ project_id: 'project_id' })) {\n console.log(vpc.id);\n}",
|
|
1719
1826
|
},
|
|
1827
|
+
http: {
|
|
1828
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1829
|
+
},
|
|
1720
1830
|
go: {
|
|
1721
1831
|
method: 'client.Networking.VPCs.List',
|
|
1722
1832
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Networking.VPCs.List(context.TODO(), networking.VPCListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -1725,9 +1835,6 @@ const EMBEDDED_METHODS = [
|
|
|
1725
1835
|
method: 'vpcs list',
|
|
1726
1836
|
example: "nirvana networking:vpcs list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
1727
1837
|
},
|
|
1728
|
-
http: {
|
|
1729
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1730
|
-
},
|
|
1731
1838
|
},
|
|
1732
1839
|
},
|
|
1733
1840
|
{
|
|
@@ -1751,6 +1858,9 @@ const EMBEDDED_METHODS = [
|
|
|
1751
1858
|
method: 'client.networking.vpcs.availability.create',
|
|
1752
1859
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.networking.vpcs.availability.create({\n name: 'my-vpc',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n subnet_name: 'my-subnet',\n});",
|
|
1753
1860
|
},
|
|
1861
|
+
http: {
|
|
1862
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1863
|
+
},
|
|
1754
1864
|
go: {
|
|
1755
1865
|
method: 'client.Networking.VPCs.Availability.New',
|
|
1756
1866
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Networking.VPCs.Availability.New(context.TODO(), networking.VPCAvailabilityNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSubnetName: "my-subnet",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -1759,9 +1869,6 @@ const EMBEDDED_METHODS = [
|
|
|
1759
1869
|
method: 'availability create',
|
|
1760
1870
|
example: "nirvana networking:vpcs:availability create \\\n --api-key 'My API Key' \\\n --name my-vpc \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --subnet-name my-subnet",
|
|
1761
1871
|
},
|
|
1762
|
-
http: {
|
|
1763
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1764
|
-
},
|
|
1765
1872
|
},
|
|
1766
1873
|
},
|
|
1767
1874
|
{
|
|
@@ -1779,6 +1886,9 @@ const EMBEDDED_METHODS = [
|
|
|
1779
1886
|
method: 'client.networking.vpcs.availability.update',
|
|
1780
1887
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.networking.vpcs.availability.update('vpc_id');",
|
|
1781
1888
|
},
|
|
1889
|
+
http: {
|
|
1890
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1891
|
+
},
|
|
1782
1892
|
go: {
|
|
1783
1893
|
method: 'client.Networking.VPCs.Availability.Update',
|
|
1784
1894
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Networking.VPCs.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.VPCAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -1787,9 +1897,6 @@ const EMBEDDED_METHODS = [
|
|
|
1787
1897
|
method: 'availability update',
|
|
1788
1898
|
example: "nirvana networking:vpcs:availability update \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1789
1899
|
},
|
|
1790
|
-
http: {
|
|
1791
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-vpc",\n "subnet_name": "my-subnet",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1792
|
-
},
|
|
1793
1900
|
},
|
|
1794
1901
|
},
|
|
1795
1902
|
{
|
|
@@ -1816,6 +1923,9 @@ const EMBEDDED_METHODS = [
|
|
|
1816
1923
|
method: 'client.networking.firewallRules.create',
|
|
1817
1924
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.firewallRules.create('vpc_id', {\n destination_address: '10.0.0.0/25',\n destination_ports: ['22', '80', '443'],\n name: 'my-firewall-rule',\n protocol: 'tcp',\n source_address: '0.0.0.0/0',\n});\n\nconsole.log(operation.id);",
|
|
1818
1925
|
},
|
|
1926
|
+
http: {
|
|
1927
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "destination_address": "10.0.0.0/25",\n "destination_ports": [\n "22",\n "80",\n "443"\n ],\n "name": "my-firewall-rule",\n "protocol": "tcp",\n "source_address": "0.0.0.0/0",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1928
|
+
},
|
|
1819
1929
|
go: {
|
|
1820
1930
|
method: 'client.Networking.FirewallRules.New',
|
|
1821
1931
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.FirewallRules.New(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.FirewallRuleNewParams{\n\t\t\tDestinationAddress: "10.0.0.0/25",\n\t\t\tDestinationPorts: []string{"22", "80", "443"},\n\t\t\tName: "my-firewall-rule",\n\t\t\tProtocol: networking.FirewallRuleNewParamsProtocolTcp,\n\t\t\tSourceAddress: "0.0.0.0/0",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1824,9 +1934,6 @@ const EMBEDDED_METHODS = [
|
|
|
1824
1934
|
method: 'firewall_rules create',
|
|
1825
1935
|
example: "nirvana networking:firewall-rules create \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --destination-address 10.0.0.0/25 \\\n --destination-port \"'22'\" \\\n --destination-port \"'80'\" \\\n --destination-port \"'443'\" \\\n --name my-firewall-rule \\\n --protocol tcp \\\n --source-address 0.0.0.0/0",
|
|
1826
1936
|
},
|
|
1827
|
-
http: {
|
|
1828
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "destination_address": "10.0.0.0/25",\n "destination_ports": [\n "22",\n "80",\n "443"\n ],\n "name": "my-firewall-rule",\n "protocol": "tcp",\n "source_address": "0.0.0.0/0",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1829
|
-
},
|
|
1830
1937
|
},
|
|
1831
1938
|
},
|
|
1832
1939
|
{
|
|
@@ -1845,6 +1952,9 @@ const EMBEDDED_METHODS = [
|
|
|
1845
1952
|
method: 'client.networking.firewallRules.get',
|
|
1846
1953
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst firewallRule = await client.networking.firewallRules.get('firewall_rule_id', {\n vpc_id: 'vpc_id',\n});\n\nconsole.log(firewallRule.id);",
|
|
1847
1954
|
},
|
|
1955
|
+
http: {
|
|
1956
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1957
|
+
},
|
|
1848
1958
|
go: {
|
|
1849
1959
|
method: 'client.Networking.FirewallRules.Get',
|
|
1850
1960
|
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\tfirewallRule, err := client.Networking.FirewallRules.Get(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\t"firewall_rule_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", firewallRule.ID)\n}\n',
|
|
@@ -1853,9 +1963,6 @@ const EMBEDDED_METHODS = [
|
|
|
1853
1963
|
method: 'firewall_rules get',
|
|
1854
1964
|
example: "nirvana networking:firewall-rules get \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --firewall-rule-id firewall_rule_id",
|
|
1855
1965
|
},
|
|
1856
|
-
http: {
|
|
1857
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1858
|
-
},
|
|
1859
1966
|
},
|
|
1860
1967
|
},
|
|
1861
1968
|
{
|
|
@@ -1883,6 +1990,9 @@ const EMBEDDED_METHODS = [
|
|
|
1883
1990
|
method: 'client.networking.firewallRules.update',
|
|
1884
1991
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.firewallRules.update('firewall_rule_id', {\n vpc_id: 'vpc_id',\n});\n\nconsole.log(operation.id);",
|
|
1885
1992
|
},
|
|
1993
|
+
http: {
|
|
1994
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "destination_address": "10.0.0.0/25",\n "destination_ports": [\n "22",\n "80",\n "443"\n ],\n "name": "my-firewall-rule",\n "protocol": "tcp",\n "source_address": "0.0.0.0/0",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1995
|
+
},
|
|
1886
1996
|
go: {
|
|
1887
1997
|
method: 'client.Networking.FirewallRules.Update',
|
|
1888
1998
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.FirewallRules.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\t"firewall_rule_id",\n\t\tnetworking.FirewallRuleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1891,9 +2001,6 @@ const EMBEDDED_METHODS = [
|
|
|
1891
2001
|
method: 'firewall_rules update',
|
|
1892
2002
|
example: "nirvana networking:firewall-rules update \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --firewall-rule-id firewall_rule_id",
|
|
1893
2003
|
},
|
|
1894
|
-
http: {
|
|
1895
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "destination_address": "10.0.0.0/25",\n "destination_ports": [\n "22",\n "80",\n "443"\n ],\n "name": "my-firewall-rule",\n "protocol": "tcp",\n "source_address": "0.0.0.0/0",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1896
|
-
},
|
|
1897
2004
|
},
|
|
1898
2005
|
},
|
|
1899
2006
|
{
|
|
@@ -1912,6 +2019,9 @@ const EMBEDDED_METHODS = [
|
|
|
1912
2019
|
method: 'client.networking.firewallRules.delete',
|
|
1913
2020
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.firewallRules.delete('firewall_rule_id', {\n vpc_id: 'vpc_id',\n});\n\nconsole.log(operation.id);",
|
|
1914
2021
|
},
|
|
2022
|
+
http: {
|
|
2023
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2024
|
+
},
|
|
1915
2025
|
go: {
|
|
1916
2026
|
method: 'client.Networking.FirewallRules.Delete',
|
|
1917
2027
|
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\toperation, err := client.Networking.FirewallRules.Delete(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\t"firewall_rule_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1920,9 +2030,6 @@ const EMBEDDED_METHODS = [
|
|
|
1920
2030
|
method: 'firewall_rules delete',
|
|
1921
2031
|
example: "nirvana networking:firewall-rules delete \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --firewall-rule-id firewall_rule_id",
|
|
1922
2032
|
},
|
|
1923
|
-
http: {
|
|
1924
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1925
|
-
},
|
|
1926
2033
|
},
|
|
1927
2034
|
},
|
|
1928
2035
|
{
|
|
@@ -1941,6 +2048,9 @@ const EMBEDDED_METHODS = [
|
|
|
1941
2048
|
method: 'client.networking.firewallRules.list',
|
|
1942
2049
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const firewallRule of client.networking.firewallRules.list('vpc_id')) {\n console.log(firewallRule.id);\n}",
|
|
1943
2050
|
},
|
|
2051
|
+
http: {
|
|
2052
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2053
|
+
},
|
|
1944
2054
|
go: {
|
|
1945
2055
|
method: 'client.Networking.FirewallRules.List',
|
|
1946
2056
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Networking.FirewallRules.List(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.FirewallRuleListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -1949,9 +2059,6 @@ const EMBEDDED_METHODS = [
|
|
|
1949
2059
|
method: 'firewall_rules list',
|
|
1950
2060
|
example: "nirvana networking:firewall-rules list \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1951
2061
|
},
|
|
1952
|
-
http: {
|
|
1953
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1954
|
-
},
|
|
1955
2062
|
},
|
|
1956
2063
|
},
|
|
1957
2064
|
{
|
|
@@ -1979,6 +2086,9 @@ const EMBEDDED_METHODS = [
|
|
|
1979
2086
|
method: 'client.networking.connect.connections.create',
|
|
1980
2087
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.connect.connections.create({\n bandwidth_mbps: 50,\n cidrs: ['10.0.0.0/16'],\n name: 'my-connect-connection',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n provider_cidrs: ['172.16.0.0/16'],\n region: 'us-sva-2',\n});\n\nconsole.log(operation.id);",
|
|
1981
2088
|
},
|
|
2089
|
+
http: {
|
|
2090
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "bandwidth_mbps": 50,\n "cidrs": [\n "10.0.0.0/16"\n ],\n "name": "my-connect-connection",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "provider_cidrs": [\n "172.16.0.0/16"\n ],\n "region": "us-sva-2",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2091
|
+
},
|
|
1982
2092
|
go: {
|
|
1983
2093
|
method: 'client.Networking.Connect.Connections.New',
|
|
1984
2094
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.Connect.Connections.New(context.TODO(), networking.ConnectConnectionNewParams{\n\t\tBandwidthMbps: 50,\n\t\tCIDRs: []string{"10.0.0.0/16"},\n\t\tName: "my-connect-connection",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tProviderCIDRs: []string{"172.16.0.0/16"},\n\t\tRegion: shared.RegionNameUsSva2,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -1987,9 +2097,6 @@ const EMBEDDED_METHODS = [
|
|
|
1987
2097
|
method: 'connections create',
|
|
1988
2098
|
example: "nirvana networking:connect:connections create \\\n --api-key 'My API Key' \\\n --bandwidth-mbps 50 \\\n --cidr 10.0.0.0/16 \\\n --name my-connect-connection \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --provider-cidr 172.16.0.0/16 \\\n --region us-sva-2",
|
|
1989
2099
|
},
|
|
1990
|
-
http: {
|
|
1991
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "bandwidth_mbps": 50,\n "cidrs": [\n "10.0.0.0/16"\n ],\n "name": "my-connect-connection",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "provider_cidrs": [\n "172.16.0.0/16"\n ],\n "region": "us-sva-2",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
1992
|
-
},
|
|
1993
2100
|
},
|
|
1994
2101
|
},
|
|
1995
2102
|
{
|
|
@@ -2008,6 +2115,9 @@ const EMBEDDED_METHODS = [
|
|
|
2008
2115
|
method: 'client.networking.connect.connections.get',
|
|
2009
2116
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst connectConnection = await client.networking.connect.connections.get('connection_id');\n\nconsole.log(connectConnection.id);",
|
|
2010
2117
|
},
|
|
2118
|
+
http: {
|
|
2119
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2120
|
+
},
|
|
2011
2121
|
go: {
|
|
2012
2122
|
method: 'client.Networking.Connect.Connections.Get',
|
|
2013
2123
|
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\tconnectConnection, err := client.Networking.Connect.Connections.Get(context.TODO(), "connection_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", connectConnection.ID)\n}\n',
|
|
@@ -2016,9 +2126,6 @@ const EMBEDDED_METHODS = [
|
|
|
2016
2126
|
method: 'connections get',
|
|
2017
2127
|
example: "nirvana networking:connect:connections get \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2018
2128
|
},
|
|
2019
|
-
http: {
|
|
2020
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2021
|
-
},
|
|
2022
2129
|
},
|
|
2023
2130
|
},
|
|
2024
2131
|
{
|
|
@@ -2037,6 +2144,9 @@ const EMBEDDED_METHODS = [
|
|
|
2037
2144
|
method: 'client.networking.connect.connections.update',
|
|
2038
2145
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.connect.connections.update('connection_id');\n\nconsole.log(operation.id);",
|
|
2039
2146
|
},
|
|
2147
|
+
http: {
|
|
2148
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-connect-connection",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2149
|
+
},
|
|
2040
2150
|
go: {
|
|
2041
2151
|
method: 'client.Networking.Connect.Connections.Update',
|
|
2042
2152
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.Connect.Connections.Update(\n\t\tcontext.TODO(),\n\t\t"connection_id",\n\t\tnetworking.ConnectConnectionUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -2045,9 +2155,6 @@ const EMBEDDED_METHODS = [
|
|
|
2045
2155
|
method: 'connections update',
|
|
2046
2156
|
example: "nirvana networking:connect:connections update \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2047
2157
|
},
|
|
2048
|
-
http: {
|
|
2049
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-connect-connection",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2050
|
-
},
|
|
2051
2158
|
},
|
|
2052
2159
|
},
|
|
2053
2160
|
{
|
|
@@ -2066,16 +2173,16 @@ const EMBEDDED_METHODS = [
|
|
|
2066
2173
|
method: 'client.networking.connect.connections.delete',
|
|
2067
2174
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.networking.connect.connections.delete('connection_id');\n\nconsole.log(operation.id);",
|
|
2068
2175
|
},
|
|
2176
|
+
http: {
|
|
2177
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2178
|
+
},
|
|
2069
2179
|
go: {
|
|
2070
2180
|
method: 'client.Networking.Connect.Connections.Delete',
|
|
2071
2181
|
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\toperation, err := client.Networking.Connect.Connections.Delete(context.TODO(), "connection_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2072
2182
|
},
|
|
2073
2183
|
cli: {
|
|
2074
|
-
method: 'connections delete',
|
|
2075
|
-
example: "nirvana networking:connect:connections delete \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2076
|
-
},
|
|
2077
|
-
http: {
|
|
2078
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2184
|
+
method: 'connections delete',
|
|
2185
|
+
example: "nirvana networking:connect:connections delete \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2079
2186
|
},
|
|
2080
2187
|
},
|
|
2081
2188
|
},
|
|
@@ -2095,6 +2202,9 @@ const EMBEDDED_METHODS = [
|
|
|
2095
2202
|
method: 'client.networking.connect.connections.list',
|
|
2096
2203
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const connectConnection of client.networking.connect.connections.list({\n project_id: 'project_id',\n})) {\n console.log(connectConnection.id);\n}",
|
|
2097
2204
|
},
|
|
2205
|
+
http: {
|
|
2206
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2207
|
+
},
|
|
2098
2208
|
go: {
|
|
2099
2209
|
method: 'client.Networking.Connect.Connections.List',
|
|
2100
2210
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Networking.Connect.Connections.List(context.TODO(), networking.ConnectConnectionListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2103,9 +2213,6 @@ const EMBEDDED_METHODS = [
|
|
|
2103
2213
|
method: 'connections list',
|
|
2104
2214
|
example: "nirvana networking:connect:connections list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2105
2215
|
},
|
|
2106
|
-
http: {
|
|
2107
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2108
|
-
},
|
|
2109
2216
|
},
|
|
2110
2217
|
},
|
|
2111
2218
|
{
|
|
@@ -2124,6 +2231,9 @@ const EMBEDDED_METHODS = [
|
|
|
2124
2231
|
method: 'client.networking.connect.routes.list',
|
|
2125
2232
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const connectRoute of client.networking.connect.routes.list()) {\n console.log(connectRoute.provider);\n}",
|
|
2126
2233
|
},
|
|
2234
|
+
http: {
|
|
2235
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/routes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2236
|
+
},
|
|
2127
2237
|
go: {
|
|
2128
2238
|
method: 'client.Networking.Connect.Routes.List',
|
|
2129
2239
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Networking.Connect.Routes.List(context.TODO(), networking.ConnectRouteListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2132,9 +2242,6 @@ const EMBEDDED_METHODS = [
|
|
|
2132
2242
|
method: 'routes list',
|
|
2133
2243
|
example: "nirvana networking:connect:routes list \\\n --api-key 'My API Key'",
|
|
2134
2244
|
},
|
|
2135
|
-
http: {
|
|
2136
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/routes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2137
|
-
},
|
|
2138
2245
|
},
|
|
2139
2246
|
},
|
|
2140
2247
|
{
|
|
@@ -2159,6 +2266,9 @@ const EMBEDDED_METHODS = [
|
|
|
2159
2266
|
method: 'client.rpcNodes.flex.create',
|
|
2160
2267
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst flex = await client.rpcNodes.flex.create({\n blockchain: 'ethereum',\n name: 'my-ethereum-node',\n network: 'mainnet',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(flex.id);",
|
|
2161
2268
|
},
|
|
2269
|
+
http: {
|
|
2270
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "blockchain": "ethereum",\n "name": "my-ethereum-node",\n "network": "mainnet",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2271
|
+
},
|
|
2162
2272
|
go: {
|
|
2163
2273
|
method: 'client.RPCNodes.Flex.New',
|
|
2164
2274
|
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/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tflex, err := client.RPCNodes.Flex.New(context.TODO(), rpc_nodes.FlexNewParams{\n\t\tBlockchain: "ethereum",\n\t\tName: "my-ethereum-node",\n\t\tNetwork: "mainnet",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", flex.ID)\n}\n',
|
|
@@ -2167,9 +2277,6 @@ const EMBEDDED_METHODS = [
|
|
|
2167
2277
|
method: 'flex create',
|
|
2168
2278
|
example: "nirvana rpc-nodes:flex create \\\n --api-key 'My API Key' \\\n --blockchain ethereum \\\n --name my-ethereum-node \\\n --network mainnet \\\n --project-id 123e4567-e89b-12d3-a456-426614174000",
|
|
2169
2279
|
},
|
|
2170
|
-
http: {
|
|
2171
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "blockchain": "ethereum",\n "name": "my-ethereum-node",\n "network": "mainnet",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2172
|
-
},
|
|
2173
2280
|
},
|
|
2174
2281
|
},
|
|
2175
2282
|
{
|
|
@@ -2188,6 +2295,9 @@ const EMBEDDED_METHODS = [
|
|
|
2188
2295
|
method: 'client.rpcNodes.flex.get',
|
|
2189
2296
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst flex = await client.rpcNodes.flex.get('node_id');\n\nconsole.log(flex.id);",
|
|
2190
2297
|
},
|
|
2298
|
+
http: {
|
|
2299
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2300
|
+
},
|
|
2191
2301
|
go: {
|
|
2192
2302
|
method: 'client.RPCNodes.Flex.Get',
|
|
2193
2303
|
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\tflex, err := client.RPCNodes.Flex.Get(context.TODO(), "node_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", flex.ID)\n}\n',
|
|
@@ -2196,9 +2306,6 @@ const EMBEDDED_METHODS = [
|
|
|
2196
2306
|
method: 'flex get',
|
|
2197
2307
|
example: "nirvana rpc-nodes:flex get \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2198
2308
|
},
|
|
2199
|
-
http: {
|
|
2200
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2201
|
-
},
|
|
2202
2309
|
},
|
|
2203
2310
|
},
|
|
2204
2311
|
{
|
|
@@ -2217,6 +2324,9 @@ const EMBEDDED_METHODS = [
|
|
|
2217
2324
|
method: 'client.rpcNodes.flex.update',
|
|
2218
2325
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst flex = await client.rpcNodes.flex.update('node_id');\n\nconsole.log(flex.id);",
|
|
2219
2326
|
},
|
|
2327
|
+
http: {
|
|
2328
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-ethereum-node",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2329
|
+
},
|
|
2220
2330
|
go: {
|
|
2221
2331
|
method: 'client.RPCNodes.Flex.Update',
|
|
2222
2332
|
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/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tflex, err := client.RPCNodes.Flex.Update(\n\t\tcontext.TODO(),\n\t\t"node_id",\n\t\trpc_nodes.FlexUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", flex.ID)\n}\n',
|
|
@@ -2225,9 +2335,6 @@ const EMBEDDED_METHODS = [
|
|
|
2225
2335
|
method: 'flex update',
|
|
2226
2336
|
example: "nirvana rpc-nodes:flex update \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2227
2337
|
},
|
|
2228
|
-
http: {
|
|
2229
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-ethereum-node",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2230
|
-
},
|
|
2231
2338
|
},
|
|
2232
2339
|
},
|
|
2233
2340
|
{
|
|
@@ -2245,6 +2352,9 @@ const EMBEDDED_METHODS = [
|
|
|
2245
2352
|
method: 'client.rpcNodes.flex.delete',
|
|
2246
2353
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.rpcNodes.flex.delete('node_id');",
|
|
2247
2354
|
},
|
|
2355
|
+
http: {
|
|
2356
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2357
|
+
},
|
|
2248
2358
|
go: {
|
|
2249
2359
|
method: 'client.RPCNodes.Flex.Delete',
|
|
2250
2360
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.RPCNodes.Flex.Delete(context.TODO(), "node_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -2253,9 +2363,6 @@ const EMBEDDED_METHODS = [
|
|
|
2253
2363
|
method: 'flex delete',
|
|
2254
2364
|
example: "nirvana rpc-nodes:flex delete \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2255
2365
|
},
|
|
2256
|
-
http: {
|
|
2257
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2258
|
-
},
|
|
2259
2366
|
},
|
|
2260
2367
|
},
|
|
2261
2368
|
{
|
|
@@ -2274,6 +2381,9 @@ const EMBEDDED_METHODS = [
|
|
|
2274
2381
|
method: 'client.rpcNodes.flex.list',
|
|
2275
2382
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const flex of client.rpcNodes.flex.list({ project_id: 'project_id' })) {\n console.log(flex.id);\n}",
|
|
2276
2383
|
},
|
|
2384
|
+
http: {
|
|
2385
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2386
|
+
},
|
|
2277
2387
|
go: {
|
|
2278
2388
|
method: 'client.RPCNodes.Flex.List',
|
|
2279
2389
|
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/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Flex.List(context.TODO(), rpc_nodes.FlexListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2282,9 +2392,6 @@ const EMBEDDED_METHODS = [
|
|
|
2282
2392
|
method: 'flex list',
|
|
2283
2393
|
example: "nirvana rpc-nodes:flex list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2284
2394
|
},
|
|
2285
|
-
http: {
|
|
2286
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2287
|
-
},
|
|
2288
2395
|
},
|
|
2289
2396
|
},
|
|
2290
2397
|
{
|
|
@@ -2303,6 +2410,9 @@ const EMBEDDED_METHODS = [
|
|
|
2303
2410
|
method: 'client.rpcNodes.flex.blockchains.list',
|
|
2304
2411
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const flexBlockchain of client.rpcNodes.flex.blockchains.list()) {\n console.log(flexBlockchain.blockchain);\n}",
|
|
2305
2412
|
},
|
|
2413
|
+
http: {
|
|
2414
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2415
|
+
},
|
|
2306
2416
|
go: {
|
|
2307
2417
|
method: 'client.RPCNodes.Flex.Blockchains.List',
|
|
2308
2418
|
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/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Flex.Blockchains.List(context.TODO(), rpc_nodes.FlexBlockchainListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2311,9 +2421,6 @@ const EMBEDDED_METHODS = [
|
|
|
2311
2421
|
method: 'blockchains list',
|
|
2312
2422
|
example: "nirvana rpc-nodes:flex:blockchains list \\\n --api-key 'My API Key'",
|
|
2313
2423
|
},
|
|
2314
|
-
http: {
|
|
2315
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2316
|
-
},
|
|
2317
2424
|
},
|
|
2318
2425
|
},
|
|
2319
2426
|
{
|
|
@@ -2332,6 +2439,9 @@ const EMBEDDED_METHODS = [
|
|
|
2332
2439
|
method: 'client.rpcNodes.dedicated.get',
|
|
2333
2440
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst dedicated = await client.rpcNodes.dedicated.get('node_id');\n\nconsole.log(dedicated.id);",
|
|
2334
2441
|
},
|
|
2442
|
+
http: {
|
|
2443
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2444
|
+
},
|
|
2335
2445
|
go: {
|
|
2336
2446
|
method: 'client.RPCNodes.Dedicated.Get',
|
|
2337
2447
|
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\tdedicated, err := client.RPCNodes.Dedicated.Get(context.TODO(), "node_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", dedicated.ID)\n}\n',
|
|
@@ -2340,9 +2450,6 @@ const EMBEDDED_METHODS = [
|
|
|
2340
2450
|
method: 'dedicated get',
|
|
2341
2451
|
example: "nirvana rpc-nodes:dedicated get \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2342
2452
|
},
|
|
2343
|
-
http: {
|
|
2344
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2345
|
-
},
|
|
2346
2453
|
},
|
|
2347
2454
|
},
|
|
2348
2455
|
{
|
|
@@ -2361,6 +2468,9 @@ const EMBEDDED_METHODS = [
|
|
|
2361
2468
|
method: 'client.rpcNodes.dedicated.list',
|
|
2362
2469
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const dedicated of client.rpcNodes.dedicated.list({ project_id: 'project_id' })) {\n console.log(dedicated.id);\n}",
|
|
2363
2470
|
},
|
|
2471
|
+
http: {
|
|
2472
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2473
|
+
},
|
|
2364
2474
|
go: {
|
|
2365
2475
|
method: 'client.RPCNodes.Dedicated.List',
|
|
2366
2476
|
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/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Dedicated.List(context.TODO(), rpc_nodes.DedicatedListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2369,9 +2479,6 @@ const EMBEDDED_METHODS = [
|
|
|
2369
2479
|
method: 'dedicated list',
|
|
2370
2480
|
example: "nirvana rpc-nodes:dedicated list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2371
2481
|
},
|
|
2372
|
-
http: {
|
|
2373
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2374
|
-
},
|
|
2375
2482
|
},
|
|
2376
2483
|
},
|
|
2377
2484
|
{
|
|
@@ -2390,6 +2497,9 @@ const EMBEDDED_METHODS = [
|
|
|
2390
2497
|
method: 'client.rpcNodes.dedicated.blockchains.list',
|
|
2391
2498
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const dedicatedBlockchain of client.rpcNodes.dedicated.blockchains.list()) {\n console.log(dedicatedBlockchain.blockchain);\n}",
|
|
2392
2499
|
},
|
|
2500
|
+
http: {
|
|
2501
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2502
|
+
},
|
|
2393
2503
|
go: {
|
|
2394
2504
|
method: 'client.RPCNodes.Dedicated.Blockchains.List',
|
|
2395
2505
|
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/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Dedicated.Blockchains.List(context.TODO(), rpc_nodes.DedicatedBlockchainListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2398,9 +2508,6 @@ const EMBEDDED_METHODS = [
|
|
|
2398
2508
|
method: 'blockchains list',
|
|
2399
2509
|
example: "nirvana rpc-nodes:dedicated:blockchains list \\\n --api-key 'My API Key'",
|
|
2400
2510
|
},
|
|
2401
|
-
http: {
|
|
2402
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2403
|
-
},
|
|
2404
2511
|
},
|
|
2405
2512
|
},
|
|
2406
2513
|
{
|
|
@@ -2419,6 +2526,9 @@ const EMBEDDED_METHODS = [
|
|
|
2419
2526
|
method: 'client.nks.kubernetesVersions.list',
|
|
2420
2527
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const kubernetesVersion of client.nks.kubernetesVersions.list()) {\n console.log(kubernetesVersion.created_at);\n}",
|
|
2421
2528
|
},
|
|
2529
|
+
http: {
|
|
2530
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/kubernetes_versions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2531
|
+
},
|
|
2422
2532
|
go: {
|
|
2423
2533
|
method: 'client.NKS.KubernetesVersions.List',
|
|
2424
2534
|
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.KubernetesVersions.List(context.TODO(), nks.KubernetesVersionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2427,9 +2537,6 @@ const EMBEDDED_METHODS = [
|
|
|
2427
2537
|
method: 'kubernetes_versions list',
|
|
2428
2538
|
example: "nirvana nks:kubernetes-versions list \\\n --api-key 'My API Key'",
|
|
2429
2539
|
},
|
|
2430
|
-
http: {
|
|
2431
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/kubernetes_versions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2432
|
-
},
|
|
2433
2540
|
},
|
|
2434
2541
|
},
|
|
2435
2542
|
{
|
|
@@ -2456,6 +2563,9 @@ const EMBEDDED_METHODS = [
|
|
|
2456
2563
|
method: 'client.nks.clusters.create',
|
|
2457
2564
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.create({\n autoscaling: true,\n kubernetes_version: 'v1.34.4',\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n vpc_id: '123e4567-e89b-12d3-a456-426614174000',\n});\n\nconsole.log(operation.id);",
|
|
2458
2565
|
},
|
|
2566
|
+
http: {
|
|
2567
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "kubernetes_version": "v1.34.4",\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "vpc_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2568
|
+
},
|
|
2459
2569
|
go: {
|
|
2460
2570
|
method: 'client.NKS.Clusters.New',
|
|
2461
2571
|
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.New(context.TODO(), nks.ClusterNewParams{\n\t\tAutoscaling: true,\n\t\tKubernetesVersion: "v1.34.4",\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tVPCID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -2464,9 +2574,6 @@ const EMBEDDED_METHODS = [
|
|
|
2464
2574
|
method: 'clusters create',
|
|
2465
2575
|
example: "nirvana nks:clusters create \\\n --api-key 'My API Key' \\\n --autoscaling \\\n --kubernetes-version v1.34.4 \\\n --name my-cluster \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --vpc-id 123e4567-e89b-12d3-a456-426614174000",
|
|
2466
2576
|
},
|
|
2467
|
-
http: {
|
|
2468
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "kubernetes_version": "v1.34.4",\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "vpc_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2469
|
-
},
|
|
2470
2577
|
},
|
|
2471
2578
|
},
|
|
2472
2579
|
{
|
|
@@ -2485,6 +2592,9 @@ const EMBEDDED_METHODS = [
|
|
|
2485
2592
|
method: 'client.nks.clusters.get',
|
|
2486
2593
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksCluster = await client.nks.clusters.get('cluster_id');\n\nconsole.log(nksCluster.id);",
|
|
2487
2594
|
},
|
|
2595
|
+
http: {
|
|
2596
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2597
|
+
},
|
|
2488
2598
|
go: {
|
|
2489
2599
|
method: 'client.NKS.Clusters.Get',
|
|
2490
2600
|
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\tnksCluster, err := client.NKS.Clusters.Get(context.TODO(), "cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksCluster.ID)\n}\n',
|
|
@@ -2493,9 +2603,6 @@ const EMBEDDED_METHODS = [
|
|
|
2493
2603
|
method: 'clusters get',
|
|
2494
2604
|
example: "nirvana nks:clusters get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2495
2605
|
},
|
|
2496
|
-
http: {
|
|
2497
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2498
|
-
},
|
|
2499
2606
|
},
|
|
2500
2607
|
},
|
|
2501
2608
|
{
|
|
@@ -2514,6 +2621,9 @@ const EMBEDDED_METHODS = [
|
|
|
2514
2621
|
method: 'client.nks.clusters.update',
|
|
2515
2622
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.update('cluster_id');\n\nconsole.log(operation.id);",
|
|
2516
2623
|
},
|
|
2624
|
+
http: {
|
|
2625
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "name": "my-cluster",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2626
|
+
},
|
|
2517
2627
|
go: {
|
|
2518
2628
|
method: 'client.NKS.Clusters.Update',
|
|
2519
2629
|
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\toperation, err := client.NKS.Clusters.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -2522,9 +2632,6 @@ const EMBEDDED_METHODS = [
|
|
|
2522
2632
|
method: 'clusters update',
|
|
2523
2633
|
example: "nirvana nks:clusters update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2524
2634
|
},
|
|
2525
|
-
http: {
|
|
2526
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "name": "my-cluster",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2527
|
-
},
|
|
2528
2635
|
},
|
|
2529
2636
|
},
|
|
2530
2637
|
{
|
|
@@ -2543,6 +2650,9 @@ const EMBEDDED_METHODS = [
|
|
|
2543
2650
|
method: 'client.nks.clusters.delete',
|
|
2544
2651
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.delete('cluster_id');\n\nconsole.log(operation.id);",
|
|
2545
2652
|
},
|
|
2653
|
+
http: {
|
|
2654
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2655
|
+
},
|
|
2546
2656
|
go: {
|
|
2547
2657
|
method: 'client.NKS.Clusters.Delete',
|
|
2548
2658
|
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\toperation, err := client.NKS.Clusters.Delete(context.TODO(), "cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -2551,9 +2661,6 @@ const EMBEDDED_METHODS = [
|
|
|
2551
2661
|
method: 'clusters delete',
|
|
2552
2662
|
example: "nirvana nks:clusters delete \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2553
2663
|
},
|
|
2554
|
-
http: {
|
|
2555
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2556
|
-
},
|
|
2557
2664
|
},
|
|
2558
2665
|
},
|
|
2559
2666
|
{
|
|
@@ -2572,6 +2679,9 @@ const EMBEDDED_METHODS = [
|
|
|
2572
2679
|
method: 'client.nks.clusters.list',
|
|
2573
2680
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksCluster of client.nks.clusters.list({ project_id: 'project_id' })) {\n console.log(nksCluster.id);\n}",
|
|
2574
2681
|
},
|
|
2682
|
+
http: {
|
|
2683
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2684
|
+
},
|
|
2575
2685
|
go: {
|
|
2576
2686
|
method: 'client.NKS.Clusters.List',
|
|
2577
2687
|
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.List(context.TODO(), nks.ClusterListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2580,9 +2690,6 @@ const EMBEDDED_METHODS = [
|
|
|
2580
2690
|
method: 'clusters list',
|
|
2581
2691
|
example: "nirvana nks:clusters list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2582
2692
|
},
|
|
2583
|
-
http: {
|
|
2584
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2585
|
-
},
|
|
2586
2693
|
},
|
|
2587
2694
|
},
|
|
2588
2695
|
{
|
|
@@ -2608,6 +2715,9 @@ const EMBEDDED_METHODS = [
|
|
|
2608
2715
|
method: 'client.nks.clusters.availability.create',
|
|
2609
2716
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.nks.clusters.availability.create({\n autoscaling: true,\n kubernetes_version: 'v1.34.4',\n name: 'my-cluster',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n vpc_id: '123e4567-e89b-12d3-a456-426614174000',\n});",
|
|
2610
2717
|
},
|
|
2718
|
+
http: {
|
|
2719
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "kubernetes_version": "v1.34.4",\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "vpc_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2720
|
+
},
|
|
2611
2721
|
go: {
|
|
2612
2722
|
method: 'client.NKS.Clusters.Availability.New',
|
|
2613
2723
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Availability.New(context.TODO(), nks.ClusterAvailabilityNewParams{\n\t\tAutoscaling: true,\n\t\tKubernetesVersion: "v1.34.4",\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tVPCID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -2616,9 +2726,6 @@ const EMBEDDED_METHODS = [
|
|
|
2616
2726
|
method: 'availability create',
|
|
2617
2727
|
example: "nirvana nks:clusters:availability create \\\n --api-key 'My API Key' \\\n --autoscaling \\\n --kubernetes-version v1.34.4 \\\n --name my-cluster \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --region us-sva-2 \\\n --vpc-id 123e4567-e89b-12d3-a456-426614174000",
|
|
2618
2728
|
},
|
|
2619
|
-
http: {
|
|
2620
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "kubernetes_version": "v1.34.4",\n "name": "my-cluster",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "vpc_id": "123e4567-e89b-12d3-a456-426614174000",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2621
|
-
},
|
|
2622
2729
|
},
|
|
2623
2730
|
},
|
|
2624
2731
|
{
|
|
@@ -2636,6 +2743,9 @@ const EMBEDDED_METHODS = [
|
|
|
2636
2743
|
method: 'client.nks.clusters.availability.update',
|
|
2637
2744
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.nks.clusters.availability.update('cluster_id');",
|
|
2638
2745
|
},
|
|
2746
|
+
http: {
|
|
2747
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "name": "my-cluster",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2748
|
+
},
|
|
2639
2749
|
go: {
|
|
2640
2750
|
method: 'client.NKS.Clusters.Availability.Update',
|
|
2641
2751
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -2644,9 +2754,6 @@ const EMBEDDED_METHODS = [
|
|
|
2644
2754
|
method: 'availability update',
|
|
2645
2755
|
example: "nirvana nks:clusters:availability update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2646
2756
|
},
|
|
2647
|
-
http: {
|
|
2648
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "autoscaling": true,\n "name": "my-cluster",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2649
|
-
},
|
|
2650
2757
|
},
|
|
2651
2758
|
},
|
|
2652
2759
|
{
|
|
@@ -2665,6 +2772,9 @@ const EMBEDDED_METHODS = [
|
|
|
2665
2772
|
method: 'client.nks.clusters.persistentVolumeClaims.get',
|
|
2666
2773
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst persistentVolumeClaim = await client.nks.clusters.persistentVolumeClaims.get(\n 'persistent_volume_claim_id',\n { cluster_id: 'cluster_id' },\n);\n\nconsole.log(persistentVolumeClaim.id);",
|
|
2667
2774
|
},
|
|
2775
|
+
http: {
|
|
2776
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/persistent_volume_claims/$PERSISTENT_VOLUME_CLAIM_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2777
|
+
},
|
|
2668
2778
|
go: {
|
|
2669
2779
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.Get',
|
|
2670
2780
|
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\tpersistentVolumeClaim, err := client.NKS.Clusters.PersistentVolumeClaims.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"persistent_volume_claim_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", persistentVolumeClaim.ID)\n}\n',
|
|
@@ -2673,9 +2783,6 @@ const EMBEDDED_METHODS = [
|
|
|
2673
2783
|
method: 'persistent_volume_claims get',
|
|
2674
2784
|
example: "nirvana nks:clusters:persistent-volume-claims get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --persistent-volume-claim-id persistent_volume_claim_id",
|
|
2675
2785
|
},
|
|
2676
|
-
http: {
|
|
2677
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/persistent_volume_claims/$PERSISTENT_VOLUME_CLAIM_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2678
|
-
},
|
|
2679
2786
|
},
|
|
2680
2787
|
},
|
|
2681
2788
|
{
|
|
@@ -2694,6 +2801,9 @@ const EMBEDDED_METHODS = [
|
|
|
2694
2801
|
method: 'client.nks.clusters.persistentVolumeClaims.list',
|
|
2695
2802
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const persistentVolumeClaim of client.nks.clusters.persistentVolumeClaims.list(\n 'cluster_id',\n)) {\n console.log(persistentVolumeClaim.id);\n}",
|
|
2696
2803
|
},
|
|
2804
|
+
http: {
|
|
2805
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/persistent_volume_claims \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2806
|
+
},
|
|
2697
2807
|
go: {
|
|
2698
2808
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.List',
|
|
2699
2809
|
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.PersistentVolumeClaims.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPersistentVolumeClaimListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2702,9 +2812,6 @@ const EMBEDDED_METHODS = [
|
|
|
2702
2812
|
method: 'persistent_volume_claims list',
|
|
2703
2813
|
example: "nirvana nks:clusters:persistent-volume-claims list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2704
2814
|
},
|
|
2705
|
-
http: {
|
|
2706
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/persistent_volume_claims \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2707
|
-
},
|
|
2708
2815
|
},
|
|
2709
2816
|
},
|
|
2710
2817
|
{
|
|
@@ -2723,6 +2830,9 @@ const EMBEDDED_METHODS = [
|
|
|
2723
2830
|
method: 'client.nks.clusters.kubeconfig.get',
|
|
2724
2831
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst kubeconfig = await client.nks.clusters.kubeconfig.get('cluster_id');\n\nconsole.log(kubeconfig.kubeconfig);",
|
|
2725
2832
|
},
|
|
2833
|
+
http: {
|
|
2834
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/kubeconfig \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2835
|
+
},
|
|
2726
2836
|
go: {
|
|
2727
2837
|
method: 'client.NKS.Clusters.Kubeconfig.Get',
|
|
2728
2838
|
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\tkubeconfig, err := client.NKS.Clusters.Kubeconfig.Get(context.TODO(), "cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", kubeconfig.Kubeconfig)\n}\n',
|
|
@@ -2731,9 +2841,6 @@ const EMBEDDED_METHODS = [
|
|
|
2731
2841
|
method: 'kubeconfig get',
|
|
2732
2842
|
example: "nirvana nks:clusters:kubeconfig get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2733
2843
|
},
|
|
2734
|
-
http: {
|
|
2735
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/kubeconfig \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2736
|
-
},
|
|
2737
2844
|
},
|
|
2738
2845
|
},
|
|
2739
2846
|
{
|
|
@@ -2752,6 +2859,9 @@ const EMBEDDED_METHODS = [
|
|
|
2752
2859
|
method: 'client.nks.clusters.controllers.get',
|
|
2753
2860
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksController = await client.nks.clusters.controllers.get('controller_id', {\n cluster_id: 'cluster_id',\n});\n\nconsole.log(nksController.id);",
|
|
2754
2861
|
},
|
|
2862
|
+
http: {
|
|
2863
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2864
|
+
},
|
|
2755
2865
|
go: {
|
|
2756
2866
|
method: 'client.NKS.Clusters.Controllers.Get',
|
|
2757
2867
|
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\tnksController, err := client.NKS.Clusters.Controllers.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"controller_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksController.ID)\n}\n',
|
|
@@ -2760,9 +2870,6 @@ const EMBEDDED_METHODS = [
|
|
|
2760
2870
|
method: 'controllers get',
|
|
2761
2871
|
example: "nirvana nks:clusters:controllers get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --controller-id controller_id",
|
|
2762
2872
|
},
|
|
2763
|
-
http: {
|
|
2764
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2765
|
-
},
|
|
2766
2873
|
},
|
|
2767
2874
|
},
|
|
2768
2875
|
{
|
|
@@ -2781,6 +2888,9 @@ const EMBEDDED_METHODS = [
|
|
|
2781
2888
|
method: 'client.nks.clusters.controllers.list',
|
|
2782
2889
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksController of client.nks.clusters.controllers.list('cluster_id')) {\n console.log(nksController.id);\n}",
|
|
2783
2890
|
},
|
|
2891
|
+
http: {
|
|
2892
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2893
|
+
},
|
|
2784
2894
|
go: {
|
|
2785
2895
|
method: 'client.NKS.Clusters.Controllers.List',
|
|
2786
2896
|
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.Controllers.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterControllerListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2789,9 +2899,6 @@ const EMBEDDED_METHODS = [
|
|
|
2789
2899
|
method: 'controllers list',
|
|
2790
2900
|
example: "nirvana nks:clusters:controllers list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2791
2901
|
},
|
|
2792
|
-
http: {
|
|
2793
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2794
|
-
},
|
|
2795
2902
|
},
|
|
2796
2903
|
},
|
|
2797
2904
|
{
|
|
@@ -2810,6 +2917,9 @@ const EMBEDDED_METHODS = [
|
|
|
2810
2917
|
method: 'client.nks.clusters.controllers.volumes.get',
|
|
2811
2918
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksControllerVolume = await client.nks.clusters.controllers.volumes.get('volume_id', {\n cluster_id: 'cluster_id',\n controller_id: 'controller_id',\n});\n\nconsole.log(nksControllerVolume.id);",
|
|
2812
2919
|
},
|
|
2920
|
+
http: {
|
|
2921
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2922
|
+
},
|
|
2813
2923
|
go: {
|
|
2814
2924
|
method: 'client.NKS.Clusters.Controllers.Volumes.Get',
|
|
2815
2925
|
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\tnksControllerVolume, err := client.NKS.Clusters.Controllers.Volumes.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"controller_id",\n\t\t"volume_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksControllerVolume.ID)\n}\n',
|
|
@@ -2818,9 +2928,6 @@ const EMBEDDED_METHODS = [
|
|
|
2818
2928
|
method: 'volumes get',
|
|
2819
2929
|
example: "nirvana nks:clusters:controllers:volumes get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --controller-id controller_id \\\n --volume-id volume_id",
|
|
2820
2930
|
},
|
|
2821
|
-
http: {
|
|
2822
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2823
|
-
},
|
|
2824
2931
|
},
|
|
2825
2932
|
},
|
|
2826
2933
|
{
|
|
@@ -2839,6 +2946,9 @@ const EMBEDDED_METHODS = [
|
|
|
2839
2946
|
method: 'client.nks.clusters.controllers.volumes.list',
|
|
2840
2947
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksControllerVolume of client.nks.clusters.controllers.volumes.list(\n 'controller_id',\n { cluster_id: 'cluster_id' },\n)) {\n console.log(nksControllerVolume.id);\n}",
|
|
2841
2948
|
},
|
|
2949
|
+
http: {
|
|
2950
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2951
|
+
},
|
|
2842
2952
|
go: {
|
|
2843
2953
|
method: 'client.NKS.Clusters.Controllers.Volumes.List',
|
|
2844
2954
|
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.Controllers.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"controller_id",\n\t\tnks.ClusterControllerVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2847,9 +2957,6 @@ const EMBEDDED_METHODS = [
|
|
|
2847
2957
|
method: 'volumes list',
|
|
2848
2958
|
example: "nirvana nks:clusters:controllers:volumes list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --controller-id controller_id",
|
|
2849
2959
|
},
|
|
2850
|
-
http: {
|
|
2851
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2852
|
-
},
|
|
2853
2960
|
},
|
|
2854
2961
|
},
|
|
2855
2962
|
{
|
|
@@ -2868,6 +2975,9 @@ const EMBEDDED_METHODS = [
|
|
|
2868
2975
|
method: 'client.nks.clusters.loadBalancers.get',
|
|
2869
2976
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksLoadBalancer = await client.nks.clusters.loadBalancers.get('load_balancer_id', {\n cluster_id: 'cluster_id',\n});\n\nconsole.log(nksLoadBalancer.id);",
|
|
2870
2977
|
},
|
|
2978
|
+
http: {
|
|
2979
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers/$LOAD_BALANCER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2980
|
+
},
|
|
2871
2981
|
go: {
|
|
2872
2982
|
method: 'client.NKS.Clusters.LoadBalancers.Get',
|
|
2873
2983
|
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\tnksLoadBalancer, err := client.NKS.Clusters.LoadBalancers.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"load_balancer_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksLoadBalancer.ID)\n}\n',
|
|
@@ -2876,9 +2986,6 @@ const EMBEDDED_METHODS = [
|
|
|
2876
2986
|
method: 'load_balancers get',
|
|
2877
2987
|
example: "nirvana nks:clusters:load-balancers get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --load-balancer-id load_balancer_id",
|
|
2878
2988
|
},
|
|
2879
|
-
http: {
|
|
2880
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers/$LOAD_BALANCER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2881
|
-
},
|
|
2882
2989
|
},
|
|
2883
2990
|
},
|
|
2884
2991
|
{
|
|
@@ -2897,6 +3004,9 @@ const EMBEDDED_METHODS = [
|
|
|
2897
3004
|
method: 'client.nks.clusters.loadBalancers.update',
|
|
2898
3005
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.loadBalancers.update('load_balancer_id', {\n cluster_id: 'cluster_id',\n public_ip_enabled: true,\n});\n\nconsole.log(operation.id);",
|
|
2899
3006
|
},
|
|
3007
|
+
http: {
|
|
3008
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers/$LOAD_BALANCER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "public_ip_enabled": true\n }\'',
|
|
3009
|
+
},
|
|
2900
3010
|
go: {
|
|
2901
3011
|
method: 'client.NKS.Clusters.LoadBalancers.Update',
|
|
2902
3012
|
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\toperation, err := client.NKS.Clusters.LoadBalancers.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"load_balancer_id",\n\t\tnks.ClusterLoadBalancerUpdateParams{\n\t\t\tPublicIPEnabled: true,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -2905,9 +3015,6 @@ const EMBEDDED_METHODS = [
|
|
|
2905
3015
|
method: 'load_balancers update',
|
|
2906
3016
|
example: "nirvana nks:clusters:load-balancers update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --load-balancer-id load_balancer_id \\\n --public-ip-enabled",
|
|
2907
3017
|
},
|
|
2908
|
-
http: {
|
|
2909
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers/$LOAD_BALANCER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "public_ip_enabled": true\n }\'',
|
|
2910
|
-
},
|
|
2911
3018
|
},
|
|
2912
3019
|
},
|
|
2913
3020
|
{
|
|
@@ -2926,6 +3033,9 @@ const EMBEDDED_METHODS = [
|
|
|
2926
3033
|
method: 'client.nks.clusters.loadBalancers.list',
|
|
2927
3034
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksLoadBalancer of client.nks.clusters.loadBalancers.list('cluster_id')) {\n console.log(nksLoadBalancer.id);\n}",
|
|
2928
3035
|
},
|
|
3036
|
+
http: {
|
|
3037
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3038
|
+
},
|
|
2929
3039
|
go: {
|
|
2930
3040
|
method: 'client.NKS.Clusters.LoadBalancers.List',
|
|
2931
3041
|
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.LoadBalancers.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterLoadBalancerListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -2934,9 +3044,6 @@ const EMBEDDED_METHODS = [
|
|
|
2934
3044
|
method: 'load_balancers list',
|
|
2935
3045
|
example: "nirvana nks:clusters:load-balancers list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2936
3046
|
},
|
|
2937
|
-
http: {
|
|
2938
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2939
|
-
},
|
|
2940
3047
|
},
|
|
2941
3048
|
},
|
|
2942
3049
|
{
|
|
@@ -2961,6 +3068,9 @@ const EMBEDDED_METHODS = [
|
|
|
2961
3068
|
method: 'client.nks.clusters.pools.create',
|
|
2962
3069
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.pools.create('cluster_id', {\n name: 'my-node-pool',\n node_config: {\n boot_volume: { size: 100, type: 'abs' },\n instance_type: 'n1-standard-8',\n },\n node_count: 3,\n});\n\nconsole.log(operation.id);",
|
|
2963
3070
|
},
|
|
3071
|
+
http: {
|
|
3072
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_config": {\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8"\n },\n "node_count": 3,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3073
|
+
},
|
|
2964
3074
|
go: {
|
|
2965
3075
|
method: 'client.NKS.Clusters.Pools.New',
|
|
2966
3076
|
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/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\toperation, err := client.NKS.Clusters.Pools.New(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolNewParams{\n\t\t\tName: "my-node-pool",\n\t\t\tNodeConfig: nks.NKSNodePoolNodeConfigParam{\n\t\t\t\tBootVolume: nks.NKSNodePoolBootVolumeParam{\n\t\t\t\t\tSize: 100,\n\t\t\t\t\tType: compute.VolumeTypeABS,\n\t\t\t\t},\n\t\t\t\tInstanceType: "n1-standard-8",\n\t\t\t},\n\t\t\tNodeCount: 3,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -2969,9 +3079,6 @@ const EMBEDDED_METHODS = [
|
|
|
2969
3079
|
method: 'pools create',
|
|
2970
3080
|
example: "nirvana nks:clusters:pools create \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --name my-node-pool \\\n --node-config '{boot_volume: {size: 100, type: abs}, instance_type: n1-standard-8}' \\\n --node-count 3",
|
|
2971
3081
|
},
|
|
2972
|
-
http: {
|
|
2973
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_config": {\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8"\n },\n "node_count": 3,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
2974
|
-
},
|
|
2975
3082
|
},
|
|
2976
3083
|
},
|
|
2977
3084
|
{
|
|
@@ -2990,6 +3097,9 @@ const EMBEDDED_METHODS = [
|
|
|
2990
3097
|
method: 'client.nks.clusters.pools.get',
|
|
2991
3098
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksNodePool = await client.nks.clusters.pools.get('pool_id', { cluster_id: 'cluster_id' });\n\nconsole.log(nksNodePool.id);",
|
|
2992
3099
|
},
|
|
3100
|
+
http: {
|
|
3101
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3102
|
+
},
|
|
2993
3103
|
go: {
|
|
2994
3104
|
method: 'client.NKS.Clusters.Pools.Get',
|
|
2995
3105
|
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\tnksNodePool, err := client.NKS.Clusters.Pools.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksNodePool.ID)\n}\n',
|
|
@@ -2998,9 +3108,6 @@ const EMBEDDED_METHODS = [
|
|
|
2998
3108
|
method: 'pools get',
|
|
2999
3109
|
example: "nirvana nks:clusters:pools get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3000
3110
|
},
|
|
3001
|
-
http: {
|
|
3002
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3003
|
-
},
|
|
3004
3111
|
},
|
|
3005
3112
|
},
|
|
3006
3113
|
{
|
|
@@ -3026,6 +3133,9 @@ const EMBEDDED_METHODS = [
|
|
|
3026
3133
|
method: 'client.nks.clusters.pools.update',
|
|
3027
3134
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.pools.update('pool_id', { cluster_id: 'cluster_id' });\n\nconsole.log(operation.id);",
|
|
3028
3135
|
},
|
|
3136
|
+
http: {
|
|
3137
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_count": 5,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3138
|
+
},
|
|
3029
3139
|
go: {
|
|
3030
3140
|
method: 'client.NKS.Clusters.Pools.Update',
|
|
3031
3141
|
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\toperation, err := client.NKS.Clusters.Pools.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -3034,9 +3144,6 @@ const EMBEDDED_METHODS = [
|
|
|
3034
3144
|
method: 'pools update',
|
|
3035
3145
|
example: "nirvana nks:clusters:pools update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3036
3146
|
},
|
|
3037
|
-
http: {
|
|
3038
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_count": 5,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3039
|
-
},
|
|
3040
3147
|
},
|
|
3041
3148
|
},
|
|
3042
3149
|
{
|
|
@@ -3055,6 +3162,9 @@ const EMBEDDED_METHODS = [
|
|
|
3055
3162
|
method: 'client.nks.clusters.pools.delete',
|
|
3056
3163
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.pools.delete('pool_id', { cluster_id: 'cluster_id' });\n\nconsole.log(operation.id);",
|
|
3057
3164
|
},
|
|
3165
|
+
http: {
|
|
3166
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3167
|
+
},
|
|
3058
3168
|
go: {
|
|
3059
3169
|
method: 'client.NKS.Clusters.Pools.Delete',
|
|
3060
3170
|
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\toperation, err := client.NKS.Clusters.Pools.Delete(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -3063,9 +3173,6 @@ const EMBEDDED_METHODS = [
|
|
|
3063
3173
|
method: 'pools delete',
|
|
3064
3174
|
example: "nirvana nks:clusters:pools delete \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3065
3175
|
},
|
|
3066
|
-
http: {
|
|
3067
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3068
|
-
},
|
|
3069
3176
|
},
|
|
3070
3177
|
},
|
|
3071
3178
|
{
|
|
@@ -3084,6 +3191,9 @@ const EMBEDDED_METHODS = [
|
|
|
3084
3191
|
method: 'client.nks.clusters.pools.list',
|
|
3085
3192
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksNodePool of client.nks.clusters.pools.list('cluster_id')) {\n console.log(nksNodePool.id);\n}",
|
|
3086
3193
|
},
|
|
3194
|
+
http: {
|
|
3195
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3196
|
+
},
|
|
3087
3197
|
go: {
|
|
3088
3198
|
method: 'client.NKS.Clusters.Pools.List',
|
|
3089
3199
|
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.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -3092,9 +3202,6 @@ const EMBEDDED_METHODS = [
|
|
|
3092
3202
|
method: 'pools list',
|
|
3093
3203
|
example: "nirvana nks:clusters:pools list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
3094
3204
|
},
|
|
3095
|
-
http: {
|
|
3096
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3097
|
-
},
|
|
3098
3205
|
},
|
|
3099
3206
|
},
|
|
3100
3207
|
{
|
|
@@ -3118,6 +3225,9 @@ const EMBEDDED_METHODS = [
|
|
|
3118
3225
|
method: 'client.nks.clusters.pools.availability.create',
|
|
3119
3226
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.nks.clusters.pools.availability.create('cluster_id', {\n name: 'my-node-pool',\n node_config: {\n boot_volume: { size: 100, type: 'abs' },\n instance_type: 'n1-standard-8',\n },\n node_count: 3,\n});",
|
|
3120
3227
|
},
|
|
3228
|
+
http: {
|
|
3229
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_config": {\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8"\n },\n "node_count": 3,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3230
|
+
},
|
|
3121
3231
|
go: {
|
|
3122
3232
|
method: 'client.NKS.Clusters.Pools.Availability.New',
|
|
3123
3233
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/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\terr := client.NKS.Clusters.Pools.Availability.New(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolAvailabilityNewParams{\n\t\t\tName: "my-node-pool",\n\t\t\tNodeConfig: nks.NKSNodePoolNodeConfigParam{\n\t\t\t\tBootVolume: nks.NKSNodePoolBootVolumeParam{\n\t\t\t\t\tSize: 100,\n\t\t\t\t\tType: compute.VolumeTypeABS,\n\t\t\t\t},\n\t\t\t\tInstanceType: "n1-standard-8",\n\t\t\t},\n\t\t\tNodeCount: 3,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -3126,9 +3236,6 @@ const EMBEDDED_METHODS = [
|
|
|
3126
3236
|
method: 'availability create',
|
|
3127
3237
|
example: "nirvana nks:clusters:pools:availability create \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --name my-node-pool \\\n --node-config '{boot_volume: {size: 100, type: abs}, instance_type: n1-standard-8}' \\\n --node-count 3",
|
|
3128
3238
|
},
|
|
3129
|
-
http: {
|
|
3130
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_config": {\n "boot_volume": {\n "size": 100,\n "type": "abs"\n },\n "instance_type": "n1-standard-8"\n },\n "node_count": 3,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3131
|
-
},
|
|
3132
3239
|
},
|
|
3133
3240
|
},
|
|
3134
3241
|
{
|
|
@@ -3153,6 +3260,9 @@ const EMBEDDED_METHODS = [
|
|
|
3153
3260
|
method: 'client.nks.clusters.pools.availability.update',
|
|
3154
3261
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.nks.clusters.pools.availability.update('pool_id', { cluster_id: 'cluster_id' });",
|
|
3155
3262
|
},
|
|
3263
|
+
http: {
|
|
3264
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_count": 5,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3265
|
+
},
|
|
3156
3266
|
go: {
|
|
3157
3267
|
method: 'client.NKS.Clusters.Pools.Availability.Update',
|
|
3158
3268
|
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Pools.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
@@ -3161,9 +3271,6 @@ const EMBEDDED_METHODS = [
|
|
|
3161
3271
|
method: 'availability update',
|
|
3162
3272
|
example: "nirvana nks:clusters:pools:availability update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3163
3273
|
},
|
|
3164
|
-
http: {
|
|
3165
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/availability \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-node-pool",\n "node_count": 5,\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
3166
|
-
},
|
|
3167
3274
|
},
|
|
3168
3275
|
},
|
|
3169
3276
|
{
|
|
@@ -3182,6 +3289,9 @@ const EMBEDDED_METHODS = [
|
|
|
3182
3289
|
method: 'client.nks.clusters.pools.nodes.get',
|
|
3183
3290
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksNode = await client.nks.clusters.pools.nodes.get('node_id', {\n cluster_id: 'cluster_id',\n pool_id: 'pool_id',\n});\n\nconsole.log(nksNode.id);",
|
|
3184
3291
|
},
|
|
3292
|
+
http: {
|
|
3293
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3294
|
+
},
|
|
3185
3295
|
go: {
|
|
3186
3296
|
method: 'client.NKS.Clusters.Pools.Nodes.Get',
|
|
3187
3297
|
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\tnksNode, err := client.NKS.Clusters.Pools.Nodes.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksNode.ID)\n}\n',
|
|
@@ -3190,9 +3300,6 @@ const EMBEDDED_METHODS = [
|
|
|
3190
3300
|
method: 'nodes get',
|
|
3191
3301
|
example: "nirvana nks:clusters:pools:nodes get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id \\\n --node-id node_id",
|
|
3192
3302
|
},
|
|
3193
|
-
http: {
|
|
3194
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3195
|
-
},
|
|
3196
3303
|
},
|
|
3197
3304
|
},
|
|
3198
3305
|
{
|
|
@@ -3211,6 +3318,9 @@ const EMBEDDED_METHODS = [
|
|
|
3211
3318
|
method: 'client.nks.clusters.pools.nodes.delete',
|
|
3212
3319
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.nks.clusters.pools.nodes.delete('node_id', {\n cluster_id: 'cluster_id',\n pool_id: 'pool_id',\n});\n\nconsole.log(operation.id);",
|
|
3213
3320
|
},
|
|
3321
|
+
http: {
|
|
3322
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3323
|
+
},
|
|
3214
3324
|
go: {
|
|
3215
3325
|
method: 'client.NKS.Clusters.Pools.Nodes.Delete',
|
|
3216
3326
|
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\toperation, err := client.NKS.Clusters.Pools.Nodes.Delete(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
@@ -3219,9 +3329,6 @@ const EMBEDDED_METHODS = [
|
|
|
3219
3329
|
method: 'nodes delete',
|
|
3220
3330
|
example: "nirvana nks:clusters:pools:nodes delete \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id \\\n --node-id node_id",
|
|
3221
3331
|
},
|
|
3222
|
-
http: {
|
|
3223
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3224
|
-
},
|
|
3225
3332
|
},
|
|
3226
3333
|
},
|
|
3227
3334
|
{
|
|
@@ -3240,6 +3347,9 @@ const EMBEDDED_METHODS = [
|
|
|
3240
3347
|
method: 'client.nks.clusters.pools.nodes.list',
|
|
3241
3348
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksNode of client.nks.clusters.pools.nodes.list('pool_id', {\n cluster_id: 'cluster_id',\n})) {\n console.log(nksNode.id);\n}",
|
|
3242
3349
|
},
|
|
3350
|
+
http: {
|
|
3351
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3352
|
+
},
|
|
3243
3353
|
go: {
|
|
3244
3354
|
method: 'client.NKS.Clusters.Pools.Nodes.List',
|
|
3245
3355
|
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.Nodes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolNodeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -3248,9 +3358,6 @@ const EMBEDDED_METHODS = [
|
|
|
3248
3358
|
method: 'nodes list',
|
|
3249
3359
|
example: "nirvana nks:clusters:pools:nodes list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3250
3360
|
},
|
|
3251
|
-
http: {
|
|
3252
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3253
|
-
},
|
|
3254
3361
|
},
|
|
3255
3362
|
},
|
|
3256
3363
|
{
|
|
@@ -3269,6 +3376,9 @@ const EMBEDDED_METHODS = [
|
|
|
3269
3376
|
method: 'client.nks.clusters.pools.nodes.volumes.get',
|
|
3270
3377
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst nksNodeVolume = await client.nks.clusters.pools.nodes.volumes.get('volume_id', {\n cluster_id: 'cluster_id',\n pool_id: 'pool_id',\n node_id: 'node_id',\n});\n\nconsole.log(nksNodeVolume.id);",
|
|
3271
3378
|
},
|
|
3379
|
+
http: {
|
|
3380
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3381
|
+
},
|
|
3272
3382
|
go: {
|
|
3273
3383
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.Get',
|
|
3274
3384
|
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\tnksNodeVolume, err := client.NKS.Clusters.Pools.Nodes.Volumes.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t\t"volume_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksNodeVolume.ID)\n}\n',
|
|
@@ -3277,9 +3387,6 @@ const EMBEDDED_METHODS = [
|
|
|
3277
3387
|
method: 'volumes get',
|
|
3278
3388
|
example: "nirvana nks:clusters:pools:nodes:volumes get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id \\\n --node-id node_id \\\n --volume-id volume_id",
|
|
3279
3389
|
},
|
|
3280
|
-
http: {
|
|
3281
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3282
|
-
},
|
|
3283
3390
|
},
|
|
3284
3391
|
},
|
|
3285
3392
|
{
|
|
@@ -3304,6 +3411,9 @@ const EMBEDDED_METHODS = [
|
|
|
3304
3411
|
method: 'client.nks.clusters.pools.nodes.volumes.list',
|
|
3305
3412
|
example: "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nksNodeVolume of client.nks.clusters.pools.nodes.volumes.list('node_id', {\n cluster_id: 'cluster_id',\n pool_id: 'pool_id',\n})) {\n console.log(nksNodeVolume.id);\n}",
|
|
3306
3413
|
},
|
|
3414
|
+
http: {
|
|
3415
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3416
|
+
},
|
|
3307
3417
|
go: {
|
|
3308
3418
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.List',
|
|
3309
3419
|
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.Nodes.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t\tnks.ClusterPoolNodeVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
@@ -3312,28 +3422,25 @@ const EMBEDDED_METHODS = [
|
|
|
3312
3422
|
method: 'volumes list',
|
|
3313
3423
|
example: "nirvana nks:clusters:pools:nodes:volumes list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id \\\n --node-id node_id",
|
|
3314
3424
|
},
|
|
3315
|
-
http: {
|
|
3316
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes/$NODE_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3317
|
-
},
|
|
3318
3425
|
},
|
|
3319
3426
|
},
|
|
3320
3427
|
];
|
|
3321
3428
|
const EMBEDDED_READMES = [
|
|
3322
3429
|
{
|
|
3323
|
-
language: '
|
|
3324
|
-
content: "# Nirvana Labs CLI\n\nThe official CLI for the [Nirvana Labs REST API](https://docs.nirvanalabs.io).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install nirvana-labs/tap/nirvana\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/nirvana-labs/nirvana-cli/cmd/nirvana@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nnirvana [resource] <command> [flags...]\n~~~\n\n~~~sh\nnirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\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 \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required |\n| ---------------------- | -------- |\n| `NIRVANA_LABS_API_KEY` | yes |\n\n### Global flags\n\n- `--api-key` (can also be set with `NIRVANA_LABS_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nnirvana <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nnirvana <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nnirvana <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\nnirvana <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nnirvana <command> --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Nirvana Labs Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/nirvana-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../nirvana-go`.\n",
|
|
3430
|
+
language: 'typescript',
|
|
3431
|
+
content: "# Nirvana Labs TypeScript API Library\n\n[)](https://npmjs.org/package/@nirvana-labs/nirvana) \n\nThis library provides convenient access to the Nirvana Labs REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.nirvanalabs.io](https://docs.nirvanalabs.io). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @nirvana-labs/nirvana\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\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});\n\nconsole.log(operation.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: NirvanaLabs.Compute.VMCreateParams = {\n boot_volume: { size: 100, type: 'abs' },\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};\nconst operation: NirvanaLabs.Operation = await client.compute.vms.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst operation = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'abs' },\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:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .catch(async (err) => {\n if (err instanceof NirvanaLabs.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\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: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\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: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the NirvanaLabs API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllVMs(params) {\n const allVMs = [];\n // Automatically fetches more pages as needed.\n for await (const vm of client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n })) {\n allVMs.push(vm);\n }\n return allVMs;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n});\nfor (const vm of page.items) {\n console.log(vm);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new NirvanaLabs();\n\nconst response = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'abs' },\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:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: operation, response: raw } = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'abs' },\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:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(operation.id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `NIRVANA_LABS_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new NirvanaLabs({\n logger: logger.child({ name: 'NirvanaLabs' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.compute.vms.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport fetch from 'my-fetch';\n\nconst client = new NirvanaLabs({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new NirvanaLabs({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport NirvanaLabs from 'npm:@nirvana-labs/nirvana';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new NirvanaLabs({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
3325
3432
|
},
|
|
3326
3433
|
{
|
|
3327
3434
|
language: 'go',
|
|
3328
|
-
content: '# Nirvana Labs Go API Library\n\n<a href="https://pkg.go.dev/github.com/nirvana-labs/nirvana-go"><img src="https://pkg.go.dev/badge/github.com/nirvana-labs/nirvana-go.svg" alt="Go Reference"></a>\n\nThe Nirvana Labs Go library provides convenient access to the [Nirvana Labs REST API](https://docs.nirvanalabs.io)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/nirvana-labs/nirvana-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/nirvana-labs/nirvana-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("NIRVANA_LABS_API_KEY")\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.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',
|
|
3435
|
+
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.91.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',
|
|
3329
3436
|
},
|
|
3330
3437
|
{
|
|
3331
3438
|
language: 'terraform',
|
|
3332
|
-
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 = "~>
|
|
3439
|
+
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.91.1"\n }\n }\n}\n\n# Initialize the provider\nprovider "nirvana" {\n api_key = "My API Key" # or set NIRVANA_LABS_API_KEY env variable\n}\n\n# Configure a resource\nresource "nirvana_compute_vm" "example_compute_vm" {\n boot_volume = {\n size = 100\n type = "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',
|
|
3333
3440
|
},
|
|
3334
3441
|
{
|
|
3335
|
-
language: '
|
|
3336
|
-
content: "# Nirvana Labs TypeScript API Library\n\n[)](https://npmjs.org/package/@nirvana-labs/nirvana) \n\nThis library provides convenient access to the Nirvana Labs REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.nirvanalabs.io](https://docs.nirvanalabs.io). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @nirvana-labs/nirvana\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst operation = await client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\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});\n\nconsole.log(operation.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: NirvanaLabs.Compute.VMCreateParams = {\n boot_volume: { size: 100, type: 'abs' },\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};\nconst operation: NirvanaLabs.Operation = await client.compute.vms.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst operation = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'abs' },\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:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .catch(async (err) => {\n if (err instanceof NirvanaLabs.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\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: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new NirvanaLabs({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.compute.vms.create({\n boot_volume: { size: 100, type: 'abs' },\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: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2' },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the NirvanaLabs API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllVMs(params) {\n const allVMs = [];\n // Automatically fetches more pages as needed.\n for await (const vm of client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n })) {\n allVMs.push(vm);\n }\n return allVMs;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.compute.vms.list({\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n limit: 10,\n});\nfor (const vm of page.items) {\n console.log(vm);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new NirvanaLabs();\n\nconst response = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'abs' },\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:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: operation, response: raw } = await client.compute.vms\n .create({\n boot_volume: { size: 100, type: 'abs' },\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:\n 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',\n },\n subnet_id: '123e4567-e89b-12d3-a456-426614174000',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(operation.id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `NIRVANA_LABS_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new NirvanaLabs({\n logger: logger.child({ name: 'NirvanaLabs' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.compute.vms.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport fetch from 'my-fetch';\n\nconst client = new NirvanaLabs({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new NirvanaLabs({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport NirvanaLabs from 'npm:@nirvana-labs/nirvana';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new NirvanaLabs({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
3442
|
+
language: 'cli',
|
|
3443
|
+
content: "# Nirvana Labs CLI\n\nThe official CLI for the [Nirvana Labs REST API](https://docs.nirvanalabs.io).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install nirvana-labs/tap/nirvana\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/nirvana-labs/nirvana-cli/cmd/nirvana@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nnirvana [resource] <command> [flags...]\n~~~\n\n~~~sh\nnirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\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 \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required |\n| ---------------------- | -------- |\n| `NIRVANA_LABS_API_KEY` | yes |\n\n### Global flags\n\n- `--api-key` (can also be set with `NIRVANA_LABS_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nnirvana <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nnirvana <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nnirvana <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\nnirvana <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nnirvana <command> --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Nirvana Labs Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/nirvana-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../nirvana-go`.\n",
|
|
3337
3444
|
},
|
|
3338
3445
|
];
|
|
3339
3446
|
const INDEX_OPTIONS = {
|