Skip to content

Latest commit

 

History

History
341 lines (256 loc) · 14 KB

README.md

File metadata and controls

341 lines (256 loc) · 14 KB

DataSources

(DataSources)

Overview

Requires that the datasources plugin is installed on the server.

Data sources plugin configuration.

Available Operations

GetAllDataSources

Get the configuration of all present data sources

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.DataSources.GetAllDataSources(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.

Response

*operations.GetAllDataSourcesResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ReloadAllDatasourcesAllNodes

Update properties from all data source on all nodes. The call is asynchronous.

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.DataSources.ReloadAllDatasourcesAllNodes(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.

Response

*operations.ReloadAllDatasourcesAllNodesResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ReloadOneDatasourceAllNodes

Update properties from all data source on all nodes. The call is asynchronous.

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var datasourceID string = "test-data-source"
    ctx := context.Background()
    res, err := s.DataSources.ReloadOneDatasourceAllNodes(ctx, datasourceID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
datasourceID string ✔️ Id of the data source test-data-source

Response

*operations.ReloadOneDatasourceAllNodesResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetDataSource

Get the configuration of a data source

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var datasourceID string = "test-data-source"
    ctx := context.Background()
    res, err := s.DataSources.GetDataSource(ctx, datasourceID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
datasourceID string ✔️ Id of the data source test-data-source

Response

*operations.GetDataSourceResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

DeleteDataSource

Delete a data source configuration

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var datasourceID string = "test-data-source"
    ctx := context.Background()
    res, err := s.DataSources.DeleteDataSource(ctx, datasourceID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
datasourceID string ✔️ Id of the data source test-data-source

Response

*operations.DeleteDataSourceResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ReloadAllDatasourcesOneNode

Update properties from all data sources on one nodes. The call is asynchronous.

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var nodeID string = "9a1773c9-0889-40b6-be89-f6504443ac1b"
    ctx := context.Background()
    res, err := s.DataSources.ReloadAllDatasourcesOneNode(ctx, nodeID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
nodeID string ✔️ Id of the target node 9a1773c9-0889-40b6-be89-f6504443ac1b

Response

*operations.ReloadAllDatasourcesOneNodeResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ReloadOneDatasourceOneNode

Update properties from a data source on one nodes. The call is asynchronous.

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var nodeID string = "9a1773c9-0889-40b6-be89-f6504443ac1b"

    var datasourceID string = "test-data-source"
    ctx := context.Background()
    res, err := s.DataSources.ReloadOneDatasourceOneNode(ctx, nodeID, datasourceID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
nodeID string ✔️ Id of the target node 9a1773c9-0889-40b6-be89-f6504443ac1b
datasourceID string ✔️ Id of the data source test-data-source

Response

*operations.ReloadOneDatasourceOneNodeResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /