Skip to content

juhnny5/rudder-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for rudder-golang

Download OpenAPI specification: openapi.yml

Other documentation sources:

Introduction

Rudder exposes a REST API, enabling the user to interact with Rudder without using the webapp, for example, in scripts or cron jobs.

Authentication

The Rudder REST API uses simple API keys for authentication. All requests must be authenticated (except from a generic status API). The tokens are 32-character strings, passed in a X-API-Token header, like in:

curl --header \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/latest/rules

The tokens are the API equivalent of a password, and must be secured just like a password would be.

API accounts

The accounts are managed in the Web interface. There are two possible types of accounts:

  • Global API accounts: they are not linked to a Rudder user, and are managed by Rudder administrators in the Administration -> API accounts page. You should define an expiration date whenever possible.

![General API tokens settings](assets/api-tokens.png "General API tokens settings")

  • User tokens: they are linked to a Rudder user, and give the same rights the user has. There can be only one token by user. This feature is provided by the api-authorizatons plugin.

![User API token](assets/api-user.png "User API token")

When an action produces a change of configuration on the server, the API account that made it will be recorded in the event log, like for a Web interaction.

Authorization

When using Rudder without the api-authorizatons plugin, only global accounts are available, with two possible privilege levels, read-only or write. With the api-authorizatons plugin, you also get access to:

  • User tokens, which have the same permissions as the user, using the Rudder roles and permissions feature.
  • Custom ACLs on global API accounts. They provide fine-grained permissions on every endpoint:

![Custom API ACL](assets/custom-acl.png "Custom API ACL")

As a general principle, you should create dedicated tokens with the least privilege level for each different interaction you have with the API. This limits the risks of exploitation if a token is stolen, and allows tracking the activity of each token separately. Token renewal is also easier when they are only used for a limited purpose.

Versioning

Each time the API is extended with new features (new functions, new parameters, new responses, ...), it will be assigned a new version number. This will allow you to keep your existing scripts (based on previous behavior). Versions will always be integers (no 2.1 or 3.3, just 2, 3, 4, ...) or latest.

You can change the version of the API used by setting it either within the url or in a header:

  • the URL: each URL is prefixed by its version id, like /api/version/function.
# Version 10
curl -X GET -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/10/rules
# Latest
curl -X GET -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/latest/rules
# Wrong (not an integer) => 404 not found
curl -X GET -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/3.14/rules
  • the HTTP headers. You can add the X-API-Version header to your request. The value needs to be an integer or latest.
# Version 10
curl -X GET -H \"X-API-Token: yourToken\" -H \"X-API-Version: 10\" https://rudder.example.com/rudder/api/rules
# Wrong => Error response indicating which versions are available
curl -X GET -H \"X-API-Token: yourToken\" -H \"X-API-Version: 3.14\" https://rudder.example.com/rudder/api/rules

In the future, we may declare some versions as deprecated, in order to remove them in a later version of Rudder, but we will never remove any versions without warning, or without a safe period of time to allow migration from previous versions.

Existing versions

Version Rudder versions it appeared in Description
1 Never released (for internal use only) Experimental version
2 to 10 (deprecated) 4.3 and before These versions provided the core set of API features for rules, directives, nodes global parameters, change requests and compliance, rudder settings, and system API
11 5.0 New system API (replacing old localhost v1 api): status, maintenance operations and server behavior
12 6.0 and 6.1 Node key management
13 6.2
  • Node status endpoint
  • System health check
  • System maintenance job to purge software [that endpoint was back-ported in 6.1]
14 7.0
  • Secret management
  • Directive tree
  • Improve techniques management
  • Demote a relay
15 7.1
  • Package updates in nodes
16 7.2
  • Create node API included from plugin
  • Configuration archive import/export
17 7.3
  • Compliance by directive
  • Path campaigns API included
18 8.0
  • Allowed network
  • Improve the structure of `/settings/allowed_networks` output

Response format

All responses from the API are in the JSON format.

{
  \"action\": \"The name of the called function\",
  \"id\": \"The ID of the element you want, if relevant\",
  \"result\": \"The result of your action: success or error\",
  \"data\": \"Only present if this is a success and depends on the function, it's usually a JSON object\",
  \"errorDetails\": \"Only present if this is an error, it contains the error message\"
}
  • Success responses are sent with the 200 HTTP (Success) code

  • Error responses are sent with a HTTP error code (mostly 5xx...)

HTTP method

Rudder's REST API is based on the usage of HTTP methods. We use them to indicate what action will be done by the request. Currently, we use four of them:

  • GET: search or retrieve information (get rule details, get a group, ...)

  • PUT: add new objects (create a directive, clone a Rule, ...)

  • DELETE: remove objects (delete a node, delete a parameter, ...)

  • POST: update existing objects (update a directive, reload a group, ...)

Parameters

General parameters

Some parameters are available for almost all API functions. They will be described in this section. They must be part of the query and can't be submitted in a JSON form.

Available for all requests

Field Type Description
prettify boolean
optional
Determine if the answer should be prettified (human friendly) or not. We recommend using this for debugging purposes, but not for general script usage as this does add some unnecessary load on the server side.

Default value: false

Available for modification requests (PUT/POST/DELETE)

Field Type Description
reason string
optional or required
Set a message to explain the change. If you set the reason messages to be mandatory in the web interface, failing to supply this value will lead to an error.

Default value: \"\"

changeRequestName string
optional
Set the change request name, is used only if workflows are enabled. The default value depends on the function called

Default value: A default string for each function

changeRequestDescription string
optional
Set the change request description, is used only if workflows are enabled.

Default value: \"\"

Passing parameters

Parameters to the API can be sent:

  • As part of the URL for resource identification

  • As data for POST/PUT requests

    • Directly in JSON format

    • As request arguments

As part of the URL for resource identification

Parameters in URLs are used to indicate which resource you want to interact with. The function will not work if this resource is missing.

# Get the Rule of ID \"id\"
curl -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/latest/rules/id

CAUTION: To avoid surprising behavior, do not put a '/' at the end of a URL: it would be interpreted as '/[empty string parameter]' and redirected to '/index', likely not what you wanted to do.

Sending data for POST/PUT requests

Directly in JSON format

JSON format is the preferred way to interact with Rudder API for creating or updating resources. You'll also have to set the Content-Type header to application/json (without it the JSON content would be ignored). In a curl POST request, that header can be provided with the -H parameter:

curl -X POST -H \"Content-Type: application/json\" ...

The supplied file must contain a valid JSON: strings need quotes, booleans and integers don't, etc.

The (human-readable) format is:

{
  \"key1\": \"value1\",
  \"key2\": false,
  \"key3\": 42
}

Here is an example with inlined data:

# Update the Rule 'id' with a new name, disabled, and setting it one directive
curl -X POST -H \"X-API-Token: yourToken\" -H  \"Content-Type: application/json\"
https://rudder.example.com/rudder/api/rules/latest/{id}
  -d '{ \"displayName\": \"new name\", \"enabled\": false, \"directives\": \"directiveId\"}'

You can also pass a supply the JSON in a file:

# Update the Rule 'id' with a new name, disabled, and setting it one directive
curl -X POST -H \"X-API-Token: yourToken\" -H \"Content-Type: application/json\" https://rudder.example.com/rudder/api/rules/latest/{id} -d @jsonParam

Note that the general parameters view in the previous chapter cannot be passed in a JSON, and you will need to pass them a URL parameters if you want them to be taken into account (you can't mix JSON and request parameters):

# Update the Rule 'id' with a new name, disabled, and setting it one directive with reason message \"Reason used\"
curl -X POST -H \"X-API-Token: yourToken\" -H \"Content-Type: application/json\" \"https://rudder.example.com/rudder/api/rules/latest/{id}?reason=Reason used\" -d @jsonParam -d \"reason=Reason ignored\"
Request parameters

In some cases, when you have little, simple data to update, JSON can feel bloated. In such cases, you can use request parameters. You will need to pass one parameter for each data you want to change.

Parameters follow the following schema:

key=value

You can pass parameters by two means:

# Update the Rule 'id' with a new name, disabled, and setting it one directive
curl -X POST -H \"X-API-Token: yourToken\"  https://rudder.example.com/rudder/api/rules/latest/{id}?\"displayName=my new name\"&\"enabled=false\"&\"directives=aDirectiveId\"
  • As request data: You can pass those parameters in the request data, they won't figure in the URL, making it lighter to read, You can pass a file that contains data.
# Update the Rule 'id' with a new name, disabled, and setting it one directive (in file directive-info.json)
curl -X POST -H \"X-API-Token: yourToken\"
https://rudder.example.com/rudder/api/rules/latest/{id} -d \"displayName=my new name\" -d \"enabled=false\" -d @directive-info.json

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 18
  • Package version: 0.0.1
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.rudder.io

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import rudder-golang "github.com/juhnny5/rudder-golang"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value rudder-golang.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), rudder-golang.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value rudder-golang.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), rudder-golang.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using rudder-golang.ContextOperationServerIndices and rudder-golang.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), rudder-golang.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), rudder-golang.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://rudder.example.local/rudder/api/latest

Class Method HTTP request Description
APIInfoAPI ApiGeneralInformations Get /info List all endpoints
APIInfoAPI ApiInformations Get /info/details/{endpointName} Get information about one API endpoint
APIInfoAPI ApiSubInformations Get /info/{sectionId} Get information on endpoint in a section
ArchivesAPI CallImport Post /archives/import Import a ZIP archive of policies into Rudder
ArchivesAPI Export Get /archives/export Get a ZIP archive of the requested items and their dependencies
BrandingAPI GetBrandingConf Get /branding Get branding configuration
BrandingAPI ReloadBrandingConf Post /branding/reload Reload branding file
BrandingAPI UpdateBRandingConf Post /branding Update web interface customization
CVEAPI CheckCVE Post /cve/check Trigger a CVE check
CVEAPI GetAllCve Get /cve Get all CVE details
CVEAPI GetCVECheckConfiguration Get /cve/check/config Get CVE check config
CVEAPI GetCVEList Post /cve/list Get a list of CVE details
CVEAPI GetCve Get /cve/{cveId} Get a CVE details
CVEAPI GetLastCVECheck Get /cve/check/last Get last CVE check result
CVEAPI ReadCVEfromFS Post /cve/update/fs Update CVE database from file system
CVEAPI UpdateCVE Post /cve/update Update CVE database from remote source
CVEAPI UpdateCVECheckConfiguration Post /cve/check/config Update cve check config
CampaignsAPI AllCampaigns Get /campaigns Get all campaigns details
CampaignsAPI DeleteCampaign Delete /campaigns/{id} Delete a campaign
CampaignsAPI DeleteCampaignEvent Delete /campaigns/events/{id} Delete a campaign event details
CampaignsAPI GetAllCampaignEvents Get /campaigns/events Get all campaign events
CampaignsAPI GetCampaign Get /campaigns/{id} Get a campaign details
CampaignsAPI GetCampaignEvent Get /campaigns/events/{id} Get a campaign event details
CampaignsAPI GetEventsCampaign Get /campaigns/{id}/events Get campaign events for a campaign
CampaignsAPI SaveCampaign Post /campaigns Save a campaign
CampaignsAPI SaveCampaignEvent Post /campaigns/events/{id} Update an existing event
CampaignsAPI ScheduleCampaign Post /campaigns/{id}/schedule Schedule a campaign event for a campaign
ChangeRequestsAPI AcceptChangeRequest Post /changeRequests/{changeRequestId}/accept Accept a request details
ChangeRequestsAPI ChangeRequestDetails Get /changeRequests/{changeRequestId} Get a change request details
ChangeRequestsAPI DeclineChangeRequest Delete /changeRequests/{changeRequestId} Decline a request details
ChangeRequestsAPI ListChangeRequests Get /api/changeRequests List all change requests
ChangeRequestsAPI ListUsers Get /users List user
ChangeRequestsAPI RemoveValidatedUser Delete /validatedUsers/{username} Remove an user from validated user list
ChangeRequestsAPI SaveWorkflowUser Post /validatedUsers Update validated user list
ChangeRequestsAPI UpdateChangeRequest Post /changeRequests/{changeRequestId} Update a request details
ComplianceAPI GetDirectiveComplianceId Get /compliance/directives/{directiveId} Compliance details by directive
ComplianceAPI GetDirectivesCompliance Get /compliance/directives Compliance details for all directives
ComplianceAPI GetGlobalCompliance Get /compliance Global compliance
ComplianceAPI GetNodeCompliance Get /compliance/nodes/{nodeId} Compliance details by node
ComplianceAPI GetNodesCompliance Get /compliance/nodes Compliance details for all nodes
ComplianceAPI GetRuleCompliance Get /compliance/rules/{ruleId} Compliance details by rule
ComplianceAPI GetRulesCompliance Get /compliance/rules Compliance details for all rules
DataSourcesAPI CreateDataSource Put /datasources Create a data source
DataSourcesAPI DeleteDataSource Delete /datasources/{datasourceId} Delete a data source
DataSourcesAPI GetAllDataSources Get /datasources List all data sources
DataSourcesAPI GetDataSource Get /datasources/{datasourceId} Get data source configuration
DataSourcesAPI ReloadAllDatasourcesAllNodes Post /datasources/reload Update properties from data sources
DataSourcesAPI ReloadAllDatasourcesOneNode Post /nodes/{nodeId}/fetchData Update properties for one node from all data sources
DataSourcesAPI ReloadOneDatasourceAllNodes Post /datasources/reload/{datasourceId} Update properties from data sources
DataSourcesAPI ReloadOneDatasourceOneNode Post /nodes/{nodeId}/fetchData/{datasourceId} Update properties for one node from a data source
DataSourcesAPI UpdateDataSource Post /datasources/{datasourceId} Update a data source configuration
DirectivesAPI CheckDirective Post /directives/{directiveId}/check Check that update on a directive is valid
DirectivesAPI CreateDirective Put /directives Create a directive
DirectivesAPI DeleteDirective Delete /directives/{directiveId} Delete a directive
DirectivesAPI DirectiveDetails Get /directives/{directiveId} Get directive details
DirectivesAPI ListDirectives Get /directives List all directives
DirectivesAPI UpdateDirective Post /directives/{directiveId} Update a directive details
GroupsAPI CreateGroup Put /groups Create a group
GroupsAPI CreateGroupCategory Put /groups/categories Create a group category
GroupsAPI DeleteGroup Delete /groups/{groupId} Delete a group
GroupsAPI DeleteGroupCategory Delete /groups/categories/{groupCategoryId} Delete group category
GroupsAPI GetGroupCategoryDetails Get /groups/categories/{groupCategoryId} Get group category details
GroupsAPI GetGroupTree Get /groups/tree Get groups tree
GroupsAPI GroupDetails Get /groups/{groupId} Get group details
GroupsAPI ListGroups Get /groups List all groups
GroupsAPI ReloadGroup Post /groups/{groupId}/reload Reload a group
GroupsAPI UpdateGroup Post /groups/{groupId} Update group details
GroupsAPI UpdateGroupCategory Post /groups/categories/{groupCategoryId} Update group category details
InventoriesAPI FileWatcherRestart Post /inventories/watcher/restart Restart inventory watcher
InventoriesAPI FileWatcherStart Post /inventories/watcher/start Start inventory watcher
InventoriesAPI FileWatcherStop Post /inventories/watcher/stop Stop inventory watcher
InventoriesAPI QueueInformation Get /inventories/info Get information about inventory processing queue
InventoriesAPI UploadInventory Post /inventories/upload Upload an inventory for processing
NodesAPI ApplyPolicy Post /nodes/{nodeId}/applyPolicy Trigger an agent run
NodesAPI ApplyPolicyAllNodes Post /nodes/applyPolicy Trigger an agent run on all nodes
NodesAPI ChangePendingNodeStatus Post /nodes/pending/{nodeId} Update pending Node status
NodesAPI CreateNodes Put /nodes Create one or several new nodes
NodesAPI DeleteNode Delete /nodes/{nodeId} Delete a node
NodesAPI GetNodesStatus Get /nodes/status Get nodes acceptation status
NodesAPI ListAcceptedNodes Get /nodes List managed nodes
NodesAPI ListPendingNodes Get /nodes/pending List pending nodes
NodesAPI NodeDetails Get /nodes/{nodeId} Get information about a node
NodesAPI NodeInheritedProperties Get /nodes/{nodeId}/inheritedProperties Get inherited node properties for a node
NodesAPI UpdateNode Post /nodes/{nodeId} Update node settings and properties
OpenSCAPAPI OpenscapReport Get /openscap/report/{nodeId} Get an OpenSCAP report
ParametersAPI CreateParameter Put /parameters Create a new property
ParametersAPI DeleteParameter Delete /parameters/{parameterId} Delete a global parameter
ParametersAPI ListParameters Get /parameters List all global properties
ParametersAPI ParameterDetails Get /parameters/{parameterId} Get the value of a global property
ParametersAPI UpdateParameter Post /parameters/{parameterId} Update a global property's value
RulesAPI CreateRule Put /rules Create a rule
RulesAPI CreateRuleCategory Put /rules/categories Create a rule category
RulesAPI DeleteRule Delete /rules/{ruleId} Delete a rule
RulesAPI DeleteRuleCategory Delete /rules/categories/{ruleCategoryId} Delete group category
RulesAPI GetRuleCategoryDetails Get /rules/categories/{ruleCategoryId} Get rule category details
RulesAPI GetRuleTree Get /rules/tree Get rules tree
RulesAPI ListRules Get /rules List all rules
RulesAPI RuleDetails Get /rules/{ruleId} Get a rule details
RulesAPI UpdateRule Post /rules/{ruleId} Update a rule details
RulesAPI UpdateRuleCategory Post /rules/categories/{ruleCategoryId} Update rule category details
ScaleOutRelayAPI DemoteToNode Post /scaleoutrelay/demote/{nodeId} Demote a relay to simple node
ScaleOutRelayAPI PromoteToRelay Post /scaleoutrelay/promote/{nodeId} Promote a node to relay
SecretManagementAPI AddSecret Put /secret Create a secret
SecretManagementAPI DeleteSecret Delete /secret/{name} Delete a secret
SecretManagementAPI GetAllSecrets Get /secret List all secrets
SecretManagementAPI GetSecret Get /secret/{name} Get one secret
SecretManagementAPI UpdateSecret Post /secret Update a secret
SettingsAPI GetAllSettings Get /settings List all settings
SettingsAPI GetAllowedNetworks Get /settings/allowed_networks/{nodeId} Get allowed networks for a policy server
SettingsAPI GetSetting Get /settings/{settingId} Get the value of a setting
SettingsAPI ModifyAllowedNetworks Post /settings/allowed_networks/{nodeId}/diff Modify allowed networks for a policy server
SettingsAPI ModifySetting Post /settings/{settingId} Set the value of a setting
SettingsAPI SetAllowedNetworks Post /settings/allowed_networks/{nodeId} Set allowed networks for a policy server
StatusAPI None Get /status Check if Rudder is alive
SystemAPI CreateArchive Post /system/archives/{archiveKind} Create an archive
SystemAPI GetHealthcheckResult Get /system/healthcheck Get healthcheck
SystemAPI GetStatus Get /system/status Get server status
SystemAPI GetSystemInfo Get /system/info Get server information
SystemAPI GetZipArchive Get /system/archives/{archiveKind}/zip/{commitId} Get an archive as a ZIP
SystemAPI ListArchives Get /system/archives/{archiveKind} List archives
SystemAPI PurgeSoftware Post /system/maintenance/purgeSoftware Trigger batch for cleaning unreferenced software
SystemAPI RegeneratePolicies Post /system/regenerate/policies Trigger a new policy generation
SystemAPI ReloadAll Post /system/reload Reload both techniques and dynamic groups
SystemAPI ReloadGroups Post /system/reload/groups Reload dynamic groups
SystemAPI ReloadTechniques Post /system/reload/techniques Reload techniques
SystemAPI RestoreArchive Post /system/archives/{archiveKind}/restore/{archiveRestoreKind} Restore an archive
SystemAPI UpdatePolicies Post /system/update/policies Trigger update of policies
SystemUpdateCampaignsAPI GetCampaignEventResult Get /systemUpdate/events/{id}/result Get a campaign event result
SystemUpdateCampaignsAPI GetCampaignResults Get /systemUpdate/campaign/{id}/history Get a campaign result history
SystemUpdateCampaignsAPI GetSystemUpdateResultForNode Get /systemUpdate/events/{id}/result/{nodeId} Get detailed campaign event result for a Node
TechniquesAPI CreateTechnique Put /techniques Create technique
TechniquesAPI DeleteTechnique Delete /techniques/{techniqueId}/{techniqueVersion} Delete technique
TechniquesAPI GetTechniqueAllVersion Get /techniques/{techniqueId} Technique metadata by ID
TechniquesAPI GetTechniqueAllVersionId Get /techniques/{techniqueId}/{techniqueVersion} Technique metadata by version and ID
TechniquesAPI GetTechniquesResources Get /techniques/{techniqueId}/{techniqueVersion}/resources Technique's resources
TechniquesAPI ListTechniqueVersionDirectives Get /techniques/{techniqueId}/{techniqueVersion}/directives List all directives based on a version of a technique
TechniquesAPI ListTechniques Get /techniques List all techniques
TechniquesAPI ListTechniquesDirectives Get /techniques/{techniqueId}/directives List all directives based on a technique
TechniquesAPI ListTechniquesVersions Get /techniques/versions List versions
TechniquesAPI Methods Get /methods List methods
TechniquesAPI ReloadMethods Post /methods/reload Reload methods
TechniquesAPI TechniqueCategories Get /techniques/categories List categories
TechniquesAPI TechniqueRevisions Get /techniques/{techniqueId}/{techniqueVersion}/revisions Technique's revisions
TechniquesAPI Techniques Post /techniques/reload Reload techniques
TechniquesAPI UpdateTechnique Post /techniques/{techniqueId}/{techniqueVersion} Update technique
UserManagementAPI AddUser Post /usermanagement Add user
UserManagementAPI DeleteUser Delete /usermanagement/{username} Delete an user
UserManagementAPI GetRole Get /usermanagement/roles List all roles
UserManagementAPI GetUserInfo Get /usermanagement/users List all users
UserManagementAPI ReloadUserConf Get /usermanagement/users/reload Reload user
UserManagementAPI UpdateUser Post /usermanagement/update/{username} Update user's infos

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

API-Tokens

  • Type: API key
  • API key parameter name: X-API-Token
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: X-API-Token and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		rudder-golang.ContextAPIKeys,
		map[string]rudder-golang.APIKey{
			"X-API-Token": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

dev@rudder.io

Releases

No releases published

Packages

No packages published

Languages