Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(agentapplication): add ability to manage browser applications #991

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .tutone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,56 @@ auth:
api_key_env_var: NEW_RELIC_API_KEY

packages:
- name: agentApplications
path: pkg/agentapplications
import_path: github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications
generators:
- typegen
- nerdgraphclient
imports:
- github.com/newrelic/newrelic-client-go/v2/pkg/common
mutations:
- name: agentApplicationCreateBrowser
max_query_field_depth: 2
- name: agentApplicationDelete
max_query_field_depth: 1
- name: agentApplicationEnableApmBrowser
max_query_field_depth: 2
- name: agentApplicationSettingsUpdate
max_query_field_depth: 5
types:
- name: EntityGuid
field_type_override: common.EntityGUID
skip_type_create: true
- name: AgentApplicationSettingsApmConfigInput
field_type_override: "*AgentApplicationSettingsApmConfigInput"
- name: AgentApplicationSettingsBrowserConfigInput
field_type_override: "*AgentApplicationSettingsBrowserConfigInput"
- name: AgentApplicationSettingsBrowserMonitoringInput
field_type_override: "*AgentApplicationSettingsBrowserMonitoringInput"
- name: AgentApplicationSettingsErrorCollectorInput
field_type_override: "*AgentApplicationSettingsErrorCollectorInput"
- name: AgentApplicationSettingsJfrInput
field_type_override: "*AgentApplicationSettingsJfrInput"
- name: AgentApplicationSettingsMobileSettingsInput
field_type_override: "*AgentApplicationSettingsMobileSettingsInput"
- name: AgentApplicationSettingsSlowSqlInput
field_type_override: "*AgentApplicationSettingsSlowSqlInput"
- name: AgentApplicationSettingsThreadProfilerInput
field_type_override: "*AgentApplicationSettingsThreadProfilerInput"
- name: AgentApplicationSettingsTracerTypeInput
field_type_override: "*AgentApplicationSettingsTracerTypeInput"
- name: AgentApplicationSettingsTransactionTracerInput
field_type_override: "*AgentApplicationSettingsTransactionTracerInput"
- name: AgentApplicationSettingsBrowserAjaxInput
field_type_override: "*AgentApplicationSettingsBrowserAjaxInput"
- name: AgentApplicationSettingsBrowserDistributedTracingInput
field_type_override: "*AgentApplicationSettingsBrowserDistributedTracingInput"
- name: AgentApplicationSettingsBrowserLoaderInput
field_type_override: "*AgentApplicationSettingsBrowserLoaderInput"
- name: AgentApplicationSettingsBrowserPrivacyInput
field_type_override: "*AgentApplicationSettingsBrowserPrivacyInput"


- name: logconfigurations
path: pkg/logconfigurations
Expand Down
3 changes: 3 additions & 0 deletions newrelic/newrelic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
log "github.com/sirupsen/logrus"

"github.com/newrelic/newrelic-client-go/v2/pkg/accounts"
"github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications"
"github.com/newrelic/newrelic-client-go/v2/pkg/alerts"
"github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess"
"github.com/newrelic/newrelic-client-go/v2/pkg/apm"
Expand Down Expand Up @@ -38,6 +39,7 @@ import (

// NewRelic is a collection of New Relic APIs.
type NewRelic struct {
AgentApplications agentapplications.AgentApplications
Accounts accounts.Accounts
Alerts alerts.Alerts
APIAccess apiaccess.APIAccess
Expand Down Expand Up @@ -90,6 +92,7 @@ func New(opts ...ConfigOption) (*NewRelic, error) {
nr := &NewRelic{
config: cfg,

AgentApplications: agentapplications.New(cfg),
Accounts: accounts.New(cfg),
Alerts: alerts.New(cfg),
APIAccess: apiaccess.New(cfg),
Expand Down
19 changes: 19 additions & 0 deletions pkg/agentapplications/agentapplications.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package agentapplications

import (
"github.com/newrelic/newrelic-client-go/v2/internal/http"
"github.com/newrelic/newrelic-client-go/v2/pkg/config"
"github.com/newrelic/newrelic-client-go/v2/pkg/logging"
)

type AgentApplications struct {
client http.Client
logger logging.Logger
}

func New(config config.Config) AgentApplications {
return AgentApplications{
client: http.NewClient(config),
logger: config.GetLogger(),
}
}
284 changes: 284 additions & 0 deletions pkg/agentapplications/agentapplications_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading