Skip to content

Latest commit

 

History

History
348 lines (219 loc) · 8.18 KB

NodesAPI.md

File metadata and controls

348 lines (219 loc) · 8.18 KB

\NodesAPI

All URIs are relative to https://name.eliona.io/v2

Method HTTP request Description
GetNodeByIdent Get /nodes/{node-ident} Information about a node
GetNodes Get /nodes Information about nodes
PostNode Post /nodes Create a node
PutNode Put /nodes Create or update a node
PutNodeByIdent Put /nodes/{node-ident} Update a node

GetNodeByIdent

Node GetNodeByIdent(ctx, nodeIdent).Execute()

Information about a node

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	nodeIdent := "4711" // string | The UUID identifier of the node

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
nodeIdent string The UUID identifier of the node

Other Parameters

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

Name Type Description Notes

Return type

Node

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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

GetNodes

[]Node GetNodes(ctx).Execute()

Information about nodes

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]Node

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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

PostNode

Node PostNode(ctx).Node(node).Execute()

Create a node

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	node := *openapiclient.NewNode() // Node | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
node Node

Return type

Node

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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

PutNode

Node PutNode(ctx).Node(node).Execute()

Create or update a node

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	node := *openapiclient.NewNode() // Node | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
node Node

Return type

Node

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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

PutNodeByIdent

Node PutNodeByIdent(ctx, nodeIdent).Node(node).Execute()

Update a node

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	nodeIdent := "4711" // string | The UUID identifier of the node
	node := *openapiclient.NewNode() // Node | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
nodeIdent string The UUID identifier of the node

Other Parameters

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

Name Type Description Notes

node | Node | |

Return type

Node

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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