(APIInfo)
Information about API endpoints and versions
- APIGeneralInformations - List all endpoints
- APIInformations - Get information about one API endpoint
- APISubInformations - Get information on endpoint in a section
List all endpoints and their version
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.APIInfo.APIGeneralInformations(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.APIGeneralInformationsResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Get the description and the list of supported version for one API endpoint
package main
import(
rudder "github.com/infra-rdc/rudder-go"
"context"
"log"
)
func main() {
s := rudder.New(
rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var endpointName string = "listAcceptedNodes"
ctx := context.Background()
res, err := s.APIInfo.APIInformations(ctx, endpointName)
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. | |
endpointName |
string | ✔️ | Name of the endpoint for which one wants information | listAcceptedNodes |
*operations.APIInformationsResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Get all endpoints in the given section with their supported version.
package main
import(
rudder "github.com/infra-rdc/rudder-go"
"context"
"log"
)
func main() {
s := rudder.New(
rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var sectionID string = "nodes"
ctx := context.Background()
res, err := s.APIInfo.APISubInformations(ctx, sectionID)
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. | |
sectionID |
string | ✔️ | Id of the API section | nodes |
*operations.APISubInformationsResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |