@nirvana-labs/nirvana-mcp 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/local-docs-search.js +134 -134
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +134 -134
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.js.map +1 -1
- package/server.mjs +1 -1
- package/server.mjs.map +1 -1
- package/src/local-docs-search.ts +134 -134
- package/src/server.ts +1 -1
package/src/local-docs-search.ts
CHANGED
|
@@ -74,7 +74,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
74
74
|
go: {
|
|
75
75
|
method: 'client.User.Get',
|
|
76
76
|
example:
|
|
77
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tuser, err := client.User.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", user.ID)\n}\n',
|
|
77
|
+
'package 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/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',
|
|
78
78
|
},
|
|
79
79
|
cli: {
|
|
80
80
|
method: 'user get',
|
|
@@ -107,7 +107,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
107
107
|
go: {
|
|
108
108
|
method: 'client.User.Security.Get',
|
|
109
109
|
example:
|
|
110
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tuserSecurity, err := client.User.Security.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", userSecurity.SourceIPRule)\n}\n',
|
|
110
|
+
'package 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/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',
|
|
111
111
|
},
|
|
112
112
|
cli: {
|
|
113
113
|
method: 'security get',
|
|
@@ -141,7 +141,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
141
141
|
go: {
|
|
142
142
|
method: 'client.User.Security.Update',
|
|
143
143
|
example:
|
|
144
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/user"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tuserSecurity, err := client.User.Security.Update(context.TODO(), user.SecurityUpdateParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", userSecurity.SourceIPRule)\n}\n',
|
|
144
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
145
145
|
},
|
|
146
146
|
cli: {
|
|
147
147
|
method: 'security update',
|
|
@@ -183,7 +183,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
183
183
|
go: {
|
|
184
184
|
method: 'client.APIKeys.New',
|
|
185
185
|
example:
|
|
186
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tapiKey, err := client.APIKeys.New(context.TODO(), api_keys.APIKeyNewParams{\n\t\tExpiresAt: time.Now(),\n\t\tName: "My API Key",\n\t\tPermissions: []api_keys.APIKeyNewParamsPermission{{\n\t\t\tPermission: api_keys.APIPermissionLevelEdit,\n\t\t\tResourceType: api_keys.APIPermissionResourceTypeVM,\n\t\t}},\n\t\tProjectIDs: []string{"123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiKey.ID)\n}\n',
|
|
186
|
+
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
187
187
|
},
|
|
188
188
|
cli: {
|
|
189
189
|
method: 'api_keys create',
|
|
@@ -218,7 +218,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
218
218
|
go: {
|
|
219
219
|
method: 'client.APIKeys.Get',
|
|
220
220
|
example:
|
|
221
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tapiKey, err := client.APIKeys.Get(context.TODO(), "api_key_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiKey.ID)\n}\n',
|
|
221
|
+
'package 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/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',
|
|
222
222
|
},
|
|
223
223
|
cli: {
|
|
224
224
|
method: 'api_keys get',
|
|
@@ -259,7 +259,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
259
259
|
go: {
|
|
260
260
|
method: 'client.APIKeys.Update',
|
|
261
261
|
example:
|
|
262
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tapiKey, err := client.APIKeys.Update(\n\t\tcontext.TODO(),\n\t\t"api_key_id",\n\t\tapi_keys.APIKeyUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiKey.ID)\n}\n',
|
|
262
|
+
'package 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/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
263
263
|
},
|
|
264
264
|
cli: {
|
|
265
265
|
method: 'api_keys update',
|
|
@@ -291,7 +291,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
291
291
|
go: {
|
|
292
292
|
method: 'client.APIKeys.Delete',
|
|
293
293
|
example:
|
|
294
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.APIKeys.Delete(context.TODO(), "api_key_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
294
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
295
295
|
},
|
|
296
296
|
cli: {
|
|
297
297
|
method: 'api_keys delete',
|
|
@@ -332,7 +332,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
332
332
|
go: {
|
|
333
333
|
method: 'client.APIKeys.List',
|
|
334
334
|
example:
|
|
335
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.APIKeys.List(context.TODO(), api_keys.APIKeyListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
335
|
+
'package 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/api_keys"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
336
336
|
},
|
|
337
337
|
cli: {
|
|
338
338
|
method: 'api_keys list',
|
|
@@ -366,7 +366,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
366
366
|
go: {
|
|
367
367
|
method: 'client.Operations.Get',
|
|
368
368
|
example:
|
|
369
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Operations.Get(context.TODO(), "operation_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
369
|
+
'package 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/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',
|
|
370
370
|
},
|
|
371
371
|
cli: {
|
|
372
372
|
method: 'operations get',
|
|
@@ -411,7 +411,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
411
411
|
go: {
|
|
412
412
|
method: 'client.Operations.List',
|
|
413
413
|
example:
|
|
414
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/operations"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Operations.List(context.TODO(), operations.OperationListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
414
|
+
'package 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/operations"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
415
415
|
},
|
|
416
416
|
cli: {
|
|
417
417
|
method: 'operations list',
|
|
@@ -445,7 +445,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
445
445
|
go: {
|
|
446
446
|
method: 'client.Organizations.New',
|
|
447
447
|
example:
|
|
448
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganization, err := client.Organizations.New(context.TODO(), organizations.OrganizationNewParams{\n\t\tName: "My Organization",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organization.ID)\n}\n',
|
|
448
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
449
449
|
},
|
|
450
450
|
cli: {
|
|
451
451
|
method: 'organizations create',
|
|
@@ -479,7 +479,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
479
479
|
go: {
|
|
480
480
|
method: 'client.Organizations.Get',
|
|
481
481
|
example:
|
|
482
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganization, err := client.Organizations.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organization.ID)\n}\n',
|
|
482
|
+
'package 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/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',
|
|
483
483
|
},
|
|
484
484
|
cli: {
|
|
485
485
|
method: 'organizations get',
|
|
@@ -514,7 +514,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
514
514
|
go: {
|
|
515
515
|
method: 'client.Organizations.Update',
|
|
516
516
|
example:
|
|
517
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganization, err := client.Organizations.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.OrganizationUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organization.ID)\n}\n',
|
|
517
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
518
518
|
},
|
|
519
519
|
cli: {
|
|
520
520
|
method: 'organizations update',
|
|
@@ -555,7 +555,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
555
555
|
go: {
|
|
556
556
|
method: 'client.Organizations.List',
|
|
557
557
|
example:
|
|
558
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Organizations.List(context.TODO(), organizations.OrganizationListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
558
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
559
559
|
},
|
|
560
560
|
cli: {
|
|
561
561
|
method: 'organizations list',
|
|
@@ -587,7 +587,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
587
587
|
go: {
|
|
588
588
|
method: 'client.Organizations.Leave',
|
|
589
589
|
example:
|
|
590
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Organizations.Leave(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
590
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
591
591
|
},
|
|
592
592
|
cli: {
|
|
593
593
|
method: 'organizations leave',
|
|
@@ -606,9 +606,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
606
606
|
qualified: 'client.organizations.memberships.get',
|
|
607
607
|
params: ['organization_id: string;', 'membership_id: string;'],
|
|
608
608
|
response:
|
|
609
|
-
"{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }",
|
|
609
|
+
"{ id: string; created_at: string; organization_id: string; role: 'owner' | 'admin' | 'billing' | 'member'; updated_at: string; user_id: string; }",
|
|
610
610
|
markdown:
|
|
611
|
-
"## get\n\n`client.organizations.memberships.get(organization_id: string, membership_id: string): { id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n\n**get** `/v1/organizations/{organization_id}/memberships/{membership_id}`\n\nGet details about an organization membership\n\n### Parameters\n\n- `organization_id: string`\n\n- `membership_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n Organization membership details.\n\n - `id: string`\n - `created_at: string`\n - `organization_id: string`\n - `role: 'owner' | 'member'`\n - `updated_at: string`\n - `user_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst organizationMembership = await client.organizations.memberships.get('membership_id', { organization_id: 'organization_id' });\n\nconsole.log(organizationMembership);\n```",
|
|
611
|
+
"## get\n\n`client.organizations.memberships.get(organization_id: string, membership_id: string): { id: string; created_at: string; organization_id: string; role: 'owner' | 'admin' | 'billing' | 'member'; updated_at: string; user_id: string; }`\n\n**get** `/v1/organizations/{organization_id}/memberships/{membership_id}`\n\nGet details about an organization membership\n\n### Parameters\n\n- `organization_id: string`\n\n- `membership_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; organization_id: string; role: 'owner' | 'admin' | 'billing' | 'member'; updated_at: string; user_id: string; }`\n Organization membership details.\n\n - `id: string`\n - `created_at: string`\n - `organization_id: string`\n - `role: 'owner' | 'admin' | 'billing' | 'member'`\n - `updated_at: string`\n - `user_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst organizationMembership = await client.organizations.memberships.get('membership_id', { organization_id: 'organization_id' });\n\nconsole.log(organizationMembership);\n```",
|
|
612
612
|
perLanguage: {
|
|
613
613
|
typescript: {
|
|
614
614
|
method: 'client.organizations.memberships.get',
|
|
@@ -622,7 +622,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
622
622
|
go: {
|
|
623
623
|
method: 'client.Organizations.Memberships.Get',
|
|
624
624
|
example:
|
|
625
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationMembership, err := client.Organizations.Memberships.Get(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\t"membership_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationMembership.ID)\n}\n',
|
|
625
|
+
'package 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/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',
|
|
626
626
|
},
|
|
627
627
|
cli: {
|
|
628
628
|
method: 'memberships get',
|
|
@@ -643,14 +643,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
643
643
|
'organization_id: string;',
|
|
644
644
|
'cursor?: string;',
|
|
645
645
|
'limit?: number;',
|
|
646
|
-
"role?: 'owner' | 'member';",
|
|
646
|
+
"role?: 'owner' | 'admin' | 'billing' | 'member';",
|
|
647
647
|
'sort?: string;',
|
|
648
648
|
'user_id?: string;',
|
|
649
649
|
],
|
|
650
650
|
response:
|
|
651
|
-
"{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }",
|
|
651
|
+
"{ id: string; created_at: string; organization_id: string; role: 'owner' | 'admin' | 'billing' | 'member'; updated_at: string; user_id: string; }",
|
|
652
652
|
markdown:
|
|
653
|
-
"## list\n\n`client.organizations.memberships.list(organization_id: string, cursor?: string, limit?: number, role?: 'owner' | 'member', sort?: string, user_id?: string): { id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n\n**get** `/v1/organizations/{organization_id}/memberships`\n\nList all memberships for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `role?: 'owner' | 'member'`\n Filter by membership role\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, role\n\n- `user_id?: string`\n Filter by the member's user ID\n\n### Returns\n\n- `{ id: string; created_at: string; organization_id: string; role: 'owner' | 'member'; updated_at: string; user_id: string; }`\n Organization membership details.\n\n - `id: string`\n - `created_at: string`\n - `organization_id: string`\n - `role: 'owner' | 'member'`\n - `updated_at: string`\n - `user_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const organizationMembership of client.organizations.memberships.list('organization_id')) {\n console.log(organizationMembership);\n}\n```",
|
|
653
|
+
"## list\n\n`client.organizations.memberships.list(organization_id: string, cursor?: string, limit?: number, role?: 'owner' | 'admin' | 'billing' | 'member', sort?: string, user_id?: string): { id: string; created_at: string; organization_id: string; role: 'owner' | 'admin' | 'billing' | 'member'; updated_at: string; user_id: string; }`\n\n**get** `/v1/organizations/{organization_id}/memberships`\n\nList all memberships for an organization\n\n### Parameters\n\n- `organization_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request. Only valid for the same filters and sort order.\n\n- `limit?: number`\n Maximum number of items to return\n\n- `role?: 'owner' | 'admin' | 'billing' | 'member'`\n Filter by membership role\n\n- `sort?: string`\n Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, role\n\n- `user_id?: string`\n Filter by the member's user ID\n\n### Returns\n\n- `{ id: string; created_at: string; organization_id: string; role: 'owner' | 'admin' | 'billing' | 'member'; updated_at: string; user_id: string; }`\n Organization membership details.\n\n - `id: string`\n - `created_at: string`\n - `organization_id: string`\n - `role: 'owner' | 'admin' | 'billing' | 'member'`\n - `updated_at: string`\n - `user_id: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const organizationMembership of client.organizations.memberships.list('organization_id')) {\n console.log(organizationMembership);\n}\n```",
|
|
654
654
|
perLanguage: {
|
|
655
655
|
typescript: {
|
|
656
656
|
method: 'client.organizations.memberships.list',
|
|
@@ -664,7 +664,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
664
664
|
go: {
|
|
665
665
|
method: 'client.Organizations.Memberships.List',
|
|
666
666
|
example:
|
|
667
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Organizations.Memberships.List(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.MembershipListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
667
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
668
668
|
},
|
|
669
669
|
cli: {
|
|
670
670
|
method: 'memberships list',
|
|
@@ -709,7 +709,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
709
709
|
go: {
|
|
710
710
|
method: 'client.Organizations.Address.New',
|
|
711
711
|
example:
|
|
712
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationAddress, err := client.Organizations.Address.New(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.AddressNewParams{\n\t\t\tCity: "San Francisco",\n\t\t\tCountry: "US",\n\t\t\tLine1: "123 Main St",\n\t\t\tPostalCode: "94105",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationAddress.ID)\n}\n',
|
|
712
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
713
713
|
},
|
|
714
714
|
cli: {
|
|
715
715
|
method: 'address create',
|
|
@@ -744,7 +744,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
744
744
|
go: {
|
|
745
745
|
method: 'client.Organizations.Address.Get',
|
|
746
746
|
example:
|
|
747
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationAddress, err := client.Organizations.Address.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationAddress.ID)\n}\n',
|
|
747
|
+
'package 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/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',
|
|
748
748
|
},
|
|
749
749
|
cli: {
|
|
750
750
|
method: 'address get',
|
|
@@ -789,7 +789,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
789
789
|
go: {
|
|
790
790
|
method: 'client.Organizations.Address.Update',
|
|
791
791
|
example:
|
|
792
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationAddress, err := client.Organizations.Address.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.AddressUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationAddress.ID)\n}\n',
|
|
792
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
793
793
|
},
|
|
794
794
|
cli: {
|
|
795
795
|
method: 'address update',
|
|
@@ -825,7 +825,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
825
825
|
go: {
|
|
826
826
|
method: 'client.Organizations.Billing.Summary',
|
|
827
827
|
example:
|
|
828
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
828
|
+
'package 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/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',
|
|
829
829
|
},
|
|
830
830
|
cli: {
|
|
831
831
|
method: 'billing summary',
|
|
@@ -860,7 +860,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
860
860
|
go: {
|
|
861
861
|
method: 'client.Organizations.Billing.Cost',
|
|
862
862
|
example:
|
|
863
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationDailyCost, err := client.Organizations.Billing.Cost(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingCostParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationDailyCost.Currency)\n}\n',
|
|
863
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
864
864
|
},
|
|
865
865
|
cli: {
|
|
866
866
|
method: 'billing cost',
|
|
@@ -906,7 +906,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
906
906
|
go: {
|
|
907
907
|
method: 'client.Organizations.Billing.History',
|
|
908
908
|
example:
|
|
909
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbillingHistoryEntryList, err := client.Organizations.Billing.History(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingHistoryParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", billingHistoryEntryList.Items)\n}\n',
|
|
909
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
910
910
|
},
|
|
911
911
|
cli: {
|
|
912
912
|
method: 'billing history',
|
|
@@ -942,7 +942,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
942
942
|
go: {
|
|
943
943
|
method: 'client.Organizations.Billing.TopUp',
|
|
944
944
|
example:
|
|
945
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.TopUp(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingTopUpParams{\n\t\t\tAmount: "50.00",\n\t\t\tIdempotencyKey: "Idempotency-Key",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
945
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
946
946
|
},
|
|
947
947
|
cli: {
|
|
948
948
|
method: 'billing top_up',
|
|
@@ -978,7 +978,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
978
978
|
go: {
|
|
979
979
|
method: 'client.Organizations.Billing.Recharge',
|
|
980
980
|
example:
|
|
981
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationBillingSummary, err := client.Organizations.Billing.Recharge(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingRechargeParams{\n\t\t\tIdempotencyKey: "Idempotency-Key",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationBillingSummary.DailyCost)\n}\n',
|
|
981
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
982
982
|
},
|
|
983
983
|
cli: {
|
|
984
984
|
method: 'billing recharge',
|
|
@@ -1014,7 +1014,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1014
1014
|
go: {
|
|
1015
1015
|
method: 'client.Organizations.Billing.Statements',
|
|
1016
1016
|
example:
|
|
1017
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationUsageStatement, err := client.Organizations.Billing.Statements(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingStatementsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationUsageStatement.Currency)\n}\n',
|
|
1017
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1018
1018
|
},
|
|
1019
1019
|
cli: {
|
|
1020
1020
|
method: 'billing statements',
|
|
@@ -1050,7 +1050,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1050
1050
|
go: {
|
|
1051
1051
|
method: 'client.Organizations.Billing.RechargePolicy.Get',
|
|
1052
1052
|
example:
|
|
1053
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationRechargePolicy, err := client.Organizations.Billing.RechargePolicy.Get(context.TODO(), "organization_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationRechargePolicy.Policy)\n}\n',
|
|
1053
|
+
'package 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/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',
|
|
1054
1054
|
},
|
|
1055
1055
|
cli: {
|
|
1056
1056
|
method: 'recharge_policy get',
|
|
@@ -1090,7 +1090,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1090
1090
|
go: {
|
|
1091
1091
|
method: 'client.Organizations.Billing.RechargePolicy.Update',
|
|
1092
1092
|
example:
|
|
1093
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/organizations"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\torganizationRechargePolicy, err := client.Organizations.Billing.RechargePolicy.Update(\n\t\tcontext.TODO(),\n\t\t"organization_id",\n\t\torganizations.BillingRechargePolicyUpdateParams{\n\t\t\tPolicy: organizations.RechargePolicyModeAutomatic,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", organizationRechargePolicy.Policy)\n}\n',
|
|
1093
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1094
1094
|
},
|
|
1095
1095
|
cli: {
|
|
1096
1096
|
method: 'recharge_policy update',
|
|
@@ -1125,7 +1125,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1125
1125
|
go: {
|
|
1126
1126
|
method: 'client.Quotas.Get',
|
|
1127
1127
|
example:
|
|
1128
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/quotas"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tquota, err := client.Quotas.Get(context.TODO(), quotas.QuotaGetParamsRegionUsSva2)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quota.Compute)\n}\n',
|
|
1128
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1129
1129
|
},
|
|
1130
1130
|
cli: {
|
|
1131
1131
|
method: 'quotas get',
|
|
@@ -1159,7 +1159,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1159
1159
|
go: {
|
|
1160
1160
|
method: 'client.Quotas.List',
|
|
1161
1161
|
example:
|
|
1162
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/quotas"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
1162
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1163
1163
|
},
|
|
1164
1164
|
cli: {
|
|
1165
1165
|
method: 'quotas list',
|
|
@@ -1194,7 +1194,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1194
1194
|
go: {
|
|
1195
1195
|
method: 'client.Usage.Get',
|
|
1196
1196
|
example:
|
|
1197
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tusage, err := client.Usage.Get(context.TODO(), "123e4567-e89b-12d3-a456-426614174000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", usage.ProjectID)\n}\n',
|
|
1197
|
+
'package 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/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',
|
|
1198
1198
|
},
|
|
1199
1199
|
cli: {
|
|
1200
1200
|
method: 'usage get',
|
|
@@ -1240,7 +1240,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1240
1240
|
go: {
|
|
1241
1241
|
method: 'client.Usage.List',
|
|
1242
1242
|
example:
|
|
1243
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/usage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Usage.List(context.TODO(), usage.UsageListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1243
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1244
1244
|
},
|
|
1245
1245
|
cli: {
|
|
1246
1246
|
method: 'usage list',
|
|
@@ -1274,7 +1274,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1274
1274
|
go: {
|
|
1275
1275
|
method: 'client.AuditLogs.Get',
|
|
1276
1276
|
example:
|
|
1277
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tauditLog, err := client.AuditLogs.Get(context.TODO(), "audit_log_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", auditLog.ID)\n}\n',
|
|
1277
|
+
'package 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/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',
|
|
1278
1278
|
},
|
|
1279
1279
|
cli: {
|
|
1280
1280
|
method: 'audit_logs get',
|
|
@@ -1324,7 +1324,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1324
1324
|
go: {
|
|
1325
1325
|
method: 'client.AuditLogs.List',
|
|
1326
1326
|
example:
|
|
1327
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/audit_logs"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.AuditLogs.List(context.TODO(), audit_logs.AuditLogListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1327
|
+
'package 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/audit_logs"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
@@ -1358,7 +1358,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1358
1358
|
go: {
|
|
1359
1359
|
method: 'client.Projects.New',
|
|
1360
1360
|
example:
|
|
1361
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/projects"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tproject, err := client.Projects.New(context.TODO(), projects.ProjectNewParams{\n\t\tName: "My Project",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", project.ID)\n}\n',
|
|
1361
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1362
1362
|
},
|
|
1363
1363
|
cli: {
|
|
1364
1364
|
method: 'projects create',
|
|
@@ -1392,7 +1392,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1392
1392
|
go: {
|
|
1393
1393
|
method: 'client.Projects.Get',
|
|
1394
1394
|
example:
|
|
1395
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tproject, err := client.Projects.Get(context.TODO(), "project_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", project.ID)\n}\n',
|
|
1395
|
+
'package 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/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',
|
|
1396
1396
|
},
|
|
1397
1397
|
cli: {
|
|
1398
1398
|
method: 'projects get',
|
|
@@ -1426,7 +1426,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1426
1426
|
go: {
|
|
1427
1427
|
method: 'client.Projects.Update',
|
|
1428
1428
|
example:
|
|
1429
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/projects"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tproject, err := client.Projects.Update(\n\t\tcontext.TODO(),\n\t\t"project_id",\n\t\tprojects.ProjectUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", project.ID)\n}\n',
|
|
1429
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1430
1430
|
},
|
|
1431
1431
|
cli: {
|
|
1432
1432
|
method: 'projects update',
|
|
@@ -1458,7 +1458,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1458
1458
|
go: {
|
|
1459
1459
|
method: 'client.Projects.Delete',
|
|
1460
1460
|
example:
|
|
1461
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Projects.Delete(context.TODO(), "project_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
1461
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1462
1462
|
},
|
|
1463
1463
|
cli: {
|
|
1464
1464
|
method: 'projects delete',
|
|
@@ -1492,7 +1492,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1492
1492
|
go: {
|
|
1493
1493
|
method: 'client.Projects.List',
|
|
1494
1494
|
example:
|
|
1495
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/projects"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Projects.List(context.TODO(), projects.ProjectListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1495
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1496
1496
|
},
|
|
1497
1497
|
cli: {
|
|
1498
1498
|
method: 'projects list',
|
|
@@ -1526,7 +1526,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1526
1526
|
go: {
|
|
1527
1527
|
method: 'client.Regions.Get',
|
|
1528
1528
|
example:
|
|
1529
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tregion, err := client.Regions.Get(context.TODO(), "us-sva-2")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", region.Availability)\n}\n',
|
|
1529
|
+
'package 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/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',
|
|
1530
1530
|
},
|
|
1531
1531
|
cli: {
|
|
1532
1532
|
method: 'regions get',
|
|
@@ -1571,7 +1571,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1571
1571
|
go: {
|
|
1572
1572
|
method: 'client.Regions.List',
|
|
1573
1573
|
example:
|
|
1574
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/regions"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Regions.List(context.TODO(), regions.RegionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1574
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1575
1575
|
},
|
|
1576
1576
|
cli: {
|
|
1577
1577
|
method: 'regions list',
|
|
@@ -1605,7 +1605,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1605
1605
|
go: {
|
|
1606
1606
|
method: 'client.InstanceTypes.Get',
|
|
1607
1607
|
example:
|
|
1608
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/instance_types"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tinstanceType, err := client.InstanceTypes.Get(\n\t\tcontext.TODO(),\n\t\tinstance_types.InstanceTypeGetParamsRegionUsSva2,\n\t\t"n1-standard-8",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", instanceType.NetworkBandwidthGbps)\n}\n',
|
|
1608
|
+
'package 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/instance_types"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1609
1609
|
},
|
|
1610
1610
|
cli: {
|
|
1611
1611
|
method: 'instance_types get',
|
|
@@ -1655,7 +1655,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1655
1655
|
go: {
|
|
1656
1656
|
method: 'client.InstanceTypes.List',
|
|
1657
1657
|
example:
|
|
1658
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/instance_types"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.InstanceTypes.List(context.TODO(), instance_types.InstanceTypeListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1658
|
+
'package 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/instance_types"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
1659
1659
|
},
|
|
1660
1660
|
cli: {
|
|
1661
1661
|
method: 'instance_types list',
|
|
@@ -1701,7 +1701,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1701
1701
|
go: {
|
|
1702
1702
|
method: 'client.Compute.VMs.New',
|
|
1703
1703
|
example:
|
|
1704
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-8",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-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',
|
|
1704
|
+
'package 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"),\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',
|
|
1705
1705
|
},
|
|
1706
1706
|
cli: {
|
|
1707
1707
|
method: 'vms create',
|
|
@@ -1736,7 +1736,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1736
1736
|
go: {
|
|
1737
1737
|
method: 'client.Compute.VMs.Get',
|
|
1738
1738
|
example:
|
|
1739
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvm, err := client.Compute.VMs.Get(context.TODO(), "vm_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vm.ID)\n}\n',
|
|
1739
|
+
'package 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/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',
|
|
1740
1740
|
},
|
|
1741
1741
|
cli: {
|
|
1742
1742
|
method: 'vms get',
|
|
@@ -1776,7 +1776,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1776
1776
|
go: {
|
|
1777
1777
|
method: 'client.Compute.VMs.Update',
|
|
1778
1778
|
example:
|
|
1779
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.Update(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
1779
|
+
'package 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)\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',
|
|
1780
1780
|
},
|
|
1781
1781
|
cli: {
|
|
1782
1782
|
method: 'vms update',
|
|
@@ -1810,7 +1810,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1810
1810
|
go: {
|
|
1811
1811
|
method: 'client.Compute.VMs.Delete',
|
|
1812
1812
|
example:
|
|
1813
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.Delete(context.TODO(), "vm_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
1813
|
+
'package 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/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',
|
|
1814
1814
|
},
|
|
1815
1815
|
cli: {
|
|
1816
1816
|
method: 'vms delete',
|
|
@@ -1856,7 +1856,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1856
1856
|
go: {
|
|
1857
1857
|
method: 'client.Compute.VMs.List',
|
|
1858
1858
|
example:
|
|
1859
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Compute.VMs.List(context.TODO(), compute.VMListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
1859
|
+
'package 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)\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',
|
|
1860
1860
|
},
|
|
1861
1861
|
cli: {
|
|
1862
1862
|
method: 'vms list',
|
|
@@ -1890,7 +1890,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1890
1890
|
go: {
|
|
1891
1891
|
method: 'client.Compute.VMs.Restart',
|
|
1892
1892
|
example:
|
|
1893
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.VMs.Restart(context.TODO(), "vm_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
1893
|
+
'package 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/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',
|
|
1894
1894
|
},
|
|
1895
1895
|
cli: {
|
|
1896
1896
|
method: 'vms restart',
|
|
@@ -1934,7 +1934,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1934
1934
|
go: {
|
|
1935
1935
|
method: 'client.Compute.VMs.Availability.New',
|
|
1936
1936
|
example:
|
|
1937
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.VMs.Availability.New(context.TODO(), compute.VMAvailabilityNewParams{\n\t\tBootVolume: compute.VMAvailabilityNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-8",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-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',
|
|
1937
|
+
'package main\n\nimport (\n\t"context"\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"),\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',
|
|
1938
1938
|
},
|
|
1939
1939
|
cli: {
|
|
1940
1940
|
method: 'availability create',
|
|
@@ -1973,7 +1973,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1973
1973
|
go: {
|
|
1974
1974
|
method: 'client.Compute.VMs.Availability.Update',
|
|
1975
1975
|
example:
|
|
1976
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.VMs.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
1976
|
+
'package main\n\nimport (\n\t"context"\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)\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',
|
|
1977
1977
|
},
|
|
1978
1978
|
cli: {
|
|
1979
1979
|
method: 'availability update',
|
|
@@ -2019,7 +2019,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2019
2019
|
go: {
|
|
2020
2020
|
method: 'client.Compute.VMs.Cost.New',
|
|
2021
2021
|
example:
|
|
2022
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
2022
|
+
'package 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"),\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',
|
|
2023
2023
|
},
|
|
2024
2024
|
cli: {
|
|
2025
2025
|
method: 'cost create',
|
|
@@ -2061,7 +2061,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2061
2061
|
go: {
|
|
2062
2062
|
method: 'client.Compute.VMs.Cost.Update',
|
|
2063
2063
|
example:
|
|
2064
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
2064
|
+
'package 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)\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',
|
|
2065
2065
|
},
|
|
2066
2066
|
cli: {
|
|
2067
2067
|
method: 'cost update',
|
|
@@ -2105,7 +2105,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2105
2105
|
go: {
|
|
2106
2106
|
method: 'client.Compute.VMs.Volumes.List',
|
|
2107
2107
|
example:
|
|
2108
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Compute.VMs.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
2108
|
+
'package 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)\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',
|
|
2109
2109
|
},
|
|
2110
2110
|
cli: {
|
|
2111
2111
|
method: 'volumes list',
|
|
@@ -2144,7 +2144,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2144
2144
|
go: {
|
|
2145
2145
|
method: 'client.Compute.VMs.OSImages.List',
|
|
2146
2146
|
example:
|
|
2147
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Compute.VMs.OSImages.List(context.TODO(), compute.VMOSImageListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
2147
|
+
'package 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)\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',
|
|
2148
2148
|
},
|
|
2149
2149
|
cli: {
|
|
2150
2150
|
method: 'os_images list',
|
|
@@ -2186,7 +2186,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2186
2186
|
go: {
|
|
2187
2187
|
method: 'client.Compute.VMs.Metrics.List',
|
|
2188
2188
|
example:
|
|
2189
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvmMetrics, err := client.Compute.VMs.Metrics.List(\n\t\tcontext.TODO(),\n\t\t"vm_id",\n\t\tcompute.VMMetricListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vmMetrics.VMID)\n}\n',
|
|
2189
|
+
'package 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)\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',
|
|
2190
2190
|
},
|
|
2191
2191
|
cli: {
|
|
2192
2192
|
method: 'metrics list',
|
|
@@ -2220,7 +2220,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2220
2220
|
go: {
|
|
2221
2221
|
method: 'client.Compute.VMs.MetricDescriptors.List',
|
|
2222
2222
|
example:
|
|
2223
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvmMetricDescriptorList, err := client.Compute.VMs.MetricDescriptors.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vmMetricDescriptorList.Items)\n}\n',
|
|
2223
|
+
'package 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/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',
|
|
2224
2224
|
},
|
|
2225
2225
|
cli: {
|
|
2226
2226
|
method: 'metric_descriptors list',
|
|
@@ -2262,7 +2262,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2262
2262
|
go: {
|
|
2263
2263
|
method: 'client.Compute.Volumes.New',
|
|
2264
2264
|
example:
|
|
2265
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.New(context.TODO(), compute.VolumeNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2265
|
+
'package 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"),\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',
|
|
2266
2266
|
},
|
|
2267
2267
|
cli: {
|
|
2268
2268
|
method: 'volumes create',
|
|
@@ -2297,7 +2297,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2297
2297
|
go: {
|
|
2298
2298
|
method: 'client.Compute.Volumes.Get',
|
|
2299
2299
|
example:
|
|
2300
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvolume, err := client.Compute.Volumes.Get(context.TODO(), "volume_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", volume.ID)\n}\n',
|
|
2300
|
+
'package 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/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',
|
|
2301
2301
|
},
|
|
2302
2302
|
cli: {
|
|
2303
2303
|
method: 'volumes get',
|
|
@@ -2331,7 +2331,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2331
2331
|
go: {
|
|
2332
2332
|
method: 'client.Compute.Volumes.Update',
|
|
2333
2333
|
example:
|
|
2334
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.Update(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2334
|
+
'package 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)\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',
|
|
2335
2335
|
},
|
|
2336
2336
|
cli: {
|
|
2337
2337
|
method: 'volumes update',
|
|
@@ -2365,7 +2365,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2365
2365
|
go: {
|
|
2366
2366
|
method: 'client.Compute.Volumes.Delete',
|
|
2367
2367
|
example:
|
|
2368
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.Delete(context.TODO(), "volume_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2368
|
+
'package 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/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',
|
|
2369
2369
|
},
|
|
2370
2370
|
cli: {
|
|
2371
2371
|
method: 'volumes delete',
|
|
@@ -2412,7 +2412,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2412
2412
|
go: {
|
|
2413
2413
|
method: 'client.Compute.Volumes.List',
|
|
2414
2414
|
example:
|
|
2415
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Compute.Volumes.List(context.TODO(), compute.VolumeListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
2415
|
+
'package 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)\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',
|
|
2416
2416
|
},
|
|
2417
2417
|
cli: {
|
|
2418
2418
|
method: 'volumes list',
|
|
@@ -2446,7 +2446,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2446
2446
|
go: {
|
|
2447
2447
|
method: 'client.Compute.Volumes.Attach',
|
|
2448
2448
|
example:
|
|
2449
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.Attach(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeAttachParams{\n\t\t\tVMID: "123e4567-e89b-12d3-a456-426614174000",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2449
|
+
'package 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)\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',
|
|
2450
2450
|
},
|
|
2451
2451
|
cli: {
|
|
2452
2452
|
method: 'volumes attach',
|
|
@@ -2481,7 +2481,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2481
2481
|
go: {
|
|
2482
2482
|
method: 'client.Compute.Volumes.Detach',
|
|
2483
2483
|
example:
|
|
2484
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Compute.Volumes.Detach(context.TODO(), "volume_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2484
|
+
'package 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/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',
|
|
2485
2485
|
},
|
|
2486
2486
|
cli: {
|
|
2487
2487
|
method: 'volumes detach',
|
|
@@ -2521,7 +2521,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2521
2521
|
go: {
|
|
2522
2522
|
method: 'client.Compute.Volumes.Availability.New',
|
|
2523
2523
|
example:
|
|
2524
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.Volumes.Availability.New(context.TODO(), compute.VolumeAvailabilityNewParams{\n\t\tName: "my-data-volume",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
2524
|
+
'package main\n\nimport (\n\t"context"\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"),\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',
|
|
2525
2525
|
},
|
|
2526
2526
|
cli: {
|
|
2527
2527
|
method: 'availability create',
|
|
@@ -2554,7 +2554,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2554
2554
|
go: {
|
|
2555
2555
|
method: 'client.Compute.Volumes.Availability.Update',
|
|
2556
2556
|
example:
|
|
2557
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Compute.Volumes.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"volume_id",\n\t\tcompute.VolumeAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
2557
|
+
'package main\n\nimport (\n\t"context"\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)\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',
|
|
2558
2558
|
},
|
|
2559
2559
|
cli: {
|
|
2560
2560
|
method: 'availability update',
|
|
@@ -2597,7 +2597,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2597
2597
|
go: {
|
|
2598
2598
|
method: 'client.Compute.Volumes.Cost.New',
|
|
2599
2599
|
example:
|
|
2600
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
2600
|
+
'package 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"),\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',
|
|
2601
2601
|
},
|
|
2602
2602
|
cli: {
|
|
2603
2603
|
method: 'cost create',
|
|
@@ -2633,7 +2633,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2633
2633
|
go: {
|
|
2634
2634
|
method: 'client.Compute.Volumes.Cost.Update',
|
|
2635
2635
|
example:
|
|
2636
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
2636
|
+
'package 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)\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',
|
|
2637
2637
|
},
|
|
2638
2638
|
cli: {
|
|
2639
2639
|
method: 'cost update',
|
|
@@ -2674,7 +2674,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2674
2674
|
go: {
|
|
2675
2675
|
method: 'client.Networking.VPCs.New',
|
|
2676
2676
|
example:
|
|
2677
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.New(context.TODO(), networking.VPCNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSubnetName: "my-subnet",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2677
|
+
'package 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/networking"\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"),\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',
|
|
2678
2678
|
},
|
|
2679
2679
|
cli: {
|
|
2680
2680
|
method: 'vpcs create',
|
|
@@ -2709,7 +2709,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2709
2709
|
go: {
|
|
2710
2710
|
method: 'client.Networking.VPCs.Get',
|
|
2711
2711
|
example:
|
|
2712
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tvpc, err := client.Networking.VPCs.Get(context.TODO(), "vpc_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", vpc.ID)\n}\n',
|
|
2712
|
+
'package 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/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',
|
|
2713
2713
|
},
|
|
2714
2714
|
cli: {
|
|
2715
2715
|
method: 'vpcs get',
|
|
@@ -2743,7 +2743,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2743
2743
|
go: {
|
|
2744
2744
|
method: 'client.Networking.VPCs.Update',
|
|
2745
2745
|
example:
|
|
2746
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.VPCUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2746
|
+
'package 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/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
2747
2747
|
},
|
|
2748
2748
|
cli: {
|
|
2749
2749
|
method: 'vpcs update',
|
|
@@ -2777,7 +2777,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2777
2777
|
go: {
|
|
2778
2778
|
method: 'client.Networking.VPCs.Delete',
|
|
2779
2779
|
example:
|
|
2780
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.VPCs.Delete(context.TODO(), "vpc_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
2780
|
+
'package 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/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',
|
|
2781
2781
|
},
|
|
2782
2782
|
cli: {
|
|
2783
2783
|
method: 'vpcs delete',
|
|
@@ -2820,7 +2820,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2820
2820
|
go: {
|
|
2821
2821
|
method: 'client.Networking.VPCs.List',
|
|
2822
2822
|
example:
|
|
2823
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Networking.VPCs.List(context.TODO(), networking.VPCListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
2823
|
+
'package 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/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
2824
2824
|
},
|
|
2825
2825
|
cli: {
|
|
2826
2826
|
method: 'vpcs list',
|
|
@@ -2858,7 +2858,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2858
2858
|
go: {
|
|
2859
2859
|
method: 'client.Networking.VPCs.Availability.New',
|
|
2860
2860
|
example:
|
|
2861
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Networking.VPCs.Availability.New(context.TODO(), networking.VPCAvailabilityNewParams{\n\t\tName: "my-vpc",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSubnetName: "my-subnet",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
2861
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/networking"\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"),\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',
|
|
2862
2862
|
},
|
|
2863
2863
|
cli: {
|
|
2864
2864
|
method: 'availability create',
|
|
@@ -2891,7 +2891,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2891
2891
|
go: {
|
|
2892
2892
|
method: 'client.Networking.VPCs.Availability.Update',
|
|
2893
2893
|
example:
|
|
2894
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.Networking.VPCs.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.VPCAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
2894
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
2895
2895
|
},
|
|
2896
2896
|
cli: {
|
|
2897
2897
|
method: 'availability update',
|
|
@@ -2932,7 +2932,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2932
2932
|
go: {
|
|
2933
2933
|
method: 'client.Networking.VPCs.Cost.New',
|
|
2934
2934
|
example:
|
|
2935
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
2935
|
+
'package 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/networking"\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"),\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',
|
|
2936
2936
|
},
|
|
2937
2937
|
cli: {
|
|
2938
2938
|
method: 'cost create',
|
|
@@ -2968,7 +2968,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2968
2968
|
go: {
|
|
2969
2969
|
method: 'client.Networking.VPCs.Cost.Update',
|
|
2970
2970
|
example:
|
|
2971
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
2971
|
+
'package 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/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
2972
2972
|
},
|
|
2973
2973
|
cli: {
|
|
2974
2974
|
method: 'cost update',
|
|
@@ -3010,7 +3010,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3010
3010
|
go: {
|
|
3011
3011
|
method: 'client.Networking.FirewallRules.New',
|
|
3012
3012
|
example:
|
|
3013
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.FirewallRules.New(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.FirewallRuleNewParams{\n\t\t\tDestinationAddress: "10.0.0.0/25",\n\t\t\tDestinationPorts: []string{"22", "80", "443"},\n\t\t\tName: "my-firewall-rule",\n\t\t\tProtocol: networking.FirewallRuleNewParamsProtocolTcp,\n\t\t\tSourceAddress: "0.0.0.0/0",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3013
|
+
'package 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/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3014
3014
|
},
|
|
3015
3015
|
cli: {
|
|
3016
3016
|
method: 'firewall_rules create',
|
|
@@ -3045,7 +3045,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3045
3045
|
go: {
|
|
3046
3046
|
method: 'client.Networking.FirewallRules.Get',
|
|
3047
3047
|
example:
|
|
3048
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tfirewallRule, err := client.Networking.FirewallRules.Get(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\t"firewall_rule_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", firewallRule.ID)\n}\n',
|
|
3048
|
+
'package 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/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',
|
|
3049
3049
|
},
|
|
3050
3050
|
cli: {
|
|
3051
3051
|
method: 'firewall_rules get',
|
|
@@ -3089,7 +3089,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3089
3089
|
go: {
|
|
3090
3090
|
method: 'client.Networking.FirewallRules.Update',
|
|
3091
3091
|
example:
|
|
3092
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.FirewallRules.Update(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\t"firewall_rule_id",\n\t\tnetworking.FirewallRuleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3092
|
+
'package 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/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3093
3093
|
},
|
|
3094
3094
|
cli: {
|
|
3095
3095
|
method: 'firewall_rules update',
|
|
@@ -3124,7 +3124,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3124
3124
|
go: {
|
|
3125
3125
|
method: 'client.Networking.FirewallRules.Delete',
|
|
3126
3126
|
example:
|
|
3127
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.Networking.FirewallRules.Delete(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\t"firewall_rule_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3127
|
+
'package 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/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',
|
|
3128
3128
|
},
|
|
3129
3129
|
cli: {
|
|
3130
3130
|
method: 'firewall_rules delete',
|
|
@@ -3168,7 +3168,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3168
3168
|
go: {
|
|
3169
3169
|
method: 'client.Networking.FirewallRules.List',
|
|
3170
3170
|
example:
|
|
3171
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/networking"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Networking.FirewallRules.List(\n\t\tcontext.TODO(),\n\t\t"vpc_id",\n\t\tnetworking.FirewallRuleListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3171
|
+
'package 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/networking"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3172
3172
|
},
|
|
3173
3173
|
cli: {
|
|
3174
3174
|
method: 'firewall_rules list',
|
|
@@ -3208,7 +3208,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3208
3208
|
go: {
|
|
3209
3209
|
method: 'client.RPCNodes.Flex.New',
|
|
3210
3210
|
example:
|
|
3211
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tflex, err := client.RPCNodes.Flex.New(context.TODO(), rpc_nodes.FlexNewParams{\n\t\tBlockchain: "ethereum",\n\t\tName: "my-ethereum-node",\n\t\tNetwork: "mainnet",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", flex.ID)\n}\n',
|
|
3211
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3212
3212
|
},
|
|
3213
3213
|
cli: {
|
|
3214
3214
|
method: 'flex create',
|
|
@@ -3243,7 +3243,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3243
3243
|
go: {
|
|
3244
3244
|
method: 'client.RPCNodes.Flex.Get',
|
|
3245
3245
|
example:
|
|
3246
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tflex, err := client.RPCNodes.Flex.Get(context.TODO(), "node_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", flex.ID)\n}\n',
|
|
3246
|
+
'package 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/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',
|
|
3247
3247
|
},
|
|
3248
3248
|
cli: {
|
|
3249
3249
|
method: 'flex get',
|
|
@@ -3277,7 +3277,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3277
3277
|
go: {
|
|
3278
3278
|
method: 'client.RPCNodes.Flex.Update',
|
|
3279
3279
|
example:
|
|
3280
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tflex, err := client.RPCNodes.Flex.Update(\n\t\tcontext.TODO(),\n\t\t"node_id",\n\t\trpc_nodes.FlexUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", flex.ID)\n}\n',
|
|
3280
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3281
3281
|
},
|
|
3282
3282
|
cli: {
|
|
3283
3283
|
method: 'flex update',
|
|
@@ -3309,7 +3309,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3309
3309
|
go: {
|
|
3310
3310
|
method: 'client.RPCNodes.Flex.Delete',
|
|
3311
3311
|
example:
|
|
3312
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.RPCNodes.Flex.Delete(context.TODO(), "node_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
3312
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3313
3313
|
},
|
|
3314
3314
|
cli: {
|
|
3315
3315
|
method: 'flex delete',
|
|
@@ -3352,7 +3352,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3352
3352
|
go: {
|
|
3353
3353
|
method: 'client.RPCNodes.Flex.List',
|
|
3354
3354
|
example:
|
|
3355
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Flex.List(context.TODO(), rpc_nodes.FlexListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3355
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3356
3356
|
},
|
|
3357
3357
|
cli: {
|
|
3358
3358
|
method: 'flex list',
|
|
@@ -3391,7 +3391,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3391
3391
|
go: {
|
|
3392
3392
|
method: 'client.RPCNodes.Flex.Blockchains.List',
|
|
3393
3393
|
example:
|
|
3394
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Flex.Blockchains.List(context.TODO(), rpc_nodes.FlexBlockchainListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3394
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3395
3395
|
},
|
|
3396
3396
|
cli: {
|
|
3397
3397
|
method: 'blockchains list',
|
|
@@ -3425,7 +3425,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3425
3425
|
go: {
|
|
3426
3426
|
method: 'client.RPCNodes.Dedicated.Get',
|
|
3427
3427
|
example:
|
|
3428
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tdedicated, err := client.RPCNodes.Dedicated.Get(context.TODO(), "node_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", dedicated.ID)\n}\n',
|
|
3428
|
+
'package 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/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',
|
|
3429
3429
|
},
|
|
3430
3430
|
cli: {
|
|
3431
3431
|
method: 'dedicated get',
|
|
@@ -3468,7 +3468,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3468
3468
|
go: {
|
|
3469
3469
|
method: 'client.RPCNodes.Dedicated.List',
|
|
3470
3470
|
example:
|
|
3471
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Dedicated.List(context.TODO(), rpc_nodes.DedicatedListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3471
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3472
3472
|
},
|
|
3473
3473
|
cli: {
|
|
3474
3474
|
method: 'dedicated list',
|
|
@@ -3508,7 +3508,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3508
3508
|
go: {
|
|
3509
3509
|
method: 'client.RPCNodes.Dedicated.Blockchains.List',
|
|
3510
3510
|
example:
|
|
3511
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/rpc_nodes"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.RPCNodes.Dedicated.Blockchains.List(context.TODO(), rpc_nodes.DedicatedBlockchainListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3511
|
+
'package 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/option"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3512
3512
|
},
|
|
3513
3513
|
cli: {
|
|
3514
3514
|
method: 'blockchains list',
|
|
@@ -3541,7 +3541,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3541
3541
|
go: {
|
|
3542
3542
|
method: 'client.NKS.KubernetesVersions.List',
|
|
3543
3543
|
example:
|
|
3544
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.KubernetesVersions.List(context.TODO(), nks.KubernetesVersionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3544
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3545
3545
|
},
|
|
3546
3546
|
cli: {
|
|
3547
3547
|
method: 'kubernetes_versions list',
|
|
@@ -3583,7 +3583,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3583
3583
|
go: {
|
|
3584
3584
|
method: 'client.NKS.Clusters.New',
|
|
3585
3585
|
example:
|
|
3586
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.New(context.TODO(), nks.ClusterNewParams{\n\t\tAutoscaling: true,\n\t\tKubernetesVersion: "v1.34.4",\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tVPCID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3586
|
+
'package 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/nks"\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"),\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',
|
|
3587
3587
|
},
|
|
3588
3588
|
cli: {
|
|
3589
3589
|
method: 'clusters create',
|
|
@@ -3618,7 +3618,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3618
3618
|
go: {
|
|
3619
3619
|
method: 'client.NKS.Clusters.Get',
|
|
3620
3620
|
example:
|
|
3621
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksCluster, err := client.NKS.Clusters.Get(context.TODO(), "cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksCluster.ID)\n}\n',
|
|
3621
|
+
'package 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/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',
|
|
3622
3622
|
},
|
|
3623
3623
|
cli: {
|
|
3624
3624
|
method: 'clusters get',
|
|
@@ -3652,7 +3652,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3652
3652
|
go: {
|
|
3653
3653
|
method: 'client.NKS.Clusters.Update',
|
|
3654
3654
|
example:
|
|
3655
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3655
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3656
3656
|
},
|
|
3657
3657
|
cli: {
|
|
3658
3658
|
method: 'clusters update',
|
|
@@ -3686,7 +3686,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3686
3686
|
go: {
|
|
3687
3687
|
method: 'client.NKS.Clusters.Delete',
|
|
3688
3688
|
example:
|
|
3689
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.Delete(context.TODO(), "cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
3689
|
+
'package 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/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',
|
|
3690
3690
|
},
|
|
3691
3691
|
cli: {
|
|
3692
3692
|
method: 'clusters delete',
|
|
@@ -3732,7 +3732,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3732
3732
|
go: {
|
|
3733
3733
|
method: 'client.NKS.Clusters.List',
|
|
3734
3734
|
example:
|
|
3735
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.List(context.TODO(), nks.ClusterListParams{\n\t\tProjectID: "project_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3735
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3736
3736
|
},
|
|
3737
3737
|
cli: {
|
|
3738
3738
|
method: 'clusters list',
|
|
@@ -3772,7 +3772,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3772
3772
|
go: {
|
|
3773
3773
|
method: 'client.NKS.Clusters.Availability.New',
|
|
3774
3774
|
example:
|
|
3775
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Availability.New(context.TODO(), nks.ClusterAvailabilityNewParams{\n\t\tAutoscaling: true,\n\t\tKubernetesVersion: "v1.34.4",\n\t\tName: "my-cluster",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tVPCID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
3775
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/nks"\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"),\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',
|
|
3776
3776
|
},
|
|
3777
3777
|
cli: {
|
|
3778
3778
|
method: 'availability create',
|
|
@@ -3805,7 +3805,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3805
3805
|
go: {
|
|
3806
3806
|
method: 'client.NKS.Clusters.Availability.Update',
|
|
3807
3807
|
example:
|
|
3808
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
3808
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3809
3809
|
},
|
|
3810
3810
|
cli: {
|
|
3811
3811
|
method: 'availability update',
|
|
@@ -3848,7 +3848,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3848
3848
|
go: {
|
|
3849
3849
|
method: 'client.NKS.Clusters.Cost.New',
|
|
3850
3850
|
example:
|
|
3851
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
3851
|
+
'package 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/nks"\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"),\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',
|
|
3852
3852
|
},
|
|
3853
3853
|
cli: {
|
|
3854
3854
|
method: 'cost create',
|
|
@@ -3884,7 +3884,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3884
3884
|
go: {
|
|
3885
3885
|
method: 'client.NKS.Clusters.Cost.Update',
|
|
3886
3886
|
example:
|
|
3887
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
3887
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3888
3888
|
},
|
|
3889
3889
|
cli: {
|
|
3890
3890
|
method: 'cost update',
|
|
@@ -3919,7 +3919,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3919
3919
|
go: {
|
|
3920
3920
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.Get',
|
|
3921
3921
|
example:
|
|
3922
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpersistentVolumeClaim, err := client.NKS.Clusters.PersistentVolumeClaims.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"persistent_volume_claim_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", persistentVolumeClaim.ID)\n}\n',
|
|
3922
|
+
'package 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/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',
|
|
3923
3923
|
},
|
|
3924
3924
|
cli: {
|
|
3925
3925
|
method: 'persistent_volume_claims get',
|
|
@@ -3964,7 +3964,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3964
3964
|
go: {
|
|
3965
3965
|
method: 'client.NKS.Clusters.PersistentVolumeClaims.List',
|
|
3966
3966
|
example:
|
|
3967
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.PersistentVolumeClaims.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPersistentVolumeClaimListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
3967
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
3968
3968
|
},
|
|
3969
3969
|
cli: {
|
|
3970
3970
|
method: 'persistent_volume_claims list',
|
|
@@ -3998,7 +3998,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3998
3998
|
go: {
|
|
3999
3999
|
method: 'client.NKS.Clusters.Kubeconfig.Get',
|
|
4000
4000
|
example:
|
|
4001
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tkubeconfig, err := client.NKS.Clusters.Kubeconfig.Get(context.TODO(), "cluster_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", kubeconfig.Kubeconfig)\n}\n',
|
|
4001
|
+
'package 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/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',
|
|
4002
4002
|
},
|
|
4003
4003
|
cli: {
|
|
4004
4004
|
method: 'kubeconfig get',
|
|
@@ -4033,7 +4033,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4033
4033
|
go: {
|
|
4034
4034
|
method: 'client.NKS.Clusters.Controllers.Get',
|
|
4035
4035
|
example:
|
|
4036
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksController, err := client.NKS.Clusters.Controllers.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"controller_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksController.ID)\n}\n',
|
|
4036
|
+
'package 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/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',
|
|
4037
4037
|
},
|
|
4038
4038
|
cli: {
|
|
4039
4039
|
method: 'controllers get',
|
|
@@ -4078,7 +4078,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4078
4078
|
go: {
|
|
4079
4079
|
method: 'client.NKS.Clusters.Controllers.List',
|
|
4080
4080
|
example:
|
|
4081
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Controllers.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterControllerListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4081
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4082
4082
|
},
|
|
4083
4083
|
cli: {
|
|
4084
4084
|
method: 'controllers list',
|
|
@@ -4113,7 +4113,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4113
4113
|
go: {
|
|
4114
4114
|
method: 'client.NKS.Clusters.Controllers.Volumes.Get',
|
|
4115
4115
|
example:
|
|
4116
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksControllerVolume, err := client.NKS.Clusters.Controllers.Volumes.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"controller_id",\n\t\t"volume_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksControllerVolume.ID)\n}\n',
|
|
4116
|
+
'package 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/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',
|
|
4117
4117
|
},
|
|
4118
4118
|
cli: {
|
|
4119
4119
|
method: 'volumes get',
|
|
@@ -4160,7 +4160,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4160
4160
|
go: {
|
|
4161
4161
|
method: 'client.NKS.Clusters.Controllers.Volumes.List',
|
|
4162
4162
|
example:
|
|
4163
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Controllers.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"controller_id",\n\t\tnks.ClusterControllerVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4163
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4164
4164
|
},
|
|
4165
4165
|
cli: {
|
|
4166
4166
|
method: 'volumes list',
|
|
@@ -4195,7 +4195,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4195
4195
|
go: {
|
|
4196
4196
|
method: 'client.NKS.Clusters.LoadBalancers.Get',
|
|
4197
4197
|
example:
|
|
4198
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksLoadBalancer, err := client.NKS.Clusters.LoadBalancers.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"load_balancer_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksLoadBalancer.ID)\n}\n',
|
|
4198
|
+
'package 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/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',
|
|
4199
4199
|
},
|
|
4200
4200
|
cli: {
|
|
4201
4201
|
method: 'load_balancers get',
|
|
@@ -4230,7 +4230,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4230
4230
|
go: {
|
|
4231
4231
|
method: 'client.NKS.Clusters.LoadBalancers.Update',
|
|
4232
4232
|
example:
|
|
4233
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.LoadBalancers.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"load_balancer_id",\n\t\tnks.ClusterLoadBalancerUpdateParams{\n\t\t\tPublicIPEnabled: true,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4233
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4234
4234
|
},
|
|
4235
4235
|
cli: {
|
|
4236
4236
|
method: 'load_balancers update',
|
|
@@ -4274,7 +4274,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4274
4274
|
go: {
|
|
4275
4275
|
method: 'client.NKS.Clusters.LoadBalancers.List',
|
|
4276
4276
|
example:
|
|
4277
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.LoadBalancers.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterLoadBalancerListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4277
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4278
4278
|
},
|
|
4279
4279
|
cli: {
|
|
4280
4280
|
method: 'load_balancers list',
|
|
@@ -4315,7 +4315,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4315
4315
|
go: {
|
|
4316
4316
|
method: 'client.NKS.Clusters.Pools.New',
|
|
4317
4317
|
example:
|
|
4318
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.Pools.New(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolNewParams{\n\t\t\tName: "my-node-pool",\n\t\t\tNodeConfig: nks.NKSNodePoolNodeConfigParam{\n\t\t\t\tBootVolume: nks.NKSNodePoolBootVolumeParam{\n\t\t\t\t\tSize: 100,\n\t\t\t\t\tType: compute.VolumeTypeABS,\n\t\t\t\t},\n\t\t\t\tInstanceType: "n1-standard-8",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4318
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4319
4319
|
},
|
|
4320
4320
|
cli: {
|
|
4321
4321
|
method: 'pools create',
|
|
@@ -4350,7 +4350,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4350
4350
|
go: {
|
|
4351
4351
|
method: 'client.NKS.Clusters.Pools.Get',
|
|
4352
4352
|
example:
|
|
4353
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksNodePool, err := client.NKS.Clusters.Pools.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksNodePool.ID)\n}\n',
|
|
4353
|
+
'package 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/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',
|
|
4354
4354
|
},
|
|
4355
4355
|
cli: {
|
|
4356
4356
|
method: 'pools get',
|
|
@@ -4391,7 +4391,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4391
4391
|
go: {
|
|
4392
4392
|
method: 'client.NKS.Clusters.Pools.Update',
|
|
4393
4393
|
example:
|
|
4394
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.Pools.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4394
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4395
4395
|
},
|
|
4396
4396
|
cli: {
|
|
4397
4397
|
method: 'pools update',
|
|
@@ -4426,7 +4426,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4426
4426
|
go: {
|
|
4427
4427
|
method: 'client.NKS.Clusters.Pools.Delete',
|
|
4428
4428
|
example:
|
|
4429
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.Pools.Delete(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4429
|
+
'package 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/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',
|
|
4430
4430
|
},
|
|
4431
4431
|
cli: {
|
|
4432
4432
|
method: 'pools delete',
|
|
@@ -4472,7 +4472,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4472
4472
|
go: {
|
|
4473
4473
|
method: 'client.NKS.Clusters.Pools.List',
|
|
4474
4474
|
example:
|
|
4475
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Pools.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4475
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4476
4476
|
},
|
|
4477
4477
|
cli: {
|
|
4478
4478
|
method: 'pools list',
|
|
@@ -4510,7 +4510,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4510
4510
|
go: {
|
|
4511
4511
|
method: 'client.NKS.Clusters.Pools.Availability.New',
|
|
4512
4512
|
example:
|
|
4513
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Pools.Availability.New(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\tnks.ClusterPoolAvailabilityNewParams{\n\t\t\tName: "my-node-pool",\n\t\t\tNodeConfig: nks.NKSNodePoolNodeConfigParam{\n\t\t\t\tBootVolume: nks.NKSNodePoolBootVolumeParam{\n\t\t\t\t\tSize: 100,\n\t\t\t\t\tType: compute.VolumeTypeABS,\n\t\t\t\t},\n\t\t\t\tInstanceType: "n1-standard-8",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
4513
|
+
'package main\n\nimport (\n\t"context"\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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4514
4514
|
},
|
|
4515
4515
|
cli: {
|
|
4516
4516
|
method: 'availability create',
|
|
@@ -4549,7 +4549,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4549
4549
|
go: {
|
|
4550
4550
|
method: 'client.NKS.Clusters.Pools.Availability.Update',
|
|
4551
4551
|
example:
|
|
4552
|
-
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\terr := client.NKS.Clusters.Pools.Availability.Update(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolAvailabilityUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
|
|
4552
|
+
'package main\n\nimport (\n\t"context"\n\n\t"github.com/nirvana-labs/nirvana-go/v2"\n\t"github.com/nirvana-labs/nirvana-go/v2/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4553
4553
|
},
|
|
4554
4554
|
cli: {
|
|
4555
4555
|
method: 'availability update',
|
|
@@ -4590,7 +4590,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4590
4590
|
go: {
|
|
4591
4591
|
method: 'client.NKS.Clusters.Pools.Cost.New',
|
|
4592
4592
|
example:
|
|
4593
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
4593
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4594
4594
|
},
|
|
4595
4595
|
cli: {
|
|
4596
4596
|
method: 'cost create',
|
|
@@ -4632,7 +4632,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4632
4632
|
go: {
|
|
4633
4633
|
method: 'client.NKS.Clusters.Pools.Cost.Update',
|
|
4634
4634
|
example:
|
|
4635
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\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',
|
|
4635
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4636
4636
|
},
|
|
4637
4637
|
cli: {
|
|
4638
4638
|
method: 'cost update',
|
|
@@ -4667,7 +4667,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4667
4667
|
go: {
|
|
4668
4668
|
method: 'client.NKS.Clusters.Pools.Nodes.Get',
|
|
4669
4669
|
example:
|
|
4670
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksNode, err := client.NKS.Clusters.Pools.Nodes.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksNode.ID)\n}\n',
|
|
4670
|
+
'package 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/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',
|
|
4671
4671
|
},
|
|
4672
4672
|
cli: {
|
|
4673
4673
|
method: 'nodes get',
|
|
@@ -4702,7 +4702,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4702
4702
|
go: {
|
|
4703
4703
|
method: 'client.NKS.Clusters.Pools.Nodes.Delete',
|
|
4704
4704
|
example:
|
|
4705
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\toperation, err := client.NKS.Clusters.Pools.Nodes.Delete(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n',
|
|
4705
|
+
'package 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/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',
|
|
4706
4706
|
},
|
|
4707
4707
|
cli: {
|
|
4708
4708
|
method: 'nodes delete',
|
|
@@ -4747,7 +4747,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4747
4747
|
go: {
|
|
4748
4748
|
method: 'client.NKS.Clusters.Pools.Nodes.List',
|
|
4749
4749
|
example:
|
|
4750
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Pools.Nodes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolNodeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4750
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4751
4751
|
},
|
|
4752
4752
|
cli: {
|
|
4753
4753
|
method: 'nodes list',
|
|
@@ -4782,7 +4782,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4782
4782
|
go: {
|
|
4783
4783
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.Get',
|
|
4784
4784
|
example:
|
|
4785
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tnksNodeVolume, err := client.NKS.Clusters.Pools.Nodes.Volumes.Get(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t\t"volume_id",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", nksNodeVolume.ID)\n}\n',
|
|
4785
|
+
'package 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/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',
|
|
4786
4786
|
},
|
|
4787
4787
|
cli: {
|
|
4788
4788
|
method: 'volumes get',
|
|
@@ -4830,7 +4830,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4830
4830
|
go: {
|
|
4831
4831
|
method: 'client.NKS.Clusters.Pools.Nodes.Volumes.List',
|
|
4832
4832
|
example:
|
|
4833
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Pools.Nodes.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\t"node_id",\n\t\tnks.ClusterPoolNodeVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4833
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4834
4834
|
},
|
|
4835
4835
|
cli: {
|
|
4836
4836
|
method: 'volumes list',
|
|
@@ -4877,7 +4877,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4877
4877
|
go: {
|
|
4878
4878
|
method: 'client.NKS.Clusters.Pools.Volumes.List',
|
|
4879
4879
|
example:
|
|
4880
|
-
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/nks"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.NKS.Clusters.Pools.Volumes.List(\n\t\tcontext.TODO(),\n\t\t"cluster_id",\n\t\t"pool_id",\n\t\tnks.ClusterPoolVolumeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
|
|
4880
|
+
'package 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/nks"\n\t"github.com/nirvana-labs/nirvana-go/v2/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',
|
|
4881
4881
|
},
|
|
4882
4882
|
cli: {
|
|
4883
4883
|
method: 'volumes list',
|
|
@@ -4897,17 +4897,17 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
|
|
|
4897
4897
|
{
|
|
4898
4898
|
language: 'go',
|
|
4899
4899
|
content:
|
|
4900
|
-
'# Nirvana Labs Go API Library\n\n<a href="https://pkg.go.dev/github.com/nirvana-labs/nirvana-go"><img src="https://pkg.go.dev/badge/github.com/nirvana-labs/nirvana-go.svg" alt="Go Reference"></a>\n\nThe Nirvana Labs Go library provides convenient access to the [Nirvana Labs REST API](https://docs.nirvanalabs.io)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Nirvana Labs MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40nirvana-labs%2Fnirvana-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuaXJ2YW5hLWxhYnMvbmlydmFuYS1tY3AiXSwiZW52Ijp7Ik5JUlZBTkFfTEFCU19BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40nirvana-labs%2Fnirvana-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nirvana-labs%2Fnirvana-mcp%22%5D%2C%22env%22%3A%7B%22NIRVANA_LABS_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/nirvana-labs/nirvana-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/nirvana-labs/nirvana-go@v1.98.9\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/compute"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/shared"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("NIRVANA_LABS_API_KEY")\n\t)\n\toperation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", operation.ID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Compute.VMs.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/nirvana-labs/nirvana-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Compute.VMs.ListAutoPaging(context.TODO(), compute.VMListParams{\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tLimit: nirvana.Int(10),\n})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tvm := iter.Current()\n\tfmt.Printf("%+v\\n", vm)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Compute.VMs.List(context.TODO(), compute.VMListParams{\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tLimit: nirvana.Int(10),\n})\nfor page != nil {\n\tfor _, vm := range page.Items {\n\t\tfmt.Printf("%+v\\n", vm)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{\n\tBootVolume: compute.VMNewParamsBootVolume{\n\t\tSize: 100,\n\t\tType: compute.VolumeTypeABS,\n\t},\n\tInstanceType: "n1-standard-2",\n\tName: "my-vm",\n\tOSImageName: "ubuntu-noble-2025-10-01",\n\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\tPublicIPEnabled: true,\n\tRegion: shared.RegionNameUsSva2,\n\tSSHKey: compute.SSHKeyRequestParam{\n\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t},\n\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n})\nif err != nil {\n\tvar apierr *nirvana.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v1/compute/vms": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Compute.VMs.New(\n\tctx,\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := nirvana.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Compute.VMs.New(\n\tcontext.TODO(),\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\noperation, err := client.Compute.VMs.New(\n\tcontext.TODO(),\n\tcompute.VMNewParams{\n\t\tBootVolume: compute.VMNewParamsBootVolume{\n\t\t\tSize: 100,\n\t\t\tType: compute.VolumeTypeABS,\n\t\t},\n\t\tInstanceType: "n1-standard-2",\n\t\tName: "my-vm",\n\t\tOSImageName: "ubuntu-noble-2025-10-01",\n\t\tProjectID: "123e4567-e89b-12d3-a456-426614174000",\n\t\tPublicIPEnabled: true,\n\t\tRegion: shared.RegionNameUsSva2,\n\t\tSSHKey: compute.SSHKeyRequestParam{\n\t\t\tPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2",\n\t\t},\n\t\tSubnetID: "123e4567-e89b-12d3-a456-426614174000",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", operation)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/nirvana-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
4900
|
+
'# 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.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go/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',
|
|
4901
4901
|
},
|
|
4902
4902
|
{
|
|
4903
4903
|
language: 'terraform',
|
|
4904
4904
|
content:
|
|
4905
|
-
'# 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 = "~>
|
|
4905
|
+
'# 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 = "~> 2.0.1"\n }\n }\n}\n\n# Initialize the provider\nprovider "nirvana" {\n api_key = "My API Key" # or set NIRVANA_LABS_API_KEY env variable\n}\n\n# Configure a resource\nresource "nirvana_compute_vm" "example_compute_vm" {\n boot_volume = {\n size = 100\n type = "abs"\n tags = ["production", "ethereum"]\n }\n instance_type = "n1-standard-2"\n name = "my-vm"\n os_image_name = "ubuntu-noble-2025-10-01"\n project_id = "123e4567-e89b-12d3-a456-426614174000"\n public_ip_enabled = true\n region = "us-sva-2"\n ssh_key = {\n public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2"\n }\n subnet_id = "123e4567-e89b-12d3-a456-426614174000"\n data_volumes = [{\n name = "my-data-volume"\n size = 100\n type = "abs"\n tags = ["production", "ethereum"]\n }]\n tags = ["production", "ethereum"]\n}\n```\n\n<!-- x-release-please-end -->\n\nInitialize your project by running `terraform init` in the directory.\n\nAdditional examples can be found in the [./examples](./examples) folder within this repository, and you can\nrefer to the full documentation on [the Terraform Registry](https://registry.terraform.io/providers/nirvana-labs/nirvana/latest/docs).\n\n### Provider Options\nWhen you initialize the provider, the following options are supported. It is recommended to use environment variables for sensitive values like access tokens.\nIf an environment variable is provided, then the option does not need to be set in the terraform source.\n\n| Property | Environment variable | Required | Default value |\n| -------- | ---------------------- | -------- | ------------- |\n| api_key | `NIRVANA_LABS_API_KEY` | true | — |\n\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/nirvana-labs/terraform-provider-nirvana/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
4906
4906
|
},
|
|
4907
4907
|
{
|
|
4908
4908
|
language: 'cli',
|
|
4909
4909
|
content:
|
|
4910
|
-
"# Nirvana Labs CLI\n\nThe official CLI for the [Nirvana Labs REST API](https://docs.nirvanalabs.io).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install nirvana-labs/tap/nirvana\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/nirvana-labs/nirvana-cli/cmd/nirvana@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nnirvana [resource] <command> [flags...]\n~~~\n\n~~~sh\nnirvana compute:vms create \\\n --api-key 'My API Key' \\\n --boot-volume '{size: 100, type: abs}' \\\n --instance-type n1-standard-2 \\\n --name my-vm \\\n --os-image-name ubuntu-noble-2025-10-01 \\\n --project-id 123e4567-e89b-12d3-a456-426614174000 \\\n --public-ip-enabled \\\n --region us-sva-2 \\\n --ssh-key '{public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2}' \\\n --subnet-id 123e4567-e89b-12d3-a456-426614174000\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required |\n| ---------------------- | -------- |\n| `NIRVANA_LABS_API_KEY` | yes |\n\n### Global flags\n\n- `--api-key` (can also be set with `NIRVANA_LABS_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nnirvana <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nnirvana <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nnirvana <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\nnirvana <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nnirvana <command> --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Nirvana Labs Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/nirvana-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../nirvana-go`.\n",
|
|
4910
|
+
"# 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/v2/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",
|
|
4911
4911
|
},
|
|
4912
4912
|
];
|
|
4913
4913
|
|