@nirvana-labs/nirvana-mcp 2.4.0 → 3.0.1
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 +15 -2
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +15 -2
- package/code-tool-worker.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 +566 -212
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +566 -212
- 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 +88 -10
- package/methods.js.map +1 -1
- package/methods.mjs +88 -10
- package/methods.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-worker.ts +15 -2
- package/src/local-docs-search.ts +632 -213
- package/src/methods.ts +88 -10
- package/src/server.ts +1 -1
package/local-docs-search.js
CHANGED
|
@@ -63,7 +63,7 @@ const EMBEDDED_METHODS = [
|
|
|
63
63
|
},
|
|
64
64
|
go: {
|
|
65
65
|
method: 'client.User.Get',
|
|
66
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
66
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
67
67
|
},
|
|
68
68
|
cli: {
|
|
69
69
|
method: 'user get',
|
|
@@ -91,7 +91,7 @@ const EMBEDDED_METHODS = [
|
|
|
91
91
|
},
|
|
92
92
|
go: {
|
|
93
93
|
method: 'client.User.Security.Get',
|
|
94
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
94
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
95
95
|
},
|
|
96
96
|
cli: {
|
|
97
97
|
method: 'security get',
|
|
@@ -120,7 +120,7 @@ const EMBEDDED_METHODS = [
|
|
|
120
120
|
},
|
|
121
121
|
go: {
|
|
122
122
|
method: 'client.User.Security.Update',
|
|
123
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
123
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
124
124
|
},
|
|
125
125
|
cli: {
|
|
126
126
|
method: 'security update',
|
|
@@ -157,7 +157,7 @@ const EMBEDDED_METHODS = [
|
|
|
157
157
|
},
|
|
158
158
|
go: {
|
|
159
159
|
method: 'client.APIKeys.New',
|
|
160
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
160
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
161
161
|
},
|
|
162
162
|
cli: {
|
|
163
163
|
method: 'api_keys create',
|
|
@@ -186,7 +186,7 @@ const EMBEDDED_METHODS = [
|
|
|
186
186
|
},
|
|
187
187
|
go: {
|
|
188
188
|
method: 'client.APIKeys.Get',
|
|
189
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
189
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
190
190
|
},
|
|
191
191
|
cli: {
|
|
192
192
|
method: 'api_keys get',
|
|
@@ -222,7 +222,7 @@ const EMBEDDED_METHODS = [
|
|
|
222
222
|
},
|
|
223
223
|
go: {
|
|
224
224
|
method: 'client.APIKeys.Update',
|
|
225
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
225
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
226
226
|
},
|
|
227
227
|
cli: {
|
|
228
228
|
method: 'api_keys update',
|
|
@@ -250,7 +250,7 @@ const EMBEDDED_METHODS = [
|
|
|
250
250
|
},
|
|
251
251
|
go: {
|
|
252
252
|
method: 'client.APIKeys.Delete',
|
|
253
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
253
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
254
254
|
},
|
|
255
255
|
cli: {
|
|
256
256
|
method: 'api_keys delete',
|
|
@@ -286,7 +286,7 @@ const EMBEDDED_METHODS = [
|
|
|
286
286
|
},
|
|
287
287
|
go: {
|
|
288
288
|
method: 'client.APIKeys.List',
|
|
289
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
289
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
290
290
|
},
|
|
291
291
|
cli: {
|
|
292
292
|
method: 'api_keys list',
|
|
@@ -315,7 +315,7 @@ const EMBEDDED_METHODS = [
|
|
|
315
315
|
},
|
|
316
316
|
go: {
|
|
317
317
|
method: 'client.Operations.Get',
|
|
318
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
318
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
319
319
|
},
|
|
320
320
|
cli: {
|
|
321
321
|
method: 'operations get',
|
|
@@ -355,7 +355,7 @@ const EMBEDDED_METHODS = [
|
|
|
355
355
|
},
|
|
356
356
|
go: {
|
|
357
357
|
method: 'client.Operations.List',
|
|
358
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
358
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/operations"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
359
359
|
},
|
|
360
360
|
cli: {
|
|
361
361
|
method: 'operations list',
|
|
@@ -384,7 +384,7 @@ const EMBEDDED_METHODS = [
|
|
|
384
384
|
},
|
|
385
385
|
go: {
|
|
386
386
|
method: 'client.Organizations.New',
|
|
387
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
387
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
388
388
|
},
|
|
389
389
|
cli: {
|
|
390
390
|
method: 'organizations create',
|
|
@@ -413,7 +413,7 @@ const EMBEDDED_METHODS = [
|
|
|
413
413
|
},
|
|
414
414
|
go: {
|
|
415
415
|
method: 'client.Organizations.Get',
|
|
416
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
416
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
417
417
|
},
|
|
418
418
|
cli: {
|
|
419
419
|
method: 'organizations get',
|
|
@@ -442,7 +442,7 @@ const EMBEDDED_METHODS = [
|
|
|
442
442
|
},
|
|
443
443
|
go: {
|
|
444
444
|
method: 'client.Organizations.Update',
|
|
445
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
445
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
446
446
|
},
|
|
447
447
|
cli: {
|
|
448
448
|
method: 'organizations update',
|
|
@@ -477,7 +477,7 @@ const EMBEDDED_METHODS = [
|
|
|
477
477
|
},
|
|
478
478
|
go: {
|
|
479
479
|
method: 'client.Organizations.List',
|
|
480
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
480
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
481
481
|
},
|
|
482
482
|
cli: {
|
|
483
483
|
method: 'organizations list',
|
|
@@ -505,7 +505,7 @@ const EMBEDDED_METHODS = [
|
|
|
505
505
|
},
|
|
506
506
|
go: {
|
|
507
507
|
method: 'client.Organizations.Leave',
|
|
508
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
508
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
509
509
|
},
|
|
510
510
|
cli: {
|
|
511
511
|
method: 'organizations leave',
|
|
@@ -534,7 +534,7 @@ const EMBEDDED_METHODS = [
|
|
|
534
534
|
},
|
|
535
535
|
go: {
|
|
536
536
|
method: 'client.Organizations.Memberships.Get',
|
|
537
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
537
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
538
538
|
},
|
|
539
539
|
cli: {
|
|
540
540
|
method: 'memberships get',
|
|
@@ -563,7 +563,7 @@ const EMBEDDED_METHODS = [
|
|
|
563
563
|
},
|
|
564
564
|
go: {
|
|
565
565
|
method: 'client.Organizations.Memberships.Me',
|
|
566
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
566
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationMembership, err := client.Organizations.Memberships.Me(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationMembership.ID)\n}\n',
|
|
567
567
|
},
|
|
568
568
|
},
|
|
569
569
|
},
|
|
@@ -595,7 +595,7 @@ const EMBEDDED_METHODS = [
|
|
|
595
595
|
},
|
|
596
596
|
go: {
|
|
597
597
|
method: 'client.Organizations.Memberships.List',
|
|
598
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
598
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
599
599
|
},
|
|
600
600
|
cli: {
|
|
601
601
|
method: 'memberships list',
|
|
@@ -628,7 +628,7 @@ const EMBEDDED_METHODS = [
|
|
|
628
628
|
},
|
|
629
629
|
go: {
|
|
630
630
|
method: 'client.Organizations.Memberships.Update',
|
|
631
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
631
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationMembership, err := client.Organizations.Memberships.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\t"membership_id",\n\t\torganizations.MembershipUpdateParams{\n\t\t\tRole: organizations.MembershipUpdateParamsRoleOwner,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationMembership.ID)\n}\n',
|
|
632
632
|
},
|
|
633
633
|
cli: {
|
|
634
634
|
method: 'memberships update',
|
|
@@ -656,7 +656,7 @@ const EMBEDDED_METHODS = [
|
|
|
656
656
|
},
|
|
657
657
|
go: {
|
|
658
658
|
method: 'client.Organizations.Memberships.Delete',
|
|
659
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
659
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Organizations.Memberships.Delete(\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}\n',
|
|
660
660
|
},
|
|
661
661
|
cli: {
|
|
662
662
|
method: 'memberships delete',
|
|
@@ -685,7 +685,7 @@ const EMBEDDED_METHODS = [
|
|
|
685
685
|
},
|
|
686
686
|
go: {
|
|
687
687
|
method: 'client.Organizations.Memberships.Invitations.New',
|
|
688
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
688
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationInvitation, err := client.Organizations.Memberships.Invitations.New(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.MembershipInvitationNewParams{\n\t\t\tEmail: "jane@example.com",\n\t\t\tRole: organizations.MembershipInvitationNewParamsRoleOwner,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationInvitation.ID)\n}\n',
|
|
689
689
|
},
|
|
690
690
|
cli: {
|
|
691
691
|
method: 'invitations create',
|
|
@@ -714,7 +714,7 @@ const EMBEDDED_METHODS = [
|
|
|
714
714
|
},
|
|
715
715
|
go: {
|
|
716
716
|
method: 'client.Organizations.Memberships.Invitations.List',
|
|
717
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
717
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationInvitationList, err := client.Organizations.Memberships.Invitations.List(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationInvitationList.Items)\n}\n',
|
|
718
718
|
},
|
|
719
719
|
cli: {
|
|
720
720
|
method: 'invitations list',
|
|
@@ -743,7 +743,7 @@ const EMBEDDED_METHODS = [
|
|
|
743
743
|
},
|
|
744
744
|
go: {
|
|
745
745
|
method: 'client.Organizations.Memberships.Invitations.Resend',
|
|
746
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
746
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationInvitation, err := client.Organizations.Memberships.Invitations.Resend(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\t"invitation_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationInvitation.ID)\n}\n',
|
|
747
747
|
},
|
|
748
748
|
cli: {
|
|
749
749
|
method: 'invitations resend',
|
|
@@ -771,7 +771,7 @@ const EMBEDDED_METHODS = [
|
|
|
771
771
|
},
|
|
772
772
|
go: {
|
|
773
773
|
method: 'client.Organizations.Memberships.Invitations.Delete',
|
|
774
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
774
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Organizations.Memberships.Invitations.Delete(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\t"invitation_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
775
775
|
},
|
|
776
776
|
cli: {
|
|
777
777
|
method: 'invitations delete',
|
|
@@ -810,7 +810,7 @@ const EMBEDDED_METHODS = [
|
|
|
810
810
|
},
|
|
811
811
|
go: {
|
|
812
812
|
method: 'client.Organizations.Address.New',
|
|
813
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
813
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
814
814
|
},
|
|
815
815
|
cli: {
|
|
816
816
|
method: 'address create',
|
|
@@ -839,7 +839,7 @@ const EMBEDDED_METHODS = [
|
|
|
839
839
|
},
|
|
840
840
|
go: {
|
|
841
841
|
method: 'client.Organizations.Address.Get',
|
|
842
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
842
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
843
843
|
},
|
|
844
844
|
cli: {
|
|
845
845
|
method: 'address get',
|
|
@@ -878,7 +878,7 @@ const EMBEDDED_METHODS = [
|
|
|
878
878
|
},
|
|
879
879
|
go: {
|
|
880
880
|
method: 'client.Organizations.Address.Update',
|
|
881
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
881
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
882
882
|
},
|
|
883
883
|
cli: {
|
|
884
884
|
method: 'address update',
|
|
@@ -907,7 +907,7 @@ const EMBEDDED_METHODS = [
|
|
|
907
907
|
},
|
|
908
908
|
go: {
|
|
909
909
|
method: 'client.Organizations.Billing.Summary',
|
|
910
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
910
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.Summary(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
911
911
|
},
|
|
912
912
|
cli: {
|
|
913
913
|
method: 'billing summary',
|
|
@@ -936,7 +936,7 @@ const EMBEDDED_METHODS = [
|
|
|
936
936
|
},
|
|
937
937
|
go: {
|
|
938
938
|
method: 'client.Organizations.Billing.Cost',
|
|
939
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
939
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationDailyCost, err := client.Organizations.Billing.Cost(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingCostParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationDailyCost.Currency)\n}\n',
|
|
940
940
|
},
|
|
941
941
|
cli: {
|
|
942
942
|
method: 'billing cost',
|
|
@@ -975,7 +975,7 @@ const EMBEDDED_METHODS = [
|
|
|
975
975
|
},
|
|
976
976
|
go: {
|
|
977
977
|
method: 'client.Organizations.Billing.History',
|
|
978
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
978
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbillingHistoryEntryList, err := client.Organizations.Billing.History(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingHistoryParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", billingHistoryEntryList.Items)\n}\n',
|
|
979
979
|
},
|
|
980
980
|
cli: {
|
|
981
981
|
method: 'billing history',
|
|
@@ -1004,7 +1004,7 @@ const EMBEDDED_METHODS = [
|
|
|
1004
1004
|
},
|
|
1005
1005
|
go: {
|
|
1006
1006
|
method: 'client.Organizations.Billing.TopUp',
|
|
1007
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1007
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.TopUp(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingTopUpParams{\n\t\t\tAmount: "50.00",\n\t\t\tIdempotencyKey: "Idempotency-Key",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
1008
1008
|
},
|
|
1009
1009
|
cli: {
|
|
1010
1010
|
method: 'billing top_up',
|
|
@@ -1033,7 +1033,7 @@ const EMBEDDED_METHODS = [
|
|
|
1033
1033
|
},
|
|
1034
1034
|
go: {
|
|
1035
1035
|
method: 'client.Organizations.Billing.Recharge',
|
|
1036
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1036
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.Recharge(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingRechargeParams{\n\t\t\tIdempotencyKey: "Idempotency-Key",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
1037
1037
|
},
|
|
1038
1038
|
cli: {
|
|
1039
1039
|
method: 'billing recharge',
|
|
@@ -1062,7 +1062,7 @@ const EMBEDDED_METHODS = [
|
|
|
1062
1062
|
},
|
|
1063
1063
|
go: {
|
|
1064
1064
|
method: 'client.Organizations.Billing.Statements',
|
|
1065
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1065
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationUsageStatement, err := client.Organizations.Billing.Statements(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingStatementsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationUsageStatement.Currency)\n}\n',
|
|
1066
1066
|
},
|
|
1067
1067
|
cli: {
|
|
1068
1068
|
method: 'billing statements',
|
|
@@ -1091,7 +1091,7 @@ const EMBEDDED_METHODS = [
|
|
|
1091
1091
|
},
|
|
1092
1092
|
go: {
|
|
1093
1093
|
method: 'client.Organizations.Billing.RechargePolicy.Get',
|
|
1094
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1094
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationRechargePolicy, err := client.Organizations.Billing.RechargePolicy.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationRechargePolicy.Policy)\n}\n',
|
|
1095
1095
|
},
|
|
1096
1096
|
cli: {
|
|
1097
1097
|
method: 'recharge_policy get',
|
|
@@ -1124,7 +1124,7 @@ const EMBEDDED_METHODS = [
|
|
|
1124
1124
|
},
|
|
1125
1125
|
go: {
|
|
1126
1126
|
method: 'client.Organizations.Billing.RechargePolicy.Update',
|
|
1127
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1127
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationRechargePolicy, err := client.Organizations.Billing.RechargePolicy.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingRechargePolicyUpdateParams{\n\t\t\tPolicy: organizations.RechargePolicyModeAutomatic,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationRechargePolicy.Policy)\n}\n',
|
|
1128
1128
|
},
|
|
1129
1129
|
cli: {
|
|
1130
1130
|
method: 'recharge_policy update',
|
|
@@ -1141,8 +1141,8 @@ const EMBEDDED_METHODS = [
|
|
|
1141
1141
|
stainlessPath: '(resource) quotas > (method) get',
|
|
1142
1142
|
qualified: 'client.quotas.get',
|
|
1143
1143
|
params: ["region: 'us-sva-2' | 'us-wdc-1';"],
|
|
1144
|
-
response: "{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; }; }",
|
|
1145
|
-
markdown: "## get\n\n`client.quotas.get(region: 'us-sva-2' | 'us-wdc-1'): { compute: quota_compute; networking: quota_networking; nks: quota_nks; region: region_name; storage: quota_storage; }`\n\n**get** `/v1/quotas/{region}`\n\nGet quota usage and limits for the current organization in a single region\n\n### Parameters\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n\n### Returns\n\n- `{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; }; }`\n Quota response.\n\n - `compute: { memory_gb: { limit: number; remaining: number; used: number; }; vcpu: { limit: number; remaining: number; used: number; }; }`\n - `networking: { public_ips: { limit: number; remaining: number; used: number; }; vpcs: { limit: number; remaining: number; used: number; }; }`\n - `nks: { clusters: { limit: number; remaining: number; used: number; }; node_pool_memory_gb: { limit: number; remaining: number; used: number; }; node_pool_vcpu: { limit: number; remaining: number; used: number; }; public_ips: { limit: number; remaining: number; used: number; }; }`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `storage: { abs: { limit: number; remaining: number; used: number; }; local_nvme: { limit: number; remaining: number; used: number; }; longhorn: { limit: number; remaining: number; used: number; }; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst quota = await client.quotas.get('us-sva-2');\n\nconsole.log(quota);\n```",
|
|
1144
|
+
response: "{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; object_storage: quota_dimension_detail; }; }",
|
|
1145
|
+
markdown: "## get\n\n`client.quotas.get(region: 'us-sva-2' | 'us-wdc-1'): { compute: quota_compute; networking: quota_networking; nks: quota_nks; region: region_name; storage: quota_storage; }`\n\n**get** `/v1/quotas/{region}`\n\nGet quota usage and limits for the current organization in a single region\n\n### Parameters\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n\n### Returns\n\n- `{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; object_storage: quota_dimension_detail; }; }`\n Quota response.\n\n - `compute: { memory_gb: { limit: number; remaining: number; used: number; }; vcpu: { limit: number; remaining: number; used: number; }; }`\n - `networking: { public_ips: { limit: number; remaining: number; used: number; }; vpcs: { limit: number; remaining: number; used: number; }; }`\n - `nks: { clusters: { limit: number; remaining: number; used: number; }; node_pool_memory_gb: { limit: number; remaining: number; used: number; }; node_pool_vcpu: { limit: number; remaining: number; used: number; }; public_ips: { limit: number; remaining: number; used: number; }; }`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `storage: { abs: { limit: number; remaining: number; used: number; }; local_nvme: { limit: number; remaining: number; used: number; }; longhorn: { limit: number; remaining: number; used: number; }; object_storage: { limit: number; remaining: number; used: number; }; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst quota = await client.quotas.get('us-sva-2');\n\nconsole.log(quota);\n```",
|
|
1146
1146
|
perLanguage: {
|
|
1147
1147
|
typescript: {
|
|
1148
1148
|
method: 'client.quotas.get',
|
|
@@ -1153,7 +1153,7 @@ const EMBEDDED_METHODS = [
|
|
|
1153
1153
|
},
|
|
1154
1154
|
go: {
|
|
1155
1155
|
method: 'client.Quotas.Get',
|
|
1156
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1156
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1157
1157
|
},
|
|
1158
1158
|
cli: {
|
|
1159
1159
|
method: 'quotas get',
|
|
@@ -1170,8 +1170,8 @@ const EMBEDDED_METHODS = [
|
|
|
1170
1170
|
stainlessPath: '(resource) quotas > (method) list',
|
|
1171
1171
|
qualified: 'client.quotas.list',
|
|
1172
1172
|
params: ['cursor?: string;', 'limit?: number;', 'region?: string;', 'sort?: string;'],
|
|
1173
|
-
response: "{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; }; }",
|
|
1174
|
-
markdown: "## list\n\n`client.quotas.list(cursor?: string, limit?: number, region?: string, sort?: string): { compute: quota_compute; networking: quota_networking; nks: quota_nks; region: region_name; storage: quota_storage; }`\n\n**get** `/v1/quotas`\n\nList quota usage and limits for the current organization across all regions\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: region\n\n### Returns\n\n- `{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; }; }`\n Quota response.\n\n - `compute: { memory_gb: { limit: number; remaining: number; used: number; }; vcpu: { limit: number; remaining: number; used: number; }; }`\n - `networking: { public_ips: { limit: number; remaining: number; used: number; }; vpcs: { limit: number; remaining: number; used: number; }; }`\n - `nks: { clusters: { limit: number; remaining: number; used: number; }; node_pool_memory_gb: { limit: number; remaining: number; used: number; }; node_pool_vcpu: { limit: number; remaining: number; used: number; }; public_ips: { limit: number; remaining: number; used: number; }; }`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `storage: { abs: { limit: number; remaining: number; used: number; }; local_nvme: { limit: number; remaining: number; used: number; }; longhorn: { limit: number; remaining: number; used: number; }; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const quota of client.quotas.list()) {\n console.log(quota);\n}\n```",
|
|
1173
|
+
response: "{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; object_storage: quota_dimension_detail; }; }",
|
|
1174
|
+
markdown: "## list\n\n`client.quotas.list(cursor?: string, limit?: number, region?: string, sort?: string): { compute: quota_compute; networking: quota_networking; nks: quota_nks; region: region_name; storage: quota_storage; }`\n\n**get** `/v1/quotas`\n\nList quota usage and limits for the current organization across all regions\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: region\n\n### Returns\n\n- `{ compute: { memory_gb: quota_dimension_detail; vcpu: quota_dimension_detail; }; networking: { public_ips: quota_dimension_detail; vpcs: quota_dimension_detail; }; nks: { clusters: quota_dimension_detail; node_pool_memory_gb: quota_dimension_detail; node_pool_vcpu: quota_dimension_detail; public_ips: quota_dimension_detail; }; region: 'us-sva-2' | 'us-wdc-1'; storage: { abs: quota_dimension_detail; local_nvme: quota_dimension_detail; longhorn: quota_dimension_detail; object_storage: quota_dimension_detail; }; }`\n Quota response.\n\n - `compute: { memory_gb: { limit: number; remaining: number; used: number; }; vcpu: { limit: number; remaining: number; used: number; }; }`\n - `networking: { public_ips: { limit: number; remaining: number; used: number; }; vpcs: { limit: number; remaining: number; used: number; }; }`\n - `nks: { clusters: { limit: number; remaining: number; used: number; }; node_pool_memory_gb: { limit: number; remaining: number; used: number; }; node_pool_vcpu: { limit: number; remaining: number; used: number; }; public_ips: { limit: number; remaining: number; used: number; }; }`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `storage: { abs: { limit: number; remaining: number; used: number; }; local_nvme: { limit: number; remaining: number; used: number; }; longhorn: { limit: number; remaining: number; used: number; }; object_storage: { limit: number; remaining: number; used: number; }; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const quota of client.quotas.list()) {\n console.log(quota);\n}\n```",
|
|
1175
1175
|
perLanguage: {
|
|
1176
1176
|
typescript: {
|
|
1177
1177
|
method: 'client.quotas.list',
|
|
@@ -1182,7 +1182,7 @@ const EMBEDDED_METHODS = [
|
|
|
1182
1182
|
},
|
|
1183
1183
|
go: {
|
|
1184
1184
|
method: 'client.Quotas.List',
|
|
1185
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1185
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/quotas"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Quotas.List(context.TODO(), quotas.QuotaListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1186
1186
|
},
|
|
1187
1187
|
cli: {
|
|
1188
1188
|
method: 'quotas list',
|
|
@@ -1199,8 +1199,8 @@ const EMBEDDED_METHODS = [
|
|
|
1199
1199
|
stainlessPath: '(resource) usage > (method) get',
|
|
1200
1200
|
qualified: 'client.usage.get',
|
|
1201
1201
|
params: ['resource_id: string;'],
|
|
1202
|
-
response: "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type:
|
|
1203
|
-
markdown: "## get\n\n`client.usage.get(resource_id: string): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage/{resource_id}`\n\nGet the usage record for a single resource (metadata plus dimension history) for the current organization.\n\n### Parameters\n\n- `resource_id: string`\n\n### Returns\n\n- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type:
|
|
1202
|
+
response: "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type: string; started_at: string; }",
|
|
1203
|
+
markdown: "## get\n\n`client.usage.get(resource_id: string): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage/{resource_id}`\n\nGet the usage record for a single resource (metadata plus dimension history) for the current organization.\n\n### Parameters\n\n- `resource_id: string`\n\n### Returns\n\n- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type: string; started_at: string; }`\n Usage record for a single metered resource.\n\n - `dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; }[]; }[]`\n - `ended_at: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `resource_id: string`\n - `resource_type: string`\n - `started_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst usage = await client.usage.get('123e4567-e89b-12d3-a456-426614174000');\n\nconsole.log(usage);\n```",
|
|
1204
1204
|
perLanguage: {
|
|
1205
1205
|
typescript: {
|
|
1206
1206
|
method: 'client.usage.get',
|
|
@@ -1211,7 +1211,7 @@ const EMBEDDED_METHODS = [
|
|
|
1211
1211
|
},
|
|
1212
1212
|
go: {
|
|
1213
1213
|
method: 'client.Usage.Get',
|
|
1214
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1214
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1215
1215
|
},
|
|
1216
1216
|
cli: {
|
|
1217
1217
|
method: 'usage get',
|
|
@@ -1235,11 +1235,11 @@ const EMBEDDED_METHODS = [
|
|
|
1235
1235
|
'limit?: number;',
|
|
1236
1236
|
'region?: string;',
|
|
1237
1237
|
'resource_id?: string;',
|
|
1238
|
-
|
|
1238
|
+
'resource_type?: string;',
|
|
1239
1239
|
'sort?: string;',
|
|
1240
1240
|
],
|
|
1241
|
-
response: "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type:
|
|
1242
|
-
markdown: "## list\n\n`client.usage.list(active_at_max?: string, active_at_min?: string, cursor?: string, dimension?: string, limit?: number, region?: string, resource_id?: string, resource_type?:
|
|
1241
|
+
response: "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type: string; started_at: string; }",
|
|
1242
|
+
markdown: "## list\n\n`client.usage.list(active_at_max?: string, active_at_min?: string, cursor?: string, dimension?: string, limit?: number, region?: string, resource_id?: string, resource_type?: string, sort?: string): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage`\n\nList per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).\n\n### Parameters\n\n- `active_at_max?: string`\n Only resources metered at or before this RFC 3339 instant\n\n- `active_at_min?: string`\n Only resources metered at or after this RFC 3339 instant; a window a usage row must overlap\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `dimension?: string`\n Only resources with usage in this dimension\n\n- `limit?: number`\n Maximum number of items to return\n\n- `region?: string`\n Filter by region\n\n- `resource_id?: string`\n Filter by a single resource\n\n- `resource_type?: string`\n Filter by the kind of resource metered\n\n- `sort?: string`\n Sort term as field:asc or field:desc. Field: created_at, the resource's earliest usage row matching the filters\n\n### Returns\n\n- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; resource_id: string; resource_type: string; started_at: string; }`\n Usage record for a single metered resource.\n\n - `dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; }[]; }[]`\n - `ended_at: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `resource_id: string`\n - `resource_type: string`\n - `started_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const usage of client.usage.list()) {\n console.log(usage);\n}\n```",
|
|
1243
1243
|
perLanguage: {
|
|
1244
1244
|
typescript: {
|
|
1245
1245
|
method: 'client.usage.list',
|
|
@@ -1250,7 +1250,7 @@ const EMBEDDED_METHODS = [
|
|
|
1250
1250
|
},
|
|
1251
1251
|
go: {
|
|
1252
1252
|
method: 'client.Usage.List',
|
|
1253
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1253
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1254
1254
|
},
|
|
1255
1255
|
cli: {
|
|
1256
1256
|
method: 'usage list',
|
|
@@ -1279,7 +1279,7 @@ const EMBEDDED_METHODS = [
|
|
|
1279
1279
|
},
|
|
1280
1280
|
go: {
|
|
1281
1281
|
method: 'client.AuditLogs.Get',
|
|
1282
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1282
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1283
1283
|
},
|
|
1284
1284
|
cli: {
|
|
1285
1285
|
method: 'audit_logs get',
|
|
@@ -1324,7 +1324,7 @@ const EMBEDDED_METHODS = [
|
|
|
1324
1324
|
},
|
|
1325
1325
|
go: {
|
|
1326
1326
|
method: 'client.AuditLogs.List',
|
|
1327
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1327
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/audit_logs"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1328
1328
|
},
|
|
1329
1329
|
cli: {
|
|
1330
1330
|
method: 'audit_logs list',
|
|
@@ -1341,8 +1341,8 @@ const EMBEDDED_METHODS = [
|
|
|
1341
1341
|
stainlessPath: '(resource) projects > (method) create',
|
|
1342
1342
|
qualified: 'client.projects.create',
|
|
1343
1343
|
params: ['name: string;', 'tags?: string[];'],
|
|
1344
|
-
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1345
|
-
markdown: "## create\n\n`client.projects.create(name: string, tags?: string[]): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**post** `/v1/projects`\n\nCreate a new project\n\n### Parameters\n\n- `name: string`\n Project name.\n\n- `tags?: string[]`\n Tags to attach to the Project.\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1344
|
+
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }",
|
|
1345
|
+
markdown: "## create\n\n`client.projects.create(name: string, tags?: string[]): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**post** `/v1/projects`\n\nCreate a new project\n\n### Parameters\n\n- `name: string`\n Project name.\n\n- `tags?: string[]`\n Tags to attach to the Project.\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }`\n Project response.\n\n - `id: string`\n - `created_at: string`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `resources: { blockchain: { rpc_nodes_dedicated: number; rpc_nodes_flex: number; }; cloud: { nks_clusters: number; nks_node_pools: number; vms: number; volumes: number; vpcs: number; }; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst project = await client.projects.create({ name: 'My Project' });\n\nconsole.log(project);\n```",
|
|
1346
1346
|
perLanguage: {
|
|
1347
1347
|
typescript: {
|
|
1348
1348
|
method: 'client.projects.create',
|
|
@@ -1353,7 +1353,7 @@ const EMBEDDED_METHODS = [
|
|
|
1353
1353
|
},
|
|
1354
1354
|
go: {
|
|
1355
1355
|
method: 'client.Projects.New',
|
|
1356
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1356
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1357
1357
|
},
|
|
1358
1358
|
cli: {
|
|
1359
1359
|
method: 'projects create',
|
|
@@ -1370,8 +1370,8 @@ const EMBEDDED_METHODS = [
|
|
|
1370
1370
|
stainlessPath: '(resource) projects > (method) get',
|
|
1371
1371
|
qualified: 'client.projects.get',
|
|
1372
1372
|
params: ['project_id: string;'],
|
|
1373
|
-
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1374
|
-
markdown: "## get\n\n`client.projects.get(project_id: string): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**get** `/v1/projects/{project_id}`\n\nGet details about a project\n\n### Parameters\n\n- `project_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1373
|
+
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }",
|
|
1374
|
+
markdown: "## get\n\n`client.projects.get(project_id: string): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**get** `/v1/projects/{project_id}`\n\nGet details about a project\n\n### Parameters\n\n- `project_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }`\n Project response.\n\n - `id: string`\n - `created_at: string`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `resources: { blockchain: { rpc_nodes_dedicated: number; rpc_nodes_flex: number; }; cloud: { nks_clusters: number; nks_node_pools: number; vms: number; volumes: number; vpcs: number; }; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst project = await client.projects.get('project_id');\n\nconsole.log(project);\n```",
|
|
1375
1375
|
perLanguage: {
|
|
1376
1376
|
typescript: {
|
|
1377
1377
|
method: 'client.projects.get',
|
|
@@ -1382,7 +1382,7 @@ const EMBEDDED_METHODS = [
|
|
|
1382
1382
|
},
|
|
1383
1383
|
go: {
|
|
1384
1384
|
method: 'client.Projects.Get',
|
|
1385
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1385
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1386
1386
|
},
|
|
1387
1387
|
cli: {
|
|
1388
1388
|
method: 'projects get',
|
|
@@ -1399,8 +1399,8 @@ const EMBEDDED_METHODS = [
|
|
|
1399
1399
|
stainlessPath: '(resource) projects > (method) update',
|
|
1400
1400
|
qualified: 'client.projects.update',
|
|
1401
1401
|
params: ['project_id: string;', 'name?: string;', 'tags?: string[];'],
|
|
1402
|
-
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1403
|
-
markdown: "## update\n\n`client.projects.update(project_id: string, name?: string, tags?: string[]): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**patch** `/v1/projects/{project_id}`\n\nUpdate an existing project\n\n### Parameters\n\n- `project_id: string`\n\n- `name?: string`\n Project name.\n\n- `tags?: string[]`\n Tags to attach to the Project.\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1402
|
+
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }",
|
|
1403
|
+
markdown: "## update\n\n`client.projects.update(project_id: string, name?: string, tags?: string[]): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**patch** `/v1/projects/{project_id}`\n\nUpdate an existing project\n\n### Parameters\n\n- `project_id: string`\n\n- `name?: string`\n Project name.\n\n- `tags?: string[]`\n Tags to attach to the Project.\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }`\n Project response.\n\n - `id: string`\n - `created_at: string`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `resources: { blockchain: { rpc_nodes_dedicated: number; rpc_nodes_flex: number; }; cloud: { nks_clusters: number; nks_node_pools: number; vms: number; volumes: number; vpcs: number; }; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst project = await client.projects.update('project_id');\n\nconsole.log(project);\n```",
|
|
1404
1404
|
perLanguage: {
|
|
1405
1405
|
typescript: {
|
|
1406
1406
|
method: 'client.projects.update',
|
|
@@ -1411,7 +1411,7 @@ const EMBEDDED_METHODS = [
|
|
|
1411
1411
|
},
|
|
1412
1412
|
go: {
|
|
1413
1413
|
method: 'client.Projects.Update',
|
|
1414
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1414
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1415
1415
|
},
|
|
1416
1416
|
cli: {
|
|
1417
1417
|
method: 'projects update',
|
|
@@ -1439,7 +1439,7 @@ const EMBEDDED_METHODS = [
|
|
|
1439
1439
|
},
|
|
1440
1440
|
go: {
|
|
1441
1441
|
method: 'client.Projects.Delete',
|
|
1442
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1442
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1443
1443
|
},
|
|
1444
1444
|
cli: {
|
|
1445
1445
|
method: 'projects delete',
|
|
@@ -1456,8 +1456,8 @@ const EMBEDDED_METHODS = [
|
|
|
1456
1456
|
stainlessPath: '(resource) projects > (method) list',
|
|
1457
1457
|
qualified: 'client.projects.list',
|
|
1458
1458
|
params: ['cursor?: string;', 'limit?: number;', 'name?: string;', 'sort?: string;', 'tags?: string[];'],
|
|
1459
|
-
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1460
|
-
markdown: "## list\n\n`client.projects.list(cursor?: string, limit?: number, name?: string, sort?: string, tags?: string[]): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**get** `/v1/projects`\n\nList all projects\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Project name\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Project must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
1459
|
+
response: "{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }",
|
|
1460
|
+
markdown: "## list\n\n`client.projects.list(cursor?: string, limit?: number, name?: string, sort?: string, tags?: string[]): { id: string; created_at: string; managed_by: object; name: string; resources: project_resources; tags: string[]; updated_at: string; }`\n\n**get** `/v1/projects`\n\nList all projects\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Project name\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Project must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; resources: { blockchain: project_blockchain_resources; cloud: project_cloud_resources; }; tags: string[]; updated_at: string; }`\n Project response.\n\n - `id: string`\n - `created_at: string`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `resources: { blockchain: { rpc_nodes_dedicated: number; rpc_nodes_flex: number; }; cloud: { nks_clusters: number; nks_node_pools: number; vms: number; volumes: number; vpcs: number; }; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const project of client.projects.list()) {\n console.log(project);\n}\n```",
|
|
1461
1461
|
perLanguage: {
|
|
1462
1462
|
typescript: {
|
|
1463
1463
|
method: 'client.projects.list',
|
|
@@ -1468,7 +1468,7 @@ const EMBEDDED_METHODS = [
|
|
|
1468
1468
|
},
|
|
1469
1469
|
go: {
|
|
1470
1470
|
method: 'client.Projects.List',
|
|
1471
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1471
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1472
1472
|
},
|
|
1473
1473
|
cli: {
|
|
1474
1474
|
method: 'projects list',
|
|
@@ -1497,7 +1497,7 @@ const EMBEDDED_METHODS = [
|
|
|
1497
1497
|
},
|
|
1498
1498
|
go: {
|
|
1499
1499
|
method: 'client.Regions.Get',
|
|
1500
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1500
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1501
1501
|
},
|
|
1502
1502
|
cli: {
|
|
1503
1503
|
method: 'regions get',
|
|
@@ -1538,7 +1538,7 @@ const EMBEDDED_METHODS = [
|
|
|
1538
1538
|
},
|
|
1539
1539
|
go: {
|
|
1540
1540
|
method: 'client.Regions.List',
|
|
1541
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1541
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1542
1542
|
},
|
|
1543
1543
|
cli: {
|
|
1544
1544
|
method: 'regions list',
|
|
@@ -1567,7 +1567,7 @@ const EMBEDDED_METHODS = [
|
|
|
1567
1567
|
},
|
|
1568
1568
|
go: {
|
|
1569
1569
|
method: 'client.InstanceTypes.Get',
|
|
1570
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1570
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/instance_types"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1571
1571
|
},
|
|
1572
1572
|
cli: {
|
|
1573
1573
|
method: 'instance_types get',
|
|
@@ -1611,7 +1611,7 @@ const EMBEDDED_METHODS = [
|
|
|
1611
1611
|
},
|
|
1612
1612
|
go: {
|
|
1613
1613
|
method: 'client.InstanceTypes.List',
|
|
1614
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1614
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/instance_types"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1615
1615
|
},
|
|
1616
1616
|
cli: {
|
|
1617
1617
|
method: 'instance_types list',
|
|
@@ -1652,7 +1652,7 @@ const EMBEDDED_METHODS = [
|
|
|
1652
1652
|
},
|
|
1653
1653
|
go: {
|
|
1654
1654
|
method: 'client.Compute.VMs.New',
|
|
1655
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1655
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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-2026-05-18",\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',
|
|
1656
1656
|
},
|
|
1657
1657
|
cli: {
|
|
1658
1658
|
method: 'vms create',
|
|
@@ -1681,7 +1681,7 @@ const EMBEDDED_METHODS = [
|
|
|
1681
1681
|
},
|
|
1682
1682
|
go: {
|
|
1683
1683
|
method: 'client.Compute.VMs.Get',
|
|
1684
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1684
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1685
1685
|
},
|
|
1686
1686
|
cli: {
|
|
1687
1687
|
method: 'vms get',
|
|
@@ -1716,7 +1716,7 @@ const EMBEDDED_METHODS = [
|
|
|
1716
1716
|
},
|
|
1717
1717
|
go: {
|
|
1718
1718
|
method: 'client.Compute.VMs.Update',
|
|
1719
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1719
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1720
1720
|
},
|
|
1721
1721
|
cli: {
|
|
1722
1722
|
method: 'vms update',
|
|
@@ -1745,7 +1745,7 @@ const EMBEDDED_METHODS = [
|
|
|
1745
1745
|
},
|
|
1746
1746
|
go: {
|
|
1747
1747
|
method: 'client.Compute.VMs.Delete',
|
|
1748
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1748
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1749
1749
|
},
|
|
1750
1750
|
cli: {
|
|
1751
1751
|
method: 'vms delete',
|
|
@@ -1786,7 +1786,7 @@ const EMBEDDED_METHODS = [
|
|
|
1786
1786
|
},
|
|
1787
1787
|
go: {
|
|
1788
1788
|
method: 'client.Compute.VMs.List',
|
|
1789
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1789
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1790
1790
|
},
|
|
1791
1791
|
cli: {
|
|
1792
1792
|
method: 'vms list',
|
|
@@ -1815,7 +1815,7 @@ const EMBEDDED_METHODS = [
|
|
|
1815
1815
|
},
|
|
1816
1816
|
go: {
|
|
1817
1817
|
method: 'client.Compute.VMs.Restart',
|
|
1818
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1818
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1819
1819
|
},
|
|
1820
1820
|
cli: {
|
|
1821
1821
|
method: 'vms restart',
|
|
@@ -1855,7 +1855,7 @@ const EMBEDDED_METHODS = [
|
|
|
1855
1855
|
},
|
|
1856
1856
|
go: {
|
|
1857
1857
|
method: 'client.Compute.VMs.Availability.New',
|
|
1858
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1858
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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-2026-05-18",\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',
|
|
1859
1859
|
},
|
|
1860
1860
|
cli: {
|
|
1861
1861
|
method: 'availability create',
|
|
@@ -1889,7 +1889,7 @@ const EMBEDDED_METHODS = [
|
|
|
1889
1889
|
},
|
|
1890
1890
|
go: {
|
|
1891
1891
|
method: 'client.Compute.VMs.Availability.Update',
|
|
1892
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1892
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
1893
1893
|
},
|
|
1894
1894
|
cli: {
|
|
1895
1895
|
method: 'availability update',
|
|
@@ -1930,7 +1930,7 @@ const EMBEDDED_METHODS = [
|
|
|
1930
1930
|
},
|
|
1931
1931
|
go: {
|
|
1932
1932
|
method: 'client.Compute.VMs.Cost.New',
|
|
1933
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1933
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuote, err := client.Compute.VMs.Cost.New(context.TODO(), compute.VMCostNewParams{\n\t\tBootVolume: compute.VMCostNewParamsBootVolume{\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-2026-05-18",\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", costQuote.Currency)\n}\n',
|
|
1934
1934
|
},
|
|
1935
1935
|
cli: {
|
|
1936
1936
|
method: 'cost create',
|
|
@@ -1965,7 +1965,7 @@ const EMBEDDED_METHODS = [
|
|
|
1965
1965
|
},
|
|
1966
1966
|
go: {
|
|
1967
1967
|
method: 'client.Compute.VMs.Cost.Update',
|
|
1968
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
1968
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuoteUpdate, err := client.Compute.VMs.Cost.Update(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMCostUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuoteUpdate.After)\n}\n',
|
|
1969
1969
|
},
|
|
1970
1970
|
cli: {
|
|
1971
1971
|
method: 'cost update',
|
|
@@ -2004,7 +2004,7 @@ const EMBEDDED_METHODS = [
|
|
|
2004
2004
|
},
|
|
2005
2005
|
go: {
|
|
2006
2006
|
method: 'client.Compute.VMs.Volumes.List',
|
|
2007
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2007
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2008
2008
|
},
|
|
2009
2009
|
cli: {
|
|
2010
2010
|
method: 'volumes list',
|
|
@@ -2039,7 +2039,7 @@ const EMBEDDED_METHODS = [
|
|
|
2039
2039
|
},
|
|
2040
2040
|
go: {
|
|
2041
2041
|
method: 'client.Compute.VMs.OSImages.List',
|
|
2042
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2042
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2043
2043
|
},
|
|
2044
2044
|
cli: {
|
|
2045
2045
|
method: 'os_images list',
|
|
@@ -2075,7 +2075,7 @@ const EMBEDDED_METHODS = [
|
|
|
2075
2075
|
},
|
|
2076
2076
|
go: {
|
|
2077
2077
|
method: 'client.Compute.VMs.Metrics.List',
|
|
2078
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2078
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvmMetrics, err := client.Compute.VMs.Metrics.List(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMMetricListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vmMetrics.VMID)\n}\n',
|
|
2079
2079
|
},
|
|
2080
2080
|
cli: {
|
|
2081
2081
|
method: 'metrics list',
|
|
@@ -2103,7 +2103,7 @@ const EMBEDDED_METHODS = [
|
|
|
2103
2103
|
},
|
|
2104
2104
|
go: {
|
|
2105
2105
|
method: 'client.Compute.VMs.MetricDescriptors.List',
|
|
2106
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2106
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvmMetricDescriptorList, err := client.Compute.VMs.MetricDescriptors.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vmMetricDescriptorList.Items)\n}\n',
|
|
2107
2107
|
},
|
|
2108
2108
|
cli: {
|
|
2109
2109
|
method: 'metric_descriptors list',
|
|
@@ -2140,7 +2140,7 @@ const EMBEDDED_METHODS = [
|
|
|
2140
2140
|
},
|
|
2141
2141
|
go: {
|
|
2142
2142
|
method: 'client.Compute.Volumes.New',
|
|
2143
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2143
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2144
2144
|
},
|
|
2145
2145
|
cli: {
|
|
2146
2146
|
method: 'volumes create',
|
|
@@ -2169,7 +2169,7 @@ const EMBEDDED_METHODS = [
|
|
|
2169
2169
|
},
|
|
2170
2170
|
go: {
|
|
2171
2171
|
method: 'client.Compute.Volumes.Get',
|
|
2172
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2172
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2173
2173
|
},
|
|
2174
2174
|
cli: {
|
|
2175
2175
|
method: 'volumes get',
|
|
@@ -2198,7 +2198,7 @@ const EMBEDDED_METHODS = [
|
|
|
2198
2198
|
},
|
|
2199
2199
|
go: {
|
|
2200
2200
|
method: 'client.Compute.Volumes.Update',
|
|
2201
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2201
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2202
2202
|
},
|
|
2203
2203
|
cli: {
|
|
2204
2204
|
method: 'volumes update',
|
|
@@ -2227,7 +2227,7 @@ const EMBEDDED_METHODS = [
|
|
|
2227
2227
|
},
|
|
2228
2228
|
go: {
|
|
2229
2229
|
method: 'client.Compute.Volumes.Delete',
|
|
2230
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2230
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2231
2231
|
},
|
|
2232
2232
|
cli: {
|
|
2233
2233
|
method: 'volumes delete',
|
|
@@ -2269,7 +2269,7 @@ const EMBEDDED_METHODS = [
|
|
|
2269
2269
|
},
|
|
2270
2270
|
go: {
|
|
2271
2271
|
method: 'client.Compute.Volumes.List',
|
|
2272
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2272
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2273
2273
|
},
|
|
2274
2274
|
cli: {
|
|
2275
2275
|
method: 'volumes list',
|
|
@@ -2298,7 +2298,7 @@ const EMBEDDED_METHODS = [
|
|
|
2298
2298
|
},
|
|
2299
2299
|
go: {
|
|
2300
2300
|
method: 'client.Compute.Volumes.Attach',
|
|
2301
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2301
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2302
2302
|
},
|
|
2303
2303
|
cli: {
|
|
2304
2304
|
method: 'volumes attach',
|
|
@@ -2327,7 +2327,7 @@ const EMBEDDED_METHODS = [
|
|
|
2327
2327
|
},
|
|
2328
2328
|
go: {
|
|
2329
2329
|
method: 'client.Compute.Volumes.Detach',
|
|
2330
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2330
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2331
2331
|
},
|
|
2332
2332
|
cli: {
|
|
2333
2333
|
method: 'volumes detach',
|
|
@@ -2363,7 +2363,7 @@ const EMBEDDED_METHODS = [
|
|
|
2363
2363
|
},
|
|
2364
2364
|
go: {
|
|
2365
2365
|
method: 'client.Compute.Volumes.Availability.New',
|
|
2366
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2366
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2367
2367
|
},
|
|
2368
2368
|
cli: {
|
|
2369
2369
|
method: 'availability create',
|
|
@@ -2391,7 +2391,7 @@ const EMBEDDED_METHODS = [
|
|
|
2391
2391
|
},
|
|
2392
2392
|
go: {
|
|
2393
2393
|
method: 'client.Compute.Volumes.Availability.Update',
|
|
2394
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2394
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2395
2395
|
},
|
|
2396
2396
|
cli: {
|
|
2397
2397
|
method: 'availability update',
|
|
@@ -2428,7 +2428,7 @@ const EMBEDDED_METHODS = [
|
|
|
2428
2428
|
},
|
|
2429
2429
|
go: {
|
|
2430
2430
|
method: 'client.Compute.Volumes.Cost.New',
|
|
2431
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2431
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuote, err := client.Compute.Volumes.Cost.New(context.TODO(), compute.VolumeCostNewParams{\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", costQuote.Currency)\n}\n',
|
|
2432
2432
|
},
|
|
2433
2433
|
cli: {
|
|
2434
2434
|
method: 'cost create',
|
|
@@ -2457,7 +2457,7 @@ const EMBEDDED_METHODS = [
|
|
|
2457
2457
|
},
|
|
2458
2458
|
go: {
|
|
2459
2459
|
method: 'client.Compute.Volumes.Cost.Update',
|
|
2460
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2460
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuoteUpdate, err := client.Compute.Volumes.Cost.Update(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeCostUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuoteUpdate.After)\n}\n',
|
|
2461
2461
|
},
|
|
2462
2462
|
cli: {
|
|
2463
2463
|
method: 'cost update',
|
|
@@ -2492,7 +2492,7 @@ const EMBEDDED_METHODS = [
|
|
|
2492
2492
|
},
|
|
2493
2493
|
go: {
|
|
2494
2494
|
method: 'client.Networking.VPCs.New',
|
|
2495
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2495
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2496
2496
|
},
|
|
2497
2497
|
cli: {
|
|
2498
2498
|
method: 'vpcs create',
|
|
@@ -2509,8 +2509,8 @@ const EMBEDDED_METHODS = [
|
|
|
2509
2509
|
stainlessPath: '(resource) networking.vpcs > (method) get',
|
|
2510
2510
|
qualified: 'client.networking.vpcs.get',
|
|
2511
2511
|
params: ['vpc_id: string;'],
|
|
2512
|
-
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2513
|
-
markdown: "## get\n\n`client.networking.vpcs.get(vpc_id: string): { id: string; created_at: string; firewall_rule_ids: string[]; managed_by: object; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}`\n\nGet details about a VPC\n\n### Parameters\n\n- `vpc_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2512
|
+
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }",
|
|
2513
|
+
markdown: "## get\n\n`client.networking.vpcs.get(vpc_id: string): { id: string; created_at: string; firewall_rule_ids: string[]; managed_by: object; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}`\n\nGet details about a VPC\n\n### Parameters\n\n- `vpc_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }`\n VPC details.\n\n - `id: string`\n - `created_at: string`\n - `firewall_rule_ids: string[]`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst vpc = await client.networking.vpcs.get('vpc_id');\n\nconsole.log(vpc);\n```",
|
|
2514
2514
|
perLanguage: {
|
|
2515
2515
|
typescript: {
|
|
2516
2516
|
method: 'client.networking.vpcs.get',
|
|
@@ -2521,7 +2521,7 @@ const EMBEDDED_METHODS = [
|
|
|
2521
2521
|
},
|
|
2522
2522
|
go: {
|
|
2523
2523
|
method: 'client.Networking.VPCs.Get',
|
|
2524
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2524
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2525
2525
|
},
|
|
2526
2526
|
cli: {
|
|
2527
2527
|
method: 'vpcs get',
|
|
@@ -2550,7 +2550,7 @@ const EMBEDDED_METHODS = [
|
|
|
2550
2550
|
},
|
|
2551
2551
|
go: {
|
|
2552
2552
|
method: 'client.Networking.VPCs.Update',
|
|
2553
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2553
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2554
2554
|
},
|
|
2555
2555
|
cli: {
|
|
2556
2556
|
method: 'vpcs update',
|
|
@@ -2579,7 +2579,7 @@ const EMBEDDED_METHODS = [
|
|
|
2579
2579
|
},
|
|
2580
2580
|
go: {
|
|
2581
2581
|
method: 'client.Networking.VPCs.Delete',
|
|
2582
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2582
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2583
2583
|
},
|
|
2584
2584
|
cli: {
|
|
2585
2585
|
method: 'vpcs delete',
|
|
@@ -2605,8 +2605,8 @@ const EMBEDDED_METHODS = [
|
|
|
2605
2605
|
"status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error';",
|
|
2606
2606
|
'tags?: string[];',
|
|
2607
2607
|
],
|
|
2608
|
-
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2609
|
-
markdown: "## list\n\n`client.networking.vpcs.list(project_id: string, cursor?: string, limit?: number, name?: string, region?: string, sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[]): { id: string; created_at: string; firewall_rule_ids: string[]; managed_by: object; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs`\n\nList all VPCs\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the VPC name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by VPC status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a VPC must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2608
|
+
response: "{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }",
|
|
2609
|
+
markdown: "## list\n\n`client.networking.vpcs.list(project_id: string, cursor?: string, limit?: number, name?: string, region?: string, sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[]): { id: string; created_at: string; firewall_rule_ids: string[]; managed_by: object; name: string; project_id: string; region: region_name; status: resource_status; subnet: subnet; tags: string[]; updated_at: string; }`\n\n**get** `/v1/networking/vpcs`\n\nList all VPCs\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the VPC name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by VPC status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a VPC must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; firewall_rule_ids: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }; tags: string[]; updated_at: string; }`\n VPC details.\n\n - `id: string`\n - `created_at: string`\n - `firewall_rule_ids: string[]`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `subnet: { id: string; cidr: string; created_at: string; name: string; updated_at: string; }`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const vpc of client.networking.vpcs.list({ project_id: 'project_id' })) {\n console.log(vpc);\n}\n```",
|
|
2610
2610
|
perLanguage: {
|
|
2611
2611
|
typescript: {
|
|
2612
2612
|
method: 'client.networking.vpcs.list',
|
|
@@ -2617,7 +2617,7 @@ const EMBEDDED_METHODS = [
|
|
|
2617
2617
|
},
|
|
2618
2618
|
go: {
|
|
2619
2619
|
method: 'client.Networking.VPCs.List',
|
|
2620
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2620
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2621
2621
|
},
|
|
2622
2622
|
cli: {
|
|
2623
2623
|
method: 'vpcs list',
|
|
@@ -2651,7 +2651,7 @@ const EMBEDDED_METHODS = [
|
|
|
2651
2651
|
},
|
|
2652
2652
|
go: {
|
|
2653
2653
|
method: 'client.Networking.VPCs.Availability.New',
|
|
2654
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2654
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2655
2655
|
},
|
|
2656
2656
|
cli: {
|
|
2657
2657
|
method: 'availability create',
|
|
@@ -2679,7 +2679,7 @@ const EMBEDDED_METHODS = [
|
|
|
2679
2679
|
},
|
|
2680
2680
|
go: {
|
|
2681
2681
|
method: 'client.Networking.VPCs.Availability.Update',
|
|
2682
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2682
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2683
2683
|
},
|
|
2684
2684
|
cli: {
|
|
2685
2685
|
method: 'availability update',
|
|
@@ -2714,7 +2714,7 @@ const EMBEDDED_METHODS = [
|
|
|
2714
2714
|
},
|
|
2715
2715
|
go: {
|
|
2716
2716
|
method: 'client.Networking.VPCs.Cost.New',
|
|
2717
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2717
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuote, err := client.Networking.VPCs.Cost.New(context.TODO(), networking.VPCCostNewParams{\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", costQuote.Currency)\n}\n',
|
|
2718
2718
|
},
|
|
2719
2719
|
cli: {
|
|
2720
2720
|
method: 'cost create',
|
|
@@ -2743,7 +2743,7 @@ const EMBEDDED_METHODS = [
|
|
|
2743
2743
|
},
|
|
2744
2744
|
go: {
|
|
2745
2745
|
method: 'client.Networking.VPCs.Cost.Update',
|
|
2746
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2746
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuoteUpdate, err := client.Networking.VPCs.Cost.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.VPCCostUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuoteUpdate.After)\n}\n',
|
|
2747
2747
|
},
|
|
2748
2748
|
cli: {
|
|
2749
2749
|
method: 'cost update',
|
|
@@ -2780,7 +2780,7 @@ const EMBEDDED_METHODS = [
|
|
|
2780
2780
|
},
|
|
2781
2781
|
go: {
|
|
2782
2782
|
method: 'client.Networking.FirewallRules.New',
|
|
2783
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2783
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2784
2784
|
},
|
|
2785
2785
|
cli: {
|
|
2786
2786
|
method: 'firewall_rules create',
|
|
@@ -2797,8 +2797,8 @@ const EMBEDDED_METHODS = [
|
|
|
2797
2797
|
stainlessPath: '(resource) networking.firewall_rules > (method) get',
|
|
2798
2798
|
qualified: 'client.networking.firewallRules.get',
|
|
2799
2799
|
params: ['vpc_id: string;', 'firewall_rule_id: string;'],
|
|
2800
|
-
response: "{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2801
|
-
markdown: "## get\n\n`client.networking.firewallRules.get(vpc_id: string, firewall_rule_id: string): { id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: object; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}`\n\nGet details about a firewall rule\n\n### Parameters\n\n- `vpc_id: string`\n\n- `firewall_rule_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2800
|
+
response: "{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
2801
|
+
markdown: "## get\n\n`client.networking.firewallRules.get(vpc_id: string, firewall_rule_id: string): { id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: object; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}`\n\nGet details about a firewall rule\n\n### Parameters\n\n- `vpc_id: string`\n\n- `firewall_rule_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n Firewall rule details.\n\n - `id: string`\n - `created_at: string`\n - `destination_address: string`\n - `destination_ports: string[]`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `protocol: 'tcp' | 'udp'`\n - `source_address: string`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst firewallRule = await client.networking.firewallRules.get('firewall_rule_id', { vpc_id: 'vpc_id' });\n\nconsole.log(firewallRule);\n```",
|
|
2802
2802
|
perLanguage: {
|
|
2803
2803
|
typescript: {
|
|
2804
2804
|
method: 'client.networking.firewallRules.get',
|
|
@@ -2809,7 +2809,7 @@ const EMBEDDED_METHODS = [
|
|
|
2809
2809
|
},
|
|
2810
2810
|
go: {
|
|
2811
2811
|
method: 'client.Networking.FirewallRules.Get',
|
|
2812
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2812
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2813
2813
|
},
|
|
2814
2814
|
cli: {
|
|
2815
2815
|
method: 'firewall_rules get',
|
|
@@ -2847,7 +2847,7 @@ const EMBEDDED_METHODS = [
|
|
|
2847
2847
|
},
|
|
2848
2848
|
go: {
|
|
2849
2849
|
method: 'client.Networking.FirewallRules.Update',
|
|
2850
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2850
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2851
2851
|
},
|
|
2852
2852
|
cli: {
|
|
2853
2853
|
method: 'firewall_rules update',
|
|
@@ -2876,7 +2876,7 @@ const EMBEDDED_METHODS = [
|
|
|
2876
2876
|
},
|
|
2877
2877
|
go: {
|
|
2878
2878
|
method: 'client.Networking.FirewallRules.Delete',
|
|
2879
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2879
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2880
2880
|
},
|
|
2881
2881
|
cli: {
|
|
2882
2882
|
method: 'firewall_rules delete',
|
|
@@ -2902,8 +2902,8 @@ const EMBEDDED_METHODS = [
|
|
|
2902
2902
|
"status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error';",
|
|
2903
2903
|
'tags?: string[];',
|
|
2904
2904
|
],
|
|
2905
|
-
response: "{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2906
|
-
markdown: "## list\n\n`client.networking.firewallRules.list(vpc_id: string, cursor?: string, limit?: number, name?: string, protocol?: 'tcp' | 'udp', sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[]): { id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: object; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}/firewall_rules`\n\nList all firewall rules\n\n### Parameters\n\n- `vpc_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same VPC, filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Firewall Rule name\n\n- `protocol?: 'tcp' | 'udp'`\n Filter by protocol\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status, protocol\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by Firewall Rule status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Firewall Rule must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'
|
|
2905
|
+
response: "{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
2906
|
+
markdown: "## list\n\n`client.networking.firewallRules.list(vpc_id: string, cursor?: string, limit?: number, name?: string, protocol?: 'tcp' | 'udp', sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[]): { id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: object; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/networking/vpcs/{vpc_id}/firewall_rules`\n\nList all firewall rules\n\n### Parameters\n\n- `vpc_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same VPC, filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Firewall Rule name\n\n- `protocol?: 'tcp' | 'udp'`\n Filter by protocol\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status, protocol\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by Firewall Rule status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Firewall Rule must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; destination_address: string; destination_ports: string[]; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; protocol: 'tcp' | 'udp'; source_address: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n Firewall rule details.\n\n - `id: string`\n - `created_at: string`\n - `destination_address: string`\n - `destination_ports: string[]`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `protocol: 'tcp' | 'udp'`\n - `source_address: string`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const firewallRule of client.networking.firewallRules.list('vpc_id')) {\n console.log(firewallRule);\n}\n```",
|
|
2907
2907
|
perLanguage: {
|
|
2908
2908
|
typescript: {
|
|
2909
2909
|
method: 'client.networking.firewallRules.list',
|
|
@@ -2914,7 +2914,7 @@ const EMBEDDED_METHODS = [
|
|
|
2914
2914
|
},
|
|
2915
2915
|
go: {
|
|
2916
2916
|
method: 'client.Networking.FirewallRules.List',
|
|
2917
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2917
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/networking"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2918
2918
|
},
|
|
2919
2919
|
cli: {
|
|
2920
2920
|
method: 'firewall_rules list',
|
|
@@ -2949,7 +2949,7 @@ const EMBEDDED_METHODS = [
|
|
|
2949
2949
|
},
|
|
2950
2950
|
go: {
|
|
2951
2951
|
method: 'client.RPCNodes.Flex.New',
|
|
2952
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2952
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2953
2953
|
},
|
|
2954
2954
|
cli: {
|
|
2955
2955
|
method: 'flex create',
|
|
@@ -2978,7 +2978,7 @@ const EMBEDDED_METHODS = [
|
|
|
2978
2978
|
},
|
|
2979
2979
|
go: {
|
|
2980
2980
|
method: 'client.RPCNodes.Flex.Get',
|
|
2981
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
2981
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
2982
2982
|
},
|
|
2983
2983
|
cli: {
|
|
2984
2984
|
method: 'flex get',
|
|
@@ -3007,7 +3007,7 @@ const EMBEDDED_METHODS = [
|
|
|
3007
3007
|
},
|
|
3008
3008
|
go: {
|
|
3009
3009
|
method: 'client.RPCNodes.Flex.Update',
|
|
3010
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3010
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3011
3011
|
},
|
|
3012
3012
|
cli: {
|
|
3013
3013
|
method: 'flex update',
|
|
@@ -3035,7 +3035,7 @@ const EMBEDDED_METHODS = [
|
|
|
3035
3035
|
},
|
|
3036
3036
|
go: {
|
|
3037
3037
|
method: 'client.RPCNodes.Flex.Delete',
|
|
3038
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3038
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3039
3039
|
},
|
|
3040
3040
|
cli: {
|
|
3041
3041
|
method: 'flex delete',
|
|
@@ -3073,7 +3073,7 @@ const EMBEDDED_METHODS = [
|
|
|
3073
3073
|
},
|
|
3074
3074
|
go: {
|
|
3075
3075
|
method: 'client.RPCNodes.Flex.List',
|
|
3076
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3076
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3077
3077
|
},
|
|
3078
3078
|
cli: {
|
|
3079
3079
|
method: 'flex list',
|
|
@@ -3108,7 +3108,7 @@ const EMBEDDED_METHODS = [
|
|
|
3108
3108
|
},
|
|
3109
3109
|
go: {
|
|
3110
3110
|
method: 'client.RPCNodes.Flex.Blockchains.List',
|
|
3111
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3111
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3112
3112
|
},
|
|
3113
3113
|
cli: {
|
|
3114
3114
|
method: 'blockchains list',
|
|
@@ -3137,7 +3137,7 @@ const EMBEDDED_METHODS = [
|
|
|
3137
3137
|
},
|
|
3138
3138
|
go: {
|
|
3139
3139
|
method: 'client.RPCNodes.Dedicated.Get',
|
|
3140
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3140
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3141
3141
|
},
|
|
3142
3142
|
cli: {
|
|
3143
3143
|
method: 'dedicated get',
|
|
@@ -3175,7 +3175,7 @@ const EMBEDDED_METHODS = [
|
|
|
3175
3175
|
},
|
|
3176
3176
|
go: {
|
|
3177
3177
|
method: 'client.RPCNodes.Dedicated.List',
|
|
3178
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3178
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3179
3179
|
},
|
|
3180
3180
|
cli: {
|
|
3181
3181
|
method: 'dedicated list',
|
|
@@ -3210,7 +3210,7 @@ const EMBEDDED_METHODS = [
|
|
|
3210
3210
|
},
|
|
3211
3211
|
go: {
|
|
3212
3212
|
method: 'client.RPCNodes.Dedicated.Blockchains.List',
|
|
3213
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3213
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3214
3214
|
},
|
|
3215
3215
|
cli: {
|
|
3216
3216
|
method: 'blockchains list',
|
|
@@ -3239,7 +3239,7 @@ const EMBEDDED_METHODS = [
|
|
|
3239
3239
|
},
|
|
3240
3240
|
go: {
|
|
3241
3241
|
method: 'client.NKS.KubernetesVersions.List',
|
|
3242
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3242
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3243
3243
|
},
|
|
3244
3244
|
cli: {
|
|
3245
3245
|
method: 'kubernetes_versions list',
|
|
@@ -3276,7 +3276,7 @@ const EMBEDDED_METHODS = [
|
|
|
3276
3276
|
},
|
|
3277
3277
|
go: {
|
|
3278
3278
|
method: 'client.NKS.Clusters.New',
|
|
3279
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3279
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3280
3280
|
},
|
|
3281
3281
|
cli: {
|
|
3282
3282
|
method: 'clusters create',
|
|
@@ -3293,8 +3293,8 @@ const EMBEDDED_METHODS = [
|
|
|
3293
3293
|
stainlessPath: '(resource) nks.clusters > (method) get',
|
|
3294
3294
|
qualified: 'client.nks.clusters.get',
|
|
3295
3295
|
params: ['cluster_id: string;'],
|
|
3296
|
-
response: "{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
3297
|
-
markdown: "## get\n\n`client.nks.clusters.get(cluster_id: string): { id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: object; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters/{cluster_id}`\n\nGet details about an NKS cluster\n\n### Parameters\n\n- `cluster_id: string`\n\n### Returns\n\n- `{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
3296
|
+
response: "{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
3297
|
+
markdown: "## get\n\n`client.nks.clusters.get(cluster_id: string): { id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: object; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters/{cluster_id}`\n\nGet details about an NKS cluster\n\n### Parameters\n\n- `cluster_id: string`\n\n### Returns\n\n- `{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n NKS Cluster details.\n\n - `id: string`\n - `autoscaling: boolean`\n - `created_at: string`\n - `kubernetes_version: string`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `pool_ids: string[]`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst nksCluster = await client.nks.clusters.get('cluster_id');\n\nconsole.log(nksCluster);\n```",
|
|
3298
3298
|
perLanguage: {
|
|
3299
3299
|
typescript: {
|
|
3300
3300
|
method: 'client.nks.clusters.get',
|
|
@@ -3305,7 +3305,7 @@ const EMBEDDED_METHODS = [
|
|
|
3305
3305
|
},
|
|
3306
3306
|
go: {
|
|
3307
3307
|
method: 'client.NKS.Clusters.Get',
|
|
3308
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3308
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3309
3309
|
},
|
|
3310
3310
|
cli: {
|
|
3311
3311
|
method: 'clusters get',
|
|
@@ -3334,7 +3334,7 @@ const EMBEDDED_METHODS = [
|
|
|
3334
3334
|
},
|
|
3335
3335
|
go: {
|
|
3336
3336
|
method: 'client.NKS.Clusters.Update',
|
|
3337
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3337
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3338
3338
|
},
|
|
3339
3339
|
cli: {
|
|
3340
3340
|
method: 'clusters update',
|
|
@@ -3363,7 +3363,7 @@ const EMBEDDED_METHODS = [
|
|
|
3363
3363
|
},
|
|
3364
3364
|
go: {
|
|
3365
3365
|
method: 'client.NKS.Clusters.Delete',
|
|
3366
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3366
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3367
3367
|
},
|
|
3368
3368
|
cli: {
|
|
3369
3369
|
method: 'clusters delete',
|
|
@@ -3392,8 +3392,8 @@ const EMBEDDED_METHODS = [
|
|
|
3392
3392
|
'tags?: string[];',
|
|
3393
3393
|
'vpc_id?: string;',
|
|
3394
3394
|
],
|
|
3395
|
-
response: "{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
3396
|
-
markdown: "## list\n\n`client.nks.clusters.list(project_id: string, autoscaling?: boolean, cursor?: string, kubernetes_version?: string, limit?: number, name?: string, region?: string, sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[], vpc_id?: string): { id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: object; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters`\n\nList all NKS clusters\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `autoscaling?: boolean`\n Filter by whether autoscaling is enabled\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `kubernetes_version?: string`\n Filter by Kubernetes version, matched exactly\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Cluster name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by Cluster status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Cluster must carry all of them.\n\n- `vpc_id?: string`\n Filter by the VPC the Cluster is in\n\n### Returns\n\n- `{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'
|
|
3395
|
+
response: "{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }",
|
|
3396
|
+
markdown: "## list\n\n`client.nks.clusters.list(project_id: string, autoscaling?: boolean, cursor?: string, kubernetes_version?: string, limit?: number, name?: string, region?: string, sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[], vpc_id?: string): { id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: object; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; vpc_id: string; }`\n\n**get** `/v1/nks/clusters`\n\nList all NKS clusters\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `autoscaling?: boolean`\n Filter by whether autoscaling is enabled\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `kubernetes_version?: string`\n Filter by Kubernetes version, matched exactly\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Cluster name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by Cluster status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Cluster must carry all of them.\n\n- `vpc_id?: string`\n Filter by the VPC the Cluster is in\n\n### Returns\n\n- `{ id: string; autoscaling: boolean; created_at: string; kubernetes_version: string; managed_by: { id: string; type: 'sandbox_cluster'; }; name: string; pool_ids: string[]; private_ip: string; project_id: string; public_ip: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; vpc_id: string; }`\n NKS Cluster details.\n\n - `id: string`\n - `autoscaling: boolean`\n - `created_at: string`\n - `kubernetes_version: string`\n - `managed_by: { id: string; type: 'sandbox_cluster'; }`\n - `name: string`\n - `pool_ids: string[]`\n - `private_ip: string`\n - `project_id: string`\n - `public_ip: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `vpc_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const nksCluster of client.nks.clusters.list({ project_id: 'project_id' })) {\n console.log(nksCluster);\n}\n```",
|
|
3397
3397
|
perLanguage: {
|
|
3398
3398
|
typescript: {
|
|
3399
3399
|
method: 'client.nks.clusters.list',
|
|
@@ -3404,7 +3404,7 @@ const EMBEDDED_METHODS = [
|
|
|
3404
3404
|
},
|
|
3405
3405
|
go: {
|
|
3406
3406
|
method: 'client.NKS.Clusters.List',
|
|
3407
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3407
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3408
3408
|
},
|
|
3409
3409
|
cli: {
|
|
3410
3410
|
method: 'clusters list',
|
|
@@ -3440,7 +3440,7 @@ const EMBEDDED_METHODS = [
|
|
|
3440
3440
|
},
|
|
3441
3441
|
go: {
|
|
3442
3442
|
method: 'client.NKS.Clusters.Availability.New',
|
|
3443
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3443
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3444
3444
|
},
|
|
3445
3445
|
cli: {
|
|
3446
3446
|
method: 'availability create',
|
|
@@ -3468,7 +3468,7 @@ const EMBEDDED_METHODS = [
|
|
|
3468
3468
|
},
|
|
3469
3469
|
go: {
|
|
3470
3470
|
method: 'client.NKS.Clusters.Availability.Update',
|
|
3471
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3471
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3472
3472
|
},
|
|
3473
3473
|
cli: {
|
|
3474
3474
|
method: 'availability update',
|
|
@@ -3505,7 +3505,7 @@ const EMBEDDED_METHODS = [
|
|
|
3505
3505
|
},
|
|
3506
3506
|
go: {
|
|
3507
3507
|
method: 'client.NKS.Clusters.Cost.New',
|
|
3508
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3508
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuote, err := client.NKS.Clusters.Cost.New(context.TODO(), nks.ClusterCostNewParams{\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", costQuote.Currency)\n}\n',
|
|
3509
3509
|
},
|
|
3510
3510
|
cli: {
|
|
3511
3511
|
method: 'cost create',
|
|
@@ -3534,7 +3534,7 @@ const EMBEDDED_METHODS = [
|
|
|
3534
3534
|
},
|
|
3535
3535
|
go: {
|
|
3536
3536
|
method: 'client.NKS.Clusters.Cost.Update',
|
|
3537
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3537
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuoteUpdate, err := client.NKS.Clusters.Cost.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterCostUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuoteUpdate.After)\n}\n',
|
|
3538
3538
|
},
|
|
3539
3539
|
cli: {
|
|
3540
3540
|
method: 'cost update',
|
|
@@ -3563,7 +3563,7 @@ const EMBEDDED_METHODS = [
|
|
|
3563
3563
|
},
|
|
3564
3564
|
go: {
|
|
3565
3565
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.Get',
|
|
3566
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3566
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3567
3567
|
},
|
|
3568
3568
|
cli: {
|
|
3569
3569
|
method: 'persistent_volume_claims get',
|
|
@@ -3602,7 +3602,7 @@ const EMBEDDED_METHODS = [
|
|
|
3602
3602
|
},
|
|
3603
3603
|
go: {
|
|
3604
3604
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.List',
|
|
3605
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3605
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3606
3606
|
},
|
|
3607
3607
|
cli: {
|
|
3608
3608
|
method: 'persistent_volume_claims list',
|
|
@@ -3631,7 +3631,7 @@ const EMBEDDED_METHODS = [
|
|
|
3631
3631
|
},
|
|
3632
3632
|
go: {
|
|
3633
3633
|
method: 'client.NKS.Clusters.Kubeconfig.Get',
|
|
3634
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3634
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3635
3635
|
},
|
|
3636
3636
|
cli: {
|
|
3637
3637
|
method: 'kubeconfig get',
|
|
@@ -3660,7 +3660,7 @@ const EMBEDDED_METHODS = [
|
|
|
3660
3660
|
},
|
|
3661
3661
|
go: {
|
|
3662
3662
|
method: 'client.NKS.Clusters.Controllers.Get',
|
|
3663
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3663
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3664
3664
|
},
|
|
3665
3665
|
cli: {
|
|
3666
3666
|
method: 'controllers get',
|
|
@@ -3699,7 +3699,7 @@ const EMBEDDED_METHODS = [
|
|
|
3699
3699
|
},
|
|
3700
3700
|
go: {
|
|
3701
3701
|
method: 'client.NKS.Clusters.Controllers.List',
|
|
3702
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3702
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3703
3703
|
},
|
|
3704
3704
|
cli: {
|
|
3705
3705
|
method: 'controllers list',
|
|
@@ -3728,7 +3728,7 @@ const EMBEDDED_METHODS = [
|
|
|
3728
3728
|
},
|
|
3729
3729
|
go: {
|
|
3730
3730
|
method: 'client.NKS.Clusters.Controllers.Volumes.Get',
|
|
3731
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3731
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3732
3732
|
},
|
|
3733
3733
|
cli: {
|
|
3734
3734
|
method: 'volumes get',
|
|
@@ -3769,7 +3769,7 @@ const EMBEDDED_METHODS = [
|
|
|
3769
3769
|
},
|
|
3770
3770
|
go: {
|
|
3771
3771
|
method: 'client.NKS.Clusters.Controllers.Volumes.List',
|
|
3772
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3772
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3773
3773
|
},
|
|
3774
3774
|
cli: {
|
|
3775
3775
|
method: 'volumes list',
|
|
@@ -3798,7 +3798,7 @@ const EMBEDDED_METHODS = [
|
|
|
3798
3798
|
},
|
|
3799
3799
|
go: {
|
|
3800
3800
|
method: 'client.NKS.Clusters.LoadBalancers.Get',
|
|
3801
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3801
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3802
3802
|
},
|
|
3803
3803
|
cli: {
|
|
3804
3804
|
method: 'load_balancers get',
|
|
@@ -3827,7 +3827,7 @@ const EMBEDDED_METHODS = [
|
|
|
3827
3827
|
},
|
|
3828
3828
|
go: {
|
|
3829
3829
|
method: 'client.NKS.Clusters.LoadBalancers.Update',
|
|
3830
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3830
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3831
3831
|
},
|
|
3832
3832
|
cli: {
|
|
3833
3833
|
method: 'load_balancers update',
|
|
@@ -3865,7 +3865,7 @@ const EMBEDDED_METHODS = [
|
|
|
3865
3865
|
},
|
|
3866
3866
|
go: {
|
|
3867
3867
|
method: 'client.NKS.Clusters.LoadBalancers.List',
|
|
3868
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3868
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3869
3869
|
},
|
|
3870
3870
|
cli: {
|
|
3871
3871
|
method: 'load_balancers list',
|
|
@@ -3900,7 +3900,7 @@ const EMBEDDED_METHODS = [
|
|
|
3900
3900
|
},
|
|
3901
3901
|
go: {
|
|
3902
3902
|
method: 'client.NKS.Clusters.Pools.New',
|
|
3903
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3903
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3904
3904
|
},
|
|
3905
3905
|
cli: {
|
|
3906
3906
|
method: 'pools create',
|
|
@@ -3929,7 +3929,7 @@ const EMBEDDED_METHODS = [
|
|
|
3929
3929
|
},
|
|
3930
3930
|
go: {
|
|
3931
3931
|
method: 'client.NKS.Clusters.Pools.Get',
|
|
3932
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3932
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3933
3933
|
},
|
|
3934
3934
|
cli: {
|
|
3935
3935
|
method: 'pools get',
|
|
@@ -3964,7 +3964,7 @@ const EMBEDDED_METHODS = [
|
|
|
3964
3964
|
},
|
|
3965
3965
|
go: {
|
|
3966
3966
|
method: 'client.NKS.Clusters.Pools.Update',
|
|
3967
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3967
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3968
3968
|
},
|
|
3969
3969
|
cli: {
|
|
3970
3970
|
method: 'pools update',
|
|
@@ -3993,7 +3993,7 @@ const EMBEDDED_METHODS = [
|
|
|
3993
3993
|
},
|
|
3994
3994
|
go: {
|
|
3995
3995
|
method: 'client.NKS.Clusters.Pools.Delete',
|
|
3996
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
3996
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
3997
3997
|
},
|
|
3998
3998
|
cli: {
|
|
3999
3999
|
method: 'pools delete',
|
|
@@ -4033,7 +4033,7 @@ const EMBEDDED_METHODS = [
|
|
|
4033
4033
|
},
|
|
4034
4034
|
go: {
|
|
4035
4035
|
method: 'client.NKS.Clusters.Pools.List',
|
|
4036
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4036
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4037
4037
|
},
|
|
4038
4038
|
cli: {
|
|
4039
4039
|
method: 'pools list',
|
|
@@ -4067,7 +4067,7 @@ const EMBEDDED_METHODS = [
|
|
|
4067
4067
|
},
|
|
4068
4068
|
go: {
|
|
4069
4069
|
method: 'client.NKS.Clusters.Pools.Availability.New',
|
|
4070
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4070
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
4071
4071
|
},
|
|
4072
4072
|
cli: {
|
|
4073
4073
|
method: 'availability create',
|
|
@@ -4101,7 +4101,7 @@ const EMBEDDED_METHODS = [
|
|
|
4101
4101
|
},
|
|
4102
4102
|
go: {
|
|
4103
4103
|
method: 'client.NKS.Clusters.Pools.Availability.Update',
|
|
4104
|
-
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4104
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4105
4105
|
},
|
|
4106
4106
|
cli: {
|
|
4107
4107
|
method: 'availability update',
|
|
@@ -4136,7 +4136,7 @@ const EMBEDDED_METHODS = [
|
|
|
4136
4136
|
},
|
|
4137
4137
|
go: {
|
|
4138
4138
|
method: 'client.NKS.Clusters.Pools.Cost.New',
|
|
4139
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4139
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuote, err := client.NKS.Clusters.Pools.Cost.New(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolCostNewParams{\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},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuote.Currency)\n}\n',
|
|
4140
4140
|
},
|
|
4141
4141
|
cli: {
|
|
4142
4142
|
method: 'cost create',
|
|
@@ -4171,7 +4171,7 @@ const EMBEDDED_METHODS = [
|
|
|
4171
4171
|
},
|
|
4172
4172
|
go: {
|
|
4173
4173
|
method: 'client.NKS.Clusters.Pools.Cost.Update',
|
|
4174
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4174
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuoteUpdate, err := client.NKS.Clusters.Pools.Cost.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolCostUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuoteUpdate.After)\n}\n',
|
|
4175
4175
|
},
|
|
4176
4176
|
cli: {
|
|
4177
4177
|
method: 'cost update',
|
|
@@ -4200,7 +4200,7 @@ const EMBEDDED_METHODS = [
|
|
|
4200
4200
|
},
|
|
4201
4201
|
go: {
|
|
4202
4202
|
method: 'client.NKS.Clusters.Pools.Nodes.Get',
|
|
4203
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4203
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4204
4204
|
},
|
|
4205
4205
|
cli: {
|
|
4206
4206
|
method: 'nodes get',
|
|
@@ -4229,7 +4229,7 @@ const EMBEDDED_METHODS = [
|
|
|
4229
4229
|
},
|
|
4230
4230
|
go: {
|
|
4231
4231
|
method: 'client.NKS.Clusters.Pools.Nodes.Delete',
|
|
4232
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4232
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4233
4233
|
},
|
|
4234
4234
|
cli: {
|
|
4235
4235
|
method: 'nodes delete',
|
|
@@ -4268,7 +4268,7 @@ const EMBEDDED_METHODS = [
|
|
|
4268
4268
|
},
|
|
4269
4269
|
go: {
|
|
4270
4270
|
method: 'client.NKS.Clusters.Pools.Nodes.List',
|
|
4271
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4271
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4272
4272
|
},
|
|
4273
4273
|
cli: {
|
|
4274
4274
|
method: 'nodes list',
|
|
@@ -4297,7 +4297,7 @@ const EMBEDDED_METHODS = [
|
|
|
4297
4297
|
},
|
|
4298
4298
|
go: {
|
|
4299
4299
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.Get',
|
|
4300
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4300
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4301
4301
|
},
|
|
4302
4302
|
cli: {
|
|
4303
4303
|
method: 'volumes get',
|
|
@@ -4339,7 +4339,7 @@ const EMBEDDED_METHODS = [
|
|
|
4339
4339
|
},
|
|
4340
4340
|
go: {
|
|
4341
4341
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.List',
|
|
4342
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4342
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/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',
|
|
4343
4343
|
},
|
|
4344
4344
|
cli: {
|
|
4345
4345
|
method: 'volumes list',
|
|
@@ -4380,7 +4380,7 @@ const EMBEDDED_METHODS = [
|
|
|
4380
4380
|
},
|
|
4381
4381
|
go: {
|
|
4382
4382
|
method: 'client.NKS.Clusters.Pools.Volumes.List',
|
|
4383
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4383
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/nks"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Pools.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4384
4384
|
},
|
|
4385
4385
|
cli: {
|
|
4386
4386
|
method: 'volumes list',
|
|
@@ -4388,103 +4388,457 @@ const EMBEDDED_METHODS = [
|
|
|
4388
4388
|
},
|
|
4389
4389
|
},
|
|
4390
4390
|
},
|
|
4391
|
+
{
|
|
4392
|
+
name: 'create',
|
|
4393
|
+
endpoint: '/v1/sandbox_clusters',
|
|
4394
|
+
httpMethod: 'post',
|
|
4395
|
+
summary: 'Create Sandbox Cluster',
|
|
4396
|
+
description: 'Create a Sandbox Cluster to run sandboxes on. The infrastructure it runs on is provisioned in a project the platform manages.',
|
|
4397
|
+
stainlessPath: '(resource) sandbox_clusters > (method) create',
|
|
4398
|
+
qualified: 'client.sandboxClusters.create',
|
|
4399
|
+
params: [
|
|
4400
|
+
'instance_type: string;',
|
|
4401
|
+
'name: string;',
|
|
4402
|
+
'node_count: number;',
|
|
4403
|
+
'project_id: string;',
|
|
4404
|
+
"region: 'us-sva-2' | 'us-wdc-1';",
|
|
4405
|
+
'tags?: string[];',
|
|
4406
|
+
],
|
|
4407
|
+
response: "{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
4408
|
+
markdown: "## create\n\n`client.sandboxClusters.create(instance_type: string, name: string, node_count: number, project_id: string, region: 'us-sva-2' | 'us-wdc-1', tags?: string[]): { id: string; created_at: string; details: operation_details; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/sandbox_clusters`\n\nCreate a Sandbox Cluster to run sandboxes on. The infrastructure it runs on is provisioned in a project the platform manages.\n\n### Parameters\n\n- `instance_type: string`\n Instance type of the nodes the sandboxes run on.\n\n- `name: string`\n Name of the Sandbox Cluster. Unique within its project.\n\n- `node_count: number`\n Number of nodes the sandboxes run on.\n\n- `project_id: string`\n ID of the project to create the Sandbox Cluster in.\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n Region the resource is in.\n\n- `tags?: string[]`\n Tags to attach to the Sandbox Cluster.\n\n### Returns\n\n- `{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `details: { changes: object; }`\n - `kind: string`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.sandboxClusters.create({\n instance_type: 'n1-standard-8',\n name: 'my-sandboxes',\n node_count: 3,\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(operation);\n```",
|
|
4409
|
+
perLanguage: {
|
|
4410
|
+
typescript: {
|
|
4411
|
+
method: 'client.sandboxClusters.create',
|
|
4412
|
+
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.sandboxClusters.create({\n instance_type: 'n1-standard-8',\n name: 'my-sandboxes',\n node_count: 3,\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(operation.id);",
|
|
4413
|
+
},
|
|
4414
|
+
http: {
|
|
4415
|
+
example: 'curl https://api.nirvanalabs.io/v1/sandbox_clusters \\\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-sandboxes",\n "node_count": 3,\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "tags": [\n "production",\n "agents"\n ]\n }\'',
|
|
4416
|
+
},
|
|
4417
|
+
go: {
|
|
4418
|
+
method: 'client.SandboxClusters.New',
|
|
4419
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/sandbox_clusters"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.SandboxClusters.New(context.TODO(), sandbox_clusters.SandboxClusterNewParams{\n\t\tInstanceType: "n1-standard-8",\n\t\tName: "my-sandboxes",\n\t\tNodeCount: 3,\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\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',
|
|
4420
|
+
},
|
|
4421
|
+
},
|
|
4422
|
+
},
|
|
4423
|
+
{
|
|
4424
|
+
name: 'get',
|
|
4425
|
+
endpoint: '/v1/sandbox_clusters/{sandbox_cluster_id}',
|
|
4426
|
+
httpMethod: 'get',
|
|
4427
|
+
summary: 'Get Sandbox Cluster',
|
|
4428
|
+
description: 'Get a Sandbox Cluster',
|
|
4429
|
+
stainlessPath: '(resource) sandbox_clusters > (method) get',
|
|
4430
|
+
qualified: 'client.sandboxClusters.get',
|
|
4431
|
+
params: ['sandbox_cluster_id: string;'],
|
|
4432
|
+
response: "{ id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }",
|
|
4433
|
+
markdown: "## get\n\n`client.sandboxClusters.get(sandbox_cluster_id: string): { id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; }`\n\n**get** `/v1/sandbox_clusters/{sandbox_cluster_id}`\n\nGet a Sandbox Cluster\n\n### Parameters\n\n- `sandbox_cluster_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }`\n A cluster sandboxes run on, in one region.\n\n - `id: string`\n - `created_at: string`\n - `gateway_hostname: string`\n - `instance_type: string`\n - `name: string`\n - `node_count: number`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst sandboxCluster = await client.sandboxClusters.get('sandbox_cluster_id');\n\nconsole.log(sandboxCluster);\n```",
|
|
4434
|
+
perLanguage: {
|
|
4435
|
+
typescript: {
|
|
4436
|
+
method: 'client.sandboxClusters.get',
|
|
4437
|
+
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 sandboxCluster = await client.sandboxClusters.get('sandbox_cluster_id');\n\nconsole.log(sandboxCluster.id);",
|
|
4438
|
+
},
|
|
4439
|
+
http: {
|
|
4440
|
+
example: 'curl https://api.nirvanalabs.io/v1/sandbox_clusters/$SANDBOX_CLUSTER_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4441
|
+
},
|
|
4442
|
+
go: {
|
|
4443
|
+
method: 'client.SandboxClusters.Get',
|
|
4444
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tsandboxCluster, err := client.SandboxClusters.Get(context.TODO(), "sandbox_cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", sandboxCluster.ID)\n}\n',
|
|
4445
|
+
},
|
|
4446
|
+
},
|
|
4447
|
+
},
|
|
4448
|
+
{
|
|
4449
|
+
name: 'update',
|
|
4450
|
+
endpoint: '/v1/sandbox_clusters/{sandbox_cluster_id}',
|
|
4451
|
+
httpMethod: 'patch',
|
|
4452
|
+
summary: 'Update Sandbox Cluster',
|
|
4453
|
+
description: "Update a Sandbox Cluster's name and tags",
|
|
4454
|
+
stainlessPath: '(resource) sandbox_clusters > (method) update',
|
|
4455
|
+
qualified: 'client.sandboxClusters.update',
|
|
4456
|
+
params: ['sandbox_cluster_id: string;', 'name?: string;', 'tags?: string[];'],
|
|
4457
|
+
response: "{ id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }",
|
|
4458
|
+
markdown: "## update\n\n`client.sandboxClusters.update(sandbox_cluster_id: string, name?: string, tags?: string[]): { id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; }`\n\n**patch** `/v1/sandbox_clusters/{sandbox_cluster_id}`\n\nUpdate a Sandbox Cluster's name and tags\n\n### Parameters\n\n- `sandbox_cluster_id: string`\n\n- `name?: string`\n Name of the Sandbox Cluster. Unique within its project.\n\n- `tags?: string[]`\n Tags to attach to the Sandbox Cluster.\n\n### Returns\n\n- `{ id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }`\n A cluster sandboxes run on, in one region.\n\n - `id: string`\n - `created_at: string`\n - `gateway_hostname: string`\n - `instance_type: string`\n - `name: string`\n - `node_count: number`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst sandboxCluster = await client.sandboxClusters.update('sandbox_cluster_id');\n\nconsole.log(sandboxCluster);\n```",
|
|
4459
|
+
perLanguage: {
|
|
4460
|
+
typescript: {
|
|
4461
|
+
method: 'client.sandboxClusters.update',
|
|
4462
|
+
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 sandboxCluster = await client.sandboxClusters.update('sandbox_cluster_id');\n\nconsole.log(sandboxCluster.id);",
|
|
4463
|
+
},
|
|
4464
|
+
http: {
|
|
4465
|
+
example: 'curl https://api.nirvanalabs.io/v1/sandbox_clusters/$SANDBOX_CLUSTER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-sandboxes",\n "tags": [\n "production",\n "agents"\n ]\n }\'',
|
|
4466
|
+
},
|
|
4467
|
+
go: {
|
|
4468
|
+
method: 'client.SandboxClusters.Update',
|
|
4469
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/sandbox_clusters"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tsandboxCluster, err := client.SandboxClusters.Update(\n\t\tcontext.TODO(),\n\t\t"sandbox_cluster_id",\n\t\tsandbox_clusters.SandboxClusterUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", sandboxCluster.ID)\n}\n',
|
|
4470
|
+
},
|
|
4471
|
+
},
|
|
4472
|
+
},
|
|
4473
|
+
{
|
|
4474
|
+
name: 'delete',
|
|
4475
|
+
endpoint: '/v1/sandbox_clusters/{sandbox_cluster_id}',
|
|
4476
|
+
httpMethod: 'delete',
|
|
4477
|
+
summary: 'Delete Sandbox Cluster',
|
|
4478
|
+
description: 'Delete a Sandbox Cluster, with its sandboxes and the infrastructure they run on.',
|
|
4479
|
+
stainlessPath: '(resource) sandbox_clusters > (method) delete',
|
|
4480
|
+
qualified: 'client.sandboxClusters.delete',
|
|
4481
|
+
params: ['sandbox_cluster_id: string;'],
|
|
4482
|
+
response: "{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
4483
|
+
markdown: "## delete\n\n`client.sandboxClusters.delete(sandbox_cluster_id: string): { id: string; created_at: string; details: operation_details; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**delete** `/v1/sandbox_clusters/{sandbox_cluster_id}`\n\nDelete a Sandbox Cluster, with its sandboxes and the infrastructure they run on.\n\n### Parameters\n\n- `sandbox_cluster_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `details: { changes: object; }`\n - `kind: string`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.sandboxClusters.delete('sandbox_cluster_id');\n\nconsole.log(operation);\n```",
|
|
4484
|
+
perLanguage: {
|
|
4485
|
+
typescript: {
|
|
4486
|
+
method: 'client.sandboxClusters.delete',
|
|
4487
|
+
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.sandboxClusters.delete('sandbox_cluster_id');\n\nconsole.log(operation.id);",
|
|
4488
|
+
},
|
|
4489
|
+
http: {
|
|
4490
|
+
example: 'curl https://api.nirvanalabs.io/v1/sandbox_clusters/$SANDBOX_CLUSTER_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4491
|
+
},
|
|
4492
|
+
go: {
|
|
4493
|
+
method: 'client.SandboxClusters.Delete',
|
|
4494
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.SandboxClusters.Delete(context.TODO(), "sandbox_cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4495
|
+
},
|
|
4496
|
+
},
|
|
4497
|
+
},
|
|
4391
4498
|
{
|
|
4392
4499
|
name: 'list',
|
|
4393
4500
|
endpoint: '/v1/sandbox_clusters',
|
|
4394
4501
|
httpMethod: 'get',
|
|
4395
4502
|
summary: 'List Sandbox Clusters',
|
|
4396
|
-
description:
|
|
4503
|
+
description: 'List the Sandbox Clusters in a project',
|
|
4397
4504
|
stainlessPath: '(resource) sandbox_clusters > (method) list',
|
|
4398
4505
|
qualified: 'client.sandboxClusters.list',
|
|
4399
|
-
params: [
|
|
4400
|
-
|
|
4401
|
-
|
|
4506
|
+
params: [
|
|
4507
|
+
'project_id: string;',
|
|
4508
|
+
'cursor?: string;',
|
|
4509
|
+
'limit?: number;',
|
|
4510
|
+
'name?: string;',
|
|
4511
|
+
'region?: string;',
|
|
4512
|
+
'sort?: string;',
|
|
4513
|
+
'tags?: string[];',
|
|
4514
|
+
],
|
|
4515
|
+
response: "{ id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }",
|
|
4516
|
+
markdown: "## list\n\n`client.sandboxClusters.list(project_id: string, cursor?: string, limit?: number, name?: string, region?: string, sort?: string, tags?: string[]): { id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: region_name; status: resource_status; tags: string[]; updated_at: string; }`\n\n**get** `/v1/sandbox_clusters`\n\nList the Sandbox Clusters in a project\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Sandbox Cluster name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Sandbox Cluster must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; gateway_hostname: string; instance_type: string; name: string; node_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; }`\n A cluster sandboxes run on, in one region.\n\n - `id: string`\n - `created_at: string`\n - `gateway_hostname: string`\n - `instance_type: string`\n - `name: string`\n - `node_count: number`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const sandboxCluster of client.sandboxClusters.list({ project_id: 'project_id' })) {\n console.log(sandboxCluster);\n}\n```",
|
|
4402
4517
|
perLanguage: {
|
|
4403
4518
|
typescript: {
|
|
4404
4519
|
method: 'client.sandboxClusters.list',
|
|
4405
|
-
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 sandboxCluster of client.sandboxClusters.list()) {\n console.log(sandboxCluster.id);\n}",
|
|
4520
|
+
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 sandboxCluster of client.sandboxClusters.list({ project_id: 'project_id' })) {\n console.log(sandboxCluster.id);\n}",
|
|
4406
4521
|
},
|
|
4407
4522
|
http: {
|
|
4408
4523
|
example: 'curl https://api.nirvanalabs.io/v1/sandbox_clusters \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4409
4524
|
},
|
|
4410
4525
|
go: {
|
|
4411
4526
|
method: 'client.SandboxClusters.List',
|
|
4412
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4527
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/sandbox_clusters"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.SandboxClusters.List(context.TODO(), sandbox_clusters.SandboxClusterListParams{\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',
|
|
4528
|
+
},
|
|
4529
|
+
},
|
|
4530
|
+
},
|
|
4531
|
+
{
|
|
4532
|
+
name: 'create',
|
|
4533
|
+
endpoint: '/v1/storage/buckets',
|
|
4534
|
+
httpMethod: 'post',
|
|
4535
|
+
summary: 'Create Bucket',
|
|
4536
|
+
description: 'Create a Bucket. The Bucket is created asynchronously: follow the returned operation until it is done.',
|
|
4537
|
+
stainlessPath: '(resource) storage.buckets > (method) create',
|
|
4538
|
+
qualified: 'client.storage.buckets.create',
|
|
4539
|
+
params: ['name: string;', 'project_id: string;', "region: 'us-sva-2' | 'us-wdc-1';", 'tags?: string[];'],
|
|
4540
|
+
response: "{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
4541
|
+
markdown: "## create\n\n`client.storage.buckets.create(name: string, project_id: string, region: 'us-sva-2' | 'us-wdc-1', tags?: string[]): { id: string; created_at: string; details: operation_details; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**post** `/v1/storage/buckets`\n\nCreate a Bucket. The Bucket is created asynchronously: follow the returned operation until it is done.\n\n### Parameters\n\n- `name: string`\n Name of the Bucket, used to address it over S3. It must be 3 to 63\ncharacters of lowercase letters, digits, dots and hyphens, start and end\nwith a letter or digit, not contain two adjacent dots and not be formatted\nas an IP address. \"admin\" and \"ops-api\" are reserved. The name cannot be\nchanged once the Bucket is created.\n\n- `project_id: string`\n Project ID the Bucket belongs to.\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n Region the resource is in.\n\n- `tags?: string[]`\n Tags to attach to the Bucket.\n\n### Returns\n\n- `{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `details: { changes: object; }`\n - `kind: string`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.storage.buckets.create({\n name: 'my-bucket',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(operation);\n```",
|
|
4542
|
+
perLanguage: {
|
|
4543
|
+
typescript: {
|
|
4544
|
+
method: 'client.storage.buckets.create',
|
|
4545
|
+
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.storage.buckets.create({\n name: 'my-bucket',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(operation.id);",
|
|
4546
|
+
},
|
|
4547
|
+
http: {
|
|
4548
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-bucket",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
4549
|
+
},
|
|
4550
|
+
go: {
|
|
4551
|
+
method: 'client.Storage.Buckets.New',
|
|
4552
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Storage.Buckets.New(context.TODO(), storage.BucketNewParams{\n\t\tName: "my-bucket",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\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',
|
|
4413
4553
|
},
|
|
4414
4554
|
},
|
|
4415
4555
|
},
|
|
4416
4556
|
{
|
|
4417
4557
|
name: 'get',
|
|
4418
|
-
endpoint: '/v1/
|
|
4558
|
+
endpoint: '/v1/storage/buckets/{bucket_id}',
|
|
4419
4559
|
httpMethod: 'get',
|
|
4420
|
-
summary: 'Get
|
|
4421
|
-
description: 'Get
|
|
4422
|
-
stainlessPath: '(resource)
|
|
4423
|
-
qualified: 'client.
|
|
4424
|
-
params: [
|
|
4425
|
-
response: "{ id: string;
|
|
4426
|
-
markdown: "## get\n\n`client.
|
|
4560
|
+
summary: 'Get Bucket Details',
|
|
4561
|
+
description: 'Get details about a Bucket',
|
|
4562
|
+
stainlessPath: '(resource) storage.buckets > (method) get',
|
|
4563
|
+
qualified: 'client.storage.buckets.get',
|
|
4564
|
+
params: ['bucket_id: string;'],
|
|
4565
|
+
response: "{ id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; size_bytes: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; url: string; }",
|
|
4566
|
+
markdown: "## get\n\n`client.storage.buckets.get(bucket_id: string): { id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: region_name; size_bytes: number; status: resource_status; tags: string[]; updated_at: string; url: string; }`\n\n**get** `/v1/storage/buckets/{bucket_id}`\n\nGet details about a Bucket\n\n### Parameters\n\n- `bucket_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; size_bytes: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; url: string; }`\n Bucket details.\n\n - `id: string`\n - `created_at: string`\n - `endpoint: string`\n - `name: string`\n - `object_count: number`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `size_bytes: number`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `url: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst bucket = await client.storage.buckets.get('bucket_id');\n\nconsole.log(bucket);\n```",
|
|
4427
4567
|
perLanguage: {
|
|
4428
4568
|
typescript: {
|
|
4429
|
-
method: 'client.
|
|
4430
|
-
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
|
|
4569
|
+
method: 'client.storage.buckets.get',
|
|
4570
|
+
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 bucket = await client.storage.buckets.get('bucket_id');\n\nconsole.log(bucket.id);",
|
|
4431
4571
|
},
|
|
4432
4572
|
http: {
|
|
4433
|
-
example: 'curl https://api.nirvanalabs.io/v1/
|
|
4573
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets/$BUCKET_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4434
4574
|
},
|
|
4435
4575
|
go: {
|
|
4436
|
-
method: 'client.
|
|
4437
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4576
|
+
method: 'client.Storage.Buckets.Get',
|
|
4577
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbucket, err := client.Storage.Buckets.Get(context.TODO(), "bucket_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", bucket.ID)\n}\n',
|
|
4438
4578
|
},
|
|
4439
4579
|
},
|
|
4440
4580
|
},
|
|
4441
4581
|
{
|
|
4442
|
-
name: '
|
|
4443
|
-
endpoint: '/v1/
|
|
4444
|
-
httpMethod: '
|
|
4445
|
-
summary: '
|
|
4446
|
-
description:
|
|
4447
|
-
stainlessPath: '(resource)
|
|
4448
|
-
qualified: 'client.
|
|
4449
|
-
params: [
|
|
4450
|
-
response: "{ id: string; created_at: string;
|
|
4451
|
-
markdown: "##
|
|
4582
|
+
name: 'update',
|
|
4583
|
+
endpoint: '/v1/storage/buckets/{bucket_id}',
|
|
4584
|
+
httpMethod: 'patch',
|
|
4585
|
+
summary: 'Update Bucket',
|
|
4586
|
+
description: "Update a Bucket's tags. A Bucket's name is its S3 name and cannot be changed.",
|
|
4587
|
+
stainlessPath: '(resource) storage.buckets > (method) update',
|
|
4588
|
+
qualified: 'client.storage.buckets.update',
|
|
4589
|
+
params: ['bucket_id: string;', 'tags?: string[];'],
|
|
4590
|
+
response: "{ id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; size_bytes: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; url: string; }",
|
|
4591
|
+
markdown: "## update\n\n`client.storage.buckets.update(bucket_id: string, tags?: string[]): { id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: region_name; size_bytes: number; status: resource_status; tags: string[]; updated_at: string; url: string; }`\n\n**patch** `/v1/storage/buckets/{bucket_id}`\n\nUpdate a Bucket's tags. A Bucket's name is its S3 name and cannot be changed.\n\n### Parameters\n\n- `bucket_id: string`\n\n- `tags?: string[]`\n Tags to attach to the Bucket.\n\n### Returns\n\n- `{ id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; size_bytes: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; url: string; }`\n Bucket details.\n\n - `id: string`\n - `created_at: string`\n - `endpoint: string`\n - `name: string`\n - `object_count: number`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `size_bytes: number`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `url: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst bucket = await client.storage.buckets.update('bucket_id');\n\nconsole.log(bucket);\n```",
|
|
4452
4592
|
perLanguage: {
|
|
4453
4593
|
typescript: {
|
|
4454
|
-
method: 'client.
|
|
4455
|
-
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
|
|
4594
|
+
method: 'client.storage.buckets.update',
|
|
4595
|
+
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 bucket = await client.storage.buckets.update('bucket_id');\n\nconsole.log(bucket.id);",
|
|
4456
4596
|
},
|
|
4457
4597
|
http: {
|
|
4458
|
-
example: 'curl https://api.nirvanalabs.io/v1/
|
|
4598
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets/$BUCKET_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
4459
4599
|
},
|
|
4460
4600
|
go: {
|
|
4461
|
-
method: 'client.
|
|
4462
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4601
|
+
method: 'client.Storage.Buckets.Update',
|
|
4602
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbucket, err := client.Storage.Buckets.Update(\n\t\tcontext.TODO(),\n\t\t"bucket_id",\n\t\tstorage.BucketUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", bucket.ID)\n}\n',
|
|
4463
4603
|
},
|
|
4464
4604
|
},
|
|
4465
4605
|
},
|
|
4466
4606
|
{
|
|
4467
|
-
name: '
|
|
4468
|
-
endpoint: '/v1/
|
|
4607
|
+
name: 'delete',
|
|
4608
|
+
endpoint: '/v1/storage/buckets/{bucket_id}',
|
|
4469
4609
|
httpMethod: 'delete',
|
|
4470
|
-
summary: '
|
|
4471
|
-
description: '
|
|
4472
|
-
stainlessPath: '(resource)
|
|
4473
|
-
qualified: 'client.
|
|
4474
|
-
params: [
|
|
4610
|
+
summary: 'Delete Bucket',
|
|
4611
|
+
description: 'Delete a Bucket. The Bucket is deleted asynchronously: follow the returned operation until it is done. A Bucket that still holds objects is only deleted with force.',
|
|
4612
|
+
stainlessPath: '(resource) storage.buckets > (method) delete',
|
|
4613
|
+
qualified: 'client.storage.buckets.delete',
|
|
4614
|
+
params: ['bucket_id: string;', 'force?: boolean;'],
|
|
4475
4615
|
response: "{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
4476
|
-
markdown: "##
|
|
4616
|
+
markdown: "## delete\n\n`client.storage.buckets.delete(bucket_id: string, force?: boolean): { id: string; created_at: string; details: operation_details; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**delete** `/v1/storage/buckets/{bucket_id}`\n\nDelete a Bucket. The Bucket is deleted asynchronously: follow the returned operation until it is done. A Bucket that still holds objects is only deleted with force.\n\n### Parameters\n\n- `bucket_id: string`\n\n- `force?: boolean`\n Permanently delete every object in the Bucket, including all versions, before deleting it. Without it, deleting a Bucket that holds objects fails.\n\n### Returns\n\n- `{ id: string; created_at: string; details: { changes: operation_changes; }; kind: string; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `details: { changes: object; }`\n - `kind: string`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.storage.buckets.delete('bucket_id');\n\nconsole.log(operation);\n```",
|
|
4617
|
+
perLanguage: {
|
|
4618
|
+
typescript: {
|
|
4619
|
+
method: 'client.storage.buckets.delete',
|
|
4620
|
+
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.storage.buckets.delete('bucket_id');\n\nconsole.log(operation.id);",
|
|
4621
|
+
},
|
|
4622
|
+
http: {
|
|
4623
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets/$BUCKET_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4624
|
+
},
|
|
4625
|
+
go: {
|
|
4626
|
+
method: 'client.Storage.Buckets.Delete',
|
|
4627
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Storage.Buckets.Delete(\n\t\tcontext.TODO(),\n\t\t"bucket_id",\n\t\tstorage.BucketDeleteParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4628
|
+
},
|
|
4629
|
+
},
|
|
4630
|
+
},
|
|
4631
|
+
{
|
|
4632
|
+
name: 'list',
|
|
4633
|
+
endpoint: '/v1/storage/buckets',
|
|
4634
|
+
httpMethod: 'get',
|
|
4635
|
+
summary: 'List Buckets',
|
|
4636
|
+
description: 'List all Buckets',
|
|
4637
|
+
stainlessPath: '(resource) storage.buckets > (method) list',
|
|
4638
|
+
qualified: 'client.storage.buckets.list',
|
|
4639
|
+
params: [
|
|
4640
|
+
'project_id: string;',
|
|
4641
|
+
'cursor?: string;',
|
|
4642
|
+
'limit?: number;',
|
|
4643
|
+
'name?: string;',
|
|
4644
|
+
'region?: string;',
|
|
4645
|
+
'sort?: string;',
|
|
4646
|
+
"status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error';",
|
|
4647
|
+
'tags?: string[];',
|
|
4648
|
+
],
|
|
4649
|
+
response: "{ id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; size_bytes: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; url: string; }",
|
|
4650
|
+
markdown: "## list\n\n`client.storage.buckets.list(project_id: string, cursor?: string, limit?: number, name?: string, region?: string, sort?: string, status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error', tags?: string[]): { id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: region_name; size_bytes: number; status: resource_status; tags: string[]; updated_at: string; url: string; }`\n\n**get** `/v1/storage/buckets`\n\nList all Buckets\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Bucket name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name, status, size_bytes, object_count\n\n- `status?: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'error'`\n Filter by Bucket status\n\n- `tags?: string[]`\n Filter by tags. Repeat the parameter to require several tags; a Bucket must carry all of them.\n\n### Returns\n\n- `{ id: string; created_at: string; endpoint: string; name: string; object_count: number; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; size_bytes: number; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; tags: string[]; updated_at: string; url: string; }`\n Bucket details.\n\n - `id: string`\n - `created_at: string`\n - `endpoint: string`\n - `name: string`\n - `object_count: number`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `size_bytes: number`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `tags: string[]`\n - `updated_at: string`\n - `url: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const bucket of client.storage.buckets.list({ project_id: 'project_id' })) {\n console.log(bucket);\n}\n```",
|
|
4651
|
+
perLanguage: {
|
|
4652
|
+
typescript: {
|
|
4653
|
+
method: 'client.storage.buckets.list',
|
|
4654
|
+
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 bucket of client.storage.buckets.list({ project_id: 'project_id' })) {\n console.log(bucket.id);\n}",
|
|
4655
|
+
},
|
|
4656
|
+
http: {
|
|
4657
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4658
|
+
},
|
|
4659
|
+
go: {
|
|
4660
|
+
method: 'client.Storage.Buckets.List',
|
|
4661
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Storage.Buckets.List(context.TODO(), storage.BucketListParams{\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',
|
|
4662
|
+
},
|
|
4663
|
+
},
|
|
4664
|
+
},
|
|
4665
|
+
{
|
|
4666
|
+
name: 'create',
|
|
4667
|
+
endpoint: '/v1/storage/buckets/availability',
|
|
4668
|
+
httpMethod: 'post',
|
|
4669
|
+
summary: 'Check Create Bucket Availability',
|
|
4670
|
+
description: 'Check if a Bucket can be created',
|
|
4671
|
+
stainlessPath: '(resource) storage.buckets.availability > (method) create',
|
|
4672
|
+
qualified: 'client.storage.buckets.availability.create',
|
|
4673
|
+
params: ['name: string;', 'project_id: string;', "region: 'us-sva-2' | 'us-wdc-1';", 'tags?: string[];'],
|
|
4674
|
+
markdown: "## create\n\n`client.storage.buckets.availability.create(name: string, project_id: string, region: 'us-sva-2' | 'us-wdc-1', tags?: string[]): void`\n\n**post** `/v1/storage/buckets/availability`\n\nCheck if a Bucket can be created\n\n### Parameters\n\n- `name: string`\n Name of the Bucket, used to address it over S3. It must be 3 to 63\ncharacters of lowercase letters, digits, dots and hyphens, start and end\nwith a letter or digit, not contain two adjacent dots and not be formatted\nas an IP address. \"admin\" and \"ops-api\" are reserved. The name cannot be\nchanged once the Bucket is created.\n\n- `project_id: string`\n Project ID the Bucket belongs to.\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n Region the resource is in.\n\n- `tags?: string[]`\n Tags to attach to the Bucket.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.storage.buckets.availability.create({\n name: 'my-bucket',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n})\n```",
|
|
4675
|
+
perLanguage: {
|
|
4676
|
+
typescript: {
|
|
4677
|
+
method: 'client.storage.buckets.availability.create',
|
|
4678
|
+
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.storage.buckets.availability.create({\n name: 'my-bucket',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});",
|
|
4679
|
+
},
|
|
4680
|
+
http: {
|
|
4681
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets/availability \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-bucket",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
4682
|
+
},
|
|
4683
|
+
go: {
|
|
4684
|
+
method: 'client.Storage.Buckets.Availability.New',
|
|
4685
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Storage.Buckets.Availability.New(context.TODO(), storage.BucketAvailabilityNewParams{\n\t\tName: "my-bucket",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
4686
|
+
},
|
|
4687
|
+
},
|
|
4688
|
+
},
|
|
4689
|
+
{
|
|
4690
|
+
name: 'create',
|
|
4691
|
+
endpoint: '/v1/storage/buckets/cost',
|
|
4692
|
+
httpMethod: 'post',
|
|
4693
|
+
summary: 'Estimate Bucket Create Cost',
|
|
4694
|
+
description: 'Return a priced cost quote for the proposed Bucket.',
|
|
4695
|
+
stainlessPath: '(resource) storage.buckets.cost > (method) create',
|
|
4696
|
+
qualified: 'client.storage.buckets.cost.create',
|
|
4697
|
+
params: ['name: string;', 'project_id: string;', "region: 'us-sva-2' | 'us-wdc-1';", 'tags?: string[];'],
|
|
4698
|
+
response: '{ currency: string; monthly_total: string; priced_at: string; usage_dimensions: { dimension: string; dimension_display_name: string; monthly_amount: string; quantity: number; unit_price: string; }[]; current_summary?: { daily_cost: string; effective_balance: string; monthly_cost: string; recharge_threshold_days: string; estimated_next_charge_at?: string; runway_months?: string; }; updated_summary?: { daily_cost: string; effective_balance: string; monthly_cost: string; recharge_threshold_days: string; estimated_next_charge_at?: string; runway_months?: string; }; }',
|
|
4699
|
+
markdown: "## create\n\n`client.storage.buckets.cost.create(name: string, project_id: string, region: 'us-sva-2' | 'us-wdc-1', tags?: string[]): { currency: string; monthly_total: string; priced_at: string; usage_dimensions: object[]; current_summary?: organization_billing_summary; updated_summary?: organization_billing_summary; }`\n\n**post** `/v1/storage/buckets/cost`\n\nReturn a priced cost quote for the proposed Bucket.\n\n### Parameters\n\n- `name: string`\n Name of the Bucket, used to address it over S3. It must be 3 to 63\ncharacters of lowercase letters, digits, dots and hyphens, start and end\nwith a letter or digit, not contain two adjacent dots and not be formatted\nas an IP address. \"admin\" and \"ops-api\" are reserved. The name cannot be\nchanged once the Bucket is created.\n\n- `project_id: string`\n Project ID the Bucket belongs to.\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n Region the resource is in.\n\n- `tags?: string[]`\n Tags to attach to the Bucket.\n\n### Returns\n\n- `{ currency: string; monthly_total: string; priced_at: string; usage_dimensions: { dimension: string; dimension_display_name: string; monthly_amount: string; quantity: number; unit_price: string; }[]; current_summary?: { daily_cost: string; effective_balance: string; monthly_cost: string; recharge_threshold_days: string; estimated_next_charge_at?: string; runway_months?: string; }; updated_summary?: { daily_cost: string; effective_balance: string; monthly_cost: string; recharge_threshold_days: string; estimated_next_charge_at?: string; runway_months?: string; }; }`\n Cost quote returned by POST /cost. current_summary and updated_summary hold the org billing summary now and with this resource; omitted when the caller cannot view billing.\n\n - `currency: string`\n - `monthly_total: string`\n - `priced_at: string`\n - `usage_dimensions: { dimension: string; dimension_display_name: string; monthly_amount: string; quantity: number; unit_price: string; }[]`\n - `current_summary?: { daily_cost: string; effective_balance: string; monthly_cost: string; recharge_threshold_days: string; estimated_next_charge_at?: string; runway_months?: string; }`\n - `updated_summary?: { daily_cost: string; effective_balance: string; monthly_cost: string; recharge_threshold_days: string; estimated_next_charge_at?: string; runway_months?: string; }`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst costQuote = await client.storage.buckets.cost.create({\n name: 'my-bucket',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(costQuote);\n```",
|
|
4700
|
+
perLanguage: {
|
|
4701
|
+
typescript: {
|
|
4702
|
+
method: 'client.storage.buckets.cost.create',
|
|
4703
|
+
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 costQuote = await client.storage.buckets.cost.create({\n name: 'my-bucket',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(costQuote.currency);",
|
|
4704
|
+
},
|
|
4705
|
+
http: {
|
|
4706
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/buckets/cost \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "my-bucket",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2",\n "tags": [\n "production",\n "ethereum"\n ]\n }\'',
|
|
4707
|
+
},
|
|
4708
|
+
go: {
|
|
4709
|
+
method: 'client.Storage.Buckets.Cost.New',
|
|
4710
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcostQuote, err := client.Storage.Buckets.Cost.New(context.TODO(), storage.BucketCostNewParams{\n\t\tName: "my-bucket",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", costQuote.Currency)\n}\n',
|
|
4711
|
+
},
|
|
4712
|
+
},
|
|
4713
|
+
},
|
|
4714
|
+
{
|
|
4715
|
+
name: 'create',
|
|
4716
|
+
endpoint: '/v1/storage/keys',
|
|
4717
|
+
httpMethod: 'post',
|
|
4718
|
+
summary: 'Create Object Storage Key',
|
|
4719
|
+
description: "Create an S3 access key for a project's Buckets in a region. The response is the only one that includes the secret access key.",
|
|
4720
|
+
stainlessPath: '(resource) storage.keys > (method) create',
|
|
4721
|
+
qualified: 'client.storage.keys.create',
|
|
4722
|
+
params: ['name: string;', 'project_id: string;', "region: 'us-sva-2' | 'us-wdc-1';"],
|
|
4723
|
+
response: "{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; secret: string; updated_at: string; }",
|
|
4724
|
+
markdown: "## create\n\n`client.storage.keys.create(name: string, project_id: string, region: 'us-sva-2' | 'us-wdc-1'): { id: string; access_key: string; created_at: string; name: string; project_id: string; region: region_name; secret: string; updated_at: string; }`\n\n**post** `/v1/storage/keys`\n\nCreate an S3 access key for a project's Buckets in a region. The response is the only one that includes the secret access key.\n\n### Parameters\n\n- `name: string`\n Name of the Object Storage Key.\n\n- `project_id: string`\n Project ID the Object Storage Key belongs to. The key can access the\nproject's Buckets in its region.\n\n- `region: 'us-sva-2' | 'us-wdc-1'`\n Region the resource is in.\n\n### Returns\n\n- `{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; secret: string; updated_at: string; }`\n Object Storage Key details, including the secret access key. Returned only when the key is created.\n\n - `id: string`\n - `access_key: string`\n - `created_at: string`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `secret: string`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst objectStorageKeyWithSecret = await client.storage.keys.create({\n name: 'ci-uploads',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(objectStorageKeyWithSecret);\n```",
|
|
4725
|
+
perLanguage: {
|
|
4726
|
+
typescript: {
|
|
4727
|
+
method: 'client.storage.keys.create',
|
|
4728
|
+
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 objectStorageKeyWithSecret = await client.storage.keys.create({\n name: 'ci-uploads',\n project_id: '123e4567-e89b-12d3-a456-426614174000',\n region: 'us-sva-2',\n});\n\nconsole.log(objectStorageKeyWithSecret.id);",
|
|
4729
|
+
},
|
|
4730
|
+
http: {
|
|
4731
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/keys \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "ci-uploads",\n "project_id": "123e4567-e89b-12d3-a456-426614174000",\n "region": "us-sva-2"\n }\'',
|
|
4732
|
+
},
|
|
4733
|
+
go: {
|
|
4734
|
+
method: 'client.Storage.Keys.New',
|
|
4735
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/shared"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tobjectStorageKeyWithSecret, err := client.Storage.Keys.New(context.TODO(), storage.KeyNewParams{\n\t\tName: "ci-uploads",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", objectStorageKeyWithSecret.ID)\n}\n',
|
|
4736
|
+
},
|
|
4737
|
+
},
|
|
4738
|
+
},
|
|
4739
|
+
{
|
|
4740
|
+
name: 'get',
|
|
4741
|
+
endpoint: '/v1/storage/keys/{key_id}',
|
|
4742
|
+
httpMethod: 'get',
|
|
4743
|
+
summary: 'Get Object Storage Key Details',
|
|
4744
|
+
description: 'Get details about an Object Storage Key. The secret access key is not included.',
|
|
4745
|
+
stainlessPath: '(resource) storage.keys > (method) get',
|
|
4746
|
+
qualified: 'client.storage.keys.get',
|
|
4747
|
+
params: ['key_id: string;'],
|
|
4748
|
+
response: "{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; updated_at: string; }",
|
|
4749
|
+
markdown: "## get\n\n`client.storage.keys.get(key_id: string): { id: string; access_key: string; created_at: string; name: string; project_id: string; region: region_name; updated_at: string; }`\n\n**get** `/v1/storage/keys/{key_id}`\n\nGet details about an Object Storage Key. The secret access key is not included.\n\n### Parameters\n\n- `key_id: string`\n\n### Returns\n\n- `{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; updated_at: string; }`\n Object Storage Key details. The secret access key is only returned when the key is created.\n\n - `id: string`\n - `access_key: string`\n - `created_at: string`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst objectStorageKey = await client.storage.keys.get('key_id');\n\nconsole.log(objectStorageKey);\n```",
|
|
4750
|
+
perLanguage: {
|
|
4751
|
+
typescript: {
|
|
4752
|
+
method: 'client.storage.keys.get',
|
|
4753
|
+
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 objectStorageKey = await client.storage.keys.get('key_id');\n\nconsole.log(objectStorageKey.id);",
|
|
4754
|
+
},
|
|
4755
|
+
http: {
|
|
4756
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/keys/$KEY_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4757
|
+
},
|
|
4758
|
+
go: {
|
|
4759
|
+
method: 'client.Storage.Keys.Get',
|
|
4760
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tobjectStorageKey, err := client.Storage.Keys.Get(context.TODO(), "key_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", objectStorageKey.ID)\n}\n',
|
|
4761
|
+
},
|
|
4762
|
+
},
|
|
4763
|
+
},
|
|
4764
|
+
{
|
|
4765
|
+
name: 'update',
|
|
4766
|
+
endpoint: '/v1/storage/keys/{key_id}',
|
|
4767
|
+
httpMethod: 'patch',
|
|
4768
|
+
summary: 'Update Object Storage Key',
|
|
4769
|
+
description: 'Rename an Object Storage Key. Its access key and secret do not change.',
|
|
4770
|
+
stainlessPath: '(resource) storage.keys > (method) update',
|
|
4771
|
+
qualified: 'client.storage.keys.update',
|
|
4772
|
+
params: ['key_id: string;', 'name?: string;'],
|
|
4773
|
+
response: "{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; updated_at: string; }",
|
|
4774
|
+
markdown: "## update\n\n`client.storage.keys.update(key_id: string, name?: string): { id: string; access_key: string; created_at: string; name: string; project_id: string; region: region_name; updated_at: string; }`\n\n**patch** `/v1/storage/keys/{key_id}`\n\nRename an Object Storage Key. Its access key and secret do not change.\n\n### Parameters\n\n- `key_id: string`\n\n- `name?: string`\n Name of the Object Storage Key.\n\n### Returns\n\n- `{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; updated_at: string; }`\n Object Storage Key details. The secret access key is only returned when the key is created.\n\n - `id: string`\n - `access_key: string`\n - `created_at: string`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst objectStorageKey = await client.storage.keys.update('key_id');\n\nconsole.log(objectStorageKey);\n```",
|
|
4775
|
+
perLanguage: {
|
|
4776
|
+
typescript: {
|
|
4777
|
+
method: 'client.storage.keys.update',
|
|
4778
|
+
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 objectStorageKey = await client.storage.keys.update('key_id');\n\nconsole.log(objectStorageKey.id);",
|
|
4779
|
+
},
|
|
4780
|
+
http: {
|
|
4781
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/keys/$KEY_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \\\n -d \'{\n "name": "ci-uploads"\n }\'',
|
|
4782
|
+
},
|
|
4783
|
+
go: {
|
|
4784
|
+
method: 'client.Storage.Keys.Update',
|
|
4785
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tobjectStorageKey, err := client.Storage.Keys.Update(\n\t\tcontext.TODO(),\n\t\t"key_id",\n\t\tstorage.KeyUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", objectStorageKey.ID)\n}\n',
|
|
4786
|
+
},
|
|
4787
|
+
},
|
|
4788
|
+
},
|
|
4789
|
+
{
|
|
4790
|
+
name: 'delete',
|
|
4791
|
+
endpoint: '/v1/storage/keys/{key_id}',
|
|
4792
|
+
httpMethod: 'delete',
|
|
4793
|
+
summary: 'Delete Object Storage Key',
|
|
4794
|
+
description: 'Delete an Object Storage Key. It stops working immediately.',
|
|
4795
|
+
stainlessPath: '(resource) storage.keys > (method) delete',
|
|
4796
|
+
qualified: 'client.storage.keys.delete',
|
|
4797
|
+
params: ['key_id: string;'],
|
|
4798
|
+
markdown: "## delete\n\n`client.storage.keys.delete(key_id: string): void`\n\n**delete** `/v1/storage/keys/{key_id}`\n\nDelete an Object Storage Key. It stops working immediately.\n\n### Parameters\n\n- `key_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.storage.keys.delete('key_id')\n```",
|
|
4799
|
+
perLanguage: {
|
|
4800
|
+
typescript: {
|
|
4801
|
+
method: 'client.storage.keys.delete',
|
|
4802
|
+
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.storage.keys.delete('key_id');",
|
|
4803
|
+
},
|
|
4804
|
+
http: {
|
|
4805
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/keys/$KEY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4806
|
+
},
|
|
4807
|
+
go: {
|
|
4808
|
+
method: 'client.Storage.Keys.Delete',
|
|
4809
|
+
example: 'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Storage.Keys.Delete(context.TODO(), "key_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
4810
|
+
},
|
|
4811
|
+
},
|
|
4812
|
+
},
|
|
4813
|
+
{
|
|
4814
|
+
name: 'list',
|
|
4815
|
+
endpoint: '/v1/storage/keys',
|
|
4816
|
+
httpMethod: 'get',
|
|
4817
|
+
summary: 'List Object Storage Keys',
|
|
4818
|
+
description: 'List all Object Storage Keys. Secret access keys are not included.',
|
|
4819
|
+
stainlessPath: '(resource) storage.keys > (method) list',
|
|
4820
|
+
qualified: 'client.storage.keys.list',
|
|
4821
|
+
params: [
|
|
4822
|
+
'project_id: string;',
|
|
4823
|
+
'cursor?: string;',
|
|
4824
|
+
'limit?: number;',
|
|
4825
|
+
'name?: string;',
|
|
4826
|
+
'region?: string;',
|
|
4827
|
+
'sort?: string;',
|
|
4828
|
+
],
|
|
4829
|
+
response: "{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; updated_at: string; }",
|
|
4830
|
+
markdown: "## list\n\n`client.storage.keys.list(project_id: string, cursor?: string, limit?: number, name?: string, region?: string, sort?: string): { id: string; access_key: string; created_at: string; name: string; project_id: string; region: region_name; updated_at: string; }`\n\n**get** `/v1/storage/keys`\n\nList all Object Storage Keys. Secret access keys are not included.\n\n### Parameters\n\n- `project_id: string`\n Project ID of resources to request\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `name?: string`\n Filter by a case-insensitive substring of the Object Storage Key name\n\n- `region?: string`\n Filter by region\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name\n\n### Returns\n\n- `{ id: string; access_key: string; created_at: string; name: string; project_id: string; region: 'us-sva-2' | 'us-wdc-1'; updated_at: string; }`\n Object Storage Key details. The secret access key is only returned when the key is created.\n\n - `id: string`\n - `access_key: string`\n - `created_at: string`\n - `name: string`\n - `project_id: string`\n - `region: 'us-sva-2' | 'us-wdc-1'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const objectStorageKey of client.storage.keys.list({ project_id: 'project_id' })) {\n console.log(objectStorageKey);\n}\n```",
|
|
4477
4831
|
perLanguage: {
|
|
4478
4832
|
typescript: {
|
|
4479
|
-
method: 'client.
|
|
4480
|
-
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\
|
|
4833
|
+
method: 'client.storage.keys.list',
|
|
4834
|
+
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 objectStorageKey of client.storage.keys.list({ project_id: 'project_id' })) {\n console.log(objectStorageKey.id);\n}",
|
|
4481
4835
|
},
|
|
4482
4836
|
http: {
|
|
4483
|
-
example: 'curl https://api.nirvanalabs.io/v1/
|
|
4837
|
+
example: 'curl https://api.nirvanalabs.io/v1/storage/keys \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
|
|
4484
4838
|
},
|
|
4485
4839
|
go: {
|
|
4486
|
-
method: 'client.
|
|
4487
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/
|
|
4840
|
+
method: 'client.Storage.Keys.List',
|
|
4841
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/storage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Storage.Keys.List(context.TODO(), storage.KeyListParams{\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',
|
|
4488
4842
|
},
|
|
4489
4843
|
},
|
|
4490
4844
|
},
|
|
@@ -4496,15 +4850,15 @@ const EMBEDDED_READMES = [
|
|
|
4496
4850
|
},
|
|
4497
4851
|
{
|
|
4498
4852
|
language: 'go',
|
|
4499
|
-
content: '# Nirvana Labs Go API Library\n\n<a href="https://pkg.go.dev/github.com/nirvana-labs/nirvana-go/v2"><img src="https://pkg.go.dev/badge/github.com/nirvana-labs/nirvana-go/v2.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/v2" // 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/v2@v2.3.2\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/compute"\n\t"github.com/nirvana-labs/nirvana-go/v2/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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/v2/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',
|
|
4853
|
+
content: '# Nirvana Labs Go API Library\n\n<a href="https://pkg.go.dev/github.com/nirvana-labs/nirvana-go/v3"><img src="https://pkg.go.dev/badge/github.com/nirvana-labs/nirvana-go/v3.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/v3" // 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/v3@v3.0.0\'\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/v3"\n\t"github.com/nirvana-labs/nirvana-go/v3/compute"\n\t"github.com/nirvana-labs/nirvana-go/v3/option"\n\t"github.com/nirvana-labs/nirvana-go/v3/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/v3/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',
|
|
4500
4854
|
},
|
|
4501
4855
|
{
|
|
4502
4856
|
language: 'terraform',
|
|
4503
|
-
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 = "~>
|
|
4857
|
+
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 = "~> 3.0.0"\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',
|
|
4504
4858
|
},
|
|
4505
4859
|
{
|
|
4506
4860
|
language: 'cli',
|
|
4507
|
-
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/
|
|
4861
|
+
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/v3/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",
|
|
4508
4862
|
},
|
|
4509
4863
|
];
|
|
4510
4864
|
const INDEX_OPTIONS = {
|