Skip to content

Latest commit

 

History

History
622 lines (464 loc) · 25 KB

README.md

File metadata and controls

622 lines (464 loc) · 25 KB

System

(System)

Overview

Internal components and administration

Available Operations

ListArchives

List configuration archives

Example Usage

package main

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

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var archiveKind components.ArchiveKind = components.ArchiveKindFull
    ctx := context.Background()
    res, err := s.System.ListArchives(ctx, archiveKind)
    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.
archiveKind components.ArchiveKind ✔️ Type of archive to make full

Response

*operations.ListArchivesResponse, error

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

CreateArchive

Create new archive of the given kind

Example Usage

package main

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

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var archiveKind components.ArchiveKind = components.ArchiveKindFull
    ctx := context.Background()
    res, err := s.System.CreateArchive(ctx, archiveKind)
    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.
archiveKind components.ArchiveKind ✔️ Type of archive to make full

Response

*operations.CreateArchiveResponse, error

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

RestoreArchive

Restore an archive of the given kind for the given moment

Example Usage

package main

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

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var archiveKind components.ArchiveKind = components.ArchiveKindFull

    var archiveRestoreKind operations.ArchiveRestoreKind = operations.ArchiveRestoreKindLatestCommit
    ctx := context.Background()
    res, err := s.System.RestoreArchive(ctx, archiveKind, archiveRestoreKind)
    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.
archiveKind components.ArchiveKind ✔️ Type of archive to make full
archiveRestoreKind operations.ArchiveRestoreKind ✔️ What archive to restore (latest archive, latest commit in configuration repository, or archive with ID as given by listArchive) latestCommit

Response

*operations.RestoreArchiveResponse, error

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

GetZipArchive

Get an archive of the given kind as a zip

Example Usage

package main

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

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var archiveKind components.ArchiveKind = components.ArchiveKindFull

    var commitID string = "<value>"
    ctx := context.Background()
    res, err := s.System.GetZipArchive(ctx, archiveKind, commitID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Stream != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
archiveKind components.ArchiveKind ✔️ Type of archive to make full
commitID string ✔️ commit ID of the archive to get as a ZIP file

Response

*operations.GetZipArchiveResponse, error

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

GetHealthcheckResult

Run and get the result of all checks

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.System.GetHealthcheckResult(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.GetHealthcheckResultResponse, error

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

GetSystemInfo

Get information about the server 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.System.GetSystemInfo(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.GetSystemInfoResponse, error

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

PurgeSoftware

Start the software cleaning batch asynchronously.

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.System.PurgeSoftware(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.PurgeSoftwareResponse, error

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

RegeneratePolicies

Trigger a full policy generation

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.System.RegeneratePolicies(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.RegeneratePoliciesResponse, error

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

ReloadAll

Reload both techniques and dynamic groups

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.System.ReloadAll(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.ReloadAllResponse, error

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

ReloadGroups

Reload dynamic groups

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.System.ReloadGroups(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.ReloadGroupsResponse, error

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

ReloadTechniques

Reload techniques from local technique library

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.System.ReloadTechniques(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.ReloadTechniquesResponse, error

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

GetStatus

Get information about current server status

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.System.GetStatus(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.GetStatusResponse, error

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

UpdatePolicies

Update configuration policies if needed

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.System.UpdatePolicies(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.UpdatePoliciesResponse, error

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