Skip to content

Latest commit

 

History

History
149 lines (111 loc) · 5.72 KB

README.md

File metadata and controls

149 lines (111 loc) · 5.72 KB

APIInfo

(APIInfo)

Overview

Information about API endpoints and versions

Available Operations

APIGeneralInformations

List all endpoints and their version

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.APIInfo.APIGeneralInformations(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.APIGeneralInformationsResponse, error

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

APIInformations

Get the description and the list of supported version for one API endpoint

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 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
    }
}

Parameters

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

Response

*operations.APIInformationsResponse, error

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

APISubInformations

Get all endpoints in the given section with their supported version.

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 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
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
sectionID string ✔️ Id of the API section nodes

Response

*operations.APISubInformationsResponse, error

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