Skip to content

Latest commit

 

History

History
550 lines (504 loc) · 39.5 KB

README.md

File metadata and controls

550 lines (504 loc) · 39.5 KB

Go API client for datadog

Collection of all Datadog Public endpoints.

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: 1.0
  • Package version: 0.1.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.datadoghq.com/support/

Installation

Install the following dependencies:

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

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

import sw "./datadog"

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 sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

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

ctx := context.WithValue(context.Background(), sw.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 identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

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

Documentation for API Endpoints

All URIs are relative to https://api.datadoghq.com

Class Method HTTP request Description
DashboardListsApi CreateDashboardListItems Post /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards Add Items to a Dashboard List
DashboardListsApi DeleteDashboardListItems Delete /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards Delete items from a dashboard list
DashboardListsApi GetDashboardListItems Get /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards Get items of a Dashboard List
DashboardListsApi UpdateDashboardListItems Put /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards Update items of a dashboard list
IncidentServicesApi CreateIncidentService Post /api/v2/services Create a new incident service
IncidentServicesApi DeleteIncidentService Delete /api/v2/services/{service_id} Delete an existing incident service
IncidentServicesApi GetIncidentService Get /api/v2/services/{service_id} Get details of an incident service
IncidentServicesApi ListIncidentServices Get /api/v2/services Get a list of all incident services
IncidentServicesApi UpdateIncidentService Patch /api/v2/services/{service_id} Update an existing incident service
IncidentTeamsApi CreateIncidentTeam Post /api/v2/teams Create a new incident team
IncidentTeamsApi DeleteIncidentTeam Delete /api/v2/teams/{team_id} Delete an existing incident team
IncidentTeamsApi GetIncidentTeam Get /api/v2/teams/{team_id} Get details of an incident team
IncidentTeamsApi ListIncidentTeams Get /api/v2/teams Get a list of all incident teams
IncidentTeamsApi UpdateIncidentTeam Patch /api/v2/teams/{team_id} Update an existing incident team
IncidentsApi CreateIncident Post /api/v2/incidents Create an incident
IncidentsApi DeleteIncident Delete /api/v2/incidents/{incident_id} Delete an existing incident
IncidentsApi GetIncident Get /api/v2/incidents/{incident_id} Get the details of an incident
IncidentsApi ListIncidents Get /api/v2/incidents Get a list of incidents
IncidentsApi UpdateIncident Patch /api/v2/incidents/{incident_id} Update an existing incident
KeyManagementApi CreateAPIKey Post /api/v2/api_keys Create an API key
KeyManagementApi CreateCurrentUserApplicationKey Post /api/v2/current_user/application_keys Create an application key for current user
KeyManagementApi DeleteAPIKey Delete /api/v2/api_keys/{api_key_id} Delete an API key
KeyManagementApi DeleteApplicationKey Delete /api/v2/application_keys/{app_key_id} Delete an application key
KeyManagementApi DeleteCurrentUserApplicationKey Delete /api/v2/current_user/application_keys/{app_key_id} Delete an application key owned by current user
KeyManagementApi GetAPIKey Get /api/v2/api_keys/{api_key_id} Get API key
KeyManagementApi GetApplicationKey Get /api/v2/application_keys/{app_key_id} Get an application key
KeyManagementApi GetCurrentUserApplicationKey Get /api/v2/current_user/application_keys/{app_key_id} Get one application key owned by current user
KeyManagementApi ListAPIKeys Get /api/v2/api_keys Get all API keys
KeyManagementApi ListApplicationKeys Get /api/v2/application_keys Get all application keys
KeyManagementApi ListCurrentUserApplicationKeys Get /api/v2/current_user/application_keys Get all application keys owned by current user
KeyManagementApi UpdateAPIKey Patch /api/v2/api_keys/{api_key_id} Edit an API key
KeyManagementApi UpdateApplicationKey Patch /api/v2/application_keys/{app_key_id} Edit an application key
KeyManagementApi UpdateCurrentUserApplicationKey Patch /api/v2/current_user/application_keys/{app_key_id} Edit an application key owned by current user
LogsApi AggregateLogs Post /api/v2/logs/analytics/aggregate Aggregate events
LogsApi ListLogs Post /api/v2/logs/events/search Search logs
LogsApi ListLogsGet Get /api/v2/logs/events Get a list of logs
LogsArchivesApi AddReadRoleToArchive Post /api/v2/logs/config/archives/{archive_id}/readers Grant role to an archive
LogsArchivesApi CreateLogsArchive Post /api/v2/logs/config/archives Create an archive
LogsArchivesApi DeleteLogsArchive Delete /api/v2/logs/config/archives/{archive_id} Delete an archive
LogsArchivesApi GetLogsArchive Get /api/v2/logs/config/archives/{archive_id} Get an archive
LogsArchivesApi GetLogsArchiveOrder Get /api/v2/logs/config/archive-order Get archive order
LogsArchivesApi ListArchiveReadRoles Get /api/v2/logs/config/archives/{archive_id}/readers List read roles for an archive
LogsArchivesApi ListLogsArchives Get /api/v2/logs/config/archives Get all archives
LogsArchivesApi RemoveRoleFromArchive Delete /api/v2/logs/config/archives/{archive_id}/readers Revoke role from an archive
LogsArchivesApi UpdateLogsArchive Put /api/v2/logs/config/archives/{archive_id} Update an archive
LogsArchivesApi UpdateLogsArchiveOrder Put /api/v2/logs/config/archive-order Update archive order
LogsMetricsApi CreateLogsMetric Post /api/v2/logs/config/metrics Create a log-based metric
LogsMetricsApi DeleteLogsMetric Delete /api/v2/logs/config/metrics/{metric_id} Delete a log-based metric
LogsMetricsApi GetLogsMetric Get /api/v2/logs/config/metrics/{metric_id} Get a log-based metric
LogsMetricsApi ListLogsMetrics Get /api/v2/logs/config/metrics Get all log-based metrics
LogsMetricsApi UpdateLogsMetric Patch /api/v2/logs/config/metrics/{metric_id} Update a log-based metric
MetricsApi CreateTagConfiguration Post /api/v2/metrics/{metric_name}/tags Create a tag configuration
MetricsApi DeleteTagConfiguration Delete /api/v2/metrics/{metric_name}/tags Delete a tag configuration
MetricsApi ListTagConfigurationByName Get /api/v2/metrics/{metric_name}/tags List tag configuration by name
MetricsApi ListTagConfigurations Get /api/v2/metrics List tag configurations
MetricsApi ListTagsByMetricName Get /api/v2/metrics/{metric_name}/all-tags List tags by metric name
MetricsApi ListVolumesByMetricName Get /api/v2/metrics/{metric_name}/volumes List distinct metric volumes by metric name
MetricsApi UpdateTagConfiguration Patch /api/v2/metrics/{metric_name}/tags Update a tag configuration
ProcessesApi ListProcesses Get /api/v2/processes Get all processes
RolesApi AddPermissionToRole Post /api/v2/roles/{role_id}/permissions Grant permission to a role
RolesApi AddUserToRole Post /api/v2/roles/{role_id}/users Add a user to a role
RolesApi CreateRole Post /api/v2/roles Create role
RolesApi DeleteRole Delete /api/v2/roles/{role_id} Delete role
RolesApi GetRole Get /api/v2/roles/{role_id} Get a role
RolesApi ListPermissions Get /api/v2/permissions List permissions
RolesApi ListRolePermissions Get /api/v2/roles/{role_id}/permissions List permissions for a role
RolesApi ListRoleUsers Get /api/v2/roles/{role_id}/users Get all users of a role
RolesApi ListRoles Get /api/v2/roles List roles
RolesApi RemovePermissionFromRole Delete /api/v2/roles/{role_id}/permissions Revoke permission
RolesApi RemoveUserFromRole Delete /api/v2/roles/{role_id}/users Remove a user from a role
RolesApi UpdateRole Patch /api/v2/roles/{role_id} Update a role
SecurityMonitoringApi CreateSecurityFilter Post /api/v2/security_monitoring/configuration/security_filters Create a security filter
SecurityMonitoringApi CreateSecurityMonitoringRule Post /api/v2/security_monitoring/rules Create a detection rule
SecurityMonitoringApi DeleteSecurityFilter Delete /api/v2/security_monitoring/configuration/security_filters/{security_filter_id} Delete a security filter
SecurityMonitoringApi DeleteSecurityMonitoringRule Delete /api/v2/security_monitoring/rules/{rule_id} Delete an existing rule
SecurityMonitoringApi GetSecurityFilter Get /api/v2/security_monitoring/configuration/security_filters/{security_filter_id} Get a security filter
SecurityMonitoringApi GetSecurityMonitoringRule Get /api/v2/security_monitoring/rules/{rule_id} Get a rule's details
SecurityMonitoringApi ListSecurityFilters Get /api/v2/security_monitoring/configuration/security_filters Get all security filters
SecurityMonitoringApi ListSecurityMonitoringRules Get /api/v2/security_monitoring/rules List rules
SecurityMonitoringApi ListSecurityMonitoringSignals Get /api/v2/security_monitoring/signals Get a quick list of security signals
SecurityMonitoringApi SearchSecurityMonitoringSignals Post /api/v2/security_monitoring/signals/search Get a list of security signals
SecurityMonitoringApi UpdateSecurityFilter Patch /api/v2/security_monitoring/configuration/security_filters/{security_filter_id} Update a security filter
SecurityMonitoringApi UpdateSecurityMonitoringRule Put /api/v2/security_monitoring/rules/{rule_id} Update an existing rule
ServiceAccountsApi CreateServiceAccountApplicationKey Post /api/v2/service_accounts/{service_account_id}/application_keys Create an application key for this service account
ServiceAccountsApi DeleteServiceAccountApplicationKey Delete /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id} Delete an application key for this service account
ServiceAccountsApi GetServiceAccountApplicationKey Get /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id} Get one application key for this service account
ServiceAccountsApi ListServiceAccountApplicationKeys Get /api/v2/service_accounts/{service_account_id}/application_keys List application keys for this service account
ServiceAccountsApi UpdateServiceAccountApplicationKey Patch /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id} Edit an application key for this service account
UsersApi CreateServiceAccount Post /api/v2/service_accounts Create a service account
UsersApi CreateUser Post /api/v2/users Create a user
UsersApi DisableUser Delete /api/v2/users/{user_id} Disable a user
UsersApi GetInvitation Get /api/v2/user_invitations/{user_invitation_uuid} Get a user invitation
UsersApi GetUser Get /api/v2/users/{user_id} Get user details
UsersApi ListUserOrganizations Get /api/v2/users/{user_id}/orgs Get a user organization
UsersApi ListUserPermissions Get /api/v2/users/{user_id}/permissions Get a user permissions
UsersApi ListUsers Get /api/v2/users List all users
UsersApi SendInvitations Post /api/v2/user_invitations Send invitation emails
UsersApi UpdateUser Patch /api/v2/users/{user_id} Update a user

Documentation For Models

Documentation For Authorization

apiKeyAuth

  • Type: API key
  • API key parameter name: DD-API-KEY
  • Location: HTTP header

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

appKeyAuth

  • Type: API key
  • API key parameter name: DD-APPLICATION-KEY
  • Location: HTTP header

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

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

support@datadoghq.com