(DataSources)
Requires that the datasources
plugin is installed on the server.
Data sources plugin configuration.
- GetAllDataSources - List all data sources
- ReloadAllDatasourcesAllNodes - Update properties from data sources
- ReloadOneDatasourceAllNodes - Update properties from data sources
- GetDataSource - Get data source configuration
- DeleteDataSource - Delete a data source
- ReloadAllDatasourcesOneNode - Update properties for one node from all data sources
- ReloadOneDatasourceOneNode - Update properties for one node from a data source
Get the configuration of all present data sources
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
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
*operations.GetAllDataSourcesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update properties from all data source on all nodes. The call is asynchronous.
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
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
*operations.ReloadAllDatasourcesAllNodesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update properties from all data source on all nodes. The call is asynchronous.
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
}
}
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 |
*operations.ReloadOneDatasourceAllNodesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Get the configuration of a data source
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
}
}
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 |
*operations.GetDataSourceResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Delete a data source configuration
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
}
}
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 |
*operations.DeleteDataSourceResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update properties from all data sources on one nodes. The call is asynchronous.
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
}
}
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 |
*operations.ReloadAllDatasourcesOneNodeResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update properties from a data source on one nodes. The call is asynchronous.
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
}
}
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 |
*operations.ReloadOneDatasourceOneNodeResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |