Ggithub-actions[bot]release version v0.28.6
e0d65655创建于 2025年10月28日历史提交

\RolesDiscoveryAPI

All URIs are relative to http://localhost

Method HTTP request Description
DiscoveryApplyDevice Post /api/v1/discovery/devices/apply Apply Discovered devices
DiscoveryDeleteDevices Delete /api/v1/discovery/devices/delete Discovery devices
DiscoveryDeleteSubnets Delete /api/v1/discovery/subnets Discovery Subnets
DiscoveryGetDevices Get /api/v1/discovery/devices Discovery devices
DiscoveryGetRoleConfig Get /api/v1/roles/discovery Discovery role config
DiscoveryGetSubnets Get /api/v1/discovery/subnets Discovery subnets
DiscoveryPutRoleConfig Post /api/v1/roles/discovery Discovery role config
DiscoveryPutSubnets Post /api/v1/discovery/subnets Discovery Subnets
DiscoverySubnetStart Post /api/v1/discovery/subnets/start Discovery Subnets

DiscoveryApplyDevice

DiscoveryApplyDevice(ctx).Identifier(identifier).DiscoveryAPIDevicesApplyInput(discoveryAPIDevicesApplyInput).Execute()

Apply Discovered devices

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	identifier := "identifier_example" // string | 
	discoveryAPIDevicesApplyInput := *openapiclient.NewDiscoveryAPIDevicesApplyInput("DhcpScope_example", "DnsZone_example", "To_example") // DiscoveryAPIDevicesApplyInput |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.RolesDiscoveryAPI.DiscoveryApplyDevice(context.Background()).Identifier(identifier).DiscoveryAPIDevicesApplyInput(discoveryAPIDevicesApplyInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryApplyDevice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryApplyDeviceRequest struct via the builder pattern

Name Type Description Notes
identifier string
discoveryAPIDevicesApplyInput DiscoveryAPIDevicesApplyInput

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryDeleteDevices

DiscoveryDeleteDevices(ctx).Identifier(identifier).Execute()

Discovery devices

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	identifier := "identifier_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.RolesDiscoveryAPI.DiscoveryDeleteDevices(context.Background()).Identifier(identifier).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryDeleteDevices``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryDeleteDevicesRequest struct via the builder pattern

Name Type Description Notes
identifier string

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryDeleteSubnets

DiscoveryDeleteSubnets(ctx).Identifier(identifier).Execute()

Discovery Subnets

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	identifier := "identifier_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.RolesDiscoveryAPI.DiscoveryDeleteSubnets(context.Background()).Identifier(identifier).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryDeleteSubnets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryDeleteSubnetsRequest struct via the builder pattern

Name Type Description Notes
identifier string

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryGetDevices

DiscoveryAPIDevicesGetOutput DiscoveryGetDevices(ctx).Identifier(identifier).Execute()

Discovery devices

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	identifier := "identifier_example" // string | Optionally get device by identifier (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.RolesDiscoveryAPI.DiscoveryGetDevices(context.Background()).Identifier(identifier).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryGetDevices``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `DiscoveryGetDevices`: DiscoveryAPIDevicesGetOutput
	fmt.Fprintf(os.Stdout, "Response from `RolesDiscoveryAPI.DiscoveryGetDevices`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryGetDevicesRequest struct via the builder pattern

Name Type Description Notes
identifier string Optionally get device by identifier

Return type

DiscoveryAPIDevicesGetOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryGetRoleConfig

DiscoveryAPIRoleConfigOutput DiscoveryGetRoleConfig(ctx).Execute()

Discovery role config

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.RolesDiscoveryAPI.DiscoveryGetRoleConfig(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryGetRoleConfig``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `DiscoveryGetRoleConfig`: DiscoveryAPIRoleConfigOutput
	fmt.Fprintf(os.Stdout, "Response from `RolesDiscoveryAPI.DiscoveryGetRoleConfig`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryGetRoleConfigRequest struct via the builder pattern

Return type

DiscoveryAPIRoleConfigOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryGetSubnets

DiscoveryAPISubnetsGetOutput DiscoveryGetSubnets(ctx).Name(name).Execute()

Discovery subnets

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	name := "name_example" // string | Optionally get Subnet by name (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.RolesDiscoveryAPI.DiscoveryGetSubnets(context.Background()).Name(name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryGetSubnets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `DiscoveryGetSubnets`: DiscoveryAPISubnetsGetOutput
	fmt.Fprintf(os.Stdout, "Response from `RolesDiscoveryAPI.DiscoveryGetSubnets`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryGetSubnetsRequest struct via the builder pattern

Name Type Description Notes
name string Optionally get Subnet by name

Return type

DiscoveryAPISubnetsGetOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryPutRoleConfig

DiscoveryPutRoleConfig(ctx).DiscoveryAPIRoleConfigInput(discoveryAPIRoleConfigInput).Execute()

Discovery role config

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	discoveryAPIRoleConfigInput := *openapiclient.NewDiscoveryAPIRoleConfigInput(*openapiclient.NewDiscoveryRoleConfig()) // DiscoveryAPIRoleConfigInput |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.RolesDiscoveryAPI.DiscoveryPutRoleConfig(context.Background()).DiscoveryAPIRoleConfigInput(discoveryAPIRoleConfigInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryPutRoleConfig``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryPutRoleConfigRequest struct via the builder pattern

Name Type Description Notes
discoveryAPIRoleConfigInput DiscoveryAPIRoleConfigInput

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoveryPutSubnets

DiscoveryPutSubnets(ctx).Identifier(identifier).DiscoveryAPISubnetsPutInput(discoveryAPISubnetsPutInput).Execute()

Discovery Subnets

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	identifier := "identifier_example" // string | 
	discoveryAPISubnetsPutInput := *openapiclient.NewDiscoveryAPISubnetsPutInput(int32(123), "DnsResolver_example", "SubnetCidr_example") // DiscoveryAPISubnetsPutInput |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.RolesDiscoveryAPI.DiscoveryPutSubnets(context.Background()).Identifier(identifier).DiscoveryAPISubnetsPutInput(discoveryAPISubnetsPutInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoveryPutSubnets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoveryPutSubnetsRequest struct via the builder pattern

Name Type Description Notes
identifier string
discoveryAPISubnetsPutInput DiscoveryAPISubnetsPutInput

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DiscoverySubnetStart

DiscoverySubnetStart(ctx).Identifier(identifier).Wait(wait).Execute()

Discovery Subnets

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "beryju.io/gravity/api"
)

func main() {
	identifier := "identifier_example" // string | 
	wait := true // bool | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.RolesDiscoveryAPI.DiscoverySubnetStart(context.Background()).Identifier(identifier).Wait(wait).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RolesDiscoveryAPI.DiscoverySubnetStart``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDiscoverySubnetStartRequest struct via the builder pattern

Name Type Description Notes
identifier string
wait bool

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]