@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.mjs
CHANGED
|
@@ -19,6 +19,9 @@ const EMBEDDED_METHODS = [
|
|
|
19
19
|
method: 'client.user.get',
|
|
20
20
|
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);",
|
|
21
21
|
},
|
|
22
|
+
http: {
|
|
23
|
+
example: 'curl https://api.nirvanalabs.io/v1/user \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
24
|
+
},
|
|
22
25
|
go: {
|
|
23
26
|
method: 'client.User.Get',
|
|
24
27
|
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',
|
|
@@ -27,9 +30,6 @@ const EMBEDDED_METHODS = [
|
|
|
27
30
|
method: 'user get',
|
|
28
31
|
example: "nirvana user get \\\n --api-key 'My API Key'",
|
|
29
32
|
},
|
|
30
|
-
http: {
|
|
31
|
-
example: 'curl https://api.nirvanalabs.io/v1/user \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
32
|
-
},
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
{
|
|
@@ -47,6 +47,9 @@ const EMBEDDED_METHODS = [
|
|
|
47
47
|
method: 'client.user.security.get',
|
|
48
48
|
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);",
|
|
49
49
|
},
|
|
50
|
+
http: {
|
|
51
|
+
example: 'curl https://api.nirvanalabs.io/v1/user/security \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
52
|
+
},
|
|
50
53
|
go: {
|
|
51
54
|
method: 'client.User.Security.Get',
|
|
52
55
|
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',
|
|
@@ -55,9 +58,6 @@ const EMBEDDED_METHODS = [
|
|
|
55
58
|
method: 'security get',
|
|
56
59
|
example: "nirvana user:security get \\\n --api-key 'My API Key'",
|
|
57
60
|
},
|
|
58
|
-
http: {
|
|
59
|
-
example: 'curl https://api.nirvanalabs.io/v1/user/security \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
60
|
-
},
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -76,6 +76,9 @@ const EMBEDDED_METHODS = [
|
|
|
76
76
|
method: 'client.user.security.update',
|
|
77
77
|
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);",
|
|
78
78
|
},
|
|
79
|
+
http: {
|
|
80
|
+
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 '{}'",
|
|
81
|
+
},
|
|
79
82
|
go: {
|
|
80
83
|
method: 'client.User.Security.Update',
|
|
81
84
|
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',
|
|
@@ -84,9 +87,6 @@ const EMBEDDED_METHODS = [
|
|
|
84
87
|
method: 'security update',
|
|
85
88
|
example: "nirvana user:security update \\\n --api-key 'My API Key'",
|
|
86
89
|
},
|
|
87
|
-
http: {
|
|
88
|
-
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 '{}'",
|
|
89
|
-
},
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -113,6 +113,9 @@ const EMBEDDED_METHODS = [
|
|
|
113
113
|
method: 'client.apiKeys.create',
|
|
114
114
|
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);",
|
|
115
115
|
},
|
|
116
|
+
http: {
|
|
117
|
+
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 }\'',
|
|
118
|
+
},
|
|
116
119
|
go: {
|
|
117
120
|
method: 'client.APIKeys.New',
|
|
118
121
|
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',
|
|
@@ -121,9 +124,6 @@ const EMBEDDED_METHODS = [
|
|
|
121
124
|
method: 'api_keys create',
|
|
122
125
|
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",
|
|
123
126
|
},
|
|
124
|
-
http: {
|
|
125
|
-
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 }\'',
|
|
126
|
-
},
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -142,6 +142,9 @@ const EMBEDDED_METHODS = [
|
|
|
142
142
|
method: 'client.apiKeys.get',
|
|
143
143
|
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);",
|
|
144
144
|
},
|
|
145
|
+
http: {
|
|
146
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
147
|
+
},
|
|
145
148
|
go: {
|
|
146
149
|
method: 'client.APIKeys.Get',
|
|
147
150
|
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',
|
|
@@ -150,9 +153,6 @@ const EMBEDDED_METHODS = [
|
|
|
150
153
|
method: 'api_keys get',
|
|
151
154
|
example: "nirvana api-keys get \\\n --api-key 'My API Key' \\\n --api-key-id api_key_id",
|
|
152
155
|
},
|
|
153
|
-
http: {
|
|
154
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
155
|
-
},
|
|
156
156
|
},
|
|
157
157
|
},
|
|
158
158
|
{
|
|
@@ -178,6 +178,9 @@ const EMBEDDED_METHODS = [
|
|
|
178
178
|
method: 'client.apiKeys.update',
|
|
179
179
|
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);",
|
|
180
180
|
},
|
|
181
|
+
http: {
|
|
182
|
+
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 }\'',
|
|
183
|
+
},
|
|
181
184
|
go: {
|
|
182
185
|
method: 'client.APIKeys.Update',
|
|
183
186
|
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',
|
|
@@ -186,9 +189,6 @@ const EMBEDDED_METHODS = [
|
|
|
186
189
|
method: 'api_keys update',
|
|
187
190
|
example: "nirvana api-keys update \\\n --api-key 'My API Key' \\\n --api-key-id api_key_id",
|
|
188
191
|
},
|
|
189
|
-
http: {
|
|
190
|
-
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 }\'',
|
|
191
|
-
},
|
|
192
192
|
},
|
|
193
193
|
},
|
|
194
194
|
{
|
|
@@ -206,6 +206,9 @@ const EMBEDDED_METHODS = [
|
|
|
206
206
|
method: 'client.apiKeys.delete',
|
|
207
207
|
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');",
|
|
208
208
|
},
|
|
209
|
+
http: {
|
|
210
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
211
|
+
},
|
|
209
212
|
go: {
|
|
210
213
|
method: 'client.APIKeys.Delete',
|
|
211
214
|
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',
|
|
@@ -214,9 +217,6 @@ const EMBEDDED_METHODS = [
|
|
|
214
217
|
method: 'api_keys delete',
|
|
215
218
|
example: "nirvana api-keys delete \\\n --api-key 'My API Key' \\\n --api-key-id api_key_id",
|
|
216
219
|
},
|
|
217
|
-
http: {
|
|
218
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys/$API_KEY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
219
|
-
},
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
222
|
{
|
|
@@ -235,6 +235,9 @@ const EMBEDDED_METHODS = [
|
|
|
235
235
|
method: 'client.apiKeys.list',
|
|
236
236
|
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}",
|
|
237
237
|
},
|
|
238
|
+
http: {
|
|
239
|
+
example: 'curl https://api.nirvanalabs.io/v1/api_keys \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
240
|
+
},
|
|
238
241
|
go: {
|
|
239
242
|
method: 'client.APIKeys.List',
|
|
240
243
|
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',
|
|
@@ -243,9 +246,6 @@ const EMBEDDED_METHODS = [
|
|
|
243
246
|
method: 'api_keys list',
|
|
244
247
|
example: "nirvana api-keys list \\\n --api-key 'My API Key'",
|
|
245
248
|
},
|
|
246
|
-
http: {
|
|
247
|
-
example: 'curl https://api.nirvanalabs.io/v1/api_keys \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
248
|
-
},
|
|
249
249
|
},
|
|
250
250
|
},
|
|
251
251
|
{
|
|
@@ -264,6 +264,9 @@ const EMBEDDED_METHODS = [
|
|
|
264
264
|
method: 'client.operations.get',
|
|
265
265
|
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);",
|
|
266
266
|
},
|
|
267
|
+
http: {
|
|
268
|
+
example: 'curl https://api.nirvanalabs.io/v1/operations/$OPERATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
269
|
+
},
|
|
267
270
|
go: {
|
|
268
271
|
method: 'client.Operations.Get',
|
|
269
272
|
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',
|
|
@@ -272,9 +275,6 @@ const EMBEDDED_METHODS = [
|
|
|
272
275
|
method: 'operations get',
|
|
273
276
|
example: "nirvana operations get \\\n --api-key 'My API Key' \\\n --operation-id operation_id",
|
|
274
277
|
},
|
|
275
|
-
http: {
|
|
276
|
-
example: 'curl https://api.nirvanalabs.io/v1/operations/$OPERATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
277
|
-
},
|
|
278
278
|
},
|
|
279
279
|
},
|
|
280
280
|
{
|
|
@@ -293,6 +293,9 @@ const EMBEDDED_METHODS = [
|
|
|
293
293
|
method: 'client.operations.list',
|
|
294
294
|
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}",
|
|
295
295
|
},
|
|
296
|
+
http: {
|
|
297
|
+
example: 'curl https://api.nirvanalabs.io/v1/operations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
298
|
+
},
|
|
296
299
|
go: {
|
|
297
300
|
method: 'client.Operations.List',
|
|
298
301
|
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',
|
|
@@ -301,9 +304,6 @@ const EMBEDDED_METHODS = [
|
|
|
301
304
|
method: 'operations list',
|
|
302
305
|
example: "nirvana operations list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
303
306
|
},
|
|
304
|
-
http: {
|
|
305
|
-
example: 'curl https://api.nirvanalabs.io/v1/operations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
306
|
-
},
|
|
307
307
|
},
|
|
308
308
|
},
|
|
309
309
|
{
|
|
@@ -322,6 +322,9 @@ const EMBEDDED_METHODS = [
|
|
|
322
322
|
method: 'client.organizations.create',
|
|
323
323
|
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);",
|
|
324
324
|
},
|
|
325
|
+
http: {
|
|
326
|
+
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 }\'',
|
|
327
|
+
},
|
|
325
328
|
go: {
|
|
326
329
|
method: 'client.Organizations.New',
|
|
327
330
|
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',
|
|
@@ -330,9 +333,6 @@ const EMBEDDED_METHODS = [
|
|
|
330
333
|
method: 'organizations create',
|
|
331
334
|
example: "nirvana organizations create \\\n --api-key 'My API Key' \\\n --name 'My Organization'",
|
|
332
335
|
},
|
|
333
|
-
http: {
|
|
334
|
-
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 }\'',
|
|
335
|
-
},
|
|
336
336
|
},
|
|
337
337
|
},
|
|
338
338
|
{
|
|
@@ -351,6 +351,9 @@ const EMBEDDED_METHODS = [
|
|
|
351
351
|
method: 'client.organizations.get',
|
|
352
352
|
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);",
|
|
353
353
|
},
|
|
354
|
+
http: {
|
|
355
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
356
|
+
},
|
|
354
357
|
go: {
|
|
355
358
|
method: 'client.Organizations.Get',
|
|
356
359
|
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',
|
|
@@ -359,9 +362,6 @@ const EMBEDDED_METHODS = [
|
|
|
359
362
|
method: 'organizations get',
|
|
360
363
|
example: "nirvana organizations get \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
361
364
|
},
|
|
362
|
-
http: {
|
|
363
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
364
|
-
},
|
|
365
365
|
},
|
|
366
366
|
},
|
|
367
367
|
{
|
|
@@ -380,6 +380,9 @@ const EMBEDDED_METHODS = [
|
|
|
380
380
|
method: 'client.organizations.update',
|
|
381
381
|
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);",
|
|
382
382
|
},
|
|
383
|
+
http: {
|
|
384
|
+
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 }\'',
|
|
385
|
+
},
|
|
383
386
|
go: {
|
|
384
387
|
method: 'client.Organizations.Update',
|
|
385
388
|
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',
|
|
@@ -388,9 +391,6 @@ const EMBEDDED_METHODS = [
|
|
|
388
391
|
method: 'organizations update',
|
|
389
392
|
example: "nirvana organizations update \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
390
393
|
},
|
|
391
|
-
http: {
|
|
392
|
-
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 }\'',
|
|
393
|
-
},
|
|
394
394
|
},
|
|
395
395
|
},
|
|
396
396
|
{
|
|
@@ -409,6 +409,9 @@ const EMBEDDED_METHODS = [
|
|
|
409
409
|
method: 'client.organizations.list',
|
|
410
410
|
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}",
|
|
411
411
|
},
|
|
412
|
+
http: {
|
|
413
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
414
|
+
},
|
|
412
415
|
go: {
|
|
413
416
|
method: 'client.Organizations.List',
|
|
414
417
|
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',
|
|
@@ -417,9 +420,6 @@ const EMBEDDED_METHODS = [
|
|
|
417
420
|
method: 'organizations list',
|
|
418
421
|
example: "nirvana organizations list \\\n --api-key 'My API Key'",
|
|
419
422
|
},
|
|
420
|
-
http: {
|
|
421
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
422
|
-
},
|
|
423
423
|
},
|
|
424
424
|
},
|
|
425
425
|
{
|
|
@@ -437,6 +437,9 @@ const EMBEDDED_METHODS = [
|
|
|
437
437
|
method: 'client.organizations.leave',
|
|
438
438
|
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');",
|
|
439
439
|
},
|
|
440
|
+
http: {
|
|
441
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/leave \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
442
|
+
},
|
|
440
443
|
go: {
|
|
441
444
|
method: 'client.Organizations.Leave',
|
|
442
445
|
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',
|
|
@@ -445,9 +448,6 @@ const EMBEDDED_METHODS = [
|
|
|
445
448
|
method: 'organizations leave',
|
|
446
449
|
example: "nirvana organizations leave \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
447
450
|
},
|
|
448
|
-
http: {
|
|
449
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/leave \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
450
|
-
},
|
|
451
451
|
},
|
|
452
452
|
},
|
|
453
453
|
{
|
|
@@ -466,6 +466,9 @@ const EMBEDDED_METHODS = [
|
|
|
466
466
|
method: 'client.organizations.memberships.get',
|
|
467
467
|
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);",
|
|
468
468
|
},
|
|
469
|
+
http: {
|
|
470
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships/$MEMBERSHIP_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
471
|
+
},
|
|
469
472
|
go: {
|
|
470
473
|
method: 'client.Organizations.Memberships.Get',
|
|
471
474
|
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',
|
|
@@ -474,9 +477,6 @@ const EMBEDDED_METHODS = [
|
|
|
474
477
|
method: 'memberships get',
|
|
475
478
|
example: "nirvana organizations:memberships get \\\n --api-key 'My API Key' \\\n --organization-id organization_id \\\n --membership-id membership_id",
|
|
476
479
|
},
|
|
477
|
-
http: {
|
|
478
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships/$MEMBERSHIP_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
479
|
-
},
|
|
480
480
|
},
|
|
481
481
|
},
|
|
482
482
|
{
|
|
@@ -495,6 +495,9 @@ const EMBEDDED_METHODS = [
|
|
|
495
495
|
method: 'client.organizations.memberships.list',
|
|
496
496
|
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}",
|
|
497
497
|
},
|
|
498
|
+
http: {
|
|
499
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
500
|
+
},
|
|
498
501
|
go: {
|
|
499
502
|
method: 'client.Organizations.Memberships.List',
|
|
500
503
|
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',
|
|
@@ -503,8 +506,112 @@ const EMBEDDED_METHODS = [
|
|
|
503
506
|
method: 'memberships list',
|
|
504
507
|
example: "nirvana organizations:memberships list \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
505
508
|
},
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: 'create',
|
|
513
|
+
endpoint: '/v1/organizations/{organization_id}/address',
|
|
514
|
+
httpMethod: 'post',
|
|
515
|
+
summary: 'Create Organization Address',
|
|
516
|
+
description: 'Create the address for an organization',
|
|
517
|
+
stainlessPath: '(resource) organizations.address > (method) create',
|
|
518
|
+
qualified: 'client.organizations.address.create',
|
|
519
|
+
params: [
|
|
520
|
+
'organization_id: string;',
|
|
521
|
+
'city: string;',
|
|
522
|
+
'country: string;',
|
|
523
|
+
'line1: string;',
|
|
524
|
+
'postal_code: string;',
|
|
525
|
+
'line2?: string;',
|
|
526
|
+
'state?: string;',
|
|
527
|
+
'tax_id?: string;',
|
|
528
|
+
'tax_id_type?: string;',
|
|
529
|
+
],
|
|
530
|
+
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; }',
|
|
531
|
+
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```",
|
|
532
|
+
perLanguage: {
|
|
533
|
+
typescript: {
|
|
534
|
+
method: 'client.organizations.address.create',
|
|
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\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);",
|
|
536
|
+
},
|
|
506
537
|
http: {
|
|
507
|
-
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/
|
|
538
|
+
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 }\'',
|
|
539
|
+
},
|
|
540
|
+
go: {
|
|
541
|
+
method: 'client.Organizations.Address.New',
|
|
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\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',
|
|
543
|
+
},
|
|
544
|
+
cli: {
|
|
545
|
+
method: 'address create',
|
|
546
|
+
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",
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: 'get',
|
|
552
|
+
endpoint: '/v1/organizations/{organization_id}/address',
|
|
553
|
+
httpMethod: 'get',
|
|
554
|
+
summary: 'Get Organization Address',
|
|
555
|
+
description: 'Get the address for an organization',
|
|
556
|
+
stainlessPath: '(resource) organizations.address > (method) get',
|
|
557
|
+
qualified: 'client.organizations.address.get',
|
|
558
|
+
params: ['organization_id: string;'],
|
|
559
|
+
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; }',
|
|
560
|
+
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```",
|
|
561
|
+
perLanguage: {
|
|
562
|
+
typescript: {
|
|
563
|
+
method: 'client.organizations.address.get',
|
|
564
|
+
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);",
|
|
565
|
+
},
|
|
566
|
+
http: {
|
|
567
|
+
example: 'curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/address \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
568
|
+
},
|
|
569
|
+
go: {
|
|
570
|
+
method: 'client.Organizations.Address.Get',
|
|
571
|
+
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',
|
|
572
|
+
},
|
|
573
|
+
cli: {
|
|
574
|
+
method: 'address get',
|
|
575
|
+
example: "nirvana organizations:address get \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: 'update',
|
|
581
|
+
endpoint: '/v1/organizations/{organization_id}/address',
|
|
582
|
+
httpMethod: 'patch',
|
|
583
|
+
summary: 'Update Organization Address',
|
|
584
|
+
description: 'Update the address for an organization',
|
|
585
|
+
stainlessPath: '(resource) organizations.address > (method) update',
|
|
586
|
+
qualified: 'client.organizations.address.update',
|
|
587
|
+
params: [
|
|
588
|
+
'organization_id: string;',
|
|
589
|
+
'city?: string;',
|
|
590
|
+
'country?: string;',
|
|
591
|
+
'line1?: string;',
|
|
592
|
+
'line2?: string;',
|
|
593
|
+
'postal_code?: string;',
|
|
594
|
+
'state?: string;',
|
|
595
|
+
'tax_id?: string;',
|
|
596
|
+
'tax_id_type?: string;',
|
|
597
|
+
],
|
|
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: "## 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```",
|
|
600
|
+
perLanguage: {
|
|
601
|
+
typescript: {
|
|
602
|
+
method: 'client.organizations.address.update',
|
|
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.update('organization_id');\n\nconsole.log(organizationAddress.id);",
|
|
604
|
+
},
|
|
605
|
+
http: {
|
|
606
|
+
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 }\'',
|
|
607
|
+
},
|
|
608
|
+
go: {
|
|
609
|
+
method: 'client.Organizations.Address.Update',
|
|
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\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',
|
|
611
|
+
},
|
|
612
|
+
cli: {
|
|
613
|
+
method: 'address update',
|
|
614
|
+
example: "nirvana organizations:address update \\\n --api-key 'My API Key' \\\n --organization-id organization_id",
|
|
508
615
|
},
|
|
509
616
|
},
|
|
510
617
|
},
|
|
@@ -524,6 +631,9 @@ const EMBEDDED_METHODS = [
|
|
|
524
631
|
method: 'client.quotas.get',
|
|
525
632
|
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);",
|
|
526
633
|
},
|
|
634
|
+
http: {
|
|
635
|
+
example: 'curl https://api.nirvanalabs.io/v1/quotas/$REGION \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
636
|
+
},
|
|
527
637
|
go: {
|
|
528
638
|
method: 'client.Quotas.Get',
|
|
529
639
|
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',
|
|
@@ -532,9 +642,6 @@ const EMBEDDED_METHODS = [
|
|
|
532
642
|
method: 'quotas get',
|
|
533
643
|
example: "nirvana quotas get \\\n --api-key 'My API Key' \\\n --region us-sva-2",
|
|
534
644
|
},
|
|
535
|
-
http: {
|
|
536
|
-
example: 'curl https://api.nirvanalabs.io/v1/quotas/$REGION \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
537
|
-
},
|
|
538
645
|
},
|
|
539
646
|
},
|
|
540
647
|
{
|
|
@@ -552,6 +659,9 @@ const EMBEDDED_METHODS = [
|
|
|
552
659
|
method: 'client.quotas.list',
|
|
553
660
|
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);",
|
|
554
661
|
},
|
|
662
|
+
http: {
|
|
663
|
+
example: 'curl https://api.nirvanalabs.io/v1/quotas \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
664
|
+
},
|
|
555
665
|
go: {
|
|
556
666
|
method: 'client.Quotas.List',
|
|
557
667
|
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',
|
|
@@ -560,9 +670,6 @@ const EMBEDDED_METHODS = [
|
|
|
560
670
|
method: 'quotas list',
|
|
561
671
|
example: "nirvana quotas list \\\n --api-key 'My API Key'",
|
|
562
672
|
},
|
|
563
|
-
http: {
|
|
564
|
-
example: 'curl https://api.nirvanalabs.io/v1/quotas \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
565
|
-
},
|
|
566
673
|
},
|
|
567
674
|
},
|
|
568
675
|
{
|
|
@@ -581,6 +688,9 @@ const EMBEDDED_METHODS = [
|
|
|
581
688
|
method: 'client.usage.get',
|
|
582
689
|
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);",
|
|
583
690
|
},
|
|
691
|
+
http: {
|
|
692
|
+
example: 'curl https://api.nirvanalabs.io/v1/usage/$RESOURCE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
693
|
+
},
|
|
584
694
|
go: {
|
|
585
695
|
method: 'client.Usage.Get',
|
|
586
696
|
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',
|
|
@@ -589,9 +699,6 @@ const EMBEDDED_METHODS = [
|
|
|
589
699
|
method: 'usage get',
|
|
590
700
|
example: "nirvana usage get \\\n --api-key 'My API Key' \\\n --resource-id 123e4567-e89b-12d3-a456-426614174000",
|
|
591
701
|
},
|
|
592
|
-
http: {
|
|
593
|
-
example: 'curl https://api.nirvanalabs.io/v1/usage/$RESOURCE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
594
|
-
},
|
|
595
702
|
},
|
|
596
703
|
},
|
|
597
704
|
{
|
|
@@ -610,6 +717,9 @@ const EMBEDDED_METHODS = [
|
|
|
610
717
|
method: 'client.usage.list',
|
|
611
718
|
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}",
|
|
612
719
|
},
|
|
720
|
+
http: {
|
|
721
|
+
example: 'curl https://api.nirvanalabs.io/v1/usage \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
722
|
+
},
|
|
613
723
|
go: {
|
|
614
724
|
method: 'client.Usage.List',
|
|
615
725
|
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',
|
|
@@ -618,9 +728,6 @@ const EMBEDDED_METHODS = [
|
|
|
618
728
|
method: 'usage list',
|
|
619
729
|
example: "nirvana usage list \\\n --api-key 'My API Key'",
|
|
620
730
|
},
|
|
621
|
-
http: {
|
|
622
|
-
example: 'curl https://api.nirvanalabs.io/v1/usage \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
623
|
-
},
|
|
624
731
|
},
|
|
625
732
|
},
|
|
626
733
|
{
|
|
@@ -639,6 +746,9 @@ const EMBEDDED_METHODS = [
|
|
|
639
746
|
method: 'client.auditLogs.get',
|
|
640
747
|
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);",
|
|
641
748
|
},
|
|
749
|
+
http: {
|
|
750
|
+
example: 'curl https://api.nirvanalabs.io/v1/audit_logs/$AUDIT_LOG_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
751
|
+
},
|
|
642
752
|
go: {
|
|
643
753
|
method: 'client.AuditLogs.Get',
|
|
644
754
|
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',
|
|
@@ -647,9 +757,6 @@ const EMBEDDED_METHODS = [
|
|
|
647
757
|
method: 'audit_logs get',
|
|
648
758
|
example: "nirvana audit-logs get \\\n --api-key 'My API Key' \\\n --audit-log-id audit_log_id",
|
|
649
759
|
},
|
|
650
|
-
http: {
|
|
651
|
-
example: 'curl https://api.nirvanalabs.io/v1/audit_logs/$AUDIT_LOG_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
652
|
-
},
|
|
653
760
|
},
|
|
654
761
|
},
|
|
655
762
|
{
|
|
@@ -668,6 +775,9 @@ const EMBEDDED_METHODS = [
|
|
|
668
775
|
method: 'client.auditLogs.list',
|
|
669
776
|
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}",
|
|
670
777
|
},
|
|
778
|
+
http: {
|
|
779
|
+
example: 'curl https://api.nirvanalabs.io/v1/audit_logs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
780
|
+
},
|
|
671
781
|
go: {
|
|
672
782
|
method: 'client.AuditLogs.List',
|
|
673
783
|
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',
|
|
@@ -676,9 +786,6 @@ const EMBEDDED_METHODS = [
|
|
|
676
786
|
method: 'audit_logs list',
|
|
677
787
|
example: "nirvana audit-logs list \\\n --api-key 'My API Key'",
|
|
678
788
|
},
|
|
679
|
-
http: {
|
|
680
|
-
example: 'curl https://api.nirvanalabs.io/v1/audit_logs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
681
|
-
},
|
|
682
789
|
},
|
|
683
790
|
},
|
|
684
791
|
{
|
|
@@ -697,6 +804,9 @@ const EMBEDDED_METHODS = [
|
|
|
697
804
|
method: 'client.projects.create',
|
|
698
805
|
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);",
|
|
699
806
|
},
|
|
807
|
+
http: {
|
|
808
|
+
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 }\'',
|
|
809
|
+
},
|
|
700
810
|
go: {
|
|
701
811
|
method: 'client.Projects.New',
|
|
702
812
|
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',
|
|
@@ -705,9 +815,6 @@ const EMBEDDED_METHODS = [
|
|
|
705
815
|
method: 'projects create',
|
|
706
816
|
example: "nirvana projects create \\\n --api-key 'My API Key' \\\n --name 'My Project'",
|
|
707
817
|
},
|
|
708
|
-
http: {
|
|
709
|
-
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 }\'',
|
|
710
|
-
},
|
|
711
818
|
},
|
|
712
819
|
},
|
|
713
820
|
{
|
|
@@ -726,6 +833,9 @@ const EMBEDDED_METHODS = [
|
|
|
726
833
|
method: 'client.projects.get',
|
|
727
834
|
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);",
|
|
728
835
|
},
|
|
836
|
+
http: {
|
|
837
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
838
|
+
},
|
|
729
839
|
go: {
|
|
730
840
|
method: 'client.Projects.Get',
|
|
731
841
|
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',
|
|
@@ -734,9 +844,6 @@ const EMBEDDED_METHODS = [
|
|
|
734
844
|
method: 'projects get',
|
|
735
845
|
example: "nirvana projects get \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
736
846
|
},
|
|
737
|
-
http: {
|
|
738
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
739
|
-
},
|
|
740
847
|
},
|
|
741
848
|
},
|
|
742
849
|
{
|
|
@@ -755,6 +862,9 @@ const EMBEDDED_METHODS = [
|
|
|
755
862
|
method: 'client.projects.update',
|
|
756
863
|
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);",
|
|
757
864
|
},
|
|
865
|
+
http: {
|
|
866
|
+
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 }\'',
|
|
867
|
+
},
|
|
758
868
|
go: {
|
|
759
869
|
method: 'client.Projects.Update',
|
|
760
870
|
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',
|
|
@@ -763,9 +873,6 @@ const EMBEDDED_METHODS = [
|
|
|
763
873
|
method: 'projects update',
|
|
764
874
|
example: "nirvana projects update \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
765
875
|
},
|
|
766
|
-
http: {
|
|
767
|
-
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 }\'',
|
|
768
|
-
},
|
|
769
876
|
},
|
|
770
877
|
},
|
|
771
878
|
{
|
|
@@ -783,6 +890,9 @@ const EMBEDDED_METHODS = [
|
|
|
783
890
|
method: 'client.projects.delete',
|
|
784
891
|
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');",
|
|
785
892
|
},
|
|
893
|
+
http: {
|
|
894
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
895
|
+
},
|
|
786
896
|
go: {
|
|
787
897
|
method: 'client.Projects.Delete',
|
|
788
898
|
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',
|
|
@@ -791,9 +901,6 @@ const EMBEDDED_METHODS = [
|
|
|
791
901
|
method: 'projects delete',
|
|
792
902
|
example: "nirvana projects delete \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
793
903
|
},
|
|
794
|
-
http: {
|
|
795
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects/$PROJECT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
796
|
-
},
|
|
797
904
|
},
|
|
798
905
|
},
|
|
799
906
|
{
|
|
@@ -812,6 +919,9 @@ const EMBEDDED_METHODS = [
|
|
|
812
919
|
method: 'client.projects.list',
|
|
813
920
|
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}",
|
|
814
921
|
},
|
|
922
|
+
http: {
|
|
923
|
+
example: 'curl https://api.nirvanalabs.io/v1/projects \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
924
|
+
},
|
|
815
925
|
go: {
|
|
816
926
|
method: 'client.Projects.List',
|
|
817
927
|
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',
|
|
@@ -820,9 +930,6 @@ const EMBEDDED_METHODS = [
|
|
|
820
930
|
method: 'projects list',
|
|
821
931
|
example: "nirvana projects list \\\n --api-key 'My API Key'",
|
|
822
932
|
},
|
|
823
|
-
http: {
|
|
824
|
-
example: 'curl https://api.nirvanalabs.io/v1/projects \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
825
|
-
},
|
|
826
933
|
},
|
|
827
934
|
},
|
|
828
935
|
{
|
|
@@ -841,6 +948,9 @@ const EMBEDDED_METHODS = [
|
|
|
841
948
|
method: 'client.regions.get',
|
|
842
949
|
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);",
|
|
843
950
|
},
|
|
951
|
+
http: {
|
|
952
|
+
example: 'curl https://api.nirvanalabs.io/v1/regions/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
953
|
+
},
|
|
844
954
|
go: {
|
|
845
955
|
method: 'client.Regions.Get',
|
|
846
956
|
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',
|
|
@@ -849,9 +959,6 @@ const EMBEDDED_METHODS = [
|
|
|
849
959
|
method: 'regions get',
|
|
850
960
|
example: "nirvana regions get \\\n --api-key 'My API Key' \\\n --name us-sva-2",
|
|
851
961
|
},
|
|
852
|
-
http: {
|
|
853
|
-
example: 'curl https://api.nirvanalabs.io/v1/regions/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
854
|
-
},
|
|
855
962
|
},
|
|
856
963
|
},
|
|
857
964
|
{
|
|
@@ -870,6 +977,9 @@ const EMBEDDED_METHODS = [
|
|
|
870
977
|
method: 'client.regions.list',
|
|
871
978
|
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}",
|
|
872
979
|
},
|
|
980
|
+
http: {
|
|
981
|
+
example: 'curl https://api.nirvanalabs.io/v1/regions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
982
|
+
},
|
|
873
983
|
go: {
|
|
874
984
|
method: 'client.Regions.List',
|
|
875
985
|
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',
|
|
@@ -878,9 +988,6 @@ const EMBEDDED_METHODS = [
|
|
|
878
988
|
method: 'regions list',
|
|
879
989
|
example: "nirvana regions list \\\n --api-key 'My API Key'",
|
|
880
990
|
},
|
|
881
|
-
http: {
|
|
882
|
-
example: 'curl https://api.nirvanalabs.io/v1/regions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
883
|
-
},
|
|
884
991
|
},
|
|
885
992
|
},
|
|
886
993
|
{
|
|
@@ -899,6 +1006,9 @@ const EMBEDDED_METHODS = [
|
|
|
899
1006
|
method: 'client.instanceTypes.get',
|
|
900
1007
|
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);",
|
|
901
1008
|
},
|
|
1009
|
+
http: {
|
|
1010
|
+
example: 'curl https://api.nirvanalabs.io/v1/instance_types/$REGION/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1011
|
+
},
|
|
902
1012
|
go: {
|
|
903
1013
|
method: 'client.InstanceTypes.Get',
|
|
904
1014
|
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',
|
|
@@ -907,9 +1017,6 @@ const EMBEDDED_METHODS = [
|
|
|
907
1017
|
method: 'instance_types get',
|
|
908
1018
|
example: "nirvana instance-types get \\\n --api-key 'My API Key' \\\n --region us-sva-2 \\\n --name n1-standard-8",
|
|
909
1019
|
},
|
|
910
|
-
http: {
|
|
911
|
-
example: 'curl https://api.nirvanalabs.io/v1/instance_types/$REGION/$NAME \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
912
|
-
},
|
|
913
1020
|
},
|
|
914
1021
|
},
|
|
915
1022
|
{
|
|
@@ -928,6 +1035,9 @@ const EMBEDDED_METHODS = [
|
|
|
928
1035
|
method: 'client.instanceTypes.list',
|
|
929
1036
|
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}",
|
|
930
1037
|
},
|
|
1038
|
+
http: {
|
|
1039
|
+
example: 'curl https://api.nirvanalabs.io/v1/instance_types \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1040
|
+
},
|
|
931
1041
|
go: {
|
|
932
1042
|
method: 'client.InstanceTypes.List',
|
|
933
1043
|
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',
|
|
@@ -936,9 +1046,6 @@ const EMBEDDED_METHODS = [
|
|
|
936
1046
|
method: 'instance_types list',
|
|
937
1047
|
example: "nirvana instance-types list \\\n --api-key 'My API Key'",
|
|
938
1048
|
},
|
|
939
|
-
http: {
|
|
940
|
-
example: 'curl https://api.nirvanalabs.io/v1/instance_types \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
941
|
-
},
|
|
942
1049
|
},
|
|
943
1050
|
},
|
|
944
1051
|
{
|
|
@@ -969,6 +1076,9 @@ const EMBEDDED_METHODS = [
|
|
|
969
1076
|
method: 'client.compute.vms.create',
|
|
970
1077
|
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);",
|
|
971
1078
|
},
|
|
1079
|
+
http: {
|
|
1080
|
+
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 }\'',
|
|
1081
|
+
},
|
|
972
1082
|
go: {
|
|
973
1083
|
method: 'client.Compute.VMs.New',
|
|
974
1084
|
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',
|
|
@@ -977,9 +1087,6 @@ const EMBEDDED_METHODS = [
|
|
|
977
1087
|
method: 'vms create',
|
|
978
1088
|
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",
|
|
979
1089
|
},
|
|
980
|
-
http: {
|
|
981
|
-
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 }\'',
|
|
982
|
-
},
|
|
983
1090
|
},
|
|
984
1091
|
},
|
|
985
1092
|
{
|
|
@@ -998,6 +1105,9 @@ const EMBEDDED_METHODS = [
|
|
|
998
1105
|
method: 'client.compute.vms.get',
|
|
999
1106
|
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);",
|
|
1000
1107
|
},
|
|
1108
|
+
http: {
|
|
1109
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1110
|
+
},
|
|
1001
1111
|
go: {
|
|
1002
1112
|
method: 'client.Compute.VMs.Get',
|
|
1003
1113
|
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',
|
|
@@ -1006,9 +1116,6 @@ const EMBEDDED_METHODS = [
|
|
|
1006
1116
|
method: 'vms get',
|
|
1007
1117
|
example: "nirvana compute:vms get \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1008
1118
|
},
|
|
1009
|
-
http: {
|
|
1010
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1011
|
-
},
|
|
1012
1119
|
},
|
|
1013
1120
|
},
|
|
1014
1121
|
{
|
|
@@ -1033,6 +1140,9 @@ const EMBEDDED_METHODS = [
|
|
|
1033
1140
|
method: 'client.compute.vms.update',
|
|
1034
1141
|
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);",
|
|
1035
1142
|
},
|
|
1143
|
+
http: {
|
|
1144
|
+
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 }\'',
|
|
1145
|
+
},
|
|
1036
1146
|
go: {
|
|
1037
1147
|
method: 'client.Compute.VMs.Update',
|
|
1038
1148
|
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',
|
|
@@ -1041,9 +1151,6 @@ const EMBEDDED_METHODS = [
|
|
|
1041
1151
|
method: 'vms update',
|
|
1042
1152
|
example: "nirvana compute:vms update \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1043
1153
|
},
|
|
1044
|
-
http: {
|
|
1045
|
-
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 }\'',
|
|
1046
|
-
},
|
|
1047
1154
|
},
|
|
1048
1155
|
},
|
|
1049
1156
|
{
|
|
@@ -1062,6 +1169,9 @@ const EMBEDDED_METHODS = [
|
|
|
1062
1169
|
method: 'client.compute.vms.delete',
|
|
1063
1170
|
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);",
|
|
1064
1171
|
},
|
|
1172
|
+
http: {
|
|
1173
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1174
|
+
},
|
|
1065
1175
|
go: {
|
|
1066
1176
|
method: 'client.Compute.VMs.Delete',
|
|
1067
1177
|
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',
|
|
@@ -1070,9 +1180,6 @@ const EMBEDDED_METHODS = [
|
|
|
1070
1180
|
method: 'vms delete',
|
|
1071
1181
|
example: "nirvana compute:vms delete \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1072
1182
|
},
|
|
1073
|
-
http: {
|
|
1074
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1075
|
-
},
|
|
1076
1183
|
},
|
|
1077
1184
|
},
|
|
1078
1185
|
{
|
|
@@ -1091,6 +1198,9 @@ const EMBEDDED_METHODS = [
|
|
|
1091
1198
|
method: 'client.compute.vms.list',
|
|
1092
1199
|
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}",
|
|
1093
1200
|
},
|
|
1201
|
+
http: {
|
|
1202
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1203
|
+
},
|
|
1094
1204
|
go: {
|
|
1095
1205
|
method: 'client.Compute.VMs.List',
|
|
1096
1206
|
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',
|
|
@@ -1099,9 +1209,6 @@ const EMBEDDED_METHODS = [
|
|
|
1099
1209
|
method: 'vms list',
|
|
1100
1210
|
example: "nirvana compute:vms list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
1101
1211
|
},
|
|
1102
|
-
http: {
|
|
1103
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1104
|
-
},
|
|
1105
1212
|
},
|
|
1106
1213
|
},
|
|
1107
1214
|
{
|
|
@@ -1120,6 +1227,9 @@ const EMBEDDED_METHODS = [
|
|
|
1120
1227
|
method: 'client.compute.vms.restart',
|
|
1121
1228
|
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);",
|
|
1122
1229
|
},
|
|
1230
|
+
http: {
|
|
1231
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/restart \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1232
|
+
},
|
|
1123
1233
|
go: {
|
|
1124
1234
|
method: 'client.Compute.VMs.Restart',
|
|
1125
1235
|
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',
|
|
@@ -1128,9 +1238,6 @@ const EMBEDDED_METHODS = [
|
|
|
1128
1238
|
method: 'vms restart',
|
|
1129
1239
|
example: "nirvana compute:vms restart \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1130
1240
|
},
|
|
1131
|
-
http: {
|
|
1132
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/restart \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1133
|
-
},
|
|
1134
1241
|
},
|
|
1135
1242
|
},
|
|
1136
1243
|
{
|
|
@@ -1160,6 +1267,9 @@ const EMBEDDED_METHODS = [
|
|
|
1160
1267
|
method: 'client.compute.vms.availability.create',
|
|
1161
1268
|
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});",
|
|
1162
1269
|
},
|
|
1270
|
+
http: {
|
|
1271
|
+
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 }\'',
|
|
1272
|
+
},
|
|
1163
1273
|
go: {
|
|
1164
1274
|
method: 'client.Compute.VMs.Availability.New',
|
|
1165
1275
|
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',
|
|
@@ -1168,9 +1278,6 @@ const EMBEDDED_METHODS = [
|
|
|
1168
1278
|
method: 'availability create',
|
|
1169
1279
|
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",
|
|
1170
1280
|
},
|
|
1171
|
-
http: {
|
|
1172
|
-
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 }\'',
|
|
1173
|
-
},
|
|
1174
1281
|
},
|
|
1175
1282
|
},
|
|
1176
1283
|
{
|
|
@@ -1194,6 +1301,9 @@ const EMBEDDED_METHODS = [
|
|
|
1194
1301
|
method: 'client.compute.vms.availability.update',
|
|
1195
1302
|
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');",
|
|
1196
1303
|
},
|
|
1304
|
+
http: {
|
|
1305
|
+
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 }\'',
|
|
1306
|
+
},
|
|
1197
1307
|
go: {
|
|
1198
1308
|
method: 'client.Compute.VMs.Availability.Update',
|
|
1199
1309
|
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',
|
|
@@ -1202,9 +1312,6 @@ const EMBEDDED_METHODS = [
|
|
|
1202
1312
|
method: 'availability update',
|
|
1203
1313
|
example: "nirvana compute:vms:availability update \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1204
1314
|
},
|
|
1205
|
-
http: {
|
|
1206
|
-
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 }\'',
|
|
1207
|
-
},
|
|
1208
1315
|
},
|
|
1209
1316
|
},
|
|
1210
1317
|
{
|
|
@@ -1223,6 +1330,9 @@ const EMBEDDED_METHODS = [
|
|
|
1223
1330
|
method: 'client.compute.vms.volumes.list',
|
|
1224
1331
|
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}",
|
|
1225
1332
|
},
|
|
1333
|
+
http: {
|
|
1334
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1335
|
+
},
|
|
1226
1336
|
go: {
|
|
1227
1337
|
method: 'client.Compute.VMs.Volumes.List',
|
|
1228
1338
|
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',
|
|
@@ -1231,9 +1341,6 @@ const EMBEDDED_METHODS = [
|
|
|
1231
1341
|
method: 'volumes list',
|
|
1232
1342
|
example: "nirvana compute:vms:volumes list \\\n --api-key 'My API Key' \\\n --vm-id vm_id",
|
|
1233
1343
|
},
|
|
1234
|
-
http: {
|
|
1235
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1236
|
-
},
|
|
1237
1344
|
},
|
|
1238
1345
|
},
|
|
1239
1346
|
{
|
|
@@ -1252,6 +1359,9 @@ const EMBEDDED_METHODS = [
|
|
|
1252
1359
|
method: 'client.compute.vms.osImages.list',
|
|
1253
1360
|
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}",
|
|
1254
1361
|
},
|
|
1362
|
+
http: {
|
|
1363
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/os_images \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1364
|
+
},
|
|
1255
1365
|
go: {
|
|
1256
1366
|
method: 'client.Compute.VMs.OSImages.List',
|
|
1257
1367
|
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',
|
|
@@ -1260,9 +1370,6 @@ const EMBEDDED_METHODS = [
|
|
|
1260
1370
|
method: 'os_images list',
|
|
1261
1371
|
example: "nirvana compute:vms:os-images list \\\n --api-key 'My API Key'",
|
|
1262
1372
|
},
|
|
1263
|
-
http: {
|
|
1264
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/vms/os_images \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1265
|
-
},
|
|
1266
1373
|
},
|
|
1267
1374
|
},
|
|
1268
1375
|
{
|
|
@@ -1289,6 +1396,9 @@ const EMBEDDED_METHODS = [
|
|
|
1289
1396
|
method: 'client.compute.volumes.create',
|
|
1290
1397
|
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);",
|
|
1291
1398
|
},
|
|
1399
|
+
http: {
|
|
1400
|
+
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 }\'',
|
|
1401
|
+
},
|
|
1292
1402
|
go: {
|
|
1293
1403
|
method: 'client.Compute.Volumes.New',
|
|
1294
1404
|
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',
|
|
@@ -1297,9 +1407,6 @@ const EMBEDDED_METHODS = [
|
|
|
1297
1407
|
method: 'volumes create',
|
|
1298
1408
|
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",
|
|
1299
1409
|
},
|
|
1300
|
-
http: {
|
|
1301
|
-
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 }\'',
|
|
1302
|
-
},
|
|
1303
1410
|
},
|
|
1304
1411
|
},
|
|
1305
1412
|
{
|
|
@@ -1318,6 +1425,9 @@ const EMBEDDED_METHODS = [
|
|
|
1318
1425
|
method: 'client.compute.volumes.get',
|
|
1319
1426
|
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);",
|
|
1320
1427
|
},
|
|
1428
|
+
http: {
|
|
1429
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1430
|
+
},
|
|
1321
1431
|
go: {
|
|
1322
1432
|
method: 'client.Compute.Volumes.Get',
|
|
1323
1433
|
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',
|
|
@@ -1326,9 +1436,6 @@ const EMBEDDED_METHODS = [
|
|
|
1326
1436
|
method: 'volumes get',
|
|
1327
1437
|
example: "nirvana compute:volumes get \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1328
1438
|
},
|
|
1329
|
-
http: {
|
|
1330
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1331
|
-
},
|
|
1332
1439
|
},
|
|
1333
1440
|
},
|
|
1334
1441
|
{
|
|
@@ -1347,6 +1454,9 @@ const EMBEDDED_METHODS = [
|
|
|
1347
1454
|
method: 'client.compute.volumes.update',
|
|
1348
1455
|
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);",
|
|
1349
1456
|
},
|
|
1457
|
+
http: {
|
|
1458
|
+
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 }\'',
|
|
1459
|
+
},
|
|
1350
1460
|
go: {
|
|
1351
1461
|
method: 'client.Compute.Volumes.Update',
|
|
1352
1462
|
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',
|
|
@@ -1355,9 +1465,6 @@ const EMBEDDED_METHODS = [
|
|
|
1355
1465
|
method: 'volumes update',
|
|
1356
1466
|
example: "nirvana compute:volumes update \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1357
1467
|
},
|
|
1358
|
-
http: {
|
|
1359
|
-
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 }\'',
|
|
1360
|
-
},
|
|
1361
1468
|
},
|
|
1362
1469
|
},
|
|
1363
1470
|
{
|
|
@@ -1376,6 +1483,9 @@ const EMBEDDED_METHODS = [
|
|
|
1376
1483
|
method: 'client.compute.volumes.delete',
|
|
1377
1484
|
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);",
|
|
1378
1485
|
},
|
|
1486
|
+
http: {
|
|
1487
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1488
|
+
},
|
|
1379
1489
|
go: {
|
|
1380
1490
|
method: 'client.Compute.Volumes.Delete',
|
|
1381
1491
|
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',
|
|
@@ -1384,9 +1494,6 @@ const EMBEDDED_METHODS = [
|
|
|
1384
1494
|
method: 'volumes delete',
|
|
1385
1495
|
example: "nirvana compute:volumes delete \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1386
1496
|
},
|
|
1387
|
-
http: {
|
|
1388
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1389
|
-
},
|
|
1390
1497
|
},
|
|
1391
1498
|
},
|
|
1392
1499
|
{
|
|
@@ -1405,6 +1512,9 @@ const EMBEDDED_METHODS = [
|
|
|
1405
1512
|
method: 'client.compute.volumes.list',
|
|
1406
1513
|
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}",
|
|
1407
1514
|
},
|
|
1515
|
+
http: {
|
|
1516
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1517
|
+
},
|
|
1408
1518
|
go: {
|
|
1409
1519
|
method: 'client.Compute.Volumes.List',
|
|
1410
1520
|
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',
|
|
@@ -1413,9 +1523,6 @@ const EMBEDDED_METHODS = [
|
|
|
1413
1523
|
method: 'volumes list',
|
|
1414
1524
|
example: "nirvana compute:volumes list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
1415
1525
|
},
|
|
1416
|
-
http: {
|
|
1417
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1418
|
-
},
|
|
1419
1526
|
},
|
|
1420
1527
|
},
|
|
1421
1528
|
{
|
|
@@ -1434,6 +1541,9 @@ const EMBEDDED_METHODS = [
|
|
|
1434
1541
|
method: 'client.compute.volumes.attach',
|
|
1435
1542
|
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);",
|
|
1436
1543
|
},
|
|
1544
|
+
http: {
|
|
1545
|
+
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 }\'',
|
|
1546
|
+
},
|
|
1437
1547
|
go: {
|
|
1438
1548
|
method: 'client.Compute.Volumes.Attach',
|
|
1439
1549
|
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',
|
|
@@ -1442,9 +1552,6 @@ const EMBEDDED_METHODS = [
|
|
|
1442
1552
|
method: 'volumes attach',
|
|
1443
1553
|
example: "nirvana compute:volumes attach \\\n --api-key 'My API Key' \\\n --volume-id volume_id \\\n --vm-id 123e4567-e89b-12d3-a456-426614174000",
|
|
1444
1554
|
},
|
|
1445
|
-
http: {
|
|
1446
|
-
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 }\'',
|
|
1447
|
-
},
|
|
1448
1555
|
},
|
|
1449
1556
|
},
|
|
1450
1557
|
{
|
|
@@ -1463,6 +1570,9 @@ const EMBEDDED_METHODS = [
|
|
|
1463
1570
|
method: 'client.compute.volumes.detach',
|
|
1464
1571
|
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);",
|
|
1465
1572
|
},
|
|
1573
|
+
http: {
|
|
1574
|
+
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/detach \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1575
|
+
},
|
|
1466
1576
|
go: {
|
|
1467
1577
|
method: 'client.Compute.Volumes.Detach',
|
|
1468
1578
|
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',
|
|
@@ -1471,9 +1581,6 @@ const EMBEDDED_METHODS = [
|
|
|
1471
1581
|
method: 'volumes detach',
|
|
1472
1582
|
example: "nirvana compute:volumes detach \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1473
1583
|
},
|
|
1474
|
-
http: {
|
|
1475
|
-
example: 'curl https://api.nirvanalabs.io/v1/compute/volumes/$VOLUME_ID/detach \\\n -X POST \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1476
|
-
},
|
|
1477
1584
|
},
|
|
1478
1585
|
},
|
|
1479
1586
|
{
|
|
@@ -1499,6 +1606,9 @@ const EMBEDDED_METHODS = [
|
|
|
1499
1606
|
method: 'client.compute.volumes.availability.create',
|
|
1500
1607
|
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});",
|
|
1501
1608
|
},
|
|
1609
|
+
http: {
|
|
1610
|
+
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 }\'',
|
|
1611
|
+
},
|
|
1502
1612
|
go: {
|
|
1503
1613
|
method: 'client.Compute.Volumes.Availability.New',
|
|
1504
1614
|
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',
|
|
@@ -1507,9 +1617,6 @@ const EMBEDDED_METHODS = [
|
|
|
1507
1617
|
method: 'availability create',
|
|
1508
1618
|
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",
|
|
1509
1619
|
},
|
|
1510
|
-
http: {
|
|
1511
|
-
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 }\'',
|
|
1512
|
-
},
|
|
1513
1620
|
},
|
|
1514
1621
|
},
|
|
1515
1622
|
{
|
|
@@ -1527,6 +1634,9 @@ const EMBEDDED_METHODS = [
|
|
|
1527
1634
|
method: 'client.compute.volumes.availability.update',
|
|
1528
1635
|
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');",
|
|
1529
1636
|
},
|
|
1637
|
+
http: {
|
|
1638
|
+
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 }\'',
|
|
1639
|
+
},
|
|
1530
1640
|
go: {
|
|
1531
1641
|
method: 'client.Compute.Volumes.Availability.Update',
|
|
1532
1642
|
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',
|
|
@@ -1535,9 +1645,6 @@ const EMBEDDED_METHODS = [
|
|
|
1535
1645
|
method: 'availability update',
|
|
1536
1646
|
example: "nirvana compute:volumes:availability update \\\n --api-key 'My API Key' \\\n --volume-id volume_id",
|
|
1537
1647
|
},
|
|
1538
|
-
http: {
|
|
1539
|
-
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 }\'',
|
|
1540
|
-
},
|
|
1541
1648
|
},
|
|
1542
1649
|
},
|
|
1543
1650
|
{
|
|
@@ -1562,6 +1669,9 @@ const EMBEDDED_METHODS = [
|
|
|
1562
1669
|
method: 'client.networking.vpcs.create',
|
|
1563
1670
|
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);",
|
|
1564
1671
|
},
|
|
1672
|
+
http: {
|
|
1673
|
+
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 }\'',
|
|
1674
|
+
},
|
|
1565
1675
|
go: {
|
|
1566
1676
|
method: 'client.Networking.VPCs.New',
|
|
1567
1677
|
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',
|
|
@@ -1570,9 +1680,6 @@ const EMBEDDED_METHODS = [
|
|
|
1570
1680
|
method: 'vpcs create',
|
|
1571
1681
|
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",
|
|
1572
1682
|
},
|
|
1573
|
-
http: {
|
|
1574
|
-
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 }\'',
|
|
1575
|
-
},
|
|
1576
1683
|
},
|
|
1577
1684
|
},
|
|
1578
1685
|
{
|
|
@@ -1591,6 +1698,9 @@ const EMBEDDED_METHODS = [
|
|
|
1591
1698
|
method: 'client.networking.vpcs.get',
|
|
1592
1699
|
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);",
|
|
1593
1700
|
},
|
|
1701
|
+
http: {
|
|
1702
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1703
|
+
},
|
|
1594
1704
|
go: {
|
|
1595
1705
|
method: 'client.Networking.VPCs.Get',
|
|
1596
1706
|
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',
|
|
@@ -1599,9 +1709,6 @@ const EMBEDDED_METHODS = [
|
|
|
1599
1709
|
method: 'vpcs get',
|
|
1600
1710
|
example: "nirvana networking:vpcs get \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1601
1711
|
},
|
|
1602
|
-
http: {
|
|
1603
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1604
|
-
},
|
|
1605
1712
|
},
|
|
1606
1713
|
},
|
|
1607
1714
|
{
|
|
@@ -1620,6 +1727,9 @@ const EMBEDDED_METHODS = [
|
|
|
1620
1727
|
method: 'client.networking.vpcs.update',
|
|
1621
1728
|
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);",
|
|
1622
1729
|
},
|
|
1730
|
+
http: {
|
|
1731
|
+
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 }\'',
|
|
1732
|
+
},
|
|
1623
1733
|
go: {
|
|
1624
1734
|
method: 'client.Networking.VPCs.Update',
|
|
1625
1735
|
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',
|
|
@@ -1628,9 +1738,6 @@ const EMBEDDED_METHODS = [
|
|
|
1628
1738
|
method: 'vpcs update',
|
|
1629
1739
|
example: "nirvana networking:vpcs update \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1630
1740
|
},
|
|
1631
|
-
http: {
|
|
1632
|
-
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 }\'',
|
|
1633
|
-
},
|
|
1634
1741
|
},
|
|
1635
1742
|
},
|
|
1636
1743
|
{
|
|
@@ -1649,6 +1756,9 @@ const EMBEDDED_METHODS = [
|
|
|
1649
1756
|
method: 'client.networking.vpcs.delete',
|
|
1650
1757
|
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);",
|
|
1651
1758
|
},
|
|
1759
|
+
http: {
|
|
1760
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1761
|
+
},
|
|
1652
1762
|
go: {
|
|
1653
1763
|
method: 'client.Networking.VPCs.Delete',
|
|
1654
1764
|
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',
|
|
@@ -1657,9 +1767,6 @@ const EMBEDDED_METHODS = [
|
|
|
1657
1767
|
method: 'vpcs delete',
|
|
1658
1768
|
example: "nirvana networking:vpcs delete \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1659
1769
|
},
|
|
1660
|
-
http: {
|
|
1661
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1662
|
-
},
|
|
1663
1770
|
},
|
|
1664
1771
|
},
|
|
1665
1772
|
{
|
|
@@ -1678,6 +1785,9 @@ const EMBEDDED_METHODS = [
|
|
|
1678
1785
|
method: 'client.networking.vpcs.list',
|
|
1679
1786
|
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}",
|
|
1680
1787
|
},
|
|
1788
|
+
http: {
|
|
1789
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1790
|
+
},
|
|
1681
1791
|
go: {
|
|
1682
1792
|
method: 'client.Networking.VPCs.List',
|
|
1683
1793
|
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',
|
|
@@ -1686,9 +1796,6 @@ const EMBEDDED_METHODS = [
|
|
|
1686
1796
|
method: 'vpcs list',
|
|
1687
1797
|
example: "nirvana networking:vpcs list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
1688
1798
|
},
|
|
1689
|
-
http: {
|
|
1690
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1691
|
-
},
|
|
1692
1799
|
},
|
|
1693
1800
|
},
|
|
1694
1801
|
{
|
|
@@ -1712,6 +1819,9 @@ const EMBEDDED_METHODS = [
|
|
|
1712
1819
|
method: 'client.networking.vpcs.availability.create',
|
|
1713
1820
|
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});",
|
|
1714
1821
|
},
|
|
1822
|
+
http: {
|
|
1823
|
+
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 }\'',
|
|
1824
|
+
},
|
|
1715
1825
|
go: {
|
|
1716
1826
|
method: 'client.Networking.VPCs.Availability.New',
|
|
1717
1827
|
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',
|
|
@@ -1720,9 +1830,6 @@ const EMBEDDED_METHODS = [
|
|
|
1720
1830
|
method: 'availability create',
|
|
1721
1831
|
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",
|
|
1722
1832
|
},
|
|
1723
|
-
http: {
|
|
1724
|
-
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 }\'',
|
|
1725
|
-
},
|
|
1726
1833
|
},
|
|
1727
1834
|
},
|
|
1728
1835
|
{
|
|
@@ -1740,6 +1847,9 @@ const EMBEDDED_METHODS = [
|
|
|
1740
1847
|
method: 'client.networking.vpcs.availability.update',
|
|
1741
1848
|
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');",
|
|
1742
1849
|
},
|
|
1850
|
+
http: {
|
|
1851
|
+
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 }\'',
|
|
1852
|
+
},
|
|
1743
1853
|
go: {
|
|
1744
1854
|
method: 'client.Networking.VPCs.Availability.Update',
|
|
1745
1855
|
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',
|
|
@@ -1748,9 +1858,6 @@ const EMBEDDED_METHODS = [
|
|
|
1748
1858
|
method: 'availability update',
|
|
1749
1859
|
example: "nirvana networking:vpcs:availability update \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1750
1860
|
},
|
|
1751
|
-
http: {
|
|
1752
|
-
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 }\'',
|
|
1753
|
-
},
|
|
1754
1861
|
},
|
|
1755
1862
|
},
|
|
1756
1863
|
{
|
|
@@ -1777,6 +1884,9 @@ const EMBEDDED_METHODS = [
|
|
|
1777
1884
|
method: 'client.networking.firewallRules.create',
|
|
1778
1885
|
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);",
|
|
1779
1886
|
},
|
|
1887
|
+
http: {
|
|
1888
|
+
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 }\'',
|
|
1889
|
+
},
|
|
1780
1890
|
go: {
|
|
1781
1891
|
method: 'client.Networking.FirewallRules.New',
|
|
1782
1892
|
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',
|
|
@@ -1785,9 +1895,6 @@ const EMBEDDED_METHODS = [
|
|
|
1785
1895
|
method: 'firewall_rules create',
|
|
1786
1896
|
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",
|
|
1787
1897
|
},
|
|
1788
|
-
http: {
|
|
1789
|
-
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 }\'',
|
|
1790
|
-
},
|
|
1791
1898
|
},
|
|
1792
1899
|
},
|
|
1793
1900
|
{
|
|
@@ -1806,6 +1913,9 @@ const EMBEDDED_METHODS = [
|
|
|
1806
1913
|
method: 'client.networking.firewallRules.get',
|
|
1807
1914
|
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);",
|
|
1808
1915
|
},
|
|
1916
|
+
http: {
|
|
1917
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1918
|
+
},
|
|
1809
1919
|
go: {
|
|
1810
1920
|
method: 'client.Networking.FirewallRules.Get',
|
|
1811
1921
|
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',
|
|
@@ -1814,9 +1924,6 @@ const EMBEDDED_METHODS = [
|
|
|
1814
1924
|
method: 'firewall_rules get',
|
|
1815
1925
|
example: "nirvana networking:firewall-rules get \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --firewall-rule-id firewall_rule_id",
|
|
1816
1926
|
},
|
|
1817
|
-
http: {
|
|
1818
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules/$FIREWALL_RULE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1819
|
-
},
|
|
1820
1927
|
},
|
|
1821
1928
|
},
|
|
1822
1929
|
{
|
|
@@ -1844,6 +1951,9 @@ const EMBEDDED_METHODS = [
|
|
|
1844
1951
|
method: 'client.networking.firewallRules.update',
|
|
1845
1952
|
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);",
|
|
1846
1953
|
},
|
|
1954
|
+
http: {
|
|
1955
|
+
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 }\'',
|
|
1956
|
+
},
|
|
1847
1957
|
go: {
|
|
1848
1958
|
method: 'client.Networking.FirewallRules.Update',
|
|
1849
1959
|
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',
|
|
@@ -1852,9 +1962,6 @@ const EMBEDDED_METHODS = [
|
|
|
1852
1962
|
method: 'firewall_rules update',
|
|
1853
1963
|
example: "nirvana networking:firewall-rules update \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --firewall-rule-id firewall_rule_id",
|
|
1854
1964
|
},
|
|
1855
|
-
http: {
|
|
1856
|
-
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 }\'',
|
|
1857
|
-
},
|
|
1858
1965
|
},
|
|
1859
1966
|
},
|
|
1860
1967
|
{
|
|
@@ -1873,6 +1980,9 @@ const EMBEDDED_METHODS = [
|
|
|
1873
1980
|
method: 'client.networking.firewallRules.delete',
|
|
1874
1981
|
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);",
|
|
1875
1982
|
},
|
|
1983
|
+
http: {
|
|
1984
|
+
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"',
|
|
1985
|
+
},
|
|
1876
1986
|
go: {
|
|
1877
1987
|
method: 'client.Networking.FirewallRules.Delete',
|
|
1878
1988
|
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',
|
|
@@ -1881,9 +1991,6 @@ const EMBEDDED_METHODS = [
|
|
|
1881
1991
|
method: 'firewall_rules delete',
|
|
1882
1992
|
example: "nirvana networking:firewall-rules delete \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id \\\n --firewall-rule-id firewall_rule_id",
|
|
1883
1993
|
},
|
|
1884
|
-
http: {
|
|
1885
|
-
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"',
|
|
1886
|
-
},
|
|
1887
1994
|
},
|
|
1888
1995
|
},
|
|
1889
1996
|
{
|
|
@@ -1902,6 +2009,9 @@ const EMBEDDED_METHODS = [
|
|
|
1902
2009
|
method: 'client.networking.firewallRules.list',
|
|
1903
2010
|
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}",
|
|
1904
2011
|
},
|
|
2012
|
+
http: {
|
|
2013
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2014
|
+
},
|
|
1905
2015
|
go: {
|
|
1906
2016
|
method: 'client.Networking.FirewallRules.List',
|
|
1907
2017
|
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',
|
|
@@ -1910,9 +2020,6 @@ const EMBEDDED_METHODS = [
|
|
|
1910
2020
|
method: 'firewall_rules list',
|
|
1911
2021
|
example: "nirvana networking:firewall-rules list \\\n --api-key 'My API Key' \\\n --vpc-id vpc_id",
|
|
1912
2022
|
},
|
|
1913
|
-
http: {
|
|
1914
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/vpcs/$VPC_ID/firewall_rules \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1915
|
-
},
|
|
1916
2023
|
},
|
|
1917
2024
|
},
|
|
1918
2025
|
{
|
|
@@ -1940,6 +2047,9 @@ const EMBEDDED_METHODS = [
|
|
|
1940
2047
|
method: 'client.networking.connect.connections.create',
|
|
1941
2048
|
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);",
|
|
1942
2049
|
},
|
|
2050
|
+
http: {
|
|
2051
|
+
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 }\'',
|
|
2052
|
+
},
|
|
1943
2053
|
go: {
|
|
1944
2054
|
method: 'client.Networking.Connect.Connections.New',
|
|
1945
2055
|
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',
|
|
@@ -1948,9 +2058,6 @@ const EMBEDDED_METHODS = [
|
|
|
1948
2058
|
method: 'connections create',
|
|
1949
2059
|
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",
|
|
1950
2060
|
},
|
|
1951
|
-
http: {
|
|
1952
|
-
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 }\'',
|
|
1953
|
-
},
|
|
1954
2061
|
},
|
|
1955
2062
|
},
|
|
1956
2063
|
{
|
|
@@ -1969,6 +2076,9 @@ const EMBEDDED_METHODS = [
|
|
|
1969
2076
|
method: 'client.networking.connect.connections.get',
|
|
1970
2077
|
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);",
|
|
1971
2078
|
},
|
|
2079
|
+
http: {
|
|
2080
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2081
|
+
},
|
|
1972
2082
|
go: {
|
|
1973
2083
|
method: 'client.Networking.Connect.Connections.Get',
|
|
1974
2084
|
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',
|
|
@@ -1977,9 +2087,6 @@ const EMBEDDED_METHODS = [
|
|
|
1977
2087
|
method: 'connections get',
|
|
1978
2088
|
example: "nirvana networking:connect:connections get \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
1979
2089
|
},
|
|
1980
|
-
http: {
|
|
1981
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
1982
|
-
},
|
|
1983
2090
|
},
|
|
1984
2091
|
},
|
|
1985
2092
|
{
|
|
@@ -1998,6 +2105,9 @@ const EMBEDDED_METHODS = [
|
|
|
1998
2105
|
method: 'client.networking.connect.connections.update',
|
|
1999
2106
|
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);",
|
|
2000
2107
|
},
|
|
2108
|
+
http: {
|
|
2109
|
+
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 }\'',
|
|
2110
|
+
},
|
|
2001
2111
|
go: {
|
|
2002
2112
|
method: 'client.Networking.Connect.Connections.Update',
|
|
2003
2113
|
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',
|
|
@@ -2006,9 +2116,6 @@ const EMBEDDED_METHODS = [
|
|
|
2006
2116
|
method: 'connections update',
|
|
2007
2117
|
example: "nirvana networking:connect:connections update \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2008
2118
|
},
|
|
2009
|
-
http: {
|
|
2010
|
-
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 }\'',
|
|
2011
|
-
},
|
|
2012
2119
|
},
|
|
2013
2120
|
},
|
|
2014
2121
|
{
|
|
@@ -2027,16 +2134,16 @@ const EMBEDDED_METHODS = [
|
|
|
2027
2134
|
method: 'client.networking.connect.connections.delete',
|
|
2028
2135
|
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);",
|
|
2029
2136
|
},
|
|
2137
|
+
http: {
|
|
2138
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2139
|
+
},
|
|
2030
2140
|
go: {
|
|
2031
2141
|
method: 'client.Networking.Connect.Connections.Delete',
|
|
2032
2142
|
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',
|
|
2033
2143
|
},
|
|
2034
2144
|
cli: {
|
|
2035
|
-
method: 'connections delete',
|
|
2036
|
-
example: "nirvana networking:connect:connections delete \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2037
|
-
},
|
|
2038
|
-
http: {
|
|
2039
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections/$CONNECTION_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2145
|
+
method: 'connections delete',
|
|
2146
|
+
example: "nirvana networking:connect:connections delete \\\n --api-key 'My API Key' \\\n --connection-id connection_id",
|
|
2040
2147
|
},
|
|
2041
2148
|
},
|
|
2042
2149
|
},
|
|
@@ -2056,6 +2163,9 @@ const EMBEDDED_METHODS = [
|
|
|
2056
2163
|
method: 'client.networking.connect.connections.list',
|
|
2057
2164
|
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}",
|
|
2058
2165
|
},
|
|
2166
|
+
http: {
|
|
2167
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2168
|
+
},
|
|
2059
2169
|
go: {
|
|
2060
2170
|
method: 'client.Networking.Connect.Connections.List',
|
|
2061
2171
|
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',
|
|
@@ -2064,9 +2174,6 @@ const EMBEDDED_METHODS = [
|
|
|
2064
2174
|
method: 'connections list',
|
|
2065
2175
|
example: "nirvana networking:connect:connections list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2066
2176
|
},
|
|
2067
|
-
http: {
|
|
2068
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/connections \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2069
|
-
},
|
|
2070
2177
|
},
|
|
2071
2178
|
},
|
|
2072
2179
|
{
|
|
@@ -2085,6 +2192,9 @@ const EMBEDDED_METHODS = [
|
|
|
2085
2192
|
method: 'client.networking.connect.routes.list',
|
|
2086
2193
|
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}",
|
|
2087
2194
|
},
|
|
2195
|
+
http: {
|
|
2196
|
+
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/routes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2197
|
+
},
|
|
2088
2198
|
go: {
|
|
2089
2199
|
method: 'client.Networking.Connect.Routes.List',
|
|
2090
2200
|
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',
|
|
@@ -2093,9 +2203,6 @@ const EMBEDDED_METHODS = [
|
|
|
2093
2203
|
method: 'routes list',
|
|
2094
2204
|
example: "nirvana networking:connect:routes list \\\n --api-key 'My API Key'",
|
|
2095
2205
|
},
|
|
2096
|
-
http: {
|
|
2097
|
-
example: 'curl https://api.nirvanalabs.io/v1/networking/connect/routes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2098
|
-
},
|
|
2099
2206
|
},
|
|
2100
2207
|
},
|
|
2101
2208
|
{
|
|
@@ -2120,6 +2227,9 @@ const EMBEDDED_METHODS = [
|
|
|
2120
2227
|
method: 'client.rpcNodes.flex.create',
|
|
2121
2228
|
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);",
|
|
2122
2229
|
},
|
|
2230
|
+
http: {
|
|
2231
|
+
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 }\'',
|
|
2232
|
+
},
|
|
2123
2233
|
go: {
|
|
2124
2234
|
method: 'client.RPCNodes.Flex.New',
|
|
2125
2235
|
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',
|
|
@@ -2128,9 +2238,6 @@ const EMBEDDED_METHODS = [
|
|
|
2128
2238
|
method: 'flex create',
|
|
2129
2239
|
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",
|
|
2130
2240
|
},
|
|
2131
|
-
http: {
|
|
2132
|
-
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 }\'',
|
|
2133
|
-
},
|
|
2134
2241
|
},
|
|
2135
2242
|
},
|
|
2136
2243
|
{
|
|
@@ -2149,6 +2256,9 @@ const EMBEDDED_METHODS = [
|
|
|
2149
2256
|
method: 'client.rpcNodes.flex.get',
|
|
2150
2257
|
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);",
|
|
2151
2258
|
},
|
|
2259
|
+
http: {
|
|
2260
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2261
|
+
},
|
|
2152
2262
|
go: {
|
|
2153
2263
|
method: 'client.RPCNodes.Flex.Get',
|
|
2154
2264
|
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',
|
|
@@ -2157,9 +2267,6 @@ const EMBEDDED_METHODS = [
|
|
|
2157
2267
|
method: 'flex get',
|
|
2158
2268
|
example: "nirvana rpc-nodes:flex get \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2159
2269
|
},
|
|
2160
|
-
http: {
|
|
2161
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2162
|
-
},
|
|
2163
2270
|
},
|
|
2164
2271
|
},
|
|
2165
2272
|
{
|
|
@@ -2178,6 +2285,9 @@ const EMBEDDED_METHODS = [
|
|
|
2178
2285
|
method: 'client.rpcNodes.flex.update',
|
|
2179
2286
|
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);",
|
|
2180
2287
|
},
|
|
2288
|
+
http: {
|
|
2289
|
+
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 }\'',
|
|
2290
|
+
},
|
|
2181
2291
|
go: {
|
|
2182
2292
|
method: 'client.RPCNodes.Flex.Update',
|
|
2183
2293
|
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',
|
|
@@ -2186,9 +2296,6 @@ const EMBEDDED_METHODS = [
|
|
|
2186
2296
|
method: 'flex update',
|
|
2187
2297
|
example: "nirvana rpc-nodes:flex update \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2188
2298
|
},
|
|
2189
|
-
http: {
|
|
2190
|
-
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 }\'',
|
|
2191
|
-
},
|
|
2192
2299
|
},
|
|
2193
2300
|
},
|
|
2194
2301
|
{
|
|
@@ -2206,6 +2313,9 @@ const EMBEDDED_METHODS = [
|
|
|
2206
2313
|
method: 'client.rpcNodes.flex.delete',
|
|
2207
2314
|
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');",
|
|
2208
2315
|
},
|
|
2316
|
+
http: {
|
|
2317
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2318
|
+
},
|
|
2209
2319
|
go: {
|
|
2210
2320
|
method: 'client.RPCNodes.Flex.Delete',
|
|
2211
2321
|
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',
|
|
@@ -2214,9 +2324,6 @@ const EMBEDDED_METHODS = [
|
|
|
2214
2324
|
method: 'flex delete',
|
|
2215
2325
|
example: "nirvana rpc-nodes:flex delete \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2216
2326
|
},
|
|
2217
|
-
http: {
|
|
2218
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/$NODE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2219
|
-
},
|
|
2220
2327
|
},
|
|
2221
2328
|
},
|
|
2222
2329
|
{
|
|
@@ -2235,6 +2342,9 @@ const EMBEDDED_METHODS = [
|
|
|
2235
2342
|
method: 'client.rpcNodes.flex.list',
|
|
2236
2343
|
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}",
|
|
2237
2344
|
},
|
|
2345
|
+
http: {
|
|
2346
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2347
|
+
},
|
|
2238
2348
|
go: {
|
|
2239
2349
|
method: 'client.RPCNodes.Flex.List',
|
|
2240
2350
|
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',
|
|
@@ -2243,9 +2353,6 @@ const EMBEDDED_METHODS = [
|
|
|
2243
2353
|
method: 'flex list',
|
|
2244
2354
|
example: "nirvana rpc-nodes:flex list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2245
2355
|
},
|
|
2246
|
-
http: {
|
|
2247
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2248
|
-
},
|
|
2249
2356
|
},
|
|
2250
2357
|
},
|
|
2251
2358
|
{
|
|
@@ -2264,6 +2371,9 @@ const EMBEDDED_METHODS = [
|
|
|
2264
2371
|
method: 'client.rpcNodes.flex.blockchains.list',
|
|
2265
2372
|
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}",
|
|
2266
2373
|
},
|
|
2374
|
+
http: {
|
|
2375
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2376
|
+
},
|
|
2267
2377
|
go: {
|
|
2268
2378
|
method: 'client.RPCNodes.Flex.Blockchains.List',
|
|
2269
2379
|
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',
|
|
@@ -2272,9 +2382,6 @@ const EMBEDDED_METHODS = [
|
|
|
2272
2382
|
method: 'blockchains list',
|
|
2273
2383
|
example: "nirvana rpc-nodes:flex:blockchains list \\\n --api-key 'My API Key'",
|
|
2274
2384
|
},
|
|
2275
|
-
http: {
|
|
2276
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/flex/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2277
|
-
},
|
|
2278
2385
|
},
|
|
2279
2386
|
},
|
|
2280
2387
|
{
|
|
@@ -2293,6 +2400,9 @@ const EMBEDDED_METHODS = [
|
|
|
2293
2400
|
method: 'client.rpcNodes.dedicated.get',
|
|
2294
2401
|
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);",
|
|
2295
2402
|
},
|
|
2403
|
+
http: {
|
|
2404
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2405
|
+
},
|
|
2296
2406
|
go: {
|
|
2297
2407
|
method: 'client.RPCNodes.Dedicated.Get',
|
|
2298
2408
|
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',
|
|
@@ -2301,9 +2411,6 @@ const EMBEDDED_METHODS = [
|
|
|
2301
2411
|
method: 'dedicated get',
|
|
2302
2412
|
example: "nirvana rpc-nodes:dedicated get \\\n --api-key 'My API Key' \\\n --node-id node_id",
|
|
2303
2413
|
},
|
|
2304
|
-
http: {
|
|
2305
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/$NODE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2306
|
-
},
|
|
2307
2414
|
},
|
|
2308
2415
|
},
|
|
2309
2416
|
{
|
|
@@ -2322,6 +2429,9 @@ const EMBEDDED_METHODS = [
|
|
|
2322
2429
|
method: 'client.rpcNodes.dedicated.list',
|
|
2323
2430
|
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}",
|
|
2324
2431
|
},
|
|
2432
|
+
http: {
|
|
2433
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2434
|
+
},
|
|
2325
2435
|
go: {
|
|
2326
2436
|
method: 'client.RPCNodes.Dedicated.List',
|
|
2327
2437
|
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',
|
|
@@ -2330,9 +2440,6 @@ const EMBEDDED_METHODS = [
|
|
|
2330
2440
|
method: 'dedicated list',
|
|
2331
2441
|
example: "nirvana rpc-nodes:dedicated list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2332
2442
|
},
|
|
2333
|
-
http: {
|
|
2334
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2335
|
-
},
|
|
2336
2443
|
},
|
|
2337
2444
|
},
|
|
2338
2445
|
{
|
|
@@ -2351,6 +2458,9 @@ const EMBEDDED_METHODS = [
|
|
|
2351
2458
|
method: 'client.rpcNodes.dedicated.blockchains.list',
|
|
2352
2459
|
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}",
|
|
2353
2460
|
},
|
|
2461
|
+
http: {
|
|
2462
|
+
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2463
|
+
},
|
|
2354
2464
|
go: {
|
|
2355
2465
|
method: 'client.RPCNodes.Dedicated.Blockchains.List',
|
|
2356
2466
|
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',
|
|
@@ -2359,9 +2469,6 @@ const EMBEDDED_METHODS = [
|
|
|
2359
2469
|
method: 'blockchains list',
|
|
2360
2470
|
example: "nirvana rpc-nodes:dedicated:blockchains list \\\n --api-key 'My API Key'",
|
|
2361
2471
|
},
|
|
2362
|
-
http: {
|
|
2363
|
-
example: 'curl https://api.nirvanalabs.io/v1/rpc_nodes/dedicated/blockchains \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2364
|
-
},
|
|
2365
2472
|
},
|
|
2366
2473
|
},
|
|
2367
2474
|
{
|
|
@@ -2380,6 +2487,9 @@ const EMBEDDED_METHODS = [
|
|
|
2380
2487
|
method: 'client.nks.kubernetesVersions.list',
|
|
2381
2488
|
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}",
|
|
2382
2489
|
},
|
|
2490
|
+
http: {
|
|
2491
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/kubernetes_versions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2492
|
+
},
|
|
2383
2493
|
go: {
|
|
2384
2494
|
method: 'client.NKS.KubernetesVersions.List',
|
|
2385
2495
|
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',
|
|
@@ -2388,9 +2498,6 @@ const EMBEDDED_METHODS = [
|
|
|
2388
2498
|
method: 'kubernetes_versions list',
|
|
2389
2499
|
example: "nirvana nks:kubernetes-versions list \\\n --api-key 'My API Key'",
|
|
2390
2500
|
},
|
|
2391
|
-
http: {
|
|
2392
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/kubernetes_versions \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2393
|
-
},
|
|
2394
2501
|
},
|
|
2395
2502
|
},
|
|
2396
2503
|
{
|
|
@@ -2417,6 +2524,9 @@ const EMBEDDED_METHODS = [
|
|
|
2417
2524
|
method: 'client.nks.clusters.create',
|
|
2418
2525
|
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);",
|
|
2419
2526
|
},
|
|
2527
|
+
http: {
|
|
2528
|
+
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 }\'',
|
|
2529
|
+
},
|
|
2420
2530
|
go: {
|
|
2421
2531
|
method: 'client.NKS.Clusters.New',
|
|
2422
2532
|
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',
|
|
@@ -2425,9 +2535,6 @@ const EMBEDDED_METHODS = [
|
|
|
2425
2535
|
method: 'clusters create',
|
|
2426
2536
|
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",
|
|
2427
2537
|
},
|
|
2428
|
-
http: {
|
|
2429
|
-
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 }\'',
|
|
2430
|
-
},
|
|
2431
2538
|
},
|
|
2432
2539
|
},
|
|
2433
2540
|
{
|
|
@@ -2446,6 +2553,9 @@ const EMBEDDED_METHODS = [
|
|
|
2446
2553
|
method: 'client.nks.clusters.get',
|
|
2447
2554
|
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);",
|
|
2448
2555
|
},
|
|
2556
|
+
http: {
|
|
2557
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2558
|
+
},
|
|
2449
2559
|
go: {
|
|
2450
2560
|
method: 'client.NKS.Clusters.Get',
|
|
2451
2561
|
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',
|
|
@@ -2454,9 +2564,6 @@ const EMBEDDED_METHODS = [
|
|
|
2454
2564
|
method: 'clusters get',
|
|
2455
2565
|
example: "nirvana nks:clusters get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2456
2566
|
},
|
|
2457
|
-
http: {
|
|
2458
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2459
|
-
},
|
|
2460
2567
|
},
|
|
2461
2568
|
},
|
|
2462
2569
|
{
|
|
@@ -2475,6 +2582,9 @@ const EMBEDDED_METHODS = [
|
|
|
2475
2582
|
method: 'client.nks.clusters.update',
|
|
2476
2583
|
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);",
|
|
2477
2584
|
},
|
|
2585
|
+
http: {
|
|
2586
|
+
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 }\'',
|
|
2587
|
+
},
|
|
2478
2588
|
go: {
|
|
2479
2589
|
method: 'client.NKS.Clusters.Update',
|
|
2480
2590
|
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',
|
|
@@ -2483,9 +2593,6 @@ const EMBEDDED_METHODS = [
|
|
|
2483
2593
|
method: 'clusters update',
|
|
2484
2594
|
example: "nirvana nks:clusters update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2485
2595
|
},
|
|
2486
|
-
http: {
|
|
2487
|
-
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 }\'',
|
|
2488
|
-
},
|
|
2489
2596
|
},
|
|
2490
2597
|
},
|
|
2491
2598
|
{
|
|
@@ -2504,6 +2611,9 @@ const EMBEDDED_METHODS = [
|
|
|
2504
2611
|
method: 'client.nks.clusters.delete',
|
|
2505
2612
|
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);",
|
|
2506
2613
|
},
|
|
2614
|
+
http: {
|
|
2615
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2616
|
+
},
|
|
2507
2617
|
go: {
|
|
2508
2618
|
method: 'client.NKS.Clusters.Delete',
|
|
2509
2619
|
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',
|
|
@@ -2512,9 +2622,6 @@ const EMBEDDED_METHODS = [
|
|
|
2512
2622
|
method: 'clusters delete',
|
|
2513
2623
|
example: "nirvana nks:clusters delete \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2514
2624
|
},
|
|
2515
|
-
http: {
|
|
2516
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2517
|
-
},
|
|
2518
2625
|
},
|
|
2519
2626
|
},
|
|
2520
2627
|
{
|
|
@@ -2533,6 +2640,9 @@ const EMBEDDED_METHODS = [
|
|
|
2533
2640
|
method: 'client.nks.clusters.list',
|
|
2534
2641
|
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}",
|
|
2535
2642
|
},
|
|
2643
|
+
http: {
|
|
2644
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2645
|
+
},
|
|
2536
2646
|
go: {
|
|
2537
2647
|
method: 'client.NKS.Clusters.List',
|
|
2538
2648
|
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',
|
|
@@ -2541,9 +2651,6 @@ const EMBEDDED_METHODS = [
|
|
|
2541
2651
|
method: 'clusters list',
|
|
2542
2652
|
example: "nirvana nks:clusters list \\\n --api-key 'My API Key' \\\n --project-id project_id",
|
|
2543
2653
|
},
|
|
2544
|
-
http: {
|
|
2545
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2546
|
-
},
|
|
2547
2654
|
},
|
|
2548
2655
|
},
|
|
2549
2656
|
{
|
|
@@ -2569,6 +2676,9 @@ const EMBEDDED_METHODS = [
|
|
|
2569
2676
|
method: 'client.nks.clusters.availability.create',
|
|
2570
2677
|
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});",
|
|
2571
2678
|
},
|
|
2679
|
+
http: {
|
|
2680
|
+
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 }\'',
|
|
2681
|
+
},
|
|
2572
2682
|
go: {
|
|
2573
2683
|
method: 'client.NKS.Clusters.Availability.New',
|
|
2574
2684
|
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',
|
|
@@ -2577,9 +2687,6 @@ const EMBEDDED_METHODS = [
|
|
|
2577
2687
|
method: 'availability create',
|
|
2578
2688
|
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",
|
|
2579
2689
|
},
|
|
2580
|
-
http: {
|
|
2581
|
-
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 }\'',
|
|
2582
|
-
},
|
|
2583
2690
|
},
|
|
2584
2691
|
},
|
|
2585
2692
|
{
|
|
@@ -2597,6 +2704,9 @@ const EMBEDDED_METHODS = [
|
|
|
2597
2704
|
method: 'client.nks.clusters.availability.update',
|
|
2598
2705
|
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');",
|
|
2599
2706
|
},
|
|
2707
|
+
http: {
|
|
2708
|
+
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 }\'',
|
|
2709
|
+
},
|
|
2600
2710
|
go: {
|
|
2601
2711
|
method: 'client.NKS.Clusters.Availability.Update',
|
|
2602
2712
|
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',
|
|
@@ -2605,9 +2715,6 @@ const EMBEDDED_METHODS = [
|
|
|
2605
2715
|
method: 'availability update',
|
|
2606
2716
|
example: "nirvana nks:clusters:availability update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2607
2717
|
},
|
|
2608
|
-
http: {
|
|
2609
|
-
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 }\'',
|
|
2610
|
-
},
|
|
2611
2718
|
},
|
|
2612
2719
|
},
|
|
2613
2720
|
{
|
|
@@ -2626,6 +2733,9 @@ const EMBEDDED_METHODS = [
|
|
|
2626
2733
|
method: 'client.nks.clusters.persistentVolumeClaims.get',
|
|
2627
2734
|
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);",
|
|
2628
2735
|
},
|
|
2736
|
+
http: {
|
|
2737
|
+
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"',
|
|
2738
|
+
},
|
|
2629
2739
|
go: {
|
|
2630
2740
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.Get',
|
|
2631
2741
|
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',
|
|
@@ -2634,9 +2744,6 @@ const EMBEDDED_METHODS = [
|
|
|
2634
2744
|
method: 'persistent_volume_claims get',
|
|
2635
2745
|
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",
|
|
2636
2746
|
},
|
|
2637
|
-
http: {
|
|
2638
|
-
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"',
|
|
2639
|
-
},
|
|
2640
2747
|
},
|
|
2641
2748
|
},
|
|
2642
2749
|
{
|
|
@@ -2655,6 +2762,9 @@ const EMBEDDED_METHODS = [
|
|
|
2655
2762
|
method: 'client.nks.clusters.persistentVolumeClaims.list',
|
|
2656
2763
|
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}",
|
|
2657
2764
|
},
|
|
2765
|
+
http: {
|
|
2766
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/persistent_volume_claims \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2767
|
+
},
|
|
2658
2768
|
go: {
|
|
2659
2769
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.List',
|
|
2660
2770
|
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',
|
|
@@ -2663,9 +2773,6 @@ const EMBEDDED_METHODS = [
|
|
|
2663
2773
|
method: 'persistent_volume_claims list',
|
|
2664
2774
|
example: "nirvana nks:clusters:persistent-volume-claims list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2665
2775
|
},
|
|
2666
|
-
http: {
|
|
2667
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/persistent_volume_claims \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2668
|
-
},
|
|
2669
2776
|
},
|
|
2670
2777
|
},
|
|
2671
2778
|
{
|
|
@@ -2684,6 +2791,9 @@ const EMBEDDED_METHODS = [
|
|
|
2684
2791
|
method: 'client.nks.clusters.kubeconfig.get',
|
|
2685
2792
|
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);",
|
|
2686
2793
|
},
|
|
2794
|
+
http: {
|
|
2795
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/kubeconfig \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2796
|
+
},
|
|
2687
2797
|
go: {
|
|
2688
2798
|
method: 'client.NKS.Clusters.Kubeconfig.Get',
|
|
2689
2799
|
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',
|
|
@@ -2692,9 +2802,6 @@ const EMBEDDED_METHODS = [
|
|
|
2692
2802
|
method: 'kubeconfig get',
|
|
2693
2803
|
example: "nirvana nks:clusters:kubeconfig get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2694
2804
|
},
|
|
2695
|
-
http: {
|
|
2696
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/kubeconfig \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2697
|
-
},
|
|
2698
2805
|
},
|
|
2699
2806
|
},
|
|
2700
2807
|
{
|
|
@@ -2713,6 +2820,9 @@ const EMBEDDED_METHODS = [
|
|
|
2713
2820
|
method: 'client.nks.clusters.controllers.get',
|
|
2714
2821
|
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);",
|
|
2715
2822
|
},
|
|
2823
|
+
http: {
|
|
2824
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2825
|
+
},
|
|
2716
2826
|
go: {
|
|
2717
2827
|
method: 'client.NKS.Clusters.Controllers.Get',
|
|
2718
2828
|
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',
|
|
@@ -2721,9 +2831,6 @@ const EMBEDDED_METHODS = [
|
|
|
2721
2831
|
method: 'controllers get',
|
|
2722
2832
|
example: "nirvana nks:clusters:controllers get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --controller-id controller_id",
|
|
2723
2833
|
},
|
|
2724
|
-
http: {
|
|
2725
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2726
|
-
},
|
|
2727
2834
|
},
|
|
2728
2835
|
},
|
|
2729
2836
|
{
|
|
@@ -2742,6 +2849,9 @@ const EMBEDDED_METHODS = [
|
|
|
2742
2849
|
method: 'client.nks.clusters.controllers.list',
|
|
2743
2850
|
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}",
|
|
2744
2851
|
},
|
|
2852
|
+
http: {
|
|
2853
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2854
|
+
},
|
|
2745
2855
|
go: {
|
|
2746
2856
|
method: 'client.NKS.Clusters.Controllers.List',
|
|
2747
2857
|
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',
|
|
@@ -2750,9 +2860,6 @@ const EMBEDDED_METHODS = [
|
|
|
2750
2860
|
method: 'controllers list',
|
|
2751
2861
|
example: "nirvana nks:clusters:controllers list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2752
2862
|
},
|
|
2753
|
-
http: {
|
|
2754
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2755
|
-
},
|
|
2756
2863
|
},
|
|
2757
2864
|
},
|
|
2758
2865
|
{
|
|
@@ -2771,6 +2878,9 @@ const EMBEDDED_METHODS = [
|
|
|
2771
2878
|
method: 'client.nks.clusters.controllers.volumes.get',
|
|
2772
2879
|
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);",
|
|
2773
2880
|
},
|
|
2881
|
+
http: {
|
|
2882
|
+
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"',
|
|
2883
|
+
},
|
|
2774
2884
|
go: {
|
|
2775
2885
|
method: 'client.NKS.Clusters.Controllers.Volumes.Get',
|
|
2776
2886
|
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',
|
|
@@ -2779,9 +2889,6 @@ const EMBEDDED_METHODS = [
|
|
|
2779
2889
|
method: 'volumes get',
|
|
2780
2890
|
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",
|
|
2781
2891
|
},
|
|
2782
|
-
http: {
|
|
2783
|
-
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"',
|
|
2784
|
-
},
|
|
2785
2892
|
},
|
|
2786
2893
|
},
|
|
2787
2894
|
{
|
|
@@ -2800,6 +2907,9 @@ const EMBEDDED_METHODS = [
|
|
|
2800
2907
|
method: 'client.nks.clusters.controllers.volumes.list',
|
|
2801
2908
|
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}",
|
|
2802
2909
|
},
|
|
2910
|
+
http: {
|
|
2911
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2912
|
+
},
|
|
2803
2913
|
go: {
|
|
2804
2914
|
method: 'client.NKS.Clusters.Controllers.Volumes.List',
|
|
2805
2915
|
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',
|
|
@@ -2808,9 +2918,6 @@ const EMBEDDED_METHODS = [
|
|
|
2808
2918
|
method: 'volumes list',
|
|
2809
2919
|
example: "nirvana nks:clusters:controllers:volumes list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --controller-id controller_id",
|
|
2810
2920
|
},
|
|
2811
|
-
http: {
|
|
2812
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/controllers/$CONTROLLER_ID/volumes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2813
|
-
},
|
|
2814
2921
|
},
|
|
2815
2922
|
},
|
|
2816
2923
|
{
|
|
@@ -2829,6 +2936,9 @@ const EMBEDDED_METHODS = [
|
|
|
2829
2936
|
method: 'client.nks.clusters.loadBalancers.get',
|
|
2830
2937
|
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);",
|
|
2831
2938
|
},
|
|
2939
|
+
http: {
|
|
2940
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers/$LOAD_BALANCER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2941
|
+
},
|
|
2832
2942
|
go: {
|
|
2833
2943
|
method: 'client.NKS.Clusters.LoadBalancers.Get',
|
|
2834
2944
|
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',
|
|
@@ -2837,9 +2947,6 @@ const EMBEDDED_METHODS = [
|
|
|
2837
2947
|
method: 'load_balancers get',
|
|
2838
2948
|
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",
|
|
2839
2949
|
},
|
|
2840
|
-
http: {
|
|
2841
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers/$LOAD_BALANCER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2842
|
-
},
|
|
2843
2950
|
},
|
|
2844
2951
|
},
|
|
2845
2952
|
{
|
|
@@ -2858,6 +2965,9 @@ const EMBEDDED_METHODS = [
|
|
|
2858
2965
|
method: 'client.nks.clusters.loadBalancers.update',
|
|
2859
2966
|
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);",
|
|
2860
2967
|
},
|
|
2968
|
+
http: {
|
|
2969
|
+
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 }\'',
|
|
2970
|
+
},
|
|
2861
2971
|
go: {
|
|
2862
2972
|
method: 'client.NKS.Clusters.LoadBalancers.Update',
|
|
2863
2973
|
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',
|
|
@@ -2866,9 +2976,6 @@ const EMBEDDED_METHODS = [
|
|
|
2866
2976
|
method: 'load_balancers update',
|
|
2867
2977
|
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",
|
|
2868
2978
|
},
|
|
2869
|
-
http: {
|
|
2870
|
-
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 }\'',
|
|
2871
|
-
},
|
|
2872
2979
|
},
|
|
2873
2980
|
},
|
|
2874
2981
|
{
|
|
@@ -2887,6 +2994,9 @@ const EMBEDDED_METHODS = [
|
|
|
2887
2994
|
method: 'client.nks.clusters.loadBalancers.list',
|
|
2888
2995
|
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}",
|
|
2889
2996
|
},
|
|
2997
|
+
http: {
|
|
2998
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2999
|
+
},
|
|
2890
3000
|
go: {
|
|
2891
3001
|
method: 'client.NKS.Clusters.LoadBalancers.List',
|
|
2892
3002
|
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',
|
|
@@ -2895,9 +3005,6 @@ const EMBEDDED_METHODS = [
|
|
|
2895
3005
|
method: 'load_balancers list',
|
|
2896
3006
|
example: "nirvana nks:clusters:load-balancers list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
2897
3007
|
},
|
|
2898
|
-
http: {
|
|
2899
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/load_balancers \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2900
|
-
},
|
|
2901
3008
|
},
|
|
2902
3009
|
},
|
|
2903
3010
|
{
|
|
@@ -2922,6 +3029,9 @@ const EMBEDDED_METHODS = [
|
|
|
2922
3029
|
method: 'client.nks.clusters.pools.create',
|
|
2923
3030
|
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);",
|
|
2924
3031
|
},
|
|
3032
|
+
http: {
|
|
3033
|
+
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 }\'',
|
|
3034
|
+
},
|
|
2925
3035
|
go: {
|
|
2926
3036
|
method: 'client.NKS.Clusters.Pools.New',
|
|
2927
3037
|
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',
|
|
@@ -2930,9 +3040,6 @@ const EMBEDDED_METHODS = [
|
|
|
2930
3040
|
method: 'pools create',
|
|
2931
3041
|
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",
|
|
2932
3042
|
},
|
|
2933
|
-
http: {
|
|
2934
|
-
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 }\'',
|
|
2935
|
-
},
|
|
2936
3043
|
},
|
|
2937
3044
|
},
|
|
2938
3045
|
{
|
|
@@ -2951,6 +3058,9 @@ const EMBEDDED_METHODS = [
|
|
|
2951
3058
|
method: 'client.nks.clusters.pools.get',
|
|
2952
3059
|
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);",
|
|
2953
3060
|
},
|
|
3061
|
+
http: {
|
|
3062
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3063
|
+
},
|
|
2954
3064
|
go: {
|
|
2955
3065
|
method: 'client.NKS.Clusters.Pools.Get',
|
|
2956
3066
|
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',
|
|
@@ -2959,9 +3069,6 @@ const EMBEDDED_METHODS = [
|
|
|
2959
3069
|
method: 'pools get',
|
|
2960
3070
|
example: "nirvana nks:clusters:pools get \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
2961
3071
|
},
|
|
2962
|
-
http: {
|
|
2963
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
2964
|
-
},
|
|
2965
3072
|
},
|
|
2966
3073
|
},
|
|
2967
3074
|
{
|
|
@@ -2987,6 +3094,9 @@ const EMBEDDED_METHODS = [
|
|
|
2987
3094
|
method: 'client.nks.clusters.pools.update',
|
|
2988
3095
|
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);",
|
|
2989
3096
|
},
|
|
3097
|
+
http: {
|
|
3098
|
+
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 }\'',
|
|
3099
|
+
},
|
|
2990
3100
|
go: {
|
|
2991
3101
|
method: 'client.NKS.Clusters.Pools.Update',
|
|
2992
3102
|
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',
|
|
@@ -2995,9 +3105,6 @@ const EMBEDDED_METHODS = [
|
|
|
2995
3105
|
method: 'pools update',
|
|
2996
3106
|
example: "nirvana nks:clusters:pools update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
2997
3107
|
},
|
|
2998
|
-
http: {
|
|
2999
|
-
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 }\'',
|
|
3000
|
-
},
|
|
3001
3108
|
},
|
|
3002
3109
|
},
|
|
3003
3110
|
{
|
|
@@ -3016,6 +3123,9 @@ const EMBEDDED_METHODS = [
|
|
|
3016
3123
|
method: 'client.nks.clusters.pools.delete',
|
|
3017
3124
|
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);",
|
|
3018
3125
|
},
|
|
3126
|
+
http: {
|
|
3127
|
+
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"',
|
|
3128
|
+
},
|
|
3019
3129
|
go: {
|
|
3020
3130
|
method: 'client.NKS.Clusters.Pools.Delete',
|
|
3021
3131
|
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',
|
|
@@ -3024,9 +3134,6 @@ const EMBEDDED_METHODS = [
|
|
|
3024
3134
|
method: 'pools delete',
|
|
3025
3135
|
example: "nirvana nks:clusters:pools delete \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3026
3136
|
},
|
|
3027
|
-
http: {
|
|
3028
|
-
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"',
|
|
3029
|
-
},
|
|
3030
3137
|
},
|
|
3031
3138
|
},
|
|
3032
3139
|
{
|
|
@@ -3045,6 +3152,9 @@ const EMBEDDED_METHODS = [
|
|
|
3045
3152
|
method: 'client.nks.clusters.pools.list',
|
|
3046
3153
|
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}",
|
|
3047
3154
|
},
|
|
3155
|
+
http: {
|
|
3156
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3157
|
+
},
|
|
3048
3158
|
go: {
|
|
3049
3159
|
method: 'client.NKS.Clusters.Pools.List',
|
|
3050
3160
|
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',
|
|
@@ -3053,9 +3163,6 @@ const EMBEDDED_METHODS = [
|
|
|
3053
3163
|
method: 'pools list',
|
|
3054
3164
|
example: "nirvana nks:clusters:pools list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id",
|
|
3055
3165
|
},
|
|
3056
|
-
http: {
|
|
3057
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3058
|
-
},
|
|
3059
3166
|
},
|
|
3060
3167
|
},
|
|
3061
3168
|
{
|
|
@@ -3079,6 +3186,9 @@ const EMBEDDED_METHODS = [
|
|
|
3079
3186
|
method: 'client.nks.clusters.pools.availability.create',
|
|
3080
3187
|
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});",
|
|
3081
3188
|
},
|
|
3189
|
+
http: {
|
|
3190
|
+
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 }\'',
|
|
3191
|
+
},
|
|
3082
3192
|
go: {
|
|
3083
3193
|
method: 'client.NKS.Clusters.Pools.Availability.New',
|
|
3084
3194
|
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',
|
|
@@ -3087,9 +3197,6 @@ const EMBEDDED_METHODS = [
|
|
|
3087
3197
|
method: 'availability create',
|
|
3088
3198
|
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",
|
|
3089
3199
|
},
|
|
3090
|
-
http: {
|
|
3091
|
-
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 }\'',
|
|
3092
|
-
},
|
|
3093
3200
|
},
|
|
3094
3201
|
},
|
|
3095
3202
|
{
|
|
@@ -3114,6 +3221,9 @@ const EMBEDDED_METHODS = [
|
|
|
3114
3221
|
method: 'client.nks.clusters.pools.availability.update',
|
|
3115
3222
|
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' });",
|
|
3116
3223
|
},
|
|
3224
|
+
http: {
|
|
3225
|
+
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 }\'',
|
|
3226
|
+
},
|
|
3117
3227
|
go: {
|
|
3118
3228
|
method: 'client.NKS.Clusters.Pools.Availability.Update',
|
|
3119
3229
|
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',
|
|
@@ -3122,9 +3232,6 @@ const EMBEDDED_METHODS = [
|
|
|
3122
3232
|
method: 'availability update',
|
|
3123
3233
|
example: "nirvana nks:clusters:pools:availability update \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3124
3234
|
},
|
|
3125
|
-
http: {
|
|
3126
|
-
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 }\'',
|
|
3127
|
-
},
|
|
3128
3235
|
},
|
|
3129
3236
|
},
|
|
3130
3237
|
{
|
|
@@ -3143,6 +3250,9 @@ const EMBEDDED_METHODS = [
|
|
|
3143
3250
|
method: 'client.nks.clusters.pools.nodes.get',
|
|
3144
3251
|
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);",
|
|
3145
3252
|
},
|
|
3253
|
+
http: {
|
|
3254
|
+
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"',
|
|
3255
|
+
},
|
|
3146
3256
|
go: {
|
|
3147
3257
|
method: 'client.NKS.Clusters.Pools.Nodes.Get',
|
|
3148
3258
|
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',
|
|
@@ -3151,9 +3261,6 @@ const EMBEDDED_METHODS = [
|
|
|
3151
3261
|
method: 'nodes get',
|
|
3152
3262
|
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",
|
|
3153
3263
|
},
|
|
3154
|
-
http: {
|
|
3155
|
-
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"',
|
|
3156
|
-
},
|
|
3157
3264
|
},
|
|
3158
3265
|
},
|
|
3159
3266
|
{
|
|
@@ -3172,6 +3279,9 @@ const EMBEDDED_METHODS = [
|
|
|
3172
3279
|
method: 'client.nks.clusters.pools.nodes.delete',
|
|
3173
3280
|
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);",
|
|
3174
3281
|
},
|
|
3282
|
+
http: {
|
|
3283
|
+
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"',
|
|
3284
|
+
},
|
|
3175
3285
|
go: {
|
|
3176
3286
|
method: 'client.NKS.Clusters.Pools.Nodes.Delete',
|
|
3177
3287
|
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',
|
|
@@ -3180,9 +3290,6 @@ const EMBEDDED_METHODS = [
|
|
|
3180
3290
|
method: 'nodes delete',
|
|
3181
3291
|
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",
|
|
3182
3292
|
},
|
|
3183
|
-
http: {
|
|
3184
|
-
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"',
|
|
3185
|
-
},
|
|
3186
3293
|
},
|
|
3187
3294
|
},
|
|
3188
3295
|
{
|
|
@@ -3201,6 +3308,9 @@ const EMBEDDED_METHODS = [
|
|
|
3201
3308
|
method: 'client.nks.clusters.pools.nodes.list',
|
|
3202
3309
|
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}",
|
|
3203
3310
|
},
|
|
3311
|
+
http: {
|
|
3312
|
+
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3313
|
+
},
|
|
3204
3314
|
go: {
|
|
3205
3315
|
method: 'client.NKS.Clusters.Pools.Nodes.List',
|
|
3206
3316
|
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',
|
|
@@ -3209,9 +3319,6 @@ const EMBEDDED_METHODS = [
|
|
|
3209
3319
|
method: 'nodes list',
|
|
3210
3320
|
example: "nirvana nks:clusters:pools:nodes list \\\n --api-key 'My API Key' \\\n --cluster-id cluster_id \\\n --pool-id pool_id",
|
|
3211
3321
|
},
|
|
3212
|
-
http: {
|
|
3213
|
-
example: 'curl https://api.nirvanalabs.io/v1/nks/clusters/$CLUSTER_ID/pools/$POOL_ID/nodes \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
3214
|
-
},
|
|
3215
3322
|
},
|
|
3216
3323
|
},
|
|
3217
3324
|
{
|
|
@@ -3230,6 +3337,9 @@ const EMBEDDED_METHODS = [
|
|
|
3230
3337
|
method: 'client.nks.clusters.pools.nodes.volumes.get',
|
|
3231
3338
|
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);",
|
|
3232
3339
|
},
|
|
3340
|
+
http: {
|
|
3341
|
+
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"',
|
|
3342
|
+
},
|
|
3233
3343
|
go: {
|
|
3234
3344
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.Get',
|
|
3235
3345
|
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',
|
|
@@ -3238,9 +3348,6 @@ const EMBEDDED_METHODS = [
|
|
|
3238
3348
|
method: 'volumes get',
|
|
3239
3349
|
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",
|
|
3240
3350
|
},
|
|
3241
|
-
http: {
|
|
3242
|
-
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"',
|
|
3243
|
-
},
|
|
3244
3351
|
},
|
|
3245
3352
|
},
|
|
3246
3353
|
{
|
|
@@ -3265,6 +3372,9 @@ const EMBEDDED_METHODS = [
|
|
|
3265
3372
|
method: 'client.nks.clusters.pools.nodes.volumes.list',
|
|
3266
3373
|
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}",
|
|
3267
3374
|
},
|
|
3375
|
+
http: {
|
|
3376
|
+
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"',
|
|
3377
|
+
},
|
|
3268
3378
|
go: {
|
|
3269
3379
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.List',
|
|
3270
3380
|
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',
|
|
@@ -3273,28 +3383,25 @@ const EMBEDDED_METHODS = [
|
|
|
3273
3383
|
method: 'volumes list',
|
|
3274
3384
|
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",
|
|
3275
3385
|
},
|
|
3276
|
-
http: {
|
|
3277
|
-
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"',
|
|
3278
|
-
},
|
|
3279
3386
|
},
|
|
3280
3387
|
},
|
|
3281
3388
|
];
|
|
3282
3389
|
const EMBEDDED_READMES = [
|
|
3283
3390
|
{
|
|
3284
|
-
language: '
|
|
3285
|
-
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",
|
|
3391
|
+
language: 'typescript',
|
|
3392
|
+
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",
|
|
3286
3393
|
},
|
|
3287
3394
|
{
|
|
3288
3395
|
language: 'go',
|
|
3289
|
-
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',
|
|
3396
|
+
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',
|
|
3290
3397
|
},
|
|
3291
3398
|
{
|
|
3292
3399
|
language: 'terraform',
|
|
3293
|
-
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 = "~>
|
|
3400
|
+
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',
|
|
3294
3401
|
},
|
|
3295
3402
|
{
|
|
3296
|
-
language: '
|
|
3297
|
-
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",
|
|
3403
|
+
language: 'cli',
|
|
3404
|
+
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",
|
|
3298
3405
|
},
|
|
3299
3406
|
];
|
|
3300
3407
|
const INDEX_OPTIONS = {
|