package
1.0.0-beta.23
Repository: https://github.com/last9/datadog-api-client-go.git
Documentation: pkg.go.dev

# README

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

ClassMethodHTTP requestDescription
AWSIntegrationApiCreateAWSAccountPost /api/v1/integration/awsCreate an AWS integration
AWSIntegrationApiCreateAWSTagFilterPost /api/v1/integration/aws/filteringSet an AWS tag filter
AWSIntegrationApiCreateNewAWSExternalIDPut /api/v1/integration/aws/generate_new_external_idGenerate a new external ID
AWSIntegrationApiDeleteAWSAccountDelete /api/v1/integration/awsDelete an AWS integration
AWSIntegrationApiDeleteAWSTagFilterDelete /api/v1/integration/aws/filteringDelete a tag filtering entry
AWSIntegrationApiListAWSAccountsGet /api/v1/integration/awsList all AWS integrations
AWSIntegrationApiListAWSTagFiltersGet /api/v1/integration/aws/filteringGet all AWS tag filters
AWSIntegrationApiListAvailableAWSNamespacesGet /api/v1/integration/aws/available_namespace_rulesList namespace rules
AWSIntegrationApiUpdateAWSAccountPut /api/v1/integration/awsUpdate an AWS integration
AWSLogsIntegrationApiCheckAWSLogsLambdaAsyncPost /api/v1/integration/aws/logs/check_asyncCheck that an AWS Lambda Function exists
AWSLogsIntegrationApiCheckAWSLogsServicesAsyncPost /api/v1/integration/aws/logs/services_asyncCheck permissions for log services
AWSLogsIntegrationApiCreateAWSLambdaARNPost /api/v1/integration/aws/logsAdd AWS Log Lambda ARN
AWSLogsIntegrationApiDeleteAWSLambdaARNDelete /api/v1/integration/aws/logsDelete an AWS Logs integration
AWSLogsIntegrationApiEnableAWSLogServicesPost /api/v1/integration/aws/logs/servicesEnable an AWS Logs integration
AWSLogsIntegrationApiListAWSLogsIntegrationsGet /api/v1/integration/aws/logsList all AWS Logs integrations
AWSLogsIntegrationApiListAWSLogsServicesGet /api/v1/integration/aws/logs/servicesGet list of AWS log ready services
AuthenticationApiValidateGet /api/v1/validateValidate API key
AzureIntegrationApiCreateAzureIntegrationPost /api/v1/integration/azureCreate an Azure integration
AzureIntegrationApiDeleteAzureIntegrationDelete /api/v1/integration/azureDelete an Azure integration
AzureIntegrationApiListAzureIntegrationGet /api/v1/integration/azureList all Azure integrations
AzureIntegrationApiUpdateAzureHostFiltersPost /api/v1/integration/azure/host_filtersUpdate Azure integration host filters
AzureIntegrationApiUpdateAzureIntegrationPut /api/v1/integration/azureUpdate an Azure integration
DashboardListsApiCreateDashboardListPost /api/v1/dashboard/lists/manualCreate a dashboard list
DashboardListsApiDeleteDashboardListDelete /api/v1/dashboard/lists/manual/{list_id}Delete a dashboard list
DashboardListsApiGetDashboardListGet /api/v1/dashboard/lists/manual/{list_id}Get a dashboard list
DashboardListsApiListDashboardListsGet /api/v1/dashboard/lists/manualGet all dashboard lists
DashboardListsApiUpdateDashboardListPut /api/v1/dashboard/lists/manual/{list_id}Update a dashboard list
DashboardsApiCreateDashboardPost /api/v1/dashboardCreate a new dashboard
DashboardsApiDeleteDashboardDelete /api/v1/dashboard/{dashboard_id}Delete a dashboard
DashboardsApiGetDashboardGet /api/v1/dashboard/{dashboard_id}Get a dashboard
DashboardsApiListDashboardsGet /api/v1/dashboardGet all dashboards
DashboardsApiUpdateDashboardPut /api/v1/dashboard/{dashboard_id}Update a dashboard
DowntimesApiCancelDowntimeDelete /api/v1/downtime/{downtime_id}Cancel a downtime
DowntimesApiCancelDowntimesByScopePost /api/v1/downtime/cancel/by_scopeCancel downtimes by scope
DowntimesApiCreateDowntimePost /api/v1/downtimeSchedule a downtime
DowntimesApiGetDowntimeGet /api/v1/downtime/{downtime_id}Get a downtime
DowntimesApiListDowntimesGet /api/v1/downtimeGet all downtimes
DowntimesApiListMonitorDowntimesGet /api/v1/monitor/{monitor_id}/downtimesGet all downtimes for a monitor
DowntimesApiUpdateDowntimePut /api/v1/downtime/{downtime_id}Update a downtime
EventsApiCreateEventPost /api/v1/eventsPost an event
EventsApiGetEventGet /api/v1/events/{event_id}Get an event
EventsApiListEventsGet /api/v1/eventsQuery the event stream
GCPIntegrationApiCreateGCPIntegrationPost /api/v1/integration/gcpCreate a GCP integration
GCPIntegrationApiDeleteGCPIntegrationDelete /api/v1/integration/gcpDelete a GCP integration
GCPIntegrationApiListGCPIntegrationGet /api/v1/integration/gcpList all GCP integrations
GCPIntegrationApiUpdateGCPIntegrationPut /api/v1/integration/gcpUpdate a GCP integration
HostsApiGetHostTotalsGet /api/v1/hosts/totalsGet the total number of active hosts
HostsApiListHostsGet /api/v1/hostsGet all hosts for your organization
HostsApiMuteHostPost /api/v1/host/{host_name}/muteMute a host
HostsApiUnmuteHostPost /api/v1/host/{host_name}/unmuteUnmute a host
IPRangesApiGetIPRangesGet /List IP Ranges
KeyManagementApiCreateAPIKeyPost /api/v1/api_keyCreate an API key
KeyManagementApiCreateApplicationKeyPost /api/v1/application_keyCreate an application key
KeyManagementApiDeleteAPIKeyDelete /api/v1/api_key/{key}Delete an API key
KeyManagementApiDeleteApplicationKeyDelete /api/v1/application_key/{key}Delete an application key
KeyManagementApiGetAPIKeyGet /api/v1/api_key/{key}Get API key
KeyManagementApiGetApplicationKeyGet /api/v1/application_key/{key}Get an application key
KeyManagementApiListAPIKeysGet /api/v1/api_keyGet all API keys
KeyManagementApiListApplicationKeysGet /api/v1/application_keyGet all application keys
KeyManagementApiUpdateAPIKeyPut /api/v1/api_key/{key}Edit an API key
KeyManagementApiUpdateApplicationKeyPut /api/v1/application_key/{key}Edit an application key
LogsApiListLogsPost /api/v1/logs-queries/listSearch logs
LogsApiSubmitLogPost /v1/inputSend logs
LogsIndexesApiCreateLogsIndexPost /api/v1/logs/config/indexesCreate an index
LogsIndexesApiGetLogsIndexGet /api/v1/logs/config/indexes/{name}Get an index
LogsIndexesApiGetLogsIndexOrderGet /api/v1/logs/config/index-orderGet indexes order
LogsIndexesApiListLogIndexesGet /api/v1/logs/config/indexesGet all indexes
LogsIndexesApiUpdateLogsIndexPut /api/v1/logs/config/indexes/{name}Update an index
LogsIndexesApiUpdateLogsIndexOrderPut /api/v1/logs/config/index-orderUpdate indexes order
LogsPipelinesApiCreateLogsPipelinePost /api/v1/logs/config/pipelinesCreate a pipeline
LogsPipelinesApiDeleteLogsPipelineDelete /api/v1/logs/config/pipelines/{pipeline_id}Delete a pipeline
LogsPipelinesApiGetLogsPipelineGet /api/v1/logs/config/pipelines/{pipeline_id}Get a pipeline
LogsPipelinesApiGetLogsPipelineOrderGet /api/v1/logs/config/pipeline-orderGet pipeline order
LogsPipelinesApiListLogsPipelinesGet /api/v1/logs/config/pipelinesGet all pipelines
LogsPipelinesApiUpdateLogsPipelinePut /api/v1/logs/config/pipelines/{pipeline_id}Update a pipeline
LogsPipelinesApiUpdateLogsPipelineOrderPut /api/v1/logs/config/pipeline-orderUpdate pipeline order
MetricsApiGetMetricMetadataGet /api/v1/metrics/{metric_name}Get metric metadata
MetricsApiListActiveMetricsGet /api/v1/metricsGet active metrics list
MetricsApiListMetricsGet /api/v1/searchSearch metrics
MetricsApiQueryMetricsGet /api/v1/queryQuery timeseries points
MetricsApiSubmitMetricsPost /api/v1/seriesSubmit metrics
MetricsApiUpdateMetricMetadataPut /api/v1/metrics/{metric_name}Edit metric metadata
MonitorsApiCheckCanDeleteMonitorGet /api/v1/monitor/can_deleteCheck if a monitor can be deleted
MonitorsApiCreateMonitorPost /api/v1/monitorCreate a monitor
MonitorsApiDeleteMonitorDelete /api/v1/monitor/{monitor_id}Delete a monitor
MonitorsApiGetMonitorGet /api/v1/monitor/{monitor_id}Get a monitor's details
MonitorsApiListMonitorsGet /api/v1/monitorGet all monitor details
MonitorsApiSearchMonitorGroupsGet /api/v1/monitor/groups/searchMonitors group search
MonitorsApiSearchMonitorsGet /api/v1/monitor/searchMonitors search
MonitorsApiUpdateMonitorPut /api/v1/monitor/{monitor_id}Edit a monitor
MonitorsApiValidateMonitorPost /api/v1/monitor/validateValidate a monitor
NotebooksApiCreateNotebookPost /api/v1/notebooksCreate a notebook
NotebooksApiDeleteNotebookDelete /api/v1/notebooks/{notebook_id}Delete a notebook
NotebooksApiGetNotebookGet /api/v1/notebooks/{notebook_id}Get a notebook
NotebooksApiListNotebooksGet /api/v1/notebooksGet all notebooks
NotebooksApiUpdateNotebookPut /api/v1/notebooks/{notebook_id}Update a notebook
OrganizationsApiCreateChildOrgPost /api/v1/orgCreate a child organization
OrganizationsApiGetOrgGet /api/v1/org/{public_id}Get organization information
OrganizationsApiListOrgsGet /api/v1/orgList your managed organizations
OrganizationsApiUpdateOrgPut /api/v1/org/{public_id}Update your organization
OrganizationsApiUploadIdPForOrgPost /api/v1/org/{public_id}/idp_metadataUpload IdP metadata
PagerDutyIntegrationApiCreatePagerDutyIntegrationServicePost /api/v1/integration/pagerduty/configuration/servicesCreate a new service object
PagerDutyIntegrationApiDeletePagerDutyIntegrationServiceDelete /api/v1/integration/pagerduty/configuration/services/{service_name}Delete a single service object
PagerDutyIntegrationApiGetPagerDutyIntegrationServiceGet /api/v1/integration/pagerduty/configuration/services/{service_name}Get a single service object
PagerDutyIntegrationApiUpdatePagerDutyIntegrationServicePut /api/v1/integration/pagerduty/configuration/services/{service_name}Update a single service object
ServiceChecksApiSubmitServiceCheckPost /api/v1/check_runSubmit a Service Check
ServiceLevelObjectiveCorrectionsApiCreateSLOCorrectionPost /api/v1/slo/correctionCreate an SLO correction
ServiceLevelObjectiveCorrectionsApiDeleteSLOCorrectionDelete /api/v1/slo/correction/{slo_correction_id}Delete an SLO correction
ServiceLevelObjectiveCorrectionsApiGetSLOCorrectionGet /api/v1/slo/correction/{slo_correction_id}Get an SLO correction for an SLO
ServiceLevelObjectiveCorrectionsApiListSLOCorrectionGet /api/v1/slo/correctionGet all SLO corrections
ServiceLevelObjectiveCorrectionsApiUpdateSLOCorrectionPatch /api/v1/slo/correction/{slo_correction_id}Update an SLO correction
ServiceLevelObjectivesApiCheckCanDeleteSLOGet /api/v1/slo/can_deleteCheck if SLOs can be safely deleted
ServiceLevelObjectivesApiCreateSLOPost /api/v1/sloCreate an SLO object
ServiceLevelObjectivesApiDeleteSLODelete /api/v1/slo/{slo_id}Delete an SLO
ServiceLevelObjectivesApiDeleteSLOTimeframeInBulkPost /api/v1/slo/bulk_deleteBulk Delete SLO Timeframes
ServiceLevelObjectivesApiGetSLOGet /api/v1/slo/{slo_id}Get an SLO's details
ServiceLevelObjectivesApiGetSLOHistoryGet /api/v1/slo/{slo_id}/historyGet an SLO's history
ServiceLevelObjectivesApiListSLOsGet /api/v1/sloGet all SLOs
ServiceLevelObjectivesApiUpdateSLOPut /api/v1/slo/{slo_id}Update an SLO
SlackIntegrationApiCreateSlackIntegrationChannelPost /api/v1/integration/slack/configuration/accounts/{account_name}/channelsCreate a Slack integration channel
SlackIntegrationApiGetSlackIntegrationChannelGet /api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}Get a Slack integration channel
SlackIntegrationApiGetSlackIntegrationChannelsGet /api/v1/integration/slack/configuration/accounts/{account_name}/channelsGet all channels in a Slack integration
SlackIntegrationApiRemoveSlackIntegrationChannelDelete /api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}Remove a Slack integration channel
SlackIntegrationApiUpdateSlackIntegrationChannelPatch /api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}Update a Slack integration channel
SnapshotsApiGetGraphSnapshotGet /api/v1/graph/snapshotTake graph snapshots
SyntheticsApiCreateGlobalVariablePost /api/v1/synthetics/variablesCreate a global variable
SyntheticsApiCreatePrivateLocationPost /api/v1/synthetics/private-locationsCreate a private location
SyntheticsApiCreateSyntheticsAPITestPost /api/v1/synthetics/tests/apiCreate an API test
SyntheticsApiCreateSyntheticsBrowserTestPost /api/v1/synthetics/tests/browserCreate a browser test
SyntheticsApiDeleteGlobalVariableDelete /api/v1/synthetics/variables/{variable_id}Delete a global variable
SyntheticsApiDeletePrivateLocationDelete /api/v1/synthetics/private-locations/{location_id}Delete a private location
SyntheticsApiDeleteTestsPost /api/v1/synthetics/tests/deleteDelete tests
SyntheticsApiEditGlobalVariablePut /api/v1/synthetics/variables/{variable_id}Edit a global variable
SyntheticsApiGetAPITestGet /api/v1/synthetics/tests/api/{public_id}Get an API test
SyntheticsApiGetAPITestLatestResultsGet /api/v1/synthetics/tests/{public_id}/resultsGet an API test's latest results summaries
SyntheticsApiGetAPITestResultGet /api/v1/synthetics/tests/{public_id}/results/{result_id}Get an API test result
SyntheticsApiGetBrowserTestGet /api/v1/synthetics/tests/browser/{public_id}Get a browser test
SyntheticsApiGetBrowserTestLatestResultsGet /api/v1/synthetics/tests/browser/{public_id}/resultsGet a browser test's latest results summaries
SyntheticsApiGetBrowserTestResultGet /api/v1/synthetics/tests/browser/{public_id}/results/{result_id}Get a browser test result
SyntheticsApiGetGlobalVariableGet /api/v1/synthetics/variables/{variable_id}Get a global variable
SyntheticsApiGetPrivateLocationGet /api/v1/synthetics/private-locations/{location_id}Get a private location
SyntheticsApiGetTestGet /api/v1/synthetics/tests/{public_id}Get a test configuration
SyntheticsApiListGlobalVariablesGet /api/v1/synthetics/variablesGet all global variables
SyntheticsApiListLocationsGet /api/v1/synthetics/locationsGet all locations (public and private)
SyntheticsApiListTestsGet /api/v1/synthetics/testsGet the list of all tests
SyntheticsApiTriggerCITestsPost /api/v1/synthetics/tests/trigger/ciTrigger tests from CI/CD pipelines
SyntheticsApiUpdateAPITestPut /api/v1/synthetics/tests/api/{public_id}Edit an API test
SyntheticsApiUpdateBrowserTestPut /api/v1/synthetics/tests/browser/{public_id}Edit a browser test
SyntheticsApiUpdatePrivateLocationPut /api/v1/synthetics/private-locations/{location_id}Edit a private location
SyntheticsApiUpdateTestPauseStatusPut /api/v1/synthetics/tests/{public_id}/statusPause or start a test
TagsApiCreateHostTagsPost /api/v1/tags/hosts/{host_name}Add tags to a host
TagsApiDeleteHostTagsDelete /api/v1/tags/hosts/{host_name}Remove host tags
TagsApiGetHostTagsGet /api/v1/tags/hosts/{host_name}Get host tags
TagsApiListHostTagsGet /api/v1/tags/hostsGet Tags
TagsApiUpdateHostTagsPut /api/v1/tags/hosts/{host_name}Update host tags
UsageMeteringApiGetDailyCustomReportsGet /api/v1/daily_custom_reportsGet the list of available daily custom reports
UsageMeteringApiGetIncidentManagementGet /api/v1/usage/incident-managementGet hourly usage for incident management
UsageMeteringApiGetIngestedSpansGet /api/v1/usage/ingested-spansGet hourly usage for ingested spans
UsageMeteringApiGetMonthlyCustomReportsGet /api/v1/monthly_custom_reportsGet the list of available monthly custom reports
UsageMeteringApiGetSpecifiedDailyCustomReportsGet /api/v1/daily_custom_reports/{report_id}Get specified daily custom reports
UsageMeteringApiGetSpecifiedMonthlyCustomReportsGet /api/v1/monthly_custom_reports/{report_id}Get specified monthly custom reports
UsageMeteringApiGetTracingWithoutLimitsGet /api/v1/usage/tracing-without-limitsGet hourly usage for tracing without limits
UsageMeteringApiGetUsageAnalyzedLogsGet /api/v1/usage/analyzed_logsGet hourly usage for analyzed logs
UsageMeteringApiGetUsageAttributionGet /api/v1/usage/attributionGet Usage Attribution
UsageMeteringApiGetUsageBillableSummaryGet /api/v1/usage/billable-summaryGet billable usage across your account
UsageMeteringApiGetUsageComplianceMonitoringGet /api/v1/usage/compliance-monitoringGet hourly usage for Compliance Monitoring
UsageMeteringApiGetUsageFargateGet /api/v1/usage/fargateGet hourly usage for Fargate
UsageMeteringApiGetUsageHostsGet /api/v1/usage/hostsGet hourly usage for hosts and containers
UsageMeteringApiGetUsageIndexedSpansGet /api/v1/usage/indexed-spansGet hourly usage for indexed spans
UsageMeteringApiGetUsageInternetOfThingsGet /api/v1/usage/iotGet hourly usage for IoT
UsageMeteringApiGetUsageLambdaGet /api/v1/usage/aws_lambdaGet hourly usage for Lambda
UsageMeteringApiGetUsageLogsGet /api/v1/usage/logsGet hourly usage for Logs
UsageMeteringApiGetUsageLogsByIndexGet /api/v1/usage/logs_by_indexGet hourly usage for Logs by Index
UsageMeteringApiGetUsageLogsByRetentionGet /api/v1/usage/logs-by-retentionGet hourly logs usage by retention
UsageMeteringApiGetUsageNetworkFlowsGet /api/v1/usage/network_flowsGet hourly usage for Network Flows
UsageMeteringApiGetUsageNetworkHostsGet /api/v1/usage/network_hostsGet hourly usage for Network Hosts
UsageMeteringApiGetUsageProfilingGet /api/v1/usage/profilingGet hourly usage for profiled hosts
UsageMeteringApiGetUsageRumSessionsGet /api/v1/usage/rum_sessionsGet hourly usage for RUM Sessions
UsageMeteringApiGetUsageSNMPGet /api/v1/usage/snmpGet hourly usage for SNMP devices
UsageMeteringApiGetUsageSummaryGet /api/v1/usage/summaryGet usage across your multi-org account
UsageMeteringApiGetUsageSyntheticsGet /api/v1/usage/syntheticsGet hourly usage for Synthetics Checks
UsageMeteringApiGetUsageSyntheticsAPIGet /api/v1/usage/synthetics_apiGet hourly usage for Synthetics API Checks
UsageMeteringApiGetUsageSyntheticsBrowserGet /api/v1/usage/synthetics_browserGet hourly usage for Synthetics Browser Checks
UsageMeteringApiGetUsageTimeseriesGet /api/v1/usage/timeseriesGet hourly usage for custom metrics
UsageMeteringApiGetUsageTopAvgMetricsGet /api/v1/usage/top_avg_metricsGet all custom metrics by hourly average
UsageMeteringApiGetUsageTraceGet /api/v1/usage/tracesGet hourly usage for Trace Search
UsersApiCreateUserPost /api/v1/userCreate a user
UsersApiDisableUserDelete /api/v1/user/{user_handle}Disable a user
UsersApiGetUserGet /api/v1/user/{user_handle}Get user details
UsersApiListUsersGet /api/v1/userList all users
UsersApiUpdateUserPut /api/v1/user/{user_handle}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.

apiKeyAuthQuery

  • Type: API key
  • API key parameter name: api_key
  • Location: URL query string

Note, each API key must be added to a map of map[string]APIKey where the key is: 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.

appKeyAuthQuery

  • Type: API key
  • API key parameter name: application_key
  • Location: URL query string

Note, each API key must be added to a map of map[string]APIKey where the key is: 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

[email protected]