From 268414ba8916938e83a63f9f33bf613f46f2f41e Mon Sep 17 00:00:00 2001 From: smcavallo Date: Fri, 8 Nov 2024 16:08:31 -0500 Subject: [PATCH 1/3] Upgrade to the latest new-relic-go v2 client Signed-off-by: smcavallo --- go.mod | 2 +- go.sum | 2 + pkg/scalers/newrelic_scaler.go | 4 +- .../newrelic-client-go/newrelic/newrelic.go | 319 - .../pkg/dashboards/dashboards_api.go | 1009 -- .../pkg/dashboards/type_overrides.go | 11 - .../pkg/dashboards/types.go | 379 - .../pkg/entities/entities.go | 22 - .../pkg/entities/entities_api.go | 2129 --- .../newrelic-client-go/pkg/nrdb/nrdb_query.go | 62 - .../pkg/testhelpers/helpers.go | 53 - .../newrelic-client-go/{ => v2}/LICENSE | 0 .../{ => v2}/internal/http/auth.go | 4 +- .../{ => v2}/internal/http/client.go | 29 +- .../{ => v2}/internal/http/compress.go | 0 .../{ => v2}/internal/http/errors.go | 0 .../{ => v2}/internal/http/graphql.go | 3 +- .../{ => v2}/internal/http/paging.go | 0 .../{ => v2}/internal/http/request.go | 9 +- .../{ => v2}/internal/http/retry.go | 0 .../{ => v2}/internal/http/test_helpers.go | 2 +- .../{ => v2}/internal/http/types.go | 0 .../internal/serialization/epoch_time.go | 15 +- .../serialization/map_string_interface.go | 0 .../v2/internal/utils/utils.go | 40 + .../{ => v2}/internal/version/version.go | 2 +- .../{ => v2}/newrelic/doc.go | 3 +- .../v2/newrelic/newrelic.go | 236 + .../accountmanagement/accountmanagement.go | 26 + .../accountmanagement_api.go | 172 + .../accountmanagement_api_.go | 73 + .../v2/pkg/accountmanagement/types.go | 81 + .../{ => v2}/pkg/accounts/accounts.go | 6 +- .../{ => v2}/pkg/accounts/doc.go | 3 +- .../{ => v2}/pkg/accounts/types.go | 0 .../newrelic-client-go/v2/pkg/agent/agent.go | 19 + .../v2/pkg/agent/agent_api.go | 46 + .../newrelic-client-go/v2/pkg/agent/types.go | 96 + .../agentapplications/agentapplications.go | 19 + .../agentapplications_api.go | 284 + .../v2/pkg/agentapplications/types.go | 686 + .../{ => v2}/pkg/ai/types.go | 0 .../{ => v2}/pkg/ai/types_ai.go | 78 + .../{ => v2}/pkg/alerts/alerts.go | 8 +- .../{ => v2}/pkg/alerts/channels.go | 4 +- .../{ => v2}/pkg/alerts/conditions.go | 6 +- .../{ => v2}/pkg/alerts/doc.go | 3 +- .../{ => v2}/pkg/alerts/events.go | 4 +- .../{ => v2}/pkg/alerts/incidents.go | 2 +- .../pkg/alerts/infrastructure_conditions.go | 2 +- .../multi_location_synthetics_conditions.go | 2 +- .../{ => v2}/pkg/alerts/muting_rules.go | 0 .../{ => v2}/pkg/alerts/nerdgraph.go | 2 +- .../{ => v2}/pkg/alerts/nrql_conditions.go | 65 +- .../{ => v2}/pkg/alerts/plugins_conditions.go | 2 +- .../{ => v2}/pkg/alerts/policies.go | 6 +- .../{ => v2}/pkg/alerts/policy_channels.go | 0 .../{ => v2}/pkg/alerts/serialization.go | 0 .../pkg/alerts/synthetics_conditions.go | 2 +- .../{ => v2}/pkg/alerts/types.go | 2 +- .../{ => v2}/pkg/apiaccess/apiaccess.go | 6 +- .../{ => v2}/pkg/apiaccess/insights_keys.go | 0 .../{ => v2}/pkg/apiaccess/keys.go | 44 +- .../{ => v2}/pkg/apiaccess/types.go | 23 +- .../v2/pkg/apiaccess/types_apiaccess.go | 11 + .../{ => v2}/pkg/apm/apm.go | 4 +- .../{ => v2}/pkg/apm/application_instances.go | 0 .../{ => v2}/pkg/apm/applications.go | 0 .../{ => v2}/pkg/apm/applications_metrics.go | 0 .../{ => v2}/pkg/apm/applications_rest.go | 0 .../{ => v2}/pkg/apm/deployments.go | 2 +- .../{ => v2}/pkg/apm/doc.go | 5 +- .../{ => v2}/pkg/apm/key_transactions.go | 0 .../{ => v2}/pkg/apm/labels.go | 2 +- .../authorizationmanagement.go | 24 + .../authorizationmanagement_api.go | 147 + .../v2/pkg/authorizationmanagement/types.go | 163 + .../v2/pkg/changetracking/changetracking.go | 29 + .../pkg/changetracking/changetracking_api.go | 71 + .../v2/pkg/changetracking/types.go | 127 + .../{ => v2}/pkg/cloud/cloud.go | 6 +- .../{ => v2}/pkg/cloud/cloud_api.go | 966 +- .../{ => v2}/pkg/cloud/types.go | 539 +- .../{ => v2}/pkg/common/types.go | 0 .../{ => v2}/pkg/config/compression.go | 0 .../{ => v2}/pkg/config/config.go | 43 +- .../{ => v2}/pkg/config/doc.go | 3 +- .../newrelic-client-go/v2/pkg/config/main.go | 194 + .../{ => v2}/pkg/contextkeys/contextkeys.go | 0 .../customeradministration.go | 24 + .../customeradministration_api.go | 692 + .../v2/pkg/customeradministration/types.go | 2053 +++ .../{ => v2}/pkg/dashboards/dashboard.go | 30 +- .../{ => v2}/pkg/dashboards/dashboards.go | 6 +- .../v2/pkg/dashboards/dashboards_api.go | 4310 +++++ .../pkg/dashboards/dashboards_types.go | 90 +- .../{ => v2}/pkg/dashboards/doc.go | 3 +- .../v2/pkg/dashboards/type_overrides.go | 46 + .../v2/pkg/dashboards/types.go | 584 + .../{ => v2}/pkg/edge/doc.go | 3 +- .../{ => v2}/pkg/edge/edge.go | 6 +- .../{ => v2}/pkg/edge/trace_observers.go | 0 .../{ => v2}/pkg/edge/types.go | 0 .../{ => v2}/pkg/entities/doc.go | 3 +- .../v2/pkg/entities/entities.go | 133 + .../v2/pkg/entities/entities_api.go | 9093 ++++++++++ .../v2/pkg/entities/entities_api_.go | 164 + .../{ => v2}/pkg/entities/entity.go | 11 + .../v2/pkg/entities/entity_guid_validator.go | 70 + .../{ => v2}/pkg/entities/tags.go | 2 +- .../{ => v2}/pkg/entities/types.go | 14566 +++++----------- .../v2/pkg/entities/types_.go | 183 + .../{ => v2}/pkg/errors/errors.go | 0 .../{ => v2}/pkg/events/doc.go | 3 +- .../{ => v2}/pkg/events/events.go | 6 +- .../{ => v2}/pkg/events/events_batch.go | 7 +- .../v2/pkg/events/events_service.go | 27 + .../pkg/eventstometrics/eventstometrics.go | 8 +- .../{ => v2}/pkg/eventstometrics/types.go | 2 +- .../{ => v2}/pkg/infrastructure/doc.go | 0 .../pkg/infrastructure/infrastructure.go | 2 +- .../{ => v2}/pkg/infrastructure/types.go | 0 .../pkg/installevents/installevents.go | 6 +- .../pkg/installevents/installevents_api.go | 2 + .../{ => v2}/pkg/installevents/types.go | 12 +- .../v2/pkg/keytransaction/keytransaction.go | 23 + .../pkg/keytransaction/keytransaction_api.go | 967 + .../v2/pkg/keytransaction/types.go | 2375 +++ .../logconfigurations/logconfigurations.go | 26 + .../logconfigurations_api.go | 1169 ++ .../v2/pkg/logconfigurations/types.go | 531 + .../{ => v2}/pkg/logging/logger.go | 0 .../{ => v2}/pkg/logging/logrus_logger.go | 0 .../{ => v2}/pkg/logging/mock_logger.go | 0 .../{ => v2}/pkg/logs/logs.go | 6 +- .../{ => v2}/pkg/logs/logs_batch.go | 6 +- .../{ => v2}/pkg/nerdgraph/doc.go | 3 +- .../{ => v2}/pkg/nerdgraph/nerdgraph.go | 6 +- .../{ => v2}/pkg/nerdstorage/doc.go | 3 +- .../{ => v2}/pkg/nerdstorage/nerdstorage.go | 6 +- .../{ => v2}/pkg/nerdstorage/types.go | 0 .../pkg/notifications/notifications.go | 8 +- .../pkg/notifications/notifications_api.go | 34 +- .../{ => v2}/pkg/notifications/types.go | 121 +- .../{ => v2}/pkg/nrdb/doc.go | 3 +- .../{ => v2}/pkg/nrdb/nrdb.go | 6 +- .../v2/pkg/nrdb/nrdb_api.go | 284 + .../{ => v2}/pkg/nrdb/types.go | 46 +- .../pkg/nrqldroprules/nrqldroprules.go | 6 +- .../pkg/nrqldroprules/nrqldroprules_api.go | 55 + .../pkg/nrqldroprules/nrqldroprules_api_.go | 26 + .../{ => v2}/pkg/nrqldroprules/types.go | 32 +- .../{ => v2}/pkg/nrtime/types.go | 2 +- .../{ => v2}/pkg/nrtime/types_func.go | 2 +- .../v2/pkg/organization/organization.go | 24 + .../v2/pkg/organization/organization_api.go | 219 + .../v2/pkg/organization/types.go | 154 + .../{ => v2}/pkg/plugins/components.go | 0 .../{ => v2}/pkg/plugins/doc.go | 3 +- .../{ => v2}/pkg/plugins/plugins.go | 6 +- .../{ => v2}/pkg/plugins/plugins_types.go | 0 .../{ => v2}/pkg/region/errors.go | 0 .../{ => v2}/pkg/region/region.go | 0 .../{ => v2}/pkg/region/region_constants.go | 22 + .../{ => v2}/pkg/servicelevel/servicelevel.go | 6 +- .../pkg/servicelevel/servicelevel_api.go | 16 +- .../{ => v2}/pkg/servicelevel/types.go | 48 +- .../{ => v2}/pkg/synthetics/doc.go | 4 +- .../pkg/synthetics/monitor_locations.go | 0 .../pkg/synthetics/monitor_scripts.go | 10 +- .../{ => v2}/pkg/synthetics/monitors.go | 54 +- .../pkg/synthetics/secure_credentials.go | 0 .../{ => v2}/pkg/synthetics/serialization.go | 0 .../{ => v2}/pkg/synthetics/synthetics.go | 6 +- .../{ => v2}/pkg/synthetics/synthetics_api.go | 671 +- .../synthetics_api_monitor_downtime.go | 262 + .../{ => v2}/pkg/synthetics/types.go | 848 +- .../{ => v2}/pkg/testhelpers/config.go | 5 +- .../v2/pkg/testhelpers/helpers.go | 83 + .../{ => v2}/pkg/testhelpers/mock.go | 0 .../v2/pkg/usermanagement/types.go | 599 + .../v2/pkg/usermanagement/usermanagement.go | 24 + .../pkg/usermanagement/usermanagement_api.go | 437 + .../usermanagement_api_queries.go | 205 + .../{ => v2}/pkg/users/doc.go | 3 +- .../{ => v2}/pkg/users/types.go | 0 .../{ => v2}/pkg/users/users.go | 6 +- .../{ => v2}/pkg/users/users_api.go | 0 .../{ => v2}/pkg/workflows/types.go | 80 +- .../{ => v2}/pkg/workflows/workflows.go | 8 +- .../{ => v2}/pkg/workflows/workflows_api.go | 31 +- .../{ => v2}/pkg/workloads/doc.go | 3 +- .../{ => v2}/pkg/workloads/types.go | 8 +- .../{ => v2}/pkg/workloads/workloads.go | 6 +- .../{ => v2}/pkg/workloads/workloads_api.go | 2 +- vendor/modules.txt | 89 +- 196 files changed, 35868 insertions(+), 14410 deletions(-) delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/newrelic/newrelic.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_api.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/type_overrides.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/types.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities_api.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/nrdb/nrdb_query.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/pkg/testhelpers/helpers.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/LICENSE (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/auth.go (94%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/client.go (93%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/compress.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/errors.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/graphql.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/paging.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/request.go (93%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/retry.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/test_helpers.go (83%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/http/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/serialization/epoch_time.go (73%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/serialization/map_string_interface.go (100%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/internal/utils/utils.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/internal/version/version.go (57%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/newrelic/doc.go (97%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/newrelic.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api_.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/accounts/accounts.go (89%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/accounts/doc.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/accounts/types.go (100%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/types.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/ai/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/ai/types_ai.go (87%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/alerts.go (77%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/channels.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/conditions.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/doc.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/events.go (94%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/incidents.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/infrastructure_conditions.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/multi_location_synthetics_conditions.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/muting_rules.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/nerdgraph.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/nrql_conditions.go (95%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/plugins_conditions.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/policies.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/policy_channels.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/serialization.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/synthetics_conditions.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/alerts/types.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apiaccess/apiaccess.go (81%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apiaccess/insights_keys.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apiaccess/keys.go (82%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apiaccess/types.go (97%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types_apiaccess.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/apm.go (82%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/application_instances.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/applications.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/applications_metrics.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/applications_rest.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/deployments.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/doc.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/key_transactions.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/apm/labels.go (98%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/types.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/cloud/cloud.go (70%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/cloud/cloud_api.go (73%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/cloud/types.go (93%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/common/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/config/compression.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/config/config.go (73%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/config/doc.go (95%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/main.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/contextkeys/contextkeys.go (100%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/dashboards/dashboard.go (81%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/dashboards/dashboards.go (79%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_api.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/dashboards/dashboards_types.go (77%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/dashboards/doc.go (97%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/type_overrides.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/edge/doc.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/edge/edge.go (71%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/edge/trace_observers.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/edge/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/entities/doc.go (97%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api_.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/entities/entity.go (94%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity_guid_validator.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/entities/tags.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/entities/types.go (57%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/types_.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/errors/errors.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/events/doc.go (95%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/events/events.go (93%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/events/events_batch.go (98%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/events/events_service.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/eventstometrics/eventstometrics.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/eventstometrics/types.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/infrastructure/doc.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/infrastructure/infrastructure.go (95%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/infrastructure/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/installevents/installevents.go (68%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/installevents/installevents_api.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/installevents/types.go (95%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction/keytransaction.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction/keytransaction_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction/types.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/logconfigurations/logconfigurations.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/logconfigurations/logconfigurations_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/logconfigurations/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/logging/logger.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/logging/logrus_logger.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/logging/mock_logger.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/logs/logs.go (89%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/logs/logs_batch.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nerdgraph/doc.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nerdgraph/nerdgraph.go (94%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nerdstorage/doc.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nerdstorage/nerdstorage.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nerdstorage/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/notifications/notifications.go (78%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/notifications/notifications_api.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/notifications/types.go (91%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrdb/doc.go (97%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrdb/nrdb.go (72%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/nrdb/nrdb_api.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrdb/types.go (87%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrqldroprules/nrqldroprules.go (73%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrqldroprules/nrqldroprules_api.go (87%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/nrqldroprules/nrqldroprules_api_.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrqldroprules/types.go (85%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrtime/types.go (95%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/nrtime/types_func.go (94%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/organization/organization.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/organization/organization_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/organization/types.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/plugins/components.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/plugins/doc.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/plugins/plugins.go (93%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/plugins/plugins_types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/region/errors.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/region/region.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/region/region_constants.go (81%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/servicelevel/servicelevel.go (82%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/servicelevel/servicelevel_api.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/servicelevel/types.go (88%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/doc.go (98%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/monitor_locations.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/monitor_scripts.go (89%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/monitors.go (79%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/secure_credentials.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/serialization.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/synthetics.go (90%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/synthetics_api.go (68%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/synthetics/synthetics_api_monitor_downtime.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/synthetics/types.go (59%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/testhelpers/config.go (94%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers/helpers.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/testhelpers/mock.go (100%) create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/usermanagement/types.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/usermanagement/usermanagement.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/usermanagement/usermanagement_api.go create mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/usermanagement/usermanagement_api_queries.go rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/users/doc.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/users/types.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/users/users.go (70%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/users/users_api.go (100%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workflows/types.go (89%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workflows/workflows.go (78%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workflows/workflows_api.go (90%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workloads/doc.go (96%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workloads/types.go (99%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workloads/workloads.go (73%) rename vendor/github.com/newrelic/newrelic-client-go/{ => v2}/pkg/workloads/workloads_api.go (99%) diff --git a/go.mod b/go.mod index 1b2684e2532..6a67207a05f 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/microsoft/ApplicationInsights-Go v0.4.4 github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 github.com/mitchellh/hashstructure v1.1.0 - github.com/newrelic/newrelic-client-go v1.1.0 + github.com/newrelic/newrelic-client-go/v2 v2.51.2 github.com/onsi/ginkgo/v2 v2.21.0 github.com/onsi/gomega v1.35.1 github.com/open-policy-agent/cert-controller v0.12.0 diff --git a/go.sum b/go.sum index 4891c93dc5f..f1779b617be 100644 --- a/go.sum +++ b/go.sum @@ -2173,6 +2173,8 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/newrelic/newrelic-client-go v1.1.0 h1:aflNjzQ21c+2GwBVh+UbAf9lznkRfCcVABoc5UM4IXw= github.com/newrelic/newrelic-client-go v1.1.0/go.mod h1:RYMXt7hgYw7nzuXIGd2BH0F1AivgWw7WrBhNBQZEB4k= +github.com/newrelic/newrelic-client-go/v2 v2.51.2 h1:Xf+M0NuZuIuxqG48zYoqyIdQL514j2J1c+kNVYajcYI= +github.com/newrelic/newrelic-client-go/v2 v2.51.2/go.mod h1:+RRjI3nDGWT3kLm9Oi3QxpBm70uu8q1upEHBVWCZFpo= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= diff --git a/pkg/scalers/newrelic_scaler.go b/pkg/scalers/newrelic_scaler.go index 851747a5beb..5892cdf6478 100644 --- a/pkg/scalers/newrelic_scaler.go +++ b/pkg/scalers/newrelic_scaler.go @@ -7,8 +7,8 @@ import ( "strconv" "github.com/go-logr/logr" - "github.com/newrelic/newrelic-client-go/newrelic" - "github.com/newrelic/newrelic-client-go/pkg/nrdb" + "github.com/newrelic/newrelic-client-go/v2/newrelic" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrdb" v2 "k8s.io/api/autoscaling/v2" "k8s.io/metrics/pkg/apis/external_metrics" diff --git a/vendor/github.com/newrelic/newrelic-client-go/newrelic/newrelic.go b/vendor/github.com/newrelic/newrelic-client-go/newrelic/newrelic.go deleted file mode 100644 index 37ec0b25236..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/newrelic/newrelic.go +++ /dev/null @@ -1,319 +0,0 @@ -package newrelic - -import ( - "errors" - "net/http" - "time" - - log "github.com/sirupsen/logrus" - - "github.com/newrelic/newrelic-client-go/pkg/accounts" - "github.com/newrelic/newrelic-client-go/pkg/alerts" - "github.com/newrelic/newrelic-client-go/pkg/apiaccess" - "github.com/newrelic/newrelic-client-go/pkg/apm" - "github.com/newrelic/newrelic-client-go/pkg/cloud" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/dashboards" - "github.com/newrelic/newrelic-client-go/pkg/edge" - "github.com/newrelic/newrelic-client-go/pkg/entities" - "github.com/newrelic/newrelic-client-go/pkg/events" - "github.com/newrelic/newrelic-client-go/pkg/eventstometrics" - "github.com/newrelic/newrelic-client-go/pkg/installevents" - "github.com/newrelic/newrelic-client-go/pkg/logging" - "github.com/newrelic/newrelic-client-go/pkg/logs" - "github.com/newrelic/newrelic-client-go/pkg/nerdgraph" - "github.com/newrelic/newrelic-client-go/pkg/nerdstorage" - "github.com/newrelic/newrelic-client-go/pkg/notifications" - "github.com/newrelic/newrelic-client-go/pkg/nrdb" - "github.com/newrelic/newrelic-client-go/pkg/nrqldroprules" - "github.com/newrelic/newrelic-client-go/pkg/plugins" - "github.com/newrelic/newrelic-client-go/pkg/region" - "github.com/newrelic/newrelic-client-go/pkg/servicelevel" - "github.com/newrelic/newrelic-client-go/pkg/synthetics" - "github.com/newrelic/newrelic-client-go/pkg/workflows" - "github.com/newrelic/newrelic-client-go/pkg/workloads" -) - -// NewRelic is a collection of New Relic APIs. -type NewRelic struct { - Accounts accounts.Accounts - Alerts alerts.Alerts - APIAccess apiaccess.APIAccess - APM apm.APM - Cloud cloud.Cloud - Dashboards dashboards.Dashboards - Edge edge.Edge - Entities entities.Entities - Events events.Events - EventsToMetrics eventstometrics.EventsToMetrics - InstallEvents installevents.Installevents - Logs logs.Logs - NerdGraph nerdgraph.NerdGraph - NerdStorage nerdstorage.NerdStorage - Notifications notifications.Notifications - Nrdb nrdb.Nrdb - Nrqldroprules nrqldroprules.Nrqldroprules - Plugins plugins.Plugins - ServiceLevel servicelevel.Servicelevel - Synthetics synthetics.Synthetics - Workflows workflows.Workflows - Workloads workloads.Workloads - - config config.Config -} - -// New returns a collection of New Relic APIs. -func New(opts ...ConfigOption) (*NewRelic, error) { - cfg := config.New() - - // Loop through config options - for _, fn := range opts { - if nil != fn { - if err := fn(&cfg); err != nil { - return nil, err - } - } - } - - if cfg.PersonalAPIKey == "" && cfg.AdminAPIKey == "" && cfg.InsightsInsertKey == "" { - return nil, errors.New("must use at least one of: ConfigPersonalAPIKey, ConfigAdminAPIKey, ConfigInsightsInsertKey") - } - - if cfg.Logger == nil { - cfg.Logger = cfg.GetLogger() - } - - nr := &NewRelic{ - config: cfg, - - Accounts: accounts.New(cfg), - Alerts: alerts.New(cfg), - APIAccess: apiaccess.New(cfg), - APM: apm.New(cfg), - Cloud: cloud.New(cfg), - Dashboards: dashboards.New(cfg), - Edge: edge.New(cfg), - Entities: entities.New(cfg), - Events: events.New(cfg), - EventsToMetrics: eventstometrics.New(cfg), - InstallEvents: installevents.New(cfg), - Logs: logs.New(cfg), - NerdGraph: nerdgraph.New(cfg), - NerdStorage: nerdstorage.New(cfg), - Notifications: notifications.New(cfg), - Nrdb: nrdb.New(cfg), - Nrqldroprules: nrqldroprules.New(cfg), - Plugins: plugins.New(cfg), - ServiceLevel: servicelevel.New(cfg), - Synthetics: synthetics.New(cfg), - Workflows: workflows.New(cfg), - Workloads: workloads.New(cfg), - } - - return nr, nil -} - -func (nr *NewRelic) SetLogLevel(levelName string) { - nr.config.Logger.SetLevel(levelName) -} - -// TestEndpoints makes a few calls to determine if the NewRelic enpoints are reachable. -func (nr *NewRelic) TestEndpoints() error { - endpoints := []string{ - nr.config.Region().InfrastructureURL(), - nr.config.Region().LogsURL(), - nr.config.Region().NerdGraphURL(), - nr.config.Region().RestURL(), - } - - for _, e := range endpoints { - _, err := http.Get(e) - if err != nil { - return err - } - } - - return nil -} - -// ConfigOption configures the Config when provided to NewApplication. -// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys -type ConfigOption func(*config.Config) error - -// ConfigPersonalAPIKey sets the New Relic Admin API key this client will use. -// This key should be used to create a client instance. -// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys -func ConfigPersonalAPIKey(apiKey string) ConfigOption { - return func(cfg *config.Config) error { - cfg.PersonalAPIKey = apiKey - return nil - } -} - -// ConfigInsightsInsertKey sets the New Relic Insights insert key this client will use. -// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys -func ConfigInsightsInsertKey(insightsInsertKey string) ConfigOption { - return func(cfg *config.Config) error { - cfg.InsightsInsertKey = insightsInsertKey - return nil - } -} - -// ConfigAdminAPIKey sets the New Relic Admin API key this client will use. -// Deprecated. Use a personal API key for authentication. -// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys -func ConfigAdminAPIKey(adminAPIKey string) ConfigOption { - return func(cfg *config.Config) error { - cfg.AdminAPIKey = adminAPIKey - return nil - } -} - -// ConfigRegion sets the New Relic Region this client will use. -func ConfigRegion(r string) ConfigOption { - return func(cfg *config.Config) error { - // We can ignore this error since we will be defaulting in the next step - regName, _ := region.Parse(r) - - reg, err := region.Get(regName) - if err != nil { - if _, ok := err.(region.UnknownUsingDefaultError); ok { - // If region wasn't provided, output a warning message - // indicating the default region "US" is being used. - log.Warn(err) - return nil - } - - return err - } - - err = cfg.SetRegion(reg) - - return err - } -} - -// ConfigHTTPTimeout sets the timeout for HTTP requests. -func ConfigHTTPTimeout(t time.Duration) ConfigOption { - return func(cfg *config.Config) error { - var timeout = &t - cfg.Timeout = timeout - return nil - } -} - -// ConfigHTTPTransport sets the HTTP Transporter. -func ConfigHTTPTransport(transport http.RoundTripper) ConfigOption { - return func(cfg *config.Config) error { - if transport != nil { - cfg.HTTPTransport = transport - return nil - } - - return errors.New("HTTP Transport can not be nil") - } -} - -// ConfigUserAgent sets the HTTP UserAgent for API requests. -func ConfigUserAgent(ua string) ConfigOption { - return func(cfg *config.Config) error { - if ua != "" { - cfg.UserAgent = ua - return nil - } - - return errors.New("user-agent can not be empty") - } -} - -// ConfigServiceName sets the service name logged -func ConfigServiceName(name string) ConfigOption { - return func(cfg *config.Config) error { - if name != "" { - cfg.ServiceName = name - } - - return nil - } -} - -// ConfigBaseURL sets the base URL used to make requests to the REST API V2. -func ConfigBaseURL(url string) ConfigOption { - return func(cfg *config.Config) error { - if url != "" { - cfg.Region().SetRestBaseURL(url) - return nil - } - - return errors.New("base URL can not be empty") - } -} - -// ConfigInfrastructureBaseURL sets the base URL used to make requests to the Infrastructure API. -func ConfigInfrastructureBaseURL(url string) ConfigOption { - return func(cfg *config.Config) error { - if url != "" { - cfg.Region().SetInfrastructureBaseURL(url) - return nil - } - - return errors.New("infrastructure base URL can not be empty") - } -} - -// ConfigSyntheticsBaseURL sets the base URL used to make requests to the Synthetics API. -func ConfigSyntheticsBaseURL(url string) ConfigOption { - return func(cfg *config.Config) error { - if url != "" { - cfg.Region().SetSyntheticsBaseURL(url) - return nil - } - - return errors.New("synthetics base URL can not be empty") - } -} - -// ConfigNerdGraphBaseURL sets the base URL used to make requests to the NerdGraph API. -func ConfigNerdGraphBaseURL(url string) ConfigOption { - return func(cfg *config.Config) error { - if url != "" { - cfg.Region().SetNerdGraphBaseURL(url) - return nil - } - - return errors.New("nerdgraph base URL can not be empty") - } -} - -// ConfigLogLevel sets the log level for the client. -func ConfigLogLevel(logLevel string) ConfigOption { - return func(cfg *config.Config) error { - if logLevel != "" { - cfg.LogLevel = logLevel - return nil - } - - return errors.New("log level can not be empty") - } -} - -// ConfigLogJSON toggles JSON formatting on for the logger if set to true. -func ConfigLogJSON(logJSON bool) ConfigOption { - return func(cfg *config.Config) error { - cfg.LogJSON = logJSON - return nil - } -} - -// ConfigLogger can be used to customize the client's logger. -// Custom loggers must conform to the logging.Logger interface. -func ConfigLogger(logger logging.Logger) ConfigOption { - return func(cfg *config.Config) error { - if logger != nil { - cfg.Logger = logger - return nil - } - - return errors.New("logger can not be nil") - } -} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_api.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_api.go deleted file mode 100644 index 0d974e44505..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_api.go +++ /dev/null @@ -1,1009 +0,0 @@ -// Code generated by tutone: DO NOT EDIT -package dashboards - -import ( - "context" - "fmt" - - "github.com/newrelic/newrelic-client-go/pkg/common" -) - -// Create a `DashboardEntity` -func (a *Dashboards) DashboardCreate( - accountID int, - dashboard DashboardInput, -) (*DashboardCreateResult, error) { - return a.DashboardCreateWithContext(context.Background(), - accountID, - dashboard, - ) -} - -// Create a `DashboardEntity` -func (a *Dashboards) DashboardCreateWithContext( - ctx context.Context, - accountID int, - dashboard DashboardInput, -) (*DashboardCreateResult, error) { - - resp := DashboardCreateQueryResponse{} - vars := map[string]interface{}{ - "accountId": accountID, - "dashboard": dashboard, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, DashboardCreateMutation, vars, &resp); err != nil { - return nil, err - } - - // If we got errors back, wrap them all up - if len(resp.DashboardCreateResult.Errors) > 0 { - errs := fmt.Errorf("query error") - for _, err := range resp.DashboardCreateResult.Errors { - errs = fmt.Errorf("%w; %s", errs, err.Description) - } - return nil, errs - } - - return &resp.DashboardCreateResult, nil -} - -type DashboardCreateQueryResponse struct { - DashboardCreateResult DashboardCreateResult `json:"DashboardCreate"` -} - -const DashboardCreateMutation = `mutation( - $accountId: Int!, - $dashboard: DashboardInput!, -) { dashboardCreate( - accountId: $accountId, - dashboard: $dashboard, -) { - entityResult { - accountId - createdAt - description - guid - name - owner { - email - userId - } - pages { - createdAt - description - guid - name - owner { - email - userId - } - updatedAt - widgets { - configuration { - area { - nrqlQueries { - accountId - query - } - } - bar { - nrqlQueries { - accountId - query - } - } - billboard { - nrqlQueries { - accountId - query - } - thresholds { - alertSeverity - value - } - } - line { - nrqlQueries { - accountId - query - } - } - markdown { - text - } - pie { - nrqlQueries { - accountId - query - } - } - table { - nrqlQueries { - accountId - query - } - } - } - id - layout { - column - height - row - width - } - linkedEntities { - __typename - account { - id - name - reportingEventTypes - } - accountId - alertSeverity - domain - entityType - guid - indexedAt - name - permalink - reporting - tags { - key - values - } - type - ... on ApmApplicationEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - apmBrowserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - } - apmSummary { - apdexScore - errorRate - hostCount - instanceCount - nonWebResponseTimeAverage - nonWebThroughput - responseTimeAverage - throughput - webResponseTimeAverage - webThroughput - } - applicationId - language - runningAgentVersions { - maxVersion - minVersion - } - settings { - apdexTarget - serverSideConfig - } - tags { - key - values - } - } - ... on ApmDatabaseInstanceEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - host - portOrPath - tags { - key - values - } - vendor - } - ... on ApmExternalServiceEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - externalSummary { - responseTimeAverage - throughput - } - host - tags { - key - values - } - } - ... on BrowserApplicationEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - agentInstallType - applicationId - browserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - pageLoadTimeMedian - spaResponseTimeAverage - spaResponseTimeMedian - } - runningAgentVersions { - maxVersion - minVersion - } - servingApmApplicationId - settings { - apdexTarget - } - tags { - key - values - } - } - ... on DashboardEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - createdAt - dashboardParentGuid - owner { - email - userId - } - permissions - tags { - key - values - } - updatedAt - } - ... on ExternalEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on GenericEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on GenericInfrastructureEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - tags { - key - values - } - } - ... on InfrastructureAwsLambdaFunctionEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - runtime - tags { - key - values - } - } - ... on InfrastructureHostEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - hostSummary { - cpuUtilizationPercent - diskUsedPercent - memoryUsedPercent - networkReceiveRate - networkTransmitRate - servicesCount - } - tags { - key - values - } - } - ... on MobileApplicationEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - applicationId - mobileSummary { - appLaunchCount - crashCount - crashRate - httpErrorRate - httpRequestCount - httpRequestRate - httpResponseTimeAverage - mobileSessionCount - networkFailureRate - usersAffectedCount - } - tags { - key - values - } - } - ... on SecureCredentialEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - description - secureCredentialId - secureCredentialSummary { - failingMonitorCount - monitorCount - } - tags { - key - values - } - updatedAt - } - ... on SyntheticMonitorEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - monitorId - monitorSummary { - locationsFailing - locationsRunning - status - successRate - } - monitorType - monitoredUrl - period - tags { - key - values - } - } - ... on ThirdPartyServiceEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on UnavailableEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on WorkloadEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - createdAt - createdByUser { - email - gravatar - id - name - } - tags { - key - values - } - updatedAt - workloadStatus { - description - statusSource - statusValue - summary - } - } - } - rawConfiguration - title - visualization { - id - } - } - } - permissions - updatedAt - } - errors { - description - type - } -} }` - -// Delete an existing `DashboardEntity` -func (a *Dashboards) DashboardDelete( - gUID common.EntityGUID, -) (*DashboardDeleteResult, error) { - return a.DashboardDeleteWithContext(context.Background(), - gUID, - ) -} - -// Delete an existing `DashboardEntity` -func (a *Dashboards) DashboardDeleteWithContext( - ctx context.Context, - gUID common.EntityGUID, -) (*DashboardDeleteResult, error) { - - resp := DashboardDeleteQueryResponse{} - vars := map[string]interface{}{ - "guid": gUID, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, DashboardDeleteMutation, vars, &resp); err != nil { - return nil, err - } - - // If we got errors back, wrap them all up - if len(resp.DashboardDeleteResult.Errors) > 0 { - errs := fmt.Errorf("query error") - for _, err := range resp.DashboardDeleteResult.Errors { - errs = fmt.Errorf("%w; %s", errs, err.Description) - } - return nil, errs - } - - return &resp.DashboardDeleteResult, nil -} - -type DashboardDeleteQueryResponse struct { - DashboardDeleteResult DashboardDeleteResult `json:"DashboardDelete"` -} - -const DashboardDeleteMutation = `mutation( - $guid: EntityGuid!, -) { dashboardDelete( - guid: $guid, -) { - errors { - description - type - } - status -} }` - -// Update an existing `DashboardEntity` -func (a *Dashboards) DashboardUpdate( - dashboard DashboardInput, - gUID common.EntityGUID, -) (*DashboardUpdateResult, error) { - return a.DashboardUpdateWithContext(context.Background(), - dashboard, - gUID, - ) -} - -// Update an existing `DashboardEntity` -func (a *Dashboards) DashboardUpdateWithContext( - ctx context.Context, - dashboard DashboardInput, - gUID common.EntityGUID, -) (*DashboardUpdateResult, error) { - - resp := DashboardUpdateQueryResponse{} - vars := map[string]interface{}{ - "dashboard": dashboard, - "guid": gUID, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, DashboardUpdateMutation, vars, &resp); err != nil { - return nil, err - } - - // If we got errors back, wrap them all up - if len(resp.DashboardUpdateResult.Errors) > 0 { - errs := fmt.Errorf("query error") - for _, err := range resp.DashboardUpdateResult.Errors { - errs = fmt.Errorf("%w; %s", errs, err.Description) - } - return nil, errs - } - - return &resp.DashboardUpdateResult, nil -} - -type DashboardUpdateQueryResponse struct { - DashboardUpdateResult DashboardUpdateResult `json:"DashboardUpdate"` -} - -const DashboardUpdateMutation = `mutation( - $dashboard: DashboardInput!, - $guid: EntityGuid!, -) { dashboardUpdate( - dashboard: $dashboard, - guid: $guid, -) { - entityResult { - accountId - createdAt - description - guid - name - owner { - email - userId - } - pages { - createdAt - description - guid - name - owner { - email - userId - } - updatedAt - widgets { - configuration { - area { - nrqlQueries { - accountId - query - } - } - bar { - nrqlQueries { - accountId - query - } - } - billboard { - nrqlQueries { - accountId - query - } - thresholds { - alertSeverity - value - } - } - line { - nrqlQueries { - accountId - query - } - } - markdown { - text - } - pie { - nrqlQueries { - accountId - query - } - } - table { - nrqlQueries { - accountId - query - } - } - } - id - layout { - column - height - row - width - } - linkedEntities { - __typename - account { - id - name - reportingEventTypes - } - accountId - alertSeverity - domain - entityType - guid - indexedAt - name - permalink - reporting - tags { - key - values - } - type - ... on ApmApplicationEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - apmBrowserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - } - apmSummary { - apdexScore - errorRate - hostCount - instanceCount - nonWebResponseTimeAverage - nonWebThroughput - responseTimeAverage - throughput - webResponseTimeAverage - webThroughput - } - applicationId - language - runningAgentVersions { - maxVersion - minVersion - } - settings { - apdexTarget - serverSideConfig - } - tags { - key - values - } - } - ... on ApmDatabaseInstanceEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - host - portOrPath - tags { - key - values - } - vendor - } - ... on ApmExternalServiceEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - externalSummary { - responseTimeAverage - throughput - } - host - tags { - key - values - } - } - ... on BrowserApplicationEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - agentInstallType - applicationId - browserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - pageLoadTimeMedian - spaResponseTimeAverage - spaResponseTimeMedian - } - runningAgentVersions { - maxVersion - minVersion - } - servingApmApplicationId - settings { - apdexTarget - } - tags { - key - values - } - } - ... on DashboardEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - createdAt - dashboardParentGuid - owner { - email - userId - } - permissions - tags { - key - values - } - updatedAt - } - ... on ExternalEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on GenericEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on GenericInfrastructureEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - tags { - key - values - } - } - ... on InfrastructureAwsLambdaFunctionEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - runtime - tags { - key - values - } - } - ... on InfrastructureHostEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - hostSummary { - cpuUtilizationPercent - diskUsedPercent - memoryUsedPercent - networkReceiveRate - networkTransmitRate - servicesCount - } - tags { - key - values - } - } - ... on MobileApplicationEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - applicationId - mobileSummary { - appLaunchCount - crashCount - crashRate - httpErrorRate - httpRequestCount - httpRequestRate - httpResponseTimeAverage - mobileSessionCount - networkFailureRate - usersAffectedCount - } - tags { - key - values - } - } - ... on SecureCredentialEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - description - secureCredentialId - secureCredentialSummary { - failingMonitorCount - monitorCount - } - tags { - key - values - } - updatedAt - } - ... on SyntheticMonitorEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - monitorId - monitorSummary { - locationsFailing - locationsRunning - status - successRate - } - monitorType - monitoredUrl - period - tags { - key - values - } - } - ... on ThirdPartyServiceEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on UnavailableEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - tags { - key - values - } - } - ... on WorkloadEntityOutline { - __typename - account { - id - name - reportingEventTypes - } - createdAt - createdByUser { - email - gravatar - id - name - } - tags { - key - values - } - updatedAt - workloadStatus { - description - statusSource - statusValue - summary - } - } - } - rawConfiguration - title - visualization { - id - } - } - } - permissions - updatedAt - } - errors { - description - type - } -} }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/type_overrides.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/type_overrides.go deleted file mode 100644 index bdf321935c2..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/type_overrides.go +++ /dev/null @@ -1,11 +0,0 @@ -// DashboardBillboardWidgetThresholdInput - Billboard widget threshold input. -package dashboards - -import "github.com/newrelic/newrelic-client-go/pkg/entities" - -type DashboardBillboardWidgetThresholdInput struct { - // alert severity. - AlertSeverity entities.DashboardAlertSeverity `json:"alertSeverity,omitempty"` - // value. - Value *float64 `json:"value,omitempty"` -} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/types.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/types.go deleted file mode 100644 index 778ec7cc08b..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/types.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by tutone: DO NOT EDIT -package dashboards - -import ( - "github.com/newrelic/newrelic-client-go/pkg/common" - "github.com/newrelic/newrelic-client-go/pkg/entities" - "github.com/newrelic/newrelic-client-go/pkg/nrdb" - "github.com/newrelic/newrelic-client-go/pkg/nrtime" -) - -// DashboardCreateErrorType - Expected error types that can be returned by create operation -type DashboardCreateErrorType string - -var DashboardCreateErrorTypeTypes = struct { - // Invalid input error - INVALID_INPUT DashboardCreateErrorType -}{ - // Invalid input error - INVALID_INPUT: "INVALID_INPUT", -} - -// DashboardDeleteErrorType - Expected error types that can be returned by delete operation -type DashboardDeleteErrorType string - -var DashboardDeleteErrorTypeTypes = struct { - // Dashboard not found in the system - DASHBOARD_NOT_FOUND DashboardDeleteErrorType - // User is not allowed to execute the operation - FORBIDDEN_OPERATION DashboardDeleteErrorType -}{ - // Dashboard not found in the system - DASHBOARD_NOT_FOUND: "DASHBOARD_NOT_FOUND", - // User is not allowed to execute the operation - FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", -} - -// DashboardDeleteResultStatus - Result status of delete operation. -type DashboardDeleteResultStatus string - -var DashboardDeleteResultStatusTypes = struct { - // FAILURE. - FAILURE DashboardDeleteResultStatus - // SUCCESS. - SUCCESS DashboardDeleteResultStatus -}{ - // FAILURE. - FAILURE: "FAILURE", - // SUCCESS. - SUCCESS: "SUCCESS", -} - -// DashboardUpdateErrorType - Expected error types that can be returned by update operation -type DashboardUpdateErrorType string - -var DashboardUpdateErrorTypeTypes = struct { - // User is not allowed to execute the operation - FORBIDDEN_OPERATION DashboardUpdateErrorType - // Invalid input error - INVALID_INPUT DashboardUpdateErrorType -}{ - // User is not allowed to execute the operation - FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", - // Invalid input error - INVALID_INPUT: "INVALID_INPUT", -} - -// DashboardUpdatePageErrorType - Expected error types that can be returned by updatePage operation -type DashboardUpdatePageErrorType string - -var DashboardUpdatePageErrorTypeTypes = struct { - // User is not allowed to execute the operation - FORBIDDEN_OPERATION DashboardUpdatePageErrorType - // Invalid input error - INVALID_INPUT DashboardUpdatePageErrorType - // Page not found in the system - PAGE_NOT_FOUND DashboardUpdatePageErrorType -}{ - // User is not allowed to execute the operation - FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", - // Invalid input error - INVALID_INPUT: "INVALID_INPUT", - // Page not found in the system - PAGE_NOT_FOUND: "PAGE_NOT_FOUND", -} - -// DashboardUpdateWidgetsInPageErrorType - Expected error types that can be returned by updateWidgetsInPage operation -type DashboardUpdateWidgetsInPageErrorType string - -var DashboardUpdateWidgetsInPageErrorTypeTypes = struct { - // User is not allowed to execute the operation - FORBIDDEN_OPERATION DashboardUpdateWidgetsInPageErrorType - // Invalid input error - INVALID_INPUT DashboardUpdateWidgetsInPageErrorType - // Page not found in the system - PAGE_NOT_FOUND DashboardUpdateWidgetsInPageErrorType - // Widget not found in the system - WIDGET_NOT_FOUND DashboardUpdateWidgetsInPageErrorType -}{ - // User is not allowed to execute the operation - FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", - // Invalid input error - INVALID_INPUT: "INVALID_INPUT", - // Page not found in the system - PAGE_NOT_FOUND: "PAGE_NOT_FOUND", - // Widget not found in the system - WIDGET_NOT_FOUND: "WIDGET_NOT_FOUND", -} - -// DashboardAreaWidgetConfigurationInput - Configuration for visualization type 'viz.area' -type DashboardAreaWidgetConfigurationInput struct { - // nrql queries - NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` -} - -// DashboardBarWidgetConfigurationInput - Configuration for visualization type 'viz.bar' -type DashboardBarWidgetConfigurationInput struct { - // nrql queries - NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` -} - -// DashboardBillboardWidgetConfigurationInput - Configuration for visualization type 'viz.billboard' -type DashboardBillboardWidgetConfigurationInput struct { - // nrql queries - NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` - // thresholds - Thresholds []DashboardBillboardWidgetThresholdInput `json:"thresholds,omitempty"` -} - -// DashboardCreateError - Expected errors that can be returned by create operation -type DashboardCreateError struct { - // Error description - Description string `json:"description,omitempty"` - // Error type - Type DashboardCreateErrorType `json:"type"` -} - -// DashboardCreateResult - Result of create operation. -type DashboardCreateResult struct { - // Dashboard creation result - EntityResult DashboardEntityResult `json:"entityResult,omitempty"` - // Expected errors while processing request - Errors []DashboardCreateError `json:"errors,omitempty"` -} - -// DashboardDeleteError - Expected error types that can be returned by delete operation -type DashboardDeleteError struct { - // Error description - Description string `json:"description,omitempty"` - // Error type - Type DashboardDeleteErrorType `json:"type"` -} - -// DashboardDeleteResult - Result of delete operation. -type DashboardDeleteResult struct { - // Expected errors while processing request - Errors []DashboardDeleteError `json:"errors,omitempty"` - // The status of the attempted delete. - Status DashboardDeleteResultStatus `json:"status,omitempty"` -} - -// DashboardEntityResult - Public schema - `DashboardEntity` result representation for mutations. It's a subset of the `DashboardEntity` that inherits from the Entity type, but a complete different type. -type DashboardEntityResult struct { - // Account ID. - AccountID int `json:"accountId,omitempty"` - // Dashboard creation timestamp. - CreatedAt nrtime.DateTime `json:"createdAt,omitempty"` - // Dashboard description. - Description string `json:"description,omitempty"` - // Unique entity identifier. - GUID common.EntityGUID `json:"guid,omitempty"` - // Dashboard name. - Name string `json:"name,omitempty"` - // Dashboard owner - Owner entities.DashboardOwnerInfo `json:"owner,omitempty"` - // Dashboard pages. - Pages []entities.DashboardPage `json:"pages,omitempty"` - // Dashboard permissions configuration. - Permissions entities.DashboardPermissions `json:"permissions,omitempty"` - // Dashboard update timestamp. - UpdatedAt nrtime.DateTime `json:"updatedAt,omitempty"` -} - -// DashboardInput - Dashboard input -type DashboardInput struct { - // Dashboard description. - Description string `json:"description,omitempty"` - // Dashboard name. - Name string `json:"name"` - // Dashboard page input. - Pages []DashboardPageInput `json:"pages,omitempty"` - // Dashboard permissions configuration. - Permissions entities.DashboardPermissions `json:"permissions"` -} - -// DashboardLineWidgetConfigurationInput - Configuration for visualization type 'viz.line' -type DashboardLineWidgetConfigurationInput struct { - // nrql queries - NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` -} - -// DashboardMarkdownWidgetConfigurationInput - Configuration for visualization type 'viz.markdown' -type DashboardMarkdownWidgetConfigurationInput struct { - // Markdown content of the widget - Text string `json:"text"` -} - -// DashboardPageInput - Page input -type DashboardPageInput struct { - // Page description. - Description string `json:"description,omitempty"` - // Unique entity identifier of the Page to be updated. When null, it means a new Page will be created. - GUID common.EntityGUID `json:"guid,omitempty"` - // Page name. - Name string `json:"name"` - // Page widgets. - Widgets []DashboardWidgetInput `json:"widgets,omitempty"` -} - -// DashboardPieWidgetConfigurationInput - Configuration for visualization type 'viz.pie' -type DashboardPieWidgetConfigurationInput struct { - // nrql queries - NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` -} - -// DashboardSnapshotURLInput - Parameters that affect the data and the rendering of the dashboards returned by the snapshot url mutation. -type DashboardSnapshotURLInput struct { - // Period of time from which the data to be displayed on the dashboard will be obtained. - TimeWindow DashboardSnapshotURLTimeWindowInput `json:"timeWindow,omitempty"` -} - -// DashboardSnapshotURLTimeWindowInput - Period of time from which the data to be displayed on the dashboard will be obtained. -type DashboardSnapshotURLTimeWindowInput struct { - // The starting time of the time window. If specified, an endTime or a duration must also be specified. - BeginTime nrtime.EpochMilliseconds `json:"beginTime,omitempty"` - // The duration of the time window. - Duration nrtime.Milliseconds `json:"duration,omitempty"` - // The end time of the time window. If specified, a beginTime or a duration must also be specified. - EndTime nrtime.EpochMilliseconds `json:"endTime,omitempty"` -} - -// DashboardTableWidgetConfigurationInput - Configuration for visualization type 'viz.table' -type DashboardTableWidgetConfigurationInput struct { - // nrql queries - NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` -} - -// DashboardUpdateError - Expected errors that can be returned by update operation -type DashboardUpdateError struct { - // Error description - Description string `json:"description,omitempty"` - // Error type - Type DashboardUpdateErrorType `json:"type"` -} - -// DashboardUpdatePageError - Expected errors that can be returned by updatePage operation -type DashboardUpdatePageError struct { - // Error description - Description string `json:"description,omitempty"` - // Error type - Type DashboardUpdatePageErrorType `json:"type"` -} - -// DashboardUpdatePageInput - Page input used when updating an individual page -type DashboardUpdatePageInput struct { - // Page description. - Description string `json:"description,omitempty"` - // Page name. - Name string `json:"name"` - // Page widgets. - Widgets []DashboardWidgetInput `json:"widgets,omitempty"` -} - -// DashboardUpdatePageResult - Result of updatePage operation. -type DashboardUpdatePageResult struct { - // Expected errors while processing request. No errors means successful request. - Errors []DashboardUpdatePageError `json:"errors,omitempty"` -} - -// DashboardUpdateResult - Result of update operation. -type DashboardUpdateResult struct { - // Dashboard update result - EntityResult DashboardEntityResult `json:"entityResult,omitempty"` - // Expected errors while processing request - Errors []DashboardUpdateError `json:"errors,omitempty"` -} - -// DashboardUpdateWidgetInput - Input type used when updating widgets -type DashboardUpdateWidgetInput struct { - // Typed configuration for the widget - Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"` - // Id of the widget to be updated. - ID string `json:"id"` - // layout - Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` - // Related entities. Currently only supports Dashboard entities, but may allow other cases in the future. - LinkedEntityGUIDs []common.EntityGUID `json:"linkedEntityGuids"` - // Untyped scalar of configuration for the widget - RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` - // title - Title string `json:"title,omitempty"` - // Specifies how this widget will be visualized. If null, the WidgetConfigurationInput will be used to determine the visualization. - Visualization DashboardWidgetVisualizationInput `json:"visualization,omitempty"` -} - -// DashboardUpdateWidgetsInPageError - Expected errors that can be returned by updateWidgetsInPage operation -type DashboardUpdateWidgetsInPageError struct { - // Error description - Description string `json:"description,omitempty"` - // Error type - Type DashboardUpdateWidgetsInPageErrorType `json:"type"` -} - -// DashboardUpdateWidgetsInPageResult - Result of updateWidgetsInPage operation. -type DashboardUpdateWidgetsInPageResult struct { - // Expected errors while processing request. No errors means successful request. - Errors []DashboardUpdateWidgetsInPageError `json:"errors,omitempty"` -} - -// DashboardWidgetConfigurationInput - Typed configuration for known visualizations. At most one may be populated. -type DashboardWidgetConfigurationInput struct { - // Configuration for visualization type 'viz.area' - Area *DashboardAreaWidgetConfigurationInput `json:"area,omitempty"` - // Configuration for visualization type 'viz.bar' - Bar *DashboardBarWidgetConfigurationInput `json:"bar,omitempty"` - // Configuration for visualization type 'viz.billboard' - Billboard *DashboardBillboardWidgetConfigurationInput `json:"billboard,omitempty"` - // Configuration for visualization type 'viz.line' - Line *DashboardLineWidgetConfigurationInput `json:"line,omitempty"` - // Configuration for visualization type 'viz.markdown' - Markdown *DashboardMarkdownWidgetConfigurationInput `json:"markdown,omitempty"` - // Configuration for visualization type 'viz.pie' - Pie *DashboardPieWidgetConfigurationInput `json:"pie,omitempty"` - // Configuration for visualization type 'viz.table' - Table *DashboardTableWidgetConfigurationInput `json:"table,omitempty"` -} - -// DashboardWidgetInput - Widget input -type DashboardWidgetInput struct { - // Typed configuration for the widget - Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"` - // Id of the widget. If null, a new widget will be created and added to a dashboard. - ID string `json:"id,omitempty"` - // layout - Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` - // Related entities. Currently only supports Dashboard entities, but may allow other cases in the future. - LinkedEntityGUIDs []common.EntityGUID `json:"linkedEntityGuids"` - // Untyped scalar of configuration for the widget - RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` - // title - Title string `json:"title,omitempty"` - // Specifies how this widget will be visualized. If null, the WidgetConfigurationInput will be used to determine the visualization. - Visualization DashboardWidgetVisualizationInput `json:"visualization,omitempty"` -} - -// DashboardWidgetLayoutInput - Widget layout input -type DashboardWidgetLayoutInput struct { - // column. - Column int `json:"column,omitempty"` - // height. - Height int `json:"height,omitempty"` - // row. - Row int `json:"row,omitempty"` - // width. - Width int `json:"width,omitempty"` -} - -// DashboardWidgetNRQLQueryInput - NRQL query used by a widget -type DashboardWidgetNRQLQueryInput struct { - // accountId - AccountID int `json:"accountId"` - // NRQL formatted query - Query nrdb.NRQL `json:"query"` -} - -// DashboardWidgetVisualizationInput - Visualization configuration -type DashboardWidgetVisualizationInput struct { - // Nerdpack artifact ID - ID string `json:"id,omitempty"` -} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities.go deleted file mode 100644 index d117c9325b3..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities.go +++ /dev/null @@ -1,22 +0,0 @@ -// Package entities provides a programmatic API for interacting with New Relic One entities. -package entities - -import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/logging" -) - -// Entities is used to communicate with the New Relic Entities product. -type Entities struct { - client http.Client - logger logging.Logger -} - -// New returns a new client for interacting with New Relic One entities. -func New(config config.Config) Entities { - return Entities{ - client: http.NewClient(config), - logger: config.GetLogger(), - } -} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities_api.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities_api.go deleted file mode 100644 index 2d75ce60200..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entities_api.go +++ /dev/null @@ -1,2129 +0,0 @@ -// Code generated by tutone: DO NOT EDIT -package entities - -import ( - "context" - - "github.com/newrelic/newrelic-client-go/pkg/common" - "github.com/newrelic/newrelic-client-go/pkg/errors" -) - -// Adds the provided tags to your specified entity, without deleting existing ones. -// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingAddTagsToEntity( - gUID common.EntityGUID, - tags []TaggingTagInput, -) (*TaggingMutationResult, error) { - return a.TaggingAddTagsToEntityWithContext(context.Background(), - gUID, - tags, - ) -} - -// Adds the provided tags to your specified entity, without deleting existing ones. -// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingAddTagsToEntityWithContext( - ctx context.Context, - gUID common.EntityGUID, - tags []TaggingTagInput, -) (*TaggingMutationResult, error) { - - resp := TaggingAddTagsToEntityQueryResponse{} - vars := map[string]interface{}{ - "guid": gUID, - "tags": tags, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, TaggingAddTagsToEntityMutation, vars, &resp); err != nil { - return nil, err - } - - return &resp.TaggingMutationResult, nil -} - -type TaggingAddTagsToEntityQueryResponse struct { - TaggingMutationResult TaggingMutationResult `json:"TaggingAddTagsToEntity"` -} - -const TaggingAddTagsToEntityMutation = `mutation( - $guid: EntityGuid!, - $tags: [TaggingTagInput!]!, -) { taggingAddTagsToEntity( - guid: $guid, - tags: $tags, -) { - errors { - message - type - } -} }` - -// Delete specific tag keys from the entity. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingDeleteTagFromEntity( - gUID common.EntityGUID, - tagKeys []string, -) (*TaggingMutationResult, error) { - return a.TaggingDeleteTagFromEntityWithContext(context.Background(), - gUID, - tagKeys, - ) -} - -// Delete specific tag keys from the entity. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingDeleteTagFromEntityWithContext( - ctx context.Context, - gUID common.EntityGUID, - tagKeys []string, -) (*TaggingMutationResult, error) { - - resp := TaggingDeleteTagFromEntityQueryResponse{} - vars := map[string]interface{}{ - "guid": gUID, - "tagKeys": tagKeys, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, TaggingDeleteTagFromEntityMutation, vars, &resp); err != nil { - return nil, err - } - - return &resp.TaggingMutationResult, nil -} - -type TaggingDeleteTagFromEntityQueryResponse struct { - TaggingMutationResult TaggingMutationResult `json:"TaggingDeleteTagFromEntity"` -} - -const TaggingDeleteTagFromEntityMutation = `mutation( - $guid: EntityGuid!, - $tagKeys: [String!]!, -) { taggingDeleteTagFromEntity( - guid: $guid, - tagKeys: $tagKeys, -) { - errors { - message - type - } -} }` - -// Delete specific tag key-values from the entity. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingDeleteTagValuesFromEntity( - gUID common.EntityGUID, - tagValues []TaggingTagValueInput, -) (*TaggingMutationResult, error) { - return a.TaggingDeleteTagValuesFromEntityWithContext(context.Background(), - gUID, - tagValues, - ) -} - -// Delete specific tag key-values from the entity. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingDeleteTagValuesFromEntityWithContext( - ctx context.Context, - gUID common.EntityGUID, - tagValues []TaggingTagValueInput, -) (*TaggingMutationResult, error) { - - resp := TaggingDeleteTagValuesFromEntityQueryResponse{} - vars := map[string]interface{}{ - "guid": gUID, - "tagValues": tagValues, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, TaggingDeleteTagValuesFromEntityMutation, vars, &resp); err != nil { - return nil, err - } - - return &resp.TaggingMutationResult, nil -} - -type TaggingDeleteTagValuesFromEntityQueryResponse struct { - TaggingMutationResult TaggingMutationResult `json:"TaggingDeleteTagValuesFromEntity"` -} - -const TaggingDeleteTagValuesFromEntityMutation = `mutation( - $guid: EntityGuid!, - $tagValues: [TaggingTagValueInput!]!, -) { taggingDeleteTagValuesFromEntity( - guid: $guid, - tagValues: $tagValues, -) { - errors { - message - type - } -} }` - -// Replaces the entity's entire set of tags with the provided tag set. -// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingReplaceTagsOnEntity( - gUID common.EntityGUID, - tags []TaggingTagInput, -) (*TaggingMutationResult, error) { - return a.TaggingReplaceTagsOnEntityWithContext(context.Background(), - gUID, - tags, - ) -} - -// Replaces the entity's entire set of tags with the provided tag set. -// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. -// -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). -func (a *Entities) TaggingReplaceTagsOnEntityWithContext( - ctx context.Context, - gUID common.EntityGUID, - tags []TaggingTagInput, -) (*TaggingMutationResult, error) { - - resp := TaggingReplaceTagsOnEntityQueryResponse{} - vars := map[string]interface{}{ - "guid": gUID, - "tags": tags, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, TaggingReplaceTagsOnEntityMutation, vars, &resp); err != nil { - return nil, err - } - - return &resp.TaggingMutationResult, nil -} - -type TaggingReplaceTagsOnEntityQueryResponse struct { - TaggingMutationResult TaggingMutationResult `json:"TaggingReplaceTagsOnEntity"` -} - -const TaggingReplaceTagsOnEntityMutation = `mutation( - $guid: EntityGuid!, - $tags: [TaggingTagInput!]!, -) { taggingReplaceTagsOnEntity( - guid: $guid, - tags: $tags, -) { - errors { - message - type - } -} }` - -// Fetch a list of entities. -// -// You can fetch a max of 25 entities in one query. -// -// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -func (a *Entities) GetEntities( - gUIDs []common.EntityGUID, -) (*[]EntityInterface, error) { - return a.GetEntitiesWithContext(context.Background(), - gUIDs, - ) -} - -// Fetch a list of entities. -// -// You can fetch a max of 25 entities in one query. -// -// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -func (a *Entities) GetEntitiesWithContext( - ctx context.Context, - gUIDs []common.EntityGUID, -) (*[]EntityInterface, error) { - - resp := entitiesResponse{} - vars := map[string]interface{}{ - "guids": gUIDs, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, getEntitiesQuery, vars, &resp); err != nil { - return nil, err - } - - if len(resp.Actor.Entities) == 0 { - return nil, errors.NewNotFound("") - } - - return &resp.Actor.Entities, nil -} - -const getEntitiesQuery = `query( - $guids: [EntityGuid]!, -) { actor { entities( - guids: $guids, -) { - account { - id - name - reportingEventTypes - } - accountId - alertSeverity - domain - entityType - goldenMetrics { - context { - account - guid - } - metrics { - name - query - title - } - } - goldenTags { - context { - account - guid - } - tags { - key - } - } - guid - indexedAt - name - permalink - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - results { - __typename - createdAt - type - ... on EntityRelationshipDetectedEdge { - __typename - } - ... on EntityRelationshipUserDefinedEdge { - __typename - } - } - } - relationships { - source { - accountId - entityType - guid - } - target { - accountId - entityType - guid - } - type - } - reporting - serviceLevel { - indicators { - createdAt - description - entityGuid - id - name - updatedAt - } - } - tags { - key - values - } - tagsWithMetadata { - key - values { - mutable - value - } - } - type - ... on ApmApplicationEntity { - __typename - account { - id - name - reportingEventTypes - } - apmBrowserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - } - apmSummary { - apdexScore - errorRate - hostCount - instanceCount - nonWebResponseTimeAverage - nonWebThroughput - responseTimeAverage - throughput - webResponseTimeAverage - webThroughput - } - applicationId - deployments { - changelog - description - permalink - revision - timestamp - user - } - language - metricNormalizationRules { - action - applicationGuid - applicationName - createdAt - enabled - id - matchExpression - notes - replacement - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - runningAgentVersions { - maxVersion - minVersion - } - settings { - apdexTarget - serverSideConfig - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on ApmDatabaseInstanceEntity { - __typename - account { - id - name - reportingEventTypes - } - host - portOrPath - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - vendor - } - ... on ApmExternalServiceEntity { - __typename - account { - id - name - reportingEventTypes - } - externalSummary { - responseTimeAverage - throughput - } - host - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on BrowserApplicationEntity { - __typename - account { - id - name - reportingEventTypes - } - agentInstallType - applicationId - browserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - pageLoadTimeMedian - spaResponseTimeAverage - spaResponseTimeMedian - } - metricNormalizationRules { - action - applicationGuid - applicationName - createdAt - enabled - id - matchExpression - notes - replacement - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - runningAgentVersions { - maxVersion - minVersion - } - servingApmApplicationId - settings { - apdexTarget - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on DashboardEntity { - __typename - account { - id - name - reportingEventTypes - } - createdAt - dashboardParentGuid - description - owner { - email - userId - } - pages { - createdAt - description - guid - name - updatedAt - } - permissions - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - updatedAt - } - ... on ExternalEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on GenericEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on GenericInfrastructureEntity { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on InfrastructureAwsLambdaFunctionEntity { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - runtime - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on InfrastructureHostEntity { - __typename - account { - id - name - reportingEventTypes - } - hostSummary { - cpuUtilizationPercent - diskUsedPercent - memoryUsedPercent - networkReceiveRate - networkTransmitRate - servicesCount - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on MobileApplicationEntity { - __typename - account { - id - name - reportingEventTypes - } - applicationId - metricNormalizationRules { - action - applicationGuid - applicationName - createdAt - enabled - id - matchExpression - notes - replacement - } - mobileSummary { - appLaunchCount - crashCount - crashRate - httpErrorRate - httpRequestCount - httpRequestRate - httpResponseTimeAverage - mobileSessionCount - networkFailureRate - usersAffectedCount - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on SecureCredentialEntity { - __typename - account { - id - name - reportingEventTypes - } - description - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - secureCredentialId - secureCredentialSummary { - failingMonitorCount - monitorCount - } - tags { - key - values - } - tagsWithMetadata { - key - } - updatedAt - } - ... on SyntheticMonitorEntity { - __typename - account { - id - name - reportingEventTypes - } - monitorId - monitorSummary { - locationsFailing - locationsRunning - status - successRate - } - monitorType - monitoredUrl - period - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on ThirdPartyServiceEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on UnavailableEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on WorkloadEntity { - __typename - account { - id - name - reportingEventTypes - } - createdAt - createdByUser { - email - gravatar - id - name - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - updatedAt - workloadStatus { - description - statusSource - statusValue - summary - } - } -} } }` - -// Fetch a single entity. -// -// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -func (a *Entities) GetEntity( - gUID common.EntityGUID, -) (*EntityInterface, error) { - return a.GetEntityWithContext(context.Background(), - gUID, - ) -} - -// Fetch a single entity. -// -// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -func (a *Entities) GetEntityWithContext( - ctx context.Context, - gUID common.EntityGUID, -) (*EntityInterface, error) { - - resp := entityResponse{} - vars := map[string]interface{}{ - "guid": gUID, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, getEntityQuery, vars, &resp); err != nil { - return nil, err - } - - return &resp.Actor.Entity, nil -} - -const getEntityQuery = `query( - $guid: EntityGuid!, -) { actor { entity( - guid: $guid, -) { - account { - id - name - reportingEventTypes - } - accountId - alertSeverity - domain - entityType - goldenMetrics { - context { - account - guid - } - metrics { - name - query - title - } - } - goldenTags { - context { - account - guid - } - tags { - key - } - } - guid - indexedAt - name - permalink - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - results { - __typename - createdAt - type - ... on EntityRelationshipDetectedEdge { - __typename - } - ... on EntityRelationshipUserDefinedEdge { - __typename - } - } - } - relationships { - source { - accountId - entityType - guid - } - target { - accountId - entityType - guid - } - type - } - reporting - serviceLevel { - indicators { - createdAt - description - entityGuid - id - name - updatedAt - } - } - tags { - key - values - } - tagsWithMetadata { - key - values { - mutable - value - } - } - type - ... on ApmApplicationEntity { - __typename - account { - id - name - reportingEventTypes - } - apmBrowserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - } - apmSummary { - apdexScore - errorRate - hostCount - instanceCount - nonWebResponseTimeAverage - nonWebThroughput - responseTimeAverage - throughput - webResponseTimeAverage - webThroughput - } - applicationId - deployments { - changelog - description - permalink - revision - timestamp - user - } - language - metricNormalizationRules { - action - applicationGuid - applicationName - createdAt - enabled - id - matchExpression - notes - replacement - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - runningAgentVersions { - maxVersion - minVersion - } - settings { - apdexTarget - serverSideConfig - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on ApmDatabaseInstanceEntity { - __typename - account { - id - name - reportingEventTypes - } - host - portOrPath - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - vendor - } - ... on ApmExternalServiceEntity { - __typename - account { - id - name - reportingEventTypes - } - externalSummary { - responseTimeAverage - throughput - } - host - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on BrowserApplicationEntity { - __typename - account { - id - name - reportingEventTypes - } - agentInstallType - applicationId - browserSummary { - ajaxRequestThroughput - ajaxResponseTimeAverage - jsErrorRate - pageLoadThroughput - pageLoadTimeAverage - pageLoadTimeMedian - spaResponseTimeAverage - spaResponseTimeMedian - } - metricNormalizationRules { - action - applicationGuid - applicationName - createdAt - enabled - id - matchExpression - notes - replacement - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - runningAgentVersions { - maxVersion - minVersion - } - servingApmApplicationId - settings { - apdexTarget - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on DashboardEntity { - __typename - account { - id - name - reportingEventTypes - } - createdAt - dashboardParentGuid - description - owner { - email - userId - } - pages { - createdAt - description - guid - name - updatedAt - } - permissions - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - updatedAt - } - ... on ExternalEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on GenericEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on GenericInfrastructureEntity { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on InfrastructureAwsLambdaFunctionEntity { - __typename - account { - id - name - reportingEventTypes - } - integrationTypeCode - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - runtime - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on InfrastructureHostEntity { - __typename - account { - id - name - reportingEventTypes - } - hostSummary { - cpuUtilizationPercent - diskUsedPercent - memoryUsedPercent - networkReceiveRate - networkTransmitRate - servicesCount - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on MobileApplicationEntity { - __typename - account { - id - name - reportingEventTypes - } - applicationId - metricNormalizationRules { - action - applicationGuid - applicationName - createdAt - enabled - id - matchExpression - notes - replacement - } - mobileSummary { - appLaunchCount - crashCount - crashRate - httpErrorRate - httpRequestCount - httpRequestRate - httpResponseTimeAverage - mobileSessionCount - networkFailureRate - usersAffectedCount - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on SecureCredentialEntity { - __typename - account { - id - name - reportingEventTypes - } - description - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - secureCredentialId - secureCredentialSummary { - failingMonitorCount - monitorCount - } - tags { - key - values - } - tagsWithMetadata { - key - } - updatedAt - } - ... on SyntheticMonitorEntity { - __typename - account { - id - name - reportingEventTypes - } - monitorId - monitorSummary { - locationsFailing - locationsRunning - status - successRate - } - monitorType - monitoredUrl - period - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on ThirdPartyServiceEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on UnavailableEntity { - __typename - account { - id - name - reportingEventTypes - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - } - ... on WorkloadEntity { - __typename - account { - id - name - reportingEventTypes - } - createdAt - createdByUser { - email - gravatar - id - name - } - recentAlertViolations { - agentUrl - alertSeverity - closedAt - label - level - openedAt - violationId - violationUrl - } - relatedEntities { - nextCursor - } - relationships { - type - } - tags { - key - values - } - tagsWithMetadata { - key - } - updatedAt - workloadStatus { - description - statusSource - statusValue - summary - } - } -} } }` - -// Search for entities using a custom query. -// -// For more details on how to create a custom query -// and what entity data you can request, visit our -// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -// -// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. -func (a *Entities) GetEntitySearch( - options EntitySearchOptions, - query string, - queryBuilder EntitySearchQueryBuilder, - sortBy []EntitySearchSortCriteria, -) (*EntitySearch, error) { - return a.GetEntitySearchWithContext(context.Background(), - options, - query, - queryBuilder, - sortBy, - ) -} - -// Search for entities using a custom query. -// -// For more details on how to create a custom query -// and what entity data you can request, visit our -// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -// -// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. -func (a *Entities) GetEntitySearchWithContext( - ctx context.Context, - options EntitySearchOptions, - query string, - queryBuilder EntitySearchQueryBuilder, - sortBy []EntitySearchSortCriteria, -) (*EntitySearch, error) { - - resp := entitySearchResponse{} - vars := map[string]interface{}{ - "options": options, - "query": query, - "queryBuilder": queryBuilder, - "sortBy": sortBy, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, getEntitySearchQuery, vars, &resp); err != nil { - return nil, err - } - - return &resp.Actor.EntitySearch, nil -} - -const getEntitySearchQuery = `query( - $queryBuilder: EntitySearchQueryBuilder, -) { actor { entitySearch( - queryBuilder: $queryBuilder, -) { - count - query - results { - entities { - __typename - accountId - alertSeverity - domain - entityType - guid - indexedAt - name - permalink - reporting - type - ... on ApmApplicationEntityOutline { - __typename - applicationId - language - } - ... on ApmDatabaseInstanceEntityOutline { - __typename - host - portOrPath - vendor - } - ... on ApmExternalServiceEntityOutline { - __typename - host - } - ... on BrowserApplicationEntityOutline { - __typename - agentInstallType - applicationId - servingApmApplicationId - } - ... on DashboardEntityOutline { - __typename - createdAt - dashboardParentGuid - permissions - updatedAt - } - ... on ExternalEntityOutline { - __typename - } - ... on GenericEntityOutline { - __typename - } - ... on GenericInfrastructureEntityOutline { - __typename - integrationTypeCode - } - ... on InfrastructureAwsLambdaFunctionEntityOutline { - __typename - integrationTypeCode - runtime - } - ... on InfrastructureHostEntityOutline { - __typename - } - ... on MobileApplicationEntityOutline { - __typename - applicationId - } - ... on SecureCredentialEntityOutline { - __typename - description - secureCredentialId - updatedAt - } - ... on SyntheticMonitorEntityOutline { - __typename - monitorId - monitorType - monitoredUrl - period - } - ... on ThirdPartyServiceEntityOutline { - __typename - } - ... on UnavailableEntityOutline { - __typename - } - ... on WorkloadEntityOutline { - __typename - createdAt - updatedAt - } - } - nextCursor - } - types { - count - domain - entityType - type - } -} } }` - -// Search for entities using a custom query. -// -// For more details on how to create a custom query -// and what entity data you can request, visit our -// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -// -// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. -func (a *Entities) GetEntitySearchByQuery( - options EntitySearchOptions, - query string, - sortBy []EntitySearchSortCriteria, -) (*EntitySearch, error) { - return a.GetEntitySearchByQueryWithContext(context.Background(), - options, - query, - sortBy, - ) -} - -// Search for entities using a custom query. -// -// For more details on how to create a custom query -// and what entity data you can request, visit our -// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). -// -// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. -func (a *Entities) GetEntitySearchByQueryWithContext( - ctx context.Context, - options EntitySearchOptions, - query string, - sortBy []EntitySearchSortCriteria, -) (*EntitySearch, error) { - - resp := entitySearchResponse{} - vars := map[string]interface{}{ - "options": options, - "query": query, - "sortBy": sortBy, - } - - if err := a.client.NerdGraphQueryWithContext(ctx, getEntitySearchByQuery, vars, &resp); err != nil { - return nil, err - } - - return &resp.Actor.EntitySearch, nil -} - -const getEntitySearchByQuery = `query( - $query: String, -) { actor { entitySearch( - query: $query, -) { - count - query - results { - entities { - __typename - accountId - alertSeverity - domain - entityType - guid - indexedAt - name - permalink - reporting - type - ... on ApmApplicationEntityOutline { - __typename - applicationId - language - } - ... on ApmDatabaseInstanceEntityOutline { - __typename - host - portOrPath - vendor - } - ... on ApmExternalServiceEntityOutline { - __typename - host - } - ... on BrowserApplicationEntityOutline { - __typename - agentInstallType - applicationId - servingApmApplicationId - } - ... on DashboardEntityOutline { - __typename - createdAt - dashboardParentGuid - permissions - updatedAt - } - ... on ExternalEntityOutline { - __typename - } - ... on GenericEntityOutline { - __typename - } - ... on GenericInfrastructureEntityOutline { - __typename - integrationTypeCode - } - ... on InfrastructureAwsLambdaFunctionEntityOutline { - __typename - integrationTypeCode - runtime - } - ... on InfrastructureHostEntityOutline { - __typename - } - ... on MobileApplicationEntityOutline { - __typename - applicationId - } - ... on SecureCredentialEntityOutline { - __typename - description - secureCredentialId - updatedAt - } - ... on SyntheticMonitorEntityOutline { - __typename - monitorId - monitorType - monitoredUrl - period - } - ... on ThirdPartyServiceEntityOutline { - __typename - } - ... on UnavailableEntityOutline { - __typename - } - ... on WorkloadEntityOutline { - __typename - createdAt - updatedAt - } - } - nextCursor - } - types { - count - domain - entityType - type - } -} } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/nrdb/nrdb_query.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/nrdb/nrdb_query.go deleted file mode 100644 index 9bbeb002e19..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/nrdb/nrdb_query.go +++ /dev/null @@ -1,62 +0,0 @@ -// Package nrdb provides a programmatic API for interacting with NRDB, New Relic's Datastore -package nrdb - -import "context" - -func (n *Nrdb) Query(accountID int, query NRQL) (*NRDBResultContainer, error) { - return n.QueryWithContext(context.Background(), accountID, query) -} - -// QueryWithContext facilitates making a NRQL query. -func (n *Nrdb) QueryWithContext(ctx context.Context, accountID int, query NRQL) (*NRDBResultContainer, error) { - respBody := gqlNrglQueryResponse{} - - vars := map[string]interface{}{ - "accountId": accountID, - "query": query, - } - - if err := n.client.NerdGraphQueryWithContext(ctx, gqlNrqlQuery, vars, &respBody); err != nil { - return nil, err - } - - return &respBody.Actor.Account.NRQL, nil -} - -func (n *Nrdb) QueryHistory() (*[]NRQLHistoricalQuery, error) { - return n.QueryHistoryWithContext(context.Background()) -} - -func (n *Nrdb) QueryHistoryWithContext(ctx context.Context) (*[]NRQLHistoricalQuery, error) { - respBody := gqlNrglQueryHistoryResponse{} - vars := map[string]interface{}{} - - if err := n.client.NerdGraphQueryWithContext(ctx, gqlNrqlQueryHistoryQuery, vars, &respBody); err != nil { - return nil, err - } - - return &respBody.Actor.NRQLQueryHistory, nil -} - -const ( - gqlNrqlQueryHistoryQuery = `{ actor { nrqlQueryHistory { accountId nrql timestamp } } }` - - gqlNrqlQuery = `query($query: Nrql!, $accountId: Int!) { actor { account(id: $accountId) { nrql(query: $query) { - currentResults otherResult previousResults results totalResult - metadata { eventTypes facets messages timeWindow { begin compareWith end since until } } - } } } }` -) - -type gqlNrglQueryResponse struct { - Actor struct { - Account struct { - NRQL NRDBResultContainer - } - } -} - -type gqlNrglQueryHistoryResponse struct { - Actor struct { - NRQLQueryHistory []NRQLHistoricalQuery - } -} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/testhelpers/helpers.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/testhelpers/helpers.go deleted file mode 100644 index 5358f5d622d..00000000000 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/testhelpers/helpers.go +++ /dev/null @@ -1,53 +0,0 @@ -package testhelpers - -import ( - "fmt" - "math/rand" - "os" - "strconv" - "time" -) - -var ( - letters = []rune("abcdefghijklmnopqrstuvwxyz") -) - -// RandSeq is used to get a string made up of n random lowercase letters. -func RandSeq(n int) string { - rand.Seed(time.Now().UnixNano()) - b := make([]rune, n) - for i := range b { - b[i] = letters[rand.Intn(len(letters))] - } - return string(b) -} - -// GetTestUserID returns the integer value for a New Relic user ID from the environment -func GetTestUserID() (int, error) { - return getEnvInt("NEW_RELIC_TEST_USER_ID") -} - -// GetTestAccountID returns the integer value for a New Relic Account ID from the environment -func GetTestAccountID() (int, error) { - return getEnvInt("NEW_RELIC_ACCOUNT_ID") -} - -// getEnvInt helper to DRY up the other env get calls for integers -func getEnvInt(name string) (int, error) { - if name == "" { - return 0, fmt.Errorf("failed to get environment value, no name specified") - } - - id := os.Getenv(name) - - if id == "" { - return 0, fmt.Errorf("failed to get environment value due to undefined environment variable %s", name) - } - - n, err := strconv.Atoi(id) - if err != nil { - return 0, err - } - - return n, nil -} diff --git a/vendor/github.com/newrelic/newrelic-client-go/LICENSE b/vendor/github.com/newrelic/newrelic-client-go/v2/LICENSE similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/LICENSE rename to vendor/github.com/newrelic/newrelic-client-go/v2/LICENSE diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/auth.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/auth.go similarity index 94% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/auth.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/auth.go index 7c54b3ab89c..5d301241072 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/http/auth.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/auth.go @@ -1,8 +1,8 @@ package http import ( - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/contextkeys" + "github.com/newrelic/newrelic-client-go/v2/pkg/config" + "github.com/newrelic/newrelic-client-go/v2/pkg/contextkeys" ) // RequestAuthorizer is an interface that allows customizatino of how a request is authorized. diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/client.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/client.go similarity index 93% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/client.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/client.go index 3baeaca3e82..3726ad019fc 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/http/client.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/client.go @@ -4,8 +4,9 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" + "os" "reflect" "regexp" "strings" @@ -13,10 +14,10 @@ import ( retryablehttp "github.com/hashicorp/go-retryablehttp" - "github.com/newrelic/newrelic-client-go/internal/version" - "github.com/newrelic/newrelic-client-go/pkg/config" - nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "github.com/newrelic/newrelic-client-go/v2/internal/version" + "github.com/newrelic/newrelic-client-go/v2/pkg/config" + nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/logging" ) const ( @@ -76,6 +77,16 @@ func NewClient(cfg config.Config) Client { cfg.ServiceName = fmt.Sprintf("%s|%s", cfg.ServiceName, defaultServiceName) } + // If a requesting service sets the NEW_RELIC_SERVICE_NAME env variable, + // we prepend this additional custom service name to the existing service name. + // The service name is used to track which requesting service is being utilized. + // e.g. We can track usage of the New Relic Deployment Marker GitHub Action by + // setting this environment variable when executing a command. + customServiceName := os.Getenv("NEW_RELIC_SERVICE_NAME") + if customServiceName != "" { + cfg.ServiceName = fmt.Sprintf("%s|%s", customServiceName, cfg.ServiceName) + } + r := retryablehttp.NewClient() r.HTTPClient = &c r.RetryMax = defaultRetryMax @@ -435,7 +446,7 @@ func (c *Client) innerDo(req *Request, errorValue ErrorResponse, i int) (*http.R return resp, nil, false, &nrErrors.NotFound{} } - body, readErr := ioutil.ReadAll(resp.Body) + body, readErr := io.ReadAll(resp.Body) if readErr != nil { return resp, body, false, readErr @@ -524,5 +535,11 @@ func (c *Client) NewNerdGraphRequest(query string, vars map[string]interface{}, req.SetAuthStrategy(&NerdGraphAuthorizer{}) req.SetErrorValue(&GraphQLErrorResponse{}) + if strings.Contains(c.config.ServiceName, "terraform-provider-newrelic") { + req.SetHeader("X-Query-Source-Capability-Id", "TERRAFORM") + } else { + req.SetHeader("X-Query-Source-Component-Id", c.config.ServiceName) + } + return req, nil } diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/compress.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/compress.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/compress.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/compress.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/errors.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/errors.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/errors.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/errors.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/graphql.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/graphql.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/graphql.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/graphql.go index 0d4fb09cc3a..5e52464f62b 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/http/graphql.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/graphql.go @@ -94,7 +94,8 @@ func (r *GraphQLErrorResponse) IsPaymentRequired(resp *http.Response) bool { // is deprecated. We want to bubble that up, but not stop returning data // // Example deprecation message: -// This field is deprecated! Please use `relatedEntities` instead. +// +// This field is deprecated! Please use `relatedEntities` instead. func (r *GraphQLErrorResponse) IsDeprecated() bool { for _, err := range r.Errors { if strings.HasPrefix(err.Message, "This field is deprecated!") { diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/paging.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/paging.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/paging.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/paging.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/request.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/request.go similarity index 93% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/request.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/request.go index dfcf31c0791..6e40a9795c1 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/http/request.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/request.go @@ -5,11 +5,12 @@ import ( "encoding/json" "fmt" "io" + "os" "github.com/google/go-querystring/query" retryablehttp "github.com/hashicorp/go-retryablehttp" - "github.com/newrelic/newrelic-client-go/pkg/config" + "github.com/newrelic/newrelic-client-go/v2/pkg/config" ) // Request represents a configurable HTTP request. @@ -121,6 +122,12 @@ func (r *Request) SetErrorValue(e ErrorResponse) { // SetServiceName sets the service name for the request. func (r *Request) SetServiceName(serviceName string) { serviceName = fmt.Sprintf("%s|%s", serviceName, defaultServiceName) + + customServiceName := os.Getenv("NEW_RELIC_SERVICE_NAME") + if customServiceName != "" { + serviceName = fmt.Sprintf("%s|%s", customServiceName, serviceName) + } + r.SetHeader(defaultNewRelicRequestingServiceHeader, serviceName) } diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/retry.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/retry.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/retry.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/retry.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/test_helpers.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/test_helpers.go similarity index 83% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/test_helpers.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/test_helpers.go index cae87e7d621..dc981937a99 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/http/test_helpers.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/test_helpers.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - mock "github.com/newrelic/newrelic-client-go/pkg/testhelpers" + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" ) // NewTestAPIClient returns a test Client instance that is configured to communicate with a mock server. diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/http/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/types.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/internal/http/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/http/types.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/serialization/epoch_time.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/serialization/epoch_time.go similarity index 73% rename from vendor/github.com/newrelic/newrelic-client-go/internal/serialization/epoch_time.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/serialization/epoch_time.go index 33aae664b16..1e58d526264 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/serialization/epoch_time.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/serialization/epoch_time.go @@ -14,10 +14,13 @@ type EpochTime time.Time func (e EpochTime) MarshalJSON() ([]byte, error) { ret := strconv.FormatInt(time.Time(e).UTC().Unix(), 10) milli := int64(time.Time(e).Nanosecond()) / int64(time.Millisecond) + nano := int64(time.Time(e).Nanosecond()) // Include milliseconds if there are some if milli > 0 { ret += fmt.Sprintf("%03d", milli) + } else if nano > 0 { + ret += fmt.Sprintf("%09d", nano) } return []byte(ret), nil @@ -34,6 +37,8 @@ func (e *EpochTime) UnmarshalJSON(s []byte) error { // detect type of timestamp based on length switch l := len(s); { + case string(s) == emptyTimeCase: // when we try to unmarhsal empty unix time + return nil case l <= 10: // seconds sec, err = strconv.ParseInt(string(s), 10, 64) case l > 10 && l <= 16: // milliseconds @@ -47,7 +52,7 @@ func (e *EpochTime) UnmarshalJSON(s []byte) error { if err != nil { return err } - nano, err = strconv.ParseInt(string(s[10:16]), 10, 64) + nano, err = strconv.ParseInt(string(s[10:l]), 10, 64) default: return fmt.Errorf("unable to parse EpochTime: '%s'", s) } @@ -76,3 +81,11 @@ func (e EpochTime) String() string { func (e EpochTime) Unix() int64 { return time.Time(e).Unix() } + +const ( + // emptyTimeCase represents result in case we marshaled empty EpochTime object to byte + // and then tried to marshal it back (we are going to get the value from []byte) + // at this moment it is emergency case, detailed you can check here https://github.com/golang/protobuf/issues/710 + // and here https://github.com/newrelic/newrelic-client-go/issues/992 + emptyTimeCase = "-62135596800" +) diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/serialization/map_string_interface.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/serialization/map_string_interface.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/internal/serialization/map_string_interface.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/serialization/map_string_interface.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/internal/utils/utils.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/utils/utils.go new file mode 100644 index 00000000000..a68282af33f --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/utils/utils.go @@ -0,0 +1,40 @@ +package utils + +import ( + "strconv" + "strings" + "time" + + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" +) + +// IntArrayToString converts an array of integers +// to a comma-separated list string - +// e.g [1, 2, 3] will be converted to "1,2,3". +func IntArrayToString(integers []int) string { + sArray := make([]string, len(integers)) + + for i, n := range integers { + sArray[i] = strconv.Itoa(n) + } + + return strings.Join(sArray, ",") +} + +// a helper function that is used to populate a timestamp with non-zero milliseconds +// if the millisecond count has been found zero, usually when generated with time.Time() +// in Golang which does not have a nanoseconds field; which helps mutations such as those +// in changetracking, the API of which requires a timestamp with non-zero milliseconds. +func GetSafeTimestampWithMilliseconds(inputTimestamp nrtime.EpochMilliseconds) nrtime.EpochMilliseconds { + timestamp := time.Time(inputTimestamp) + + // since time.Time in Go does not have a milliseconds field, which is why the implementation + // of unmarshaling time.Time into a Unix timestamp in the serialization package relies on + // nanoseconds to produce a value of milliseconds, we try employing a similar logic below + + if timestamp.Nanosecond() < 100000000 { + timestamp = timestamp.Add(time.Nanosecond * 100000000) + } + + return nrtime.EpochMilliseconds(timestamp) +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/version/version.go similarity index 57% rename from vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/internal/version/version.go index 25fdfffd0f0..7ee1bf38a74 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/internal/version/version.go @@ -1,4 +1,4 @@ package version // Version of this library -const Version string = "1.1.0" +const Version string = "2.51.2" diff --git a/vendor/github.com/newrelic/newrelic-client-go/newrelic/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/doc.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/newrelic/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/doc.go index 4c68444e8ba..7e628bdacc1 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/newrelic/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/doc.go @@ -3,13 +3,12 @@ Package newrelic is a convenience package that provides a programmatic API surfa area for interacting with all the New Relic One products encompassed by this project. Refer to each package's documentation to learn more about its capabilities. -Authentication +# Authentication You will need a valid Personal API to communicate with the backend New Relic APIs that this client communicates with. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package newrelic diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/newrelic.go b/vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/newrelic.go new file mode 100644 index 00000000000..75729d00af9 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/newrelic/newrelic.go @@ -0,0 +1,236 @@ +package newrelic + +import ( + "net/http" + "time" + + "github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement" + "github.com/newrelic/newrelic-client-go/v2/pkg/accounts" + "github.com/newrelic/newrelic-client-go/v2/pkg/agent" + "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" + "github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement" + "github.com/newrelic/newrelic-client-go/v2/pkg/changetracking" + "github.com/newrelic/newrelic-client-go/v2/pkg/cloud" + "github.com/newrelic/newrelic-client-go/v2/pkg/config" + "github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration" + "github.com/newrelic/newrelic-client-go/v2/pkg/dashboards" + "github.com/newrelic/newrelic-client-go/v2/pkg/edge" + "github.com/newrelic/newrelic-client-go/v2/pkg/entities" + "github.com/newrelic/newrelic-client-go/v2/pkg/events" + "github.com/newrelic/newrelic-client-go/v2/pkg/eventstometrics" + "github.com/newrelic/newrelic-client-go/v2/pkg/installevents" + "github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction" + "github.com/newrelic/newrelic-client-go/v2/pkg/logconfigurations" + "github.com/newrelic/newrelic-client-go/v2/pkg/logging" + "github.com/newrelic/newrelic-client-go/v2/pkg/logs" + "github.com/newrelic/newrelic-client-go/v2/pkg/nerdgraph" + "github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage" + "github.com/newrelic/newrelic-client-go/v2/pkg/notifications" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrdb" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrqldroprules" + "github.com/newrelic/newrelic-client-go/v2/pkg/organization" + "github.com/newrelic/newrelic-client-go/v2/pkg/plugins" + "github.com/newrelic/newrelic-client-go/v2/pkg/servicelevel" + "github.com/newrelic/newrelic-client-go/v2/pkg/synthetics" + "github.com/newrelic/newrelic-client-go/v2/pkg/usermanagement" + "github.com/newrelic/newrelic-client-go/v2/pkg/workflows" + "github.com/newrelic/newrelic-client-go/v2/pkg/workloads" +) + +// NewRelic is a collection of New Relic APIs. +type NewRelic struct { + AccountManagement accountmanagement.Accountmanagement + Accounts accounts.Accounts + Agent agent.Agent + AgentApplications agentapplications.AgentApplications + Alerts alerts.Alerts + APIAccess apiaccess.APIAccess + APM apm.APM + AuthorizationManagement authorizationmanagement.Authorizationmanagement + ChangeTracking changetracking.Changetracking + Cloud cloud.Cloud + CustomerAdministration customeradministration.Customeradministration + Dashboards dashboards.Dashboards + Edge edge.Edge + Entities entities.Entities + Events events.Events + EventsToMetrics eventstometrics.EventsToMetrics + InstallEvents installevents.Installevents + Logs logs.Logs + Logconfigurations logconfigurations.Logconfigurations + NerdGraph nerdgraph.NerdGraph + NerdStorage nerdstorage.NerdStorage + Notifications notifications.Notifications + Nrdb nrdb.Nrdb + Nrqldroprules nrqldroprules.Nrqldroprules + Organization organization.Organization + Plugins plugins.Plugins + ServiceLevel servicelevel.Servicelevel + Synthetics synthetics.Synthetics + UserManagement usermanagement.Usermanagement + Workflows workflows.Workflows + Workloads workloads.Workloads + KeyTransaction keytransaction.Keytransaction + + config config.Config +} + +// New returns a collection of New Relic APIs. +func New(opts ...ConfigOption) (*NewRelic, error) { + cfg := config.New() + + err := cfg.Init(opts) + if err != nil { + return nil, err + } + + nr := &NewRelic{ + config: cfg, + + AccountManagement: accountmanagement.New(cfg), + Accounts: accounts.New(cfg), + Agent: agent.New(cfg), + AgentApplications: agentapplications.New(cfg), + Alerts: alerts.New(cfg), + APIAccess: apiaccess.New(cfg), + APM: apm.New(cfg), + AuthorizationManagement: authorizationmanagement.New(cfg), + ChangeTracking: changetracking.New(cfg), + Cloud: cloud.New(cfg), + CustomerAdministration: customeradministration.New(cfg), + Dashboards: dashboards.New(cfg), + Edge: edge.New(cfg), + Entities: entities.New(cfg), + Events: events.New(cfg), + EventsToMetrics: eventstometrics.New(cfg), + InstallEvents: installevents.New(cfg), + Logs: logs.New(cfg), + Logconfigurations: logconfigurations.New(cfg), + NerdGraph: nerdgraph.New(cfg), + NerdStorage: nerdstorage.New(cfg), + Notifications: notifications.New(cfg), + Nrdb: nrdb.New(cfg), + Nrqldroprules: nrqldroprules.New(cfg), + Organization: organization.New(cfg), + Plugins: plugins.New(cfg), + ServiceLevel: servicelevel.New(cfg), + Synthetics: synthetics.New(cfg), + UserManagement: usermanagement.New(cfg), + Workflows: workflows.New(cfg), + Workloads: workloads.New(cfg), + KeyTransaction: keytransaction.New(cfg), + } + + return nr, nil +} + +func (nr *NewRelic) SetLogLevel(levelName string) { + nr.config.Logger.SetLevel(levelName) +} + +// TestEndpoints makes a few calls to determine if the NewRelic enpoints are reachable. +func (nr *NewRelic) TestEndpoints() error { + endpoints := []string{ + // nr.config.Region().InfrastructureURL(), + nr.config.Region().LogsURL(), + nr.config.Region().NerdGraphURL(), + nr.config.Region().RestURL(), + } + + for _, e := range endpoints { + _, err := http.Get(e) + if err != nil { + return err + } + } + + return nil +} + +// ConfigOption configures the Config when provided to NewApplication. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +type ConfigOption = config.ConfigOption + +// ConfigPersonalAPIKey sets the New Relic Admin API key this client will use. +// This key should be used to create a client instance. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +func ConfigPersonalAPIKey(apiKey string) ConfigOption { + return config.ConfigPersonalAPIKey(apiKey) +} + +// ConfigInsightsInsertKey sets the New Relic Insights insert key this client will use. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +func ConfigInsightsInsertKey(insightsInsertKey string) ConfigOption { + return config.ConfigInsightsInsertKey(insightsInsertKey) +} + +// ConfigAdminAPIKey sets the New Relic Admin API key this client will use. +// Deprecated. Use a personal API key for authentication. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +func ConfigAdminAPIKey(adminAPIKey string) ConfigOption { + return config.ConfigAdminAPIKey(adminAPIKey) +} + +// ConfigRegion sets the New Relic Region this client will use. +func ConfigRegion(r string) ConfigOption { + return config.ConfigRegion(r) +} + +// ConfigHTTPTimeout sets the timeout for HTTP requests. +func ConfigHTTPTimeout(t time.Duration) ConfigOption { + return config.ConfigHTTPTimeout(t) +} + +// ConfigHTTPTransport sets the HTTP Transporter. +func ConfigHTTPTransport(transport http.RoundTripper) ConfigOption { + return config.ConfigHTTPTransport(transport) +} + +// ConfigUserAgent sets the HTTP UserAgent for API requests. +func ConfigUserAgent(ua string) ConfigOption { + return config.ConfigUserAgent(ua) +} + +// ConfigServiceName sets the service name logged +func ConfigServiceName(name string) ConfigOption { + return config.ConfigServiceName(name) +} + +// ConfigBaseURL sets the base URL used to make requests to the REST API V2. +func ConfigBaseURL(url string) ConfigOption { + return config.ConfigBaseURL(url) +} + +// ConfigInfrastructureBaseURL sets the base URL used to make requests to the Infrastructure API. +func ConfigInfrastructureBaseURL(url string) ConfigOption { + return config.ConfigInfrastructureBaseURL(url) +} + +// ConfigSyntheticsBaseURL sets the base URL used to make requests to the Synthetics API. +func ConfigSyntheticsBaseURL(url string) ConfigOption { + return config.ConfigSyntheticsBaseURL(url) +} + +// ConfigNerdGraphBaseURL sets the base URL used to make requests to the NerdGraph API. +func ConfigNerdGraphBaseURL(url string) ConfigOption { + return config.ConfigNerdGraphBaseURL(url) +} + +// ConfigLogLevel sets the log level for the client. +func ConfigLogLevel(logLevel string) ConfigOption { + return config.ConfigLogLevel(logLevel) +} + +// ConfigLogJSON toggles JSON formatting on for the logger if set to true. +func ConfigLogJSON(logJSON bool) ConfigOption { + return config.ConfigLogJSON(logJSON) +} + +// ConfigLogger can be used to customize the client's logger. +// Custom loggers must conform to the logging.Logger interface. +func ConfigLogger(logger logging.Logger) ConfigOption { + return config.ConfigLogger(logger) +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement.go new file mode 100644 index 00000000000..b1ceb22502a --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement.go @@ -0,0 +1,26 @@ +// Code generated by tutone: DO NOT EDIT +package accountmanagement + +// Package accountmanagement provides a programmatic API for interacting with the New Relic account management +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 Accountmanagement struct { + client http.Client + logger logging.Logger +} + +// New is used to create a new Account Management. +func New(config config.Config) Accountmanagement { + client := http.NewClient(config) + + pkg := Accountmanagement{ + client: client, + logger: config.GetLogger(), + } + + return pkg +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api.go new file mode 100644 index 00000000000..1259a65853b --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api.go @@ -0,0 +1,172 @@ +// Code generated by tutone: DO NOT EDIT +package accountmanagement + +import ( + "context" + + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" +) + +// Cancels an account. +func (a *Accountmanagement) AccountManagementCancelAccount( + iD int, +) (*AccountManagementManagedAccount, error) { + return a.AccountManagementCancelAccountWithContext(context.Background(), + iD, + ) +} + +// Cancels an account. +func (a *Accountmanagement) AccountManagementCancelAccountWithContext( + ctx context.Context, + iD int, +) (*AccountManagementManagedAccount, error) { + + resp := AccountManagementCancelAccountQueryResponse{} + vars := map[string]interface{}{ + "id": iD, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AccountManagementCancelAccountMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AccountManagementManagedAccount, nil +} + +type AccountManagementCancelAccountQueryResponse struct { + AccountManagementManagedAccount AccountManagementManagedAccount `json:"AccountManagementCancelAccount"` +} + +const AccountManagementCancelAccountMutation = `mutation( + $id: Int!, +) { accountManagementCancelAccount( + id: $id, +) { + id + isCanceled + name + regionCode +} }` + +// Creates an organization-scoped account. +func (a *Accountmanagement) AccountManagementCreateAccount( + managedAccount AccountManagementCreateInput, +) (*AccountManagementCreateResponse, error) { + return a.AccountManagementCreateAccountWithContext(context.Background(), + managedAccount, + ) +} + +// Creates an organization-scoped account. +func (a *Accountmanagement) AccountManagementCreateAccountWithContext( + ctx context.Context, + managedAccount AccountManagementCreateInput, +) (*AccountManagementCreateResponse, error) { + + resp := AccountManagementCreateAccountQueryResponse{} + vars := map[string]interface{}{ + "managedAccount": managedAccount, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AccountManagementCreateAccountMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AccountManagementCreateResponse, nil +} + +type AccountManagementCreateAccountQueryResponse struct { + AccountManagementCreateResponse AccountManagementCreateResponse `json:"AccountManagementCreateAccount"` +} + +const AccountManagementCreateAccountMutation = `mutation( + $managedAccount: AccountManagementCreateInput!, +) { accountManagementCreateAccount( + managedAccount: $managedAccount, +) { + managedAccount { + id + isCanceled + name + regionCode + } +} }` + +// Updates an account. +func (a *Accountmanagement) AccountManagementUpdateAccount( + managedAccount AccountManagementUpdateInput, +) (*AccountManagementUpdateResponse, error) { + return a.AccountManagementUpdateAccountWithContext(context.Background(), + managedAccount, + ) +} + +// Updates an account. +func (a *Accountmanagement) AccountManagementUpdateAccountWithContext( + ctx context.Context, + managedAccount AccountManagementUpdateInput, +) (*AccountManagementUpdateResponse, error) { + + resp := AccountManagementUpdateAccountQueryResponse{} + vars := map[string]interface{}{ + "managedAccount": managedAccount, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AccountManagementUpdateAccountMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AccountManagementUpdateResponse, nil +} + +type AccountManagementUpdateAccountQueryResponse struct { + AccountManagementUpdateResponse AccountManagementUpdateResponse `json:"AccountManagementUpdateAccount"` +} + +const AccountManagementUpdateAccountMutation = `mutation( + $managedAccount: AccountManagementUpdateInput!, +) { accountManagementUpdateAccount( + managedAccount: $managedAccount, +) { + managedAccount { + id + name + regionCode + } +} }` + +// NOTE: Tutone changes made to GetManagedAccounts and dependent functions and queries have been reverted +// owing to a few limitations. In order to use the recently added attribute "isCanceled" with GetManagedAccounts, +// please see the functions in accountmanagement_api_.go. + +// Admin-level info about the accounts in an organization. +func (a *Accountmanagement) GetManagedAccounts() (*[]AccountManagementManagedAccount, error) { + return a.GetManagedAccountsWithContext(context.Background()) +} + +// Admin-level info about the accounts in an organization. +func (a *Accountmanagement) GetManagedAccountsWithContext( + ctx context.Context, +) (*[]AccountManagementManagedAccount, error) { + + resp := managedAccountsResponse{} + vars := map[string]interface{}{} + + if err := a.client.NerdGraphQueryWithContext(ctx, getManagedAccountsQuery, vars, &resp); err != nil { + return nil, err + } + + if len(resp.Actor.Organization.AccountManagement.ManagedAccounts) == 0 { + return nil, errors.NewNotFound("") + } + + return &resp.Actor.Organization.AccountManagement.ManagedAccounts, nil +} + +const getManagedAccountsQuery = `query { actor { organization { accountManagement { managedAccounts { + id + isCanceled + name + regionCode +} } } } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api_.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api_.go new file mode 100644 index 00000000000..7c5995f9d5b --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/accountmanagement_api_.go @@ -0,0 +1,73 @@ +// Code **NOT** generated by tutone +package accountmanagement + +import ( + "context" + + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" +) + +// -------------------------------------------------------------------- +// NOTE: (for the maintainers and users of newrelic-client-go) +// -------------------------------------------------------------------- +// The function `GetManagedAccountsWithAdditionalArguments`, function `GetManagedAccountsWithAdditionalArgumentsWithContext` and the query `getManagedAccountsWithAdditionalArgumentsQuery` in this file +// are "modified" versions of the function `GetManagedAccounts`, the function `GetManagedAccountsWithContext` and the query `getManagedAccountsQuery` respectively, +// originally defined in accountmanagement_api.go. +// +// These manual modifications had to be written owing to the introduction of a new input (and output) field to the `getManagedAccountsQuery`, "isCanceled", which +// is causing conflicts with the Tutone generated code; see the PR linked to this change for more details on the exact limitations. +// +// Owing to this, in order to facilitate using these functions with the isCanceled attribute, modified versions of the functions and mutations have been added to +// this file. This would also allow us to ensure the older counterparts of these functions defined in accountmanagement_api.go inflict no breaking changes onto upstream +// services, such as the New Relic Terraform Provider. While we shall aim to bring this under Tutone's scope, please use the functions in this file to use the "isCanceled" +// attribute recently added to this query. +// +// TL;DR The functions in this file are NOT Tutone generated; we would eventually need to move functionalities in these duplicated functions into the original ones +// in accountmanagement_api.go . + +// Admin-level info about the accounts in an organization. +func (a *Accountmanagement) GetManagedAccountsWithAdditionalArguments( + isCanceled *bool, +) (*[]AccountManagementManagedAccount, error) { + return a.GetManagedAccountsWithAdditionalArgumentsWithContext(context.Background(), + isCanceled, + ) +} + +// Admin-level info about the accounts in an organization. +func (a *Accountmanagement) GetManagedAccountsWithAdditionalArgumentsWithContext( + ctx context.Context, + isCanceled *bool, +) (*[]AccountManagementManagedAccount, error) { + + resp := managedAccountsResponse{} + vars := map[string]interface{}{ + "isCanceled": &isCanceled, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getManagedAccountsWithAdditionalArgumentsQuery, vars, &resp); err != nil { + return nil, err + } + + if len(resp.Actor.Organization.AccountManagement.ManagedAccounts) == 0 { + return nil, errors.NewNotFound("") + } + + return &resp.Actor.Organization.AccountManagement.ManagedAccounts, nil +} + +const getManagedAccountsWithAdditionalArgumentsQuery = `query ($isCanceled: Boolean) { + actor { + organization { + accountManagement { + managedAccounts(isCanceled: $isCanceled) { + id + isCanceled + name + regionCode + } + } + } + } +} +` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/types.go new file mode 100644 index 00000000000..824ea366b60 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accountmanagement/types.go @@ -0,0 +1,81 @@ +// Code generated by tutone: DO NOT EDIT +package accountmanagement + +// AccountManagementCreateInput - Attributes for creating an account. +type AccountManagementCreateInput struct { + // The name of the account. + Name string `json:"name"` + // The id of the managed organization where the account will be created. + OrganizationId int `json:"organizationId,omitempty"` + // The data center region for the account + RegionCode string `json:"regionCode,omitempty"` +} + +// AccountManagementCreateResponse - The return object for a create-account mutation. +type AccountManagementCreateResponse struct { + // Information about the newly created account. + ManagedAccount AccountManagementManagedAccount `json:"managedAccount,omitempty"` +} + +// AccountManagementManagedAccount - Account data view for administration tasks. +type AccountManagementManagedAccount struct { + // The account ID. + ID int `json:"id"` + // True if account is canceled + IsCanceled bool `json:"isCanceled"` + // The name of the account. + Name string `json:"name"` + // The data center region for the account (US or EU). + RegionCode string `json:"regionCode"` +} + +// AccountManagementOrganizationStitchedFields - The field type for stitching into the NerdGraph schema. +type AccountManagementOrganizationStitchedFields struct { + // Admin-level info about the accounts in an organization. + ManagedAccounts []AccountManagementManagedAccount `json:"managedAccounts"` +} + +// AccountManagementUpdateInput - The attributes for updating an account. +type AccountManagementUpdateInput struct { + // The ID for the account being updated. + ID int `json:"id"` + // The new account name. + Name string `json:"name"` +} + +// AccountManagementUpdateResponse - The return object for an update-account mutation. +type AccountManagementUpdateResponse struct { + // Information about an updated account + ManagedAccount AccountManagementManagedAccount `json:"managedAccount,omitempty"` +} + +// Actor - The `Actor` object contains fields that are scoped to the API user's access level. +type Actor struct { + // The `organization` field is the entry point into data that is scoped to the user's organization. + Organization Organization `json:"organization,omitempty"` +} + +// Organization - The `Organization` object provides basic data about an organization. +type Organization struct { + // This field provides access to AccountManagement data. + AccountManagement AccountManagementOrganizationStitchedFields `json:"accountManagement,omitempty"` + // The customer id for the organization. + CustomerId string `json:"customerId,omitempty"` + // The ID of the organization. + ID int `json:"id,omitempty"` + // The name of the organization. + Name string `json:"name,omitempty"` + // The telemetry id for the organization + TelemetryId string `json:"telemetryId,omitempty"` +} + +type managedAccountsResponse struct { + Actor Actor `json:"actor"` +} + +// ID - The `ID` scalar type represents a unique identifier, often used to +// refetch an object or as key for a cache. The ID type appears in a JSON +// response as a String; however, it is not intended to be human-readable. +// When expected as an input type, any string (such as `"4"`) or integer +// (such as `4`) input value will be accepted as an ID. +type ID string diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/accounts.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/accounts.go similarity index 89% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/accounts.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/accounts.go index fd01b821977..1d909ebbe6f 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/accounts.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/accounts.go @@ -4,9 +4,9 @@ package accounts import ( "context" - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "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" ) // Accounts is used to interact with New Relic accounts. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/doc.go similarity index 96% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/doc.go index d083ecfceff..61456f62b67 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/doc.go @@ -2,13 +2,12 @@ Package accounts provides a programmatic API for interacting with New Relic accounts. It can be used to retrieve details about all accounts the user is authorized to view. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package accounts diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/types.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/accounts/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/accounts/types.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent.go new file mode 100644 index 00000000000..a3dd7c6c884 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent.go @@ -0,0 +1,19 @@ +package agent + +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 Agent struct { + client http.Client + logger logging.Logger +} + +func New(config config.Config) Agent { + return Agent{ + client: http.NewClient(config), + logger: config.GetLogger(), + } +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent_api.go new file mode 100644 index 00000000000..b9ecbf636bd --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/agent_api.go @@ -0,0 +1,46 @@ +// Code generated by tutone: DO NOT EDIT +package agent + +import "context" + +// The current release of the provided Agent +func (a *Agent) GetCurrentAgentRelease( + agentName AgentReleasesFilter, +) (*AgentReleasesAgentRelease, error) { + return a.GetCurrentAgentReleaseWithContext(context.Background(), + agentName, + ) +} + +// The current release of the provided Agent +func (a *Agent) GetCurrentAgentReleaseWithContext( + ctx context.Context, + agentName AgentReleasesFilter, +) (*AgentReleasesAgentRelease, error) { + + resp := currentAgentReleaseResponse{} + vars := map[string]interface{}{ + "agentName": agentName, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getCurrentAgentReleaseQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.DocumentationFields.CurrentAgentRelease, nil +} + +const getCurrentAgentReleaseQuery = `query( + $agentName: AgentReleasesFilter!, +) { docs { currentAgentRelease( + agentName: $agentName, +) { + bugs + date + downloadLink + eolDate + features + security + slug + version +} } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/types.go new file mode 100644 index 00000000000..bf6df1e8c3a --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agent/types.go @@ -0,0 +1,96 @@ +// Code generated by tutone: DO NOT EDIT +package agent + +// AgentReleasesFilter - Agent Release Filter +type AgentReleasesFilter string + +var AgentReleasesFilterTypes = struct { + // Android agent + ANDROID AgentReleasesFilter + // Browser agent + BROWSER AgentReleasesFilter + // .NET agent + DOTNET AgentReleasesFilter + // Elixir agent + ELIXIR AgentReleasesFilter + // Go agent + GO AgentReleasesFilter + // Infrastructure agent + INFRASTRUCTURE AgentReleasesFilter + // iOS agent + IOS AgentReleasesFilter + // Java agent + JAVA AgentReleasesFilter + // Node.js agent + NODEJS AgentReleasesFilter + // PHP agent + PHP AgentReleasesFilter + // Python agent + PYTHON AgentReleasesFilter + // Ruby agent + RUBY AgentReleasesFilter + // C SDK + SDK AgentReleasesFilter +}{ + // Android agent + ANDROID: "ANDROID", + // Browser agent + BROWSER: "BROWSER", + // .NET agent + DOTNET: "DOTNET", + // Elixir agent + ELIXIR: "ELIXIR", + // Go agent + GO: "GO", + // Infrastructure agent + INFRASTRUCTURE: "INFRASTRUCTURE", + // iOS agent + IOS: "IOS", + // Java agent + JAVA: "JAVA", + // Node.js agent + NODEJS: "NODEJS", + // PHP agent + PHP: "PHP", + // Python agent + PYTHON: "PYTHON", + // Ruby agent + RUBY: "RUBY", + // C SDK + SDK: "SDK", +} + +// AgentReleasesAgentRelease - Information about an Agent release +type AgentReleasesAgentRelease struct { + // Patch for a bug + Bugs []string `json:"bugs,omitempty"` + // The date of the release + Date Date `json:"date,omitempty"` + // Link to agent distribution + DownloadLink string `json:"downloadLink,omitempty"` + // The date the release will reach the end of its life. See [New Relic's EOL Policy](https://docs.newrelic.com/docs/licenses/end-of-life/notification-changes-new-relic-saas-features-distributed-software/) for details + EolDate Date `json:"eolDate,omitempty"` + // New feature or instrumentation + Features []string `json:"features,omitempty"` + // Fix for a security vulnerability + Security []string `json:"security,omitempty"` + // The release note's location on the docs website. The full URL would be prefixed with [https://docs.newrelic.com](https://docs.newrelic.com/) + Slug string `json:"slug,omitempty"` + // The version of the release + Version string `json:"version,omitempty"` +} + +// DocumentationFields - +type DocumentationFields struct { + // View a list of all releases for the provided Agent + AgentReleases []AgentReleasesAgentRelease `json:"agentReleases,omitempty"` + // The current release of the provided Agent + CurrentAgentRelease AgentReleasesAgentRelease `json:"currentAgentRelease,omitempty"` +} + +type currentAgentReleaseResponse struct { + DocumentationFields DocumentationFields `json:"docs"` +} + +// Date - The `Date` scalar represents a date. The `Date` appears as an ISO8601 formatted string. +type Date string diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications.go new file mode 100644 index 00000000000..80a93942051 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications.go @@ -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(), + } +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications_api.go new file mode 100644 index 00000000000..b7fe703b05d --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/agentapplications_api.go @@ -0,0 +1,284 @@ +// Code generated by tutone: DO NOT EDIT +package agentapplications + +import ( + "context" + + "github.com/newrelic/newrelic-client-go/v2/pkg/common" +) + +// If you aren't using an auto-instrumenting agent on the backend, use this to set up browser monitoring for an application. For more information on enabling copy/paste, [see our docs](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste-app) +func (a *AgentApplications) AgentApplicationCreateBrowser( + accountID int, + name string, + settings AgentApplicationBrowserSettingsInput, +) (*AgentApplicationCreateBrowserResult, error) { + return a.AgentApplicationCreateBrowserWithContext(context.Background(), + accountID, + name, + settings, + ) +} + +// If you aren't using an auto-instrumenting agent on the backend, use this to set up browser monitoring for an application. For more information on enabling copy/paste, [see our docs](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste-app) +func (a *AgentApplications) AgentApplicationCreateBrowserWithContext( + ctx context.Context, + accountID int, + name string, + settings AgentApplicationBrowserSettingsInput, +) (*AgentApplicationCreateBrowserResult, error) { + + resp := AgentApplicationCreateBrowserQueryResponse{} + vars := map[string]interface{}{ + "accountId": accountID, + "name": name, + "settings": settings, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AgentApplicationCreateBrowserMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AgentApplicationCreateBrowserResult, nil +} + +type AgentApplicationCreateBrowserQueryResponse struct { + AgentApplicationCreateBrowserResult AgentApplicationCreateBrowserResult `json:"AgentApplicationCreateBrowser"` +} + +const AgentApplicationCreateBrowserMutation = `mutation( + $accountId: Int!, + $name: String!, + $settings: AgentApplicationBrowserSettingsInput, +) { agentApplicationCreateBrowser( + accountId: $accountId, + name: $name, + settings: $settings, +) { + guid + name + settings { + cookiesEnabled + distributedTracingEnabled + loaderScript + loaderType + } +} }` + +// Deletes a browser, mobile, or APM application. This isn't allowed if an application is actively reporting data. +func (a *AgentApplications) AgentApplicationDelete( + gUID common.EntityGUID, +) (*AgentApplicationDeleteResult, error) { + return a.AgentApplicationDeleteWithContext(context.Background(), + gUID, + ) +} + +// Deletes a browser, mobile, or APM application. This isn't allowed if an application is actively reporting data. +func (a *AgentApplications) AgentApplicationDeleteWithContext( + ctx context.Context, + gUID common.EntityGUID, +) (*AgentApplicationDeleteResult, error) { + + resp := AgentApplicationDeleteQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AgentApplicationDeleteMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AgentApplicationDeleteResult, nil +} + +type AgentApplicationDeleteQueryResponse struct { + AgentApplicationDeleteResult AgentApplicationDeleteResult `json:"AgentApplicationDelete"` +} + +const AgentApplicationDeleteMutation = `mutation( + $guid: EntityGuid!, +) { agentApplicationDelete( + guid: $guid, +) { + success +} }` + +// Enable browser monitoring for an application monitored by APM. For information about specific APM agents, [see our docs](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-instrumentation) +func (a *AgentApplications) AgentApplicationEnableApmBrowser( + gUID common.EntityGUID, + settings AgentApplicationBrowserSettingsInput, +) (*AgentApplicationEnableBrowserResult, error) { + return a.AgentApplicationEnableApmBrowserWithContext(context.Background(), + gUID, + settings, + ) +} + +// Enable browser monitoring for an application monitored by APM. For information about specific APM agents, [see our docs](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-instrumentation) +func (a *AgentApplications) AgentApplicationEnableApmBrowserWithContext( + ctx context.Context, + gUID common.EntityGUID, + settings AgentApplicationBrowserSettingsInput, +) (*AgentApplicationEnableBrowserResult, error) { + + resp := AgentApplicationEnableApmBrowserQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + "settings": settings, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AgentApplicationEnableApmBrowserMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AgentApplicationEnableBrowserResult, nil +} + +type AgentApplicationEnableApmBrowserQueryResponse struct { + AgentApplicationEnableBrowserResult AgentApplicationEnableBrowserResult `json:"AgentApplicationEnableApmBrowser"` +} + +const AgentApplicationEnableApmBrowserMutation = `mutation( + $guid: EntityGuid!, + $settings: AgentApplicationBrowserSettingsInput, +) { agentApplicationEnableApmBrowser( + guid: $guid, + settings: $settings, +) { + name + settings { + cookiesEnabled + distributedTracingEnabled + loaderType + } +} }` + +// Update configuration for APM applications. Includes thresholds for how often to record Transaction traces, SQL traces, enabling Distributed traces, ignoring certain error classes. This is the main mutation that powers the Application > Settings page in APM. +func (a *AgentApplications) AgentApplicationSettingsUpdate( + gUID common.EntityGUID, + settings AgentApplicationSettingsUpdateInput, +) (*AgentApplicationSettingsUpdateResult, error) { + return a.AgentApplicationSettingsUpdateWithContext(context.Background(), + gUID, + settings, + ) +} + +// Update configuration for APM applications. Includes thresholds for how often to record Transaction traces, SQL traces, enabling Distributed traces, ignoring certain error classes. This is the main mutation that powers the Application > Settings page in APM. +func (a *AgentApplications) AgentApplicationSettingsUpdateWithContext( + ctx context.Context, + gUID common.EntityGUID, + settings AgentApplicationSettingsUpdateInput, +) (*AgentApplicationSettingsUpdateResult, error) { + + resp := AgentApplicationSettingsUpdateQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + "settings": settings, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AgentApplicationSettingsUpdateMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AgentApplicationSettingsUpdateResult, nil +} + +type AgentApplicationSettingsUpdateQueryResponse struct { + AgentApplicationSettingsUpdateResult AgentApplicationSettingsUpdateResult `json:"AgentApplicationSettingsUpdate"` +} + +const AgentApplicationSettingsUpdateMutation = `mutation( + $guid: EntityGuid!, + $settings: AgentApplicationSettingsUpdateInput!, +) { agentApplicationSettingsUpdate( + guid: $guid, + settings: $settings, +) { + alias + apmSettings { + apmConfig { + apdexTarget + useServerSideConfig + } + errorCollector { + enabled + expectedErrorClasses + expectedErrorCodes + ignoredErrorClasses + ignoredErrorCodes + } + jfr { + enabled + } + originalName + slowSql { + enabled + } + threadProfiler { + enabled + } + tracerType + transactionTracer { + captureMemcacheKeys + enabled + explainEnabled + explainThresholdType + explainThresholdValue + logSql + recordSql + stackTraceThreshold + transactionThresholdType + transactionThresholdValue + } + } + browserProperties { + jsLoaderScript + } + browserSettings { + browserConfig { + apdexTarget + } + browserMonitoring { + ajax { + denyList + } + distributedTracing { + allowedOrigins + corsEnabled + corsUseNewrelicHeader + corsUseTracecontextHeaders + enabled + excludeNewrelicHeader + } + loader + privacy { + cookiesEnabled + } + } + } + errors { + description + errorClass + field + } + guid + mobileSettings { + networkSettings { + aliases { + alias + hosts + } + filterMode + hideList + ignoredStatusCodeRules { + hosts + statusCodes + } + showList + } + useCrashReports + } + name +} }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/types.go new file mode 100644 index 00000000000..b4bb1ebcad6 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/agentapplications/types.go @@ -0,0 +1,686 @@ +// Code generated by tutone: DO NOT EDIT +package agentapplications + +import ( + "github.com/newrelic/newrelic-client-go/v2/pkg/common" +) + +// AgentApplicationBrowserLoader - Determines which browser loader will be configured. There are three browser loader types. They are Pro+SPA, Pro, and Lite. +// See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types) for further information. +type AgentApplicationBrowserLoader string + +var AgentApplicationBrowserLoaderTypes = struct { + // Use PRO instead. + FULL AgentApplicationBrowserLoader + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. + LITE AgentApplicationBrowserLoader + // Don't use an agent. + NONE AgentApplicationBrowserLoader + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO AgentApplicationBrowserLoader + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. + SPA AgentApplicationBrowserLoader +}{ + // Use PRO instead. + FULL: "FULL", + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. + LITE: "LITE", + // Don't use an agent. + NONE: "NONE", + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO: "PRO", + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. + SPA: "SPA", +} + +// AgentApplicationSettingsBrowserLoader - Determines which browser loader will be configured. Some allowed return values are specified for backwards-compatibility and do not represent currently allowed values for new applications. +// See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types) for further information. +type AgentApplicationSettingsBrowserLoader string + +var AgentApplicationSettingsBrowserLoaderTypes = struct { + // Use PRO instead + FULL AgentApplicationSettingsBrowserLoader + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. + LITE AgentApplicationSettingsBrowserLoader + // Don't use an agent. + NONE AgentApplicationSettingsBrowserLoader + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO AgentApplicationSettingsBrowserLoader + // This value is no longer in use. + RUM AgentApplicationSettingsBrowserLoader + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. + SPA AgentApplicationSettingsBrowserLoader + // This value is specified for backwards-compatibility. + XHR AgentApplicationSettingsBrowserLoader +}{ + // Use PRO instead + FULL: "FULL", + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. + LITE: "LITE", + // Don't use an agent. + NONE: "NONE", + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO: "PRO", + // This value is no longer in use. + RUM: "RUM", + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. + SPA: "SPA", + // This value is specified for backwards-compatability. + XHR: "XHR", +} + +// AgentApplicationSettingsBrowserLoaderInput - We have three types of browser agents: Lite, Pro, and Pro+SPA. +type AgentApplicationSettingsBrowserLoaderInput string + +var AgentApplicationSettingsBrowserLoaderInputTypes = struct { + // Use PRO instead. + FULL AgentApplicationSettingsBrowserLoaderInput + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. + LITE AgentApplicationSettingsBrowserLoaderInput + // Don't use an agent. + NONE AgentApplicationSettingsBrowserLoaderInput + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO AgentApplicationSettingsBrowserLoaderInput + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. + SPA AgentApplicationSettingsBrowserLoaderInput +}{ + // Use PRO instead. + FULL: "FULL", + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. + LITE: "LITE", + // Don't use an agent. + NONE: "NONE", + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO: "PRO", + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. + SPA: "SPA", +} + +// AgentApplicationSettingsNetworkFilterMode - Configuration setting to apply either the show or hide strategy for network filtering. +type AgentApplicationSettingsNetworkFilterMode string + +var AgentApplicationSettingsNetworkFilterModeTypes = struct { + // Disables both show and hide confurations. + DISABLED AgentApplicationSettingsNetworkFilterMode + // Use the hide list configuration. + HIDE AgentApplicationSettingsNetworkFilterMode + // Use the show list configuration. + SHOW AgentApplicationSettingsNetworkFilterMode +}{ + // Disables both show and hide confurations. + DISABLED: "DISABLED", + // Use the hide list configuration. + HIDE: "HIDE", + // Use the show list configuration. + SHOW: "SHOW", +} + +// AgentApplicationSettingsRecordSqlEnum - Obfuscation level for SQL queries reported in transaction trace nodes. +// +// When turned on, the New Relic agent will attempt to remove values from SQL qeries. +// +// For example: +// +// ``` +// SELECT * FROM Table WHERE ssn='123-45-6789' +// ``` +// +// might become: +// +// ``` +// SELECT * FROM Table WHERE ssn=? +// ``` +// +// This can behave differently for differnet applications and frameworks. Please test for your specific case. +// Note: RAW collection is not campatible with High Security mode and cannot be set if your agent is running in that mode. +type AgentApplicationSettingsRecordSqlEnum string + +var AgentApplicationSettingsRecordSqlEnumTypes = struct { + // This is the default value. This setting strips string literals and numeric sequences from your queries and replaces them with the ? character. For example: the query select * from table where ssn='123-45-6789' would become select * from table where ssn=?. + OBFUSCATED AgentApplicationSettingsRecordSqlEnum + // Query collection is turned off entirely. + OFF AgentApplicationSettingsRecordSqlEnum + // If you are confident that full query data collection will not impact your data security or your users' privacy, you can change the setting to RAW, which will record all query values. NOTE: 'RAW' is not permitted when 'High security mode' is enabled. + RAW AgentApplicationSettingsRecordSqlEnum +}{ + // This is the default value. This setting strips string literals and numeric sequences from your queries and replaces them with the ? character. For example: the query select * from table where ssn='123-45-6789' would become select * from table where ssn=?. + OBFUSCATED: "OBFUSCATED", + // Query collection is turned off entirely. + OFF: "OFF", + // If you are confident that full query data collection will not impact your data security or your users' privacy, you can change the setting to RAW, which will record all query values. NOTE: 'RAW' is not permitted when 'High security mode' is enabled. + RAW: "RAW", +} + +// AgentApplicationSettingsThresholdTypeEnum - Determines whether a threshold is statically configured or dynamically configured. +type AgentApplicationSettingsThresholdTypeEnum string + +var AgentApplicationSettingsThresholdTypeEnumTypes = struct { + // Configures the threshold to be 4 times the value of APDEX_T. + APDEX_F AgentApplicationSettingsThresholdTypeEnum + // Threshold will be statically configured via the corresponding "value" field. + VALUE AgentApplicationSettingsThresholdTypeEnum +}{ + // Configures the threshold to be 4 times the value of APDEX_T. + APDEX_F: "APDEX_F", + // Threshold will be statically configured via the corresponding "value" field. + VALUE: "VALUE", +} + +// AgentApplicationSettingsTracer - The type of tracing being done. +type AgentApplicationSettingsTracer string + +var AgentApplicationSettingsTracerTypes = struct { + // Cross-application tracing feature enabled. + CROSS_APPLICATION_TRACER AgentApplicationSettingsTracer + // Distributed tracing feature enabled. + DISTRIBUTED_TRACING AgentApplicationSettingsTracer + // Both cross-application and distributed tracing disabled. + NONE AgentApplicationSettingsTracer +}{ + // Cross-application tracing feature enabled. + CROSS_APPLICATION_TRACER: "CROSS_APPLICATION_TRACER", + // Distributed tracing feature enabled. + DISTRIBUTED_TRACING: "DISTRIBUTED_TRACING", + // Both cross-application and distributed tracing disabled. + NONE: "NONE", +} + +// AgentApplicationSettingsUpdateErrorClass - Categories of errors that could occur while attempting updates. +type AgentApplicationSettingsUpdateErrorClass string + +var AgentApplicationSettingsUpdateErrorClassTypes = struct { + // You are not authorized to update this field. + ACCESS_DENIED AgentApplicationSettingsUpdateErrorClass + // The given value for the field is not valid or out of range. + INVALID_INPUT AgentApplicationSettingsUpdateErrorClass + // No record could be found using the given input value. + NOT_FOUND AgentApplicationSettingsUpdateErrorClass +}{ + // You are not authorized to update this field. + ACCESS_DENIED: "ACCESS_DENIED", + // The given value for the field is not valid or out of range. + INVALID_INPUT: "INVALID_INPUT", + // No record could be found using the given input value. + NOT_FOUND: "NOT_FOUND", +} + +// AgentApplicationApmBrowserSettings - The settings of a browser application. +type AgentApplicationApmBrowserSettings struct { + // Configure cookies. The default is enabled: true. + CookiesEnabled bool `json:"cookiesEnabled"` + // Configure distributed tracing in browser apps. The default is enabled: true. + DistributedTracingEnabled bool `json:"distributedTracingEnabled"` + // Determines which browser loader will be configured. The default is "SPA". + LoaderType AgentApplicationBrowserLoader `json:"loaderType"` +} + +// AgentApplicationBrowserSettings - The settings of a browser application. Includes loader script. +type AgentApplicationBrowserSettings struct { + // Configure cookies. The default is enabled: true. + CookiesEnabled bool `json:"cookiesEnabled"` + // Configure distributed tracing in browser apps. The default is enabled: true. + DistributedTracingEnabled bool `json:"distributedTracingEnabled"` + // The snippet of JavaScript used to copy/paste into your JavaScript app if you aren't using an auto-instrumenting agent on the backend. Note that the resulting snippet will be a JSON string that will need to be parsed before using in your browser application. + LoaderScript string `json:"loaderScript,omitempty"` + // Determines which browser loader will be configured. The default is "SPA". + LoaderType AgentApplicationBrowserLoader `json:"loaderType"` +} + +// AgentApplicationBrowserSettingsInput - Configure additional browser settings here. +type AgentApplicationBrowserSettingsInput struct { + // Configure cookies. The default is enabled: true. + CookiesEnabled *bool `json:"cookiesEnabled,omitempty"` + // Configure distributed tracing in browser apps. The default is enabled: true. + DistributedTracingEnabled bool `json:"distributedTracingEnabled,omitempty"` + // Determines which browser loader is configured. The default is "SPA". + LoaderType AgentApplicationBrowserLoader `json:"loaderType,omitempty"` +} + +// AgentApplicationCreateBrowserResult - The result of creating a browser application. +type AgentApplicationCreateBrowserResult struct { + // The GUID for the affected Entity. + GUID common.EntityGUID `json:"guid"` + // The name of the application. + Name string `json:"name"` + // Fields related to browser settings. + Settings AgentApplicationBrowserSettings `json:"settings,omitempty"` +} + +// AgentApplicationDeleteResult - The result of deleting an application. +type AgentApplicationDeleteResult struct { + // Did the delete succeed? + Success bool `json:"success"` +} + +// AgentApplicationEnableBrowserResult - The result of enabling browser monitoring for an APM-monitored application. +type AgentApplicationEnableBrowserResult struct { + // The application's name + Name string `json:"name"` + // Fields related to browser settings. + Settings AgentApplicationApmBrowserSettings `json:"settings,omitempty"` +} + +// AgentApplicationSettingsApmBase - Settings that are applicable to APM applications and their agents. +type AgentApplicationSettingsApmBase struct { + // The name for the application + Alias string `json:"alias,omitempty"` + // Access general settings for the application. + ApmConfig AgentApplicationSettingsApmConfig `json:"apmConfig"` + // Access error collector settings for the application. The error collector captures information about uncaught exceptions and sends them to New Relic for viewing. + ErrorCollector AgentApplicationSettingsErrorCollector `json:"errorCollector,omitempty"` + // Access enabled state for the Java Flight Recorder. This is available only for the Java language agent version 8.0.0 or later. + Jfr AgentApplicationSettingsJfr `json:"jfr,omitempty"` + // The name originally given to the application for reporting. + OriginalName string `json:"originalName,omitempty"` + // In APM, when transaction traces are collected, there may be additional Slow query data available. + SlowSql AgentApplicationSettingsSlowSql `json:"slowSql,omitempty"` + // Measures wall clock time, CPU time, and method call counts in your application's threads as they run. + ThreadProfiler AgentApplicationSettingsThreadProfiler `json:"threadProfiler,omitempty"` + // Type of tracer used. APM's cross application tracing links transactions between APM apps in your service-oriented architecture (SOA). Distributed tracing is an improvement on the cross application tracing feature, and is recommended for large, distributed systems. + TracerType AgentApplicationSettingsTracer `json:"tracerType,omitempty"` + // Access transaction tracer settings for the application. + TransactionTracer AgentApplicationSettingsTransactionTracer `json:"transactionTracer,omitempty"` +} + +// AgentApplicationSettingsApmConfig - General settings related to APM applications. +type AgentApplicationSettingsApmConfig struct { + // The desired target for the APDEX measurement of this APM application. + ApdexTarget float64 `json:"apdexTarget,omitempty"` + // Sets if agents for this APM application should get some of their configuration from the server. + UseServerSideConfig bool `json:"useServerSideConfig,omitempty"` +} + +// AgentApplicationSettingsApmConfigInput - Provides fields to set general APM application settings. +type AgentApplicationSettingsApmConfigInput struct { + // The desired target for the APDEX measurement of this application. + ApdexTarget float64 `json:"apdexTarget,omitempty"` + // Sets if installed agents should override local settings with ones set here. + UseServerSideConfig bool `json:"useServerSideConfig,omitempty"` +} + +// AgentApplicationSettingsBrowserAjax - Browser Ajax. +type AgentApplicationSettingsBrowserAjax struct { + // List of domains excluded from Ajax traces by the browser agent. + DenyList []string `json:"denyList"` +} + +// AgentApplicationSettingsBrowserAjaxInput - Configuration settings related to how a browser agent handles Ajax requests. +type AgentApplicationSettingsBrowserAjaxInput struct { + // A list of host destinations that will not record AjaxRequest events when requested. + DenyList []string `json:"denyList"` +} + +// AgentApplicationSettingsBrowserBase - Settings that are applicable to browser applications. +type AgentApplicationSettingsBrowserBase struct { + // Access general settings for the application. + BrowserConfig AgentApplicationSettingsBrowserConfig `json:"browserConfig"` + // browser monitoring provides real user monitoring (RUM) that measures the speed and performance of end users as they navigate the application using different web browsers, devices, operating systems, and networks. + BrowserMonitoring AgentApplicationSettingsBrowserMonitoring `json:"browserMonitoring"` +} + +// AgentApplicationSettingsBrowserConfig - General settings related to APM applications. +type AgentApplicationSettingsBrowserConfig struct { + // The desired target for the APDEX measurement of this browser application. + ApdexTarget float64 `json:"apdexTarget,omitempty"` +} + +// AgentApplicationSettingsBrowserConfigInput - Provides fields to set general browser application settings. +type AgentApplicationSettingsBrowserConfigInput struct { + // The desired target for the APDEX measurement of this application. + ApdexTarget float64 `json:"apdexTarget,omitempty"` +} + +// AgentApplicationSettingsBrowserDistributedTracing - Distributed tracing type. See [documentation](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/browser-data-distributed-tracing/) for further information. +type AgentApplicationSettingsBrowserDistributedTracing struct { + // List of allowed origins for use with distributed tracing. + AllowedOrigins []string `json:"allowedOrigins"` + // Whether or not CORS is enabled in distributed tracing. + CorsEnabled bool `json:"corsEnabled,omitempty"` + // Whether or not CORS uses the `newrelic` header in distributed tracing. + CorsUseNewrelicHeader bool `json:"corsUseNewrelicHeader,omitempty"` + // Whether or not CORS uses tracecontext headers in distributed tracing. + CorsUseTracecontextHeaders bool `json:"corsUseTracecontextHeaders,omitempty"` + // Whether or not distributed tracing is enabled. + Enabled bool `json:"enabled,omitempty"` + // Whether or not to exclude the `newrelic` header in distributed tracing. + ExcludeNewrelicHeader bool `json:"excludeNewrelicHeader,omitempty"` +} + +// AgentApplicationSettingsBrowserDistributedTracingInput - Configure distributed traces from within browser apps. +type AgentApplicationSettingsBrowserDistributedTracingInput struct { + // Supplies allowed origins for distributed tracing in browser. + AllowedOrigins *[]string `json:"allowedOrigins,omitempty"` + // Enables CORS for distributed tracing in browser. + CorsEnabled bool `json:"corsEnabled,omitempty"` + // Enables the use of the `newrelic` header for CORS requests with distributed tracing. [See Docs](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/browser-data-distributed-tracing/#cors) for more information. + CorsUseNewrelicHeader bool `json:"corsUseNewrelicHeader,omitempty"` + // Enables CORS to use tracecontext headers for distributed tracing in browser. + CorsUseTracecontextHeaders bool `json:"corsUseTracecontextHeaders,omitempty"` + // Enables distributed tracing in browser. + Enabled bool `json:"enabled"` + // Enables the `newrelic` header to be excluded in distributed tracing in browser. + ExcludeNewrelicHeader bool `json:"excludeNewrelicHeader,omitempty"` +} + +// AgentApplicationSettingsBrowserMonitoring - Browser monitoring. +type AgentApplicationSettingsBrowserMonitoring struct { + // Enables ajax traces in the browser app. + Ajax AgentApplicationSettingsBrowserAjax `json:"ajax,omitempty"` + // Configure distributed tracing in browser apps. + DistributedTracing AgentApplicationSettingsBrowserDistributedTracing `json:"distributedTracing"` + // The type of browser agent that will be loaded. + Loader AgentApplicationSettingsBrowserLoader `json:"loader"` + // Browser monitoring's page load timing feature can track sessions by using cookies that contain a simple session identifier. + Privacy AgentApplicationSettingsBrowserPrivacy `json:"privacy"` +} + +// AgentApplicationSettingsBrowserMonitoringInput - Set browser monitoring application settings. +type AgentApplicationSettingsBrowserMonitoringInput struct { + // Browser monitoring's page load Ajax requests. + Ajax *AgentApplicationSettingsBrowserAjaxInput `json:"ajax,omitempty"` + // If you use browser to monitor end-user browser activity, you can now see end-user-originating browser-side traces in distributed tracing. + DistributedTracing *AgentApplicationSettingsBrowserDistributedTracingInput `json:"distributedTracing,omitempty"` + // Determines which browser loader will be configured. + Loader *AgentApplicationSettingsBrowserLoaderInput `json:"loader,omitempty"` + // Browser monitoring's page load timing feature can track sessions by using cookies that contain a simple session identifier. + Privacy *AgentApplicationSettingsBrowserPrivacyInput `json:"privacy,omitempty"` +} + +// AgentApplicationSettingsBrowserPrivacy - Browser privacy. See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/page-load-timing-resources/cookie-collection-session-tracking/) for further information. +type AgentApplicationSettingsBrowserPrivacy struct { + // Whether or not cookies are enabled. + CookiesEnabled bool `json:"cookiesEnabled"` +} + +// AgentApplicationSettingsBrowserPrivacyInput - Browser monitoring's page load timing feature can track sessions by using cookies that contain a simple session identifier. +type AgentApplicationSettingsBrowserPrivacyInput struct { + // If enabled, enables cookies. + CookiesEnabled *bool `json:"cookiesEnabled,omitempty"` +} + +// AgentApplicationSettingsBrowserProperties - General Properties related to browser applications. +type AgentApplicationSettingsBrowserProperties struct { + // The snippet of JavaScript used to copy/paste into your JavaScript app if you aren’t using an auto-instrumentating agent on the backend. + JsLoaderScript string `json:"jsLoaderScript,omitempty"` +} + +// AgentApplicationSettingsErrorCollector - The error collector captures information about uncaught exceptions and sends them to New Relic for viewing. For more information about what these settings do and which ones are applicable for your application, please see https://docs.newrelic.com for more information about agent configuration for your language agent. +type AgentApplicationSettingsErrorCollector struct { + // Enables error collector. + Enabled bool `json:"enabled,omitempty"` + // Prevents specified exception classes from affecting error rate or Apdex score while still reporting the errors to APM. + ExpectedErrorClasses []string `json:"expectedErrorClasses"` + // An array of individual HTTP status codes to be marked as expected and thus prevented from affecting error rate or Apdex score. + ExpectedErrorCodes []AgentApplicationSettingsErrorCollectorHttpStatus `json:"expectedErrorCodes"` + // Specified exception class names will be ignored and will not affect error rate or Apdex score, or be reported to APM. + IgnoredErrorClasses []string `json:"ignoredErrorClasses"` + // An array of individual HTTP status codes that should not be treated as errors. + IgnoredErrorCodes []AgentApplicationSettingsErrorCollectorHttpStatus `json:"ignoredErrorCodes"` +} + +// AgentApplicationSettingsErrorCollectorInput - The error collector captures information about uncaught exceptions and sends them to New Relic for viewing. For more information about what these settings do and which ones are applicable for your application, please see https://docs.newrelic.com for more information about agent configuration for your language agent. +type AgentApplicationSettingsErrorCollectorInput struct { + // Enables error collector. + Enabled bool `json:"enabled,omitempty"` + // Prevents specified exception classes from affecting error rate or Apdex score while still reporting the errors to APM. + ExpectedErrorClasses []string `json:"expectedErrorClasses"` + // An array of individual HTTP status codes to be marked as expected and thus prevented from affecting error rate or Apdex score. + ExpectedErrorCodes []AgentApplicationSettingsErrorCollectorHttpStatus `json:"expectedErrorCodes"` + // Specified exception class names will be ignored and will not affect error rate or Apdex score, or be reported to APM. + IgnoredErrorClasses []string `json:"ignoredErrorClasses"` + // An array of individual HTTP status codes that should not be treated as errors. + IgnoredErrorCodes []AgentApplicationSettingsErrorCollectorHttpStatus `json:"ignoredErrorCodes"` +} + +// AgentApplicationSettingsIgnoredStatusCodeRule - A configuration setting used ignore status codes associated with different hosts. +type AgentApplicationSettingsIgnoredStatusCodeRule struct { + // An array of hosts to apply the status code rule to. + Hosts []string `json:"hosts"` + // An array of status codes to be be ignored on these hosts. + StatusCodes []string `json:"statusCodes"` +} + +// AgentApplicationSettingsIgnoredStatusCodeRuleInput - Input data that maps ignore status codes associated with different hosts. +type AgentApplicationSettingsIgnoredStatusCodeRuleInput struct { + // An array of hosts to apply the status code rule to. + Hosts []string `json:"hosts"` + // An array of status codes to be be ignored on these hosts. + StatusCodes []string `json:"statusCodes"` +} + +// AgentApplicationSettingsJfr - Access to the enabled state of the Java Flight Recorder. This feature only available on the Java language agent version 8.0.0 or later. +type AgentApplicationSettingsJfr struct { + // If true, the java agent collects Java Flight Recorder data. (Java Agent version 8.0.0 required.) + Enabled bool `json:"enabled,omitempty"` +} + +// AgentApplicationSettingsJfrInput - In the Java agent (v8.0.0 or later), the Java Flight Recorder can be turned on to collect additional information about the application. This setting cannot be updated for non-java agents. +type AgentApplicationSettingsJfrInput struct { + // Whether or not JFR is enabled. + Enabled bool `json:"enabled,omitempty"` +} + +// AgentApplicationSettingsMobileBase - Settings that are applicable to mobile applications. +type AgentApplicationSettingsMobileBase struct { + // Network settings associated with the mobile application. + NetworkSettings AgentApplicationSettingsMobileNetworkSettings `json:"networkSettings,omitempty"` + // Enables viewing in-depth reports for mobile application crashes. + UseCrashReports bool `json:"useCrashReports,omitempty"` +} + +// AgentApplicationSettingsMobileNetworkSettings - An object containing your network settings. +type AgentApplicationSettingsMobileNetworkSettings struct { + // A list of configuration settings that map host to alias names for grouping and identification purposes. + Aliases []AgentApplicationSettingsNetworkAlias `json:"aliases"` + // Configuration setting to apply either the show or hide strategy for network filtering. + FilterMode AgentApplicationSettingsNetworkFilterMode `json:"filterMode,omitempty"` + // A list of hostnames that would be applied to our filter settings when the filterMode is 'HIDE.' + HideList []string `json:"hideList"` + // A list of rules to ignore status codes associated with different hosts. + IgnoredStatusCodeRules []AgentApplicationSettingsIgnoredStatusCodeRule `json:"ignoredStatusCodeRules"` + // A list of hostnames that would be applied to our filter settings when the filterMode is 'SHOW.' + ShowList []string `json:"showList"` +} + +// AgentApplicationSettingsMobileSettingsInput - Configure mobile settings here. +type AgentApplicationSettingsMobileSettingsInput struct { + // Input arguments for network settings. + NetworkSettings AgentApplicationSettingsNetworkSettingsInput `json:"networkSettings,omitempty"` + // Sets if application should use crash report or not for mobile settings. + UseCrashReports bool `json:"useCrashReports,omitempty"` +} + +// AgentApplicationSettingsNetworkAlias - A configuration setting that maps hosts to alias names for grouping and identification purposes. +type AgentApplicationSettingsNetworkAlias struct { + // An alternative name that can be used to reference the hostnames. + Alias string `json:"alias,omitempty"` + // A list of hostnames to associate with an alias. + Hosts []string `json:"hosts"` +} + +// AgentApplicationSettingsNetworkAliasesInput - Input data that maps hosts to alias names for grouping and identification purposes. +type AgentApplicationSettingsNetworkAliasesInput struct { + // An alternative name that can be used to reference the hostnames. + Alias string `json:"alias"` + // A list of hostnames to associate with an alias. + Hosts []string `json:"hosts"` +} + +// AgentApplicationSettingsNetworkSettingsInput - Configure mobile network settings here. +type AgentApplicationSettingsNetworkSettingsInput struct { + // Input data that maps hosts to alias names for grouping and identification purposes. + Aliases []AgentApplicationSettingsNetworkAliasesInput `json:"aliases,omitempty"` + // Configuration setting to apply either the show or hide strategy for network filtering. + FilterMode AgentApplicationSettingsNetworkFilterMode `json:"filterMode,omitempty"` + // A list of hostnames that would be applied to our filter settings when the filterMode is 'HIDE.' + HideList []string `json:"hideList"` + // Input data that maps ignore status codes associated with different hosts. + IgnoredStatusCodeRules []AgentApplicationSettingsIgnoredStatusCodeRuleInput `json:"ignoredStatusCodeRules,omitempty"` + // A list of hostnames that would be applied to our filter settings when the filterMode is 'SHOW.' + ShowList []string `json:"showList"` +} + +// AgentApplicationSettingsSlowSql - In APM, when transaction traces are collected, there may be additional Slow query data available. +type AgentApplicationSettingsSlowSql struct { + // If true, the agent collects slow SQL queries. + Enabled bool `json:"enabled,omitempty"` +} + +// AgentApplicationSettingsSlowSqlInput - In APM, when transaction traces are collected, there may be additional Slow query data available. +type AgentApplicationSettingsSlowSqlInput struct { + // Whether or not slow_sql is enabled. + Enabled bool `json:"enabled,omitempty"` +} + +// AgentApplicationSettingsThreadProfiler - Measures wall clock time, CPU time, and method call counts in your application's threads as they run. +type AgentApplicationSettingsThreadProfiler struct { + // Whether or not the Thread Profiler is enabled for your application. + Enabled bool `json:"enabled,omitempty"` +} + +// AgentApplicationSettingsThreadProfilerInput - Settings for the thread profiler. +type AgentApplicationSettingsThreadProfilerInput struct { + // Is thread profiling enabled for this application? + Enabled bool `json:"enabled,omitempty"` +} + +// AgentApplicationSettingsTracerTypeInput - Input object for setting the type of tracing performed. +type AgentApplicationSettingsTracerTypeInput struct { + // The type of tracing being done. + Value AgentApplicationSettingsTracer `json:"value,omitempty"` +} + +// AgentApplicationSettingsTransactionTracer - Transaction tracer settings related to APM applications. For more information about what these settings do and which ones are applicable for your application, please see https://docs.newrelic.com for more information about agent configuration for your language agent. +type AgentApplicationSettingsTransactionTracer struct { + // Enable or disable the capture of memcache keys from transaction traces. + CaptureMemcacheKeys bool `json:"captureMemcacheKeys,omitempty"` + // If true, this enables the transaction tracer feature, enabling collection of transaction traces. + Enabled bool `json:"enabled,omitempty"` + // If true, enables the collection of explain plans in transaction traces. This setting will also apply to explain plans in slow SQL traces if slow_sql.explain_enabled is not set separately. + ExplainEnabled bool `json:"explainEnabled,omitempty"` + // Relevant only when explain_enabled is true. Can be set to automatic configuration (APDEX_F) or manual (see explainThresholdValue). + ExplainThresholdType AgentApplicationSettingsThresholdTypeEnum `json:"explainThresholdType,omitempty"` + // Threshold (in seconds) above which the agent will collect explain plans. Relevant only when explainEnabled is true and explainThresholdType is set to VALUE. + ExplainThresholdValue Seconds `json:"explainThresholdValue,omitempty"` + // Set to true to enable logging of queries to the agent log file instead of uploading to New Relic. Queries are logged using the record_sql mode. + LogSql bool `json:"logSql,omitempty"` + // Obfuscation level for SQL queries reported in transaction trace nodes. + RecordSql AgentApplicationSettingsRecordSqlEnum `json:"recordSql,omitempty"` + // Specify a threshold in seconds. The agent includes stack traces in transaction trace nodes when the stack trace duration exceeds this threshold. + StackTraceThreshold Seconds `json:"stackTraceThreshold,omitempty"` + // Relevant only when TransactionTracer is enabled. Can be set to automatic configuration (APDEX_F) or manual (see TransactionThresholdValue). + TransactionThresholdType AgentApplicationSettingsThresholdTypeEnum `json:"transactionThresholdType,omitempty"` + // Threshold (in seconds) that transactions with a duration longer than this threshold are eligible for transaction traces. Relevant only when transaction tracer is enabled and transaction_threshold_type is set to VALUE. + TransactionThresholdValue Seconds `json:"transactionThresholdValue,omitempty"` +} + +// AgentApplicationSettingsTransactionTracerInput - Fields related to transaction traces and data collection for traces. +type AgentApplicationSettingsTransactionTracerInput struct { + // Enable or disable the capture of memcache keys from transaction traces. + CaptureMemcacheKeys bool `json:"captureMemcacheKeys,omitempty"` + // If true, this enables the transaction tracer feature, enabling collection of transaction traces. + Enabled bool `json:"enabled,omitempty"` + // If true, enables the collection of explain plans in transaction traces. This setting will also apply to explain plans in slow SQL traces if slow_sql.explain_enabled is not set separately. + ExplainEnabled bool `json:"explainEnabled,omitempty"` + // Relevant only when explain_enabled is true. Can be set to automatic configuration (APDEX_F) or manual (see explainThresholdValue). + ExplainThresholdType AgentApplicationSettingsThresholdTypeEnum `json:"explainThresholdType,omitempty"` + // Threshold (in seconds) above which the agent will collect explain plans. Relevant only when explain_enabled is true and explainThresholdType is set to VALUE. + ExplainThresholdValue Seconds `json:"explainThresholdValue,omitempty"` + // Set to true to enable logging of queries to the agent log file instead of uploading to New Relic. Queries are logged using the record_sql mode. + LogSql bool `json:"logSql,omitempty"` + // Obfuscation level for SQL queries reported in transaction trace nodes. + RecordSql AgentApplicationSettingsRecordSqlEnum `json:"recordSql,omitempty"` + // Specify a threshold in seconds. The agent includes stack traces in transaction trace nodes when the stack trace duration exceeds this threshold. + StackTraceThreshold Seconds `json:"stackTraceThreshold,omitempty"` + // Relevant only when transaction tracer is enabled. Can be set to automatic configuration (APDEX_F) or manual (see TransactionThresholdValue). + TransactionThresholdType AgentApplicationSettingsThresholdTypeEnum `json:"transactionThresholdType,omitempty"` + // Threshold (in seconds) that transactions with a duration longer than this threshold are eligible for transaction traces. Relevant only when transaction tracer is enabled and transaction_threshold_type is set to VALUE. + TransactionThresholdValue Seconds `json:"transactionThresholdValue,omitempty"` +} + +// AgentApplicationSettingsUpdateError - Information about any errors encountered while updating values. +type AgentApplicationSettingsUpdateError struct { + // A 'human readable' description of the error. + Description string `json:"description,omitempty"` + // The category of the error. + ErrorClass AgentApplicationSettingsUpdateErrorClass `json:"errorClass,omitempty"` + // The field that was being updated when the error was encountered. + Field string `json:"field,omitempty"` +} + +// AgentApplicationSettingsUpdateInput - The new settings to use - leave blank any settings you do not wish to modify. +// +// While all settings can be specified here, some may not affect your installed agents, depending on the language agent and the current version installed. Note: not all settings of your agent are available to be set server-side. +// +// Please see docs.newrelic.com for more information about the capabilities of individual agents. +// +// [Go agent configuration](https://docs.newrelic.com/docs/agents/go-agent/configuration/go-agent-configuration/) +// +// [Java agent configuration](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file/) +// +// [.Net agent configuration](https://docs.newrelic.com/docs/agents/net-agent/configuration/net-agent-configuration/) +// +// [nodejs agent configuration](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration/) +// +// [PHP agent configuration](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration/) +// +// [Python agent configuration](https://docs.newrelic.com/docs/agents/python-agent/configuration/python-agent-configuration/) +// +// [Ruby agent configuration](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/) +type AgentApplicationSettingsUpdateInput struct { + // The new name for the application. + Alias string `json:"alias,omitempty"` + // Provides fields to set general APM application settings. + ApmConfig *AgentApplicationSettingsApmConfigInput `json:"apmConfig,omitempty"` + // Provides fields to set general browser application settings. + BrowserConfig *AgentApplicationSettingsBrowserConfigInput `json:"browserConfig,omitempty"` + // Provides fields to set browser monitoring application settings. + BrowserMonitoring *AgentApplicationSettingsBrowserMonitoringInput `json:"browserMonitoring,omitempty"` + // Captures information about uncaught exceptions and sends them to New Relic for viewing. + ErrorCollector *AgentApplicationSettingsErrorCollectorInput `json:"errorCollector,omitempty"` + // In the Java Agent (v8.0.0 or later), it can collect additional data with the Java Flight Recorder enabled. + Jfr *AgentApplicationSettingsJfrInput `json:"jfr,omitempty"` + // Input object for mobile settings. + MobileSettings *AgentApplicationSettingsMobileSettingsInput `json:"mobileSettings,omitempty"` + // DEPRECATED: Use `alias` to set a new name for the application. + Name string `json:"name,omitempty"` + // In APM, when transaction traces are collected, there may be additional Slow query data available. + SlowSql *AgentApplicationSettingsSlowSqlInput `json:"slowSql,omitempty"` + // Settings for the thread profiler. + ThreadProfiler *AgentApplicationSettingsThreadProfilerInput `json:"threadProfiler,omitempty"` + // Input object for setting the type of tracing performed. + TracerType *AgentApplicationSettingsTracerTypeInput `json:"tracerType,omitempty"` + // Transaction tracer settings related to APM applications. + TransactionTracer *AgentApplicationSettingsTransactionTracerInput `json:"transactionTracer,omitempty"` +} + +// AgentApplicationSettingsUpdateResult - The result of updating application settings. +type AgentApplicationSettingsUpdateResult struct { + // The name for the application. + Alias string `json:"alias,omitempty"` + // Access general settings for the application. + ApmSettings AgentApplicationSettingsApmBase `json:"apmSettings,omitempty"` + // Access general properties for the application. + BrowserProperties AgentApplicationSettingsBrowserProperties `json:"browserProperties,omitempty"` + // Access general settings for the browser application. + BrowserSettings AgentApplicationSettingsBrowserBase `json:"browserSettings,omitempty"` + // Information about any errors encountered while updating values. + Errors []AgentApplicationSettingsUpdateError `json:"errors,omitempty"` + // The GUID for the affected Entity. + GUID common.EntityGUID `json:"guid"` + // Access mobile settings for the application. + MobileSettings AgentApplicationSettingsMobileBase `json:"mobileSettings,omitempty"` + // The name for the application. + Name string `json:"name,omitempty"` +} + +// AgentApplicationSettingsErrorCollectorHttpStatus - A list of HTTP status codes, such as "404" or "500." +type AgentApplicationSettingsErrorCollectorHttpStatus string + +// Float - The `Float` scalar type represents signed double-precision fractional +// values as specified by +// [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). +type Float string + +// Seconds - The `Seconds` scalar represents a duration in seconds +type Seconds string diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/ai/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/ai/types.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/ai/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/ai/types.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/ai/types_ai.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/ai/types_ai.go similarity index 87% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/ai/types_ai.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/ai/types_ai.go index bf48bfeed1f..f7fb396aabd 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/ai/types_ai.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/ai/types_ai.go @@ -197,6 +197,8 @@ func UnmarshalAiNotificationsErrorInterface(b []byte) (*AiNotificationsErrorInte type AiNotificationsDestinationFilter struct { // id ID string `json:"id,omitempty"` + // Name + Name string `json:"name,omitempty"` } // SecureValue - The `SecureValue` scalar represents a secure value, ie a password, an API key, etc. @@ -213,6 +215,10 @@ type AiNotificationsTokenAuth struct { Prefix string `json:"prefix"` } +func (x AiNotificationsTokenAuth) GetCustomHeaders() []AiNotificationsCustomHeaders { + return nil +} + func (x AiNotificationsTokenAuth) GetAccessTokenURL() string { return "" } @@ -266,6 +272,10 @@ type AiNotificationsBasicAuth struct { User string `json:"user"` } +func (x AiNotificationsBasicAuth) GetCustomHeaders() []AiNotificationsCustomHeaders { + return nil +} + // GetAuthType returns a pointer to the value of AuthType from AiNotificationsBasicAuth func (x AiNotificationsBasicAuth) GetAuthType() AiNotificationsAuthType { return x.AuthType @@ -388,6 +398,8 @@ type AiNotificationsAuth struct { Password SecureValue `json:"password,omitempty"` // Basic auth user User string `json:"user,omitempty"` + // Custom headers + CustomHeaders []AiNotificationsCustomHeaders `json:"customHeaders,omitempty"` } func (x *AiNotificationsAuth) ImplementsAiNotificationsAuth() {} @@ -403,8 +415,64 @@ type AiNotificationsAuthInterface interface { GetRefreshInterval() int GetRefreshable() bool GetScope() string + GetCustomHeaders() []AiNotificationsCustomHeaders +} + +// AiNotificationsCustomHeaders - Custom headers +type AiNotificationsCustomHeaders struct { + Key string `json:"key"` +} + +// AiNotificationsCustomHeadersAuth - Custom headers based authentication +type AiNotificationsCustomHeadersAuth struct { + // Authentication Type - CustomHeaders + AuthType AiNotificationsAuthType `json:"authType"` + // Custom headers + CustomHeaders []AiNotificationsCustomHeaders `json:"customHeaders"` +} + +func (x AiNotificationsCustomHeadersAuth) GetUser() string { + return "" +} + +func (x AiNotificationsCustomHeadersAuth) GetPrefix() string { + return "" +} + +func (x AiNotificationsCustomHeadersAuth) GetAccessTokenURL() string { + return "" +} + +func (x AiNotificationsCustomHeadersAuth) GetAuthorizationURL() string { + return "" +} + +func (x AiNotificationsCustomHeadersAuth) GetClientId() string { + return "" } +func (x AiNotificationsCustomHeadersAuth) GetRefreshInterval() int { + return 0 +} + +func (x AiNotificationsCustomHeadersAuth) GetRefreshable() bool { + return false +} + +func (x AiNotificationsCustomHeadersAuth) GetScope() string { + return "" +} + +func (x AiNotificationsCustomHeadersAuth) GetAuthType() AiNotificationsAuthType { + return x.AuthType +} + +func (x AiNotificationsCustomHeadersAuth) GetCustomHeaders() []AiNotificationsCustomHeaders { + return x.CustomHeaders +} + +func (x AiNotificationsCustomHeadersAuth) ImplementsAiNotificationsAuth() {} + // UnmarshalAiNotificationsAuthInterface unmarshals the interface into the correct type // based on __typename provided by GraphQL func UnmarshalAiNotificationsAuthInterface(b []byte) (*AiNotificationsAuthInterface, error) { @@ -449,6 +517,16 @@ func UnmarshalAiNotificationsAuthInterface(b []byte) (*AiNotificationsAuthInterf var xxx AiNotificationsAuthInterface = &interfaceType + return &xxx, nil + case "AiNotificationsCustomHeadersAuth": + var interfaceType AiNotificationsCustomHeadersAuth + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx AiNotificationsAuthInterface = &interfaceType + return &xxx, nil } } else { diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/alerts.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/alerts.go similarity index 77% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/alerts.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/alerts.go index d32693a3a0e..98774f0ec8e 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/alerts.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/alerts.go @@ -1,10 +1,10 @@ package alerts import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/infrastructure" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "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/infrastructure" + "github.com/newrelic/newrelic-client-go/v2/pkg/logging" ) // Alerts is used to communicate with New Relic Alerts. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/channels.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/channels.go index 9834649470c..a3da797d9de 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/channels.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" - "github.com/newrelic/newrelic-client-go/internal/serialization" + "github.com/newrelic/newrelic-client-go/v2/internal/serialization" ) // ChannelType specifies the channel type used when creating the alert channel. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/conditions.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/conditions.go index c8c2ee4bd6e..574990d4efc 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/conditions.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // ConditionType specifies the condition type used when creating the alert condition. @@ -160,6 +160,8 @@ var ( Total ValueFunctionType SampleSize ValueFunctionType SingleValue ValueFunctionType + Rate ValueFunctionType + Percent ValueFunctionType }{ Average: "average", Min: "min", @@ -167,6 +169,8 @@ var ( Total: "total", SampleSize: "sample_size", SingleValue: "single_value", + Rate: "rate", + Percent: "percent", } ) diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/doc.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/doc.go index 3f9028d6390..bc63d2ecacf 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/doc.go @@ -22,7 +22,7 @@ Alerts product. It can be used for a variety of operations, including: - Associating one or more alert conditions with a policy -Authentication +# Authentication You will need a valid API key to communicate with the backend New Relic APIs that provide this functionality. Use a Personal API key for authentication. @@ -30,6 +30,5 @@ See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package alerts diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/events.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/events.go similarity index 94% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/events.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/events.go index aba24629beb..e608dabe631 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/events.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/events.go @@ -3,7 +3,7 @@ package alerts import ( "context" - "github.com/newrelic/newrelic-client-go/internal/serialization" + "github.com/newrelic/newrelic-client-go/v2/internal/serialization" ) // AlertEvent response struct @@ -60,5 +60,5 @@ func (a *Alerts) ListAlertEventsWithContext(ctx context.Context, params *ListAle } type alertEventsResponse struct { - AlertEvents []*AlertEvent `json:"alert_events,omitempty"` + AlertEvents []*AlertEvent `json:"recent_events,omitempty"` } diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/incidents.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/incidents.go index 71da7aa4111..f11582d6336 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/incidents.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/internal/serialization" + "github.com/newrelic/newrelic-client-go/v2/internal/serialization" ) // Incident represents a New Relic alert incident. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/infrastructure_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/infrastructure_conditions.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/infrastructure_conditions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/infrastructure_conditions.go index 5f3291eadf7..82809d8f870 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/infrastructure_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/infrastructure_conditions.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/internal/serialization" + "github.com/newrelic/newrelic-client-go/v2/internal/serialization" ) // InfrastructureCondition represents a New Relic Infrastructure alert condition. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/multi_location_synthetics_conditions.go similarity index 99% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/multi_location_synthetics_conditions.go index 79f188d6998..e9e35e25215 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/multi_location_synthetics_conditions.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // MultiLocationSyntheticsCondition represents a location-based failure condition. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/muting_rules.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/muting_rules.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/muting_rules.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/muting_rules.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nerdgraph.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/nerdgraph.go similarity index 96% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nerdgraph.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/nerdgraph.go index 1377731d2f8..4d68b14fbcd 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nerdgraph.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/nerdgraph.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/newrelic/newrelic-client-go/internal/http" + "github.com/newrelic/newrelic-client-go/v2/internal/http" ) // NerdGraphQueryWithContext works similarly to the default client's NerdGraphQueryWithContext but with a custom error diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/nrql_conditions.go similarity index 95% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/nrql_conditions.go index 05ab369ccb4..520bc544e20 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/nrql_conditions.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/common" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // AlertsNrqlConditionExpiration @@ -16,6 +16,7 @@ type AlertsNrqlConditionExpiration struct { ExpirationDuration *int `json:"expirationDuration"` CloseViolationsOnExpiration bool `json:"closeViolationsOnExpiration"` OpenViolationOnExpiration bool `json:"openViolationOnExpiration"` + IgnoreOnExpectedTermination bool `json:"ignoreOnExpectedTermination"` } // AlertsNrqlConditionSignal - Configuration that defines the signal that the NRQL condition will use to evaluate. @@ -23,6 +24,7 @@ type AlertsNrqlConditionExpiration struct { type AlertsNrqlConditionSignal struct { AggregationWindow *int `json:"aggregationWindow,omitempty"` EvaluationOffset *int `json:"evaluationOffset,omitempty"` + EvaluationDelay *int `json:"evaluationDelay,omitempty"` FillOption *AlertsFillOption `json:"fillOption"` FillValue *float64 `json:"fillValue"` AggregationMethod *NrqlConditionAggregationMethod `json:"aggregationMethod,omitempty"` @@ -36,6 +38,7 @@ type AlertsNrqlConditionSignal struct { type AlertsNrqlConditionCreateSignal struct { AggregationWindow *int `json:"aggregationWindow,omitempty"` EvaluationOffset *int `json:"evaluationOffset,omitempty"` + EvaluationDelay *int `json:"evaluationDelay,omitempty"` FillOption *AlertsFillOption `json:"fillOption"` FillValue *float64 `json:"fillValue"` AggregationMethod *NrqlConditionAggregationMethod `json:"aggregationMethod,omitempty"` @@ -49,6 +52,7 @@ type AlertsNrqlConditionCreateSignal struct { type AlertsNrqlConditionUpdateSignal struct { AggregationWindow *int `json:"aggregationWindow,omitempty"` EvaluationOffset *int `json:"evaluationOffset,omitempty"` + EvaluationDelay *int `json:"evaluationDelay,omitempty"` FillOption *AlertsFillOption `json:"fillOption"` FillValue *float64 `json:"fillValue"` AggregationMethod *NrqlConditionAggregationMethod `json:"aggregationMethod"` @@ -131,20 +135,6 @@ var ( } ) -// NrqlConditionValueFunction specifies the value function of NRQL alert condition. -type NrqlConditionValueFunction string - -var ( - // NrqlConditionValueFunctions enumerates the possible NRQL condition value function values for NRQL alert conditions. - NrqlConditionValueFunctions = struct { - SingleValue NrqlConditionValueFunction - Sum NrqlConditionValueFunction - }{ - SingleValue: "SINGLE_VALUE", - Sum: "SUM", - } -) - // NrqlConditionViolationTimeLimit specifies the value function of NRQL alert condition. type NrqlConditionViolationTimeLimit string @@ -225,18 +215,21 @@ type NrqlConditionTerm struct { // NrqlConditionQuery represents the NRQL query object returned in a NerdGraph response object. type NrqlConditionQuery struct { Query string `json:"query,omitempty"` + DataAccountId *int `json:"dataAccountId,omitempty"` EvaluationOffset *int `json:"evaluationOffset,omitempty"` } // NrqlConditionCreateQuery represents the NRQL query object for create. type NrqlConditionCreateQuery struct { Query string `json:"query,omitempty"` + DataAccountId *int `json:"dataAccountId,omitempty"` EvaluationOffset *int `json:"evaluationOffset,omitempty"` } // NrqlConditionUpdateQuery represents the NRQL query object for update. type NrqlConditionUpdateQuery struct { Query string `json:"query"` + DataAccountId *int `json:"dataAccountId,omitempty"` EvaluationOffset *int `json:"evaluationOffset"` } @@ -254,6 +247,7 @@ type NrqlConditionBase struct { Expiration *AlertsNrqlConditionExpiration `json:"expiration,omitempty"` Signal *AlertsNrqlConditionSignal `json:"signal,omitempty"` EntityGUID common.EntityGUID `json:"entityGuid,omitempty"` + TitleTemplate *string `json:"titleTemplate,omitempty"` } // NrqlConditionCreateBase represents the base fields for creating a New Relic NRQL Alert condition. @@ -269,6 +263,7 @@ type NrqlConditionCreateBase struct { ViolationTimeLimitSeconds int `json:"violationTimeLimitSeconds,omitempty"` Expiration *AlertsNrqlConditionExpiration `json:"expiration,omitempty"` Signal *AlertsNrqlConditionCreateSignal `json:"signal,omitempty"` + TitleTemplate *string `json:"titleTemplate,omitempty"` } // NrqlConditionUpdateBase represents the base fields for updating a New Relic NRQL Alert condition. @@ -277,13 +272,14 @@ type NrqlConditionUpdateBase struct { Enabled bool `json:"enabled"` Name string `json:"name,omitempty"` Nrql NrqlConditionUpdateQuery `json:"nrql"` - RunbookURL string `json:"runbookUrl,omitempty"` + RunbookURL string `json:"runbookUrl"` Terms []NrqlConditionTerm `json:"terms,omitempty"` Type NrqlConditionType `json:"type,omitempty"` ViolationTimeLimit NrqlConditionViolationTimeLimit `json:"violationTimeLimit,omitempty"` ViolationTimeLimitSeconds int `json:"violationTimeLimitSeconds,omitempty"` Expiration *AlertsNrqlConditionExpiration `json:"expiration,omitempty"` Signal *AlertsNrqlConditionUpdateSignal `json:"signal"` + TitleTemplate *string `json:"titleTemplate"` } // NrqlConditionCreateInput represents the input options for creating a Nrql Condition. @@ -292,9 +288,6 @@ type NrqlConditionCreateInput struct { // BaselineDirection ONLY applies to NRQL conditions of type BASELINE. BaselineDirection *NrqlBaselineDirection `json:"baselineDirection,omitempty"` - - // ValueFunction ONLY applies to NRQL conditions of type STATIC. - ValueFunction *NrqlConditionValueFunction `json:"valueFunction,omitempty"` } // NrqlConditionUpdateInput represents the input options for updating a Nrql Condition. @@ -303,9 +296,6 @@ type NrqlConditionUpdateInput struct { // BaselineDirection ONLY applies to NRQL conditions of type BASELINE. BaselineDirection *NrqlBaselineDirection `json:"baselineDirection,omitempty"` - - // ValueFunction ONLY applies to NRQL conditions of type STATIC. - ValueFunction *NrqlConditionValueFunction `json:"valueFunction,omitempty"` } type NrqlConditionsSearchCriteria struct { @@ -326,9 +316,6 @@ type NrqlAlertCondition struct { // BaselineDirection exists ONLY for NRQL conditions of type BASELINE. BaselineDirection *NrqlBaselineDirection `json:"baselineDirection,omitempty"` - - // ValueFunction is returned ONLY for NRQL conditions of type STATIC. - ValueFunction *NrqlConditionValueFunction `json:"valueFunction,omitempty"` } // NrqlCondition represents a New Relic NRQL Alert condition. @@ -341,8 +328,8 @@ type NrqlCondition struct { RunbookURL string `json:"runbook_url,omitempty"` Terms []ConditionTerm `json:"terms,omitempty"` Type string `json:"type,omitempty"` - ValueFunction ValueFunctionType `json:"value_function,omitempty"` EntityGUID *common.EntityGUID `json:"entity_guid,omitempty"` + TitleTemplate *string `json:"titleTemplate,omitempty"` } // NrqlQuery represents a NRQL query to use with a NRQL alert condition @@ -732,10 +719,12 @@ const ( nrql { evaluationOffset query + dataAccountId } enabled entityGuid description + titleTemplate policyId runbookUrl terms { @@ -746,16 +735,18 @@ const ( thresholdOccurrences } type - violationTimeLimit - violationTimeLimitSeconds + violationTimeLimit + violationTimeLimitSeconds expiration { closeViolationsOnExpiration expirationDuration openViolationOnExpiration + ignoreOnExpectedTermination } signal { - aggregationWindow + aggregationWindow evaluationOffset + evaluationDelay fillOption fillValue aggregationMethod @@ -771,12 +762,6 @@ const ( } ` - graphqlFragmentNrqlStaticConditionFields = ` - ... on AlertsNrqlStaticCondition { - valueFunction - } - ` - searchNrqlConditionsQuery = ` query($accountId: Int!, $searchCriteria: AlertsNrqlConditionsSearchCriteriaInput, $cursor: String) { actor { @@ -788,7 +773,6 @@ const ( nrqlConditions {` + graphqlNrqlConditionStructFields + graphqlFragmentNrqlBaselineConditionFields + - graphqlFragmentNrqlStaticConditionFields + `} } } } } }` getNrqlConditionQuery = ` @@ -799,7 +783,6 @@ const ( nrqlCondition(id: $id) {` + graphqlNrqlConditionStructFields + graphqlFragmentNrqlBaselineConditionFields + - graphqlFragmentNrqlStaticConditionFields + `} } } } }` // Baseline @@ -821,16 +804,14 @@ const ( // Static createNrqlConditionStaticMutation = ` mutation($accountId: Int!, $policyId: ID!, $condition: AlertsNrqlConditionStaticInput!) { - alertsNrqlConditionStaticCreate(accountId: $accountId, policyId: $policyId, condition: $condition) { - valueFunction` + + alertsNrqlConditionStaticCreate(accountId: $accountId, policyId: $policyId, condition: $condition) {` + graphqlNrqlConditionStructFields + ` } }` // Static updateNrqlConditionStaticMutation = ` mutation($accountId: Int!, $id: ID!, $condition: AlertsNrqlConditionUpdateStaticInput!) { - alertsNrqlConditionStaticUpdate(accountId: $accountId, id: $id, condition: $condition) { - valueFunction` + + alertsNrqlConditionStaticUpdate(accountId: $accountId, id: $id, condition: $condition) {` + graphqlNrqlConditionStructFields + ` } }` ) diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/plugins_conditions.go similarity index 99% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/plugins_conditions.go index a85e645be18..b0260dde390 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/plugins_conditions.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // PluginsCondition represents an alert condition for New Relic Plugins. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/policies.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/policies.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/policies.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/policies.go index 3a05023b294..41ab163bbbf 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/policies.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/policies.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/internal/serialization" + "github.com/newrelic/newrelic-client-go/v2/internal/http" + "github.com/newrelic/newrelic-client-go/v2/internal/serialization" ) // IncidentPreferenceType specifies rollup settings for alert policies. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/policy_channels.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/policy_channels.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/policy_channels.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/policy_channels.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/serialization.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/serialization.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/serialization.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/serialization.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/synthetics_conditions.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/synthetics_conditions.go index 3cafa683899..297cdaab4ca 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/synthetics_conditions.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // SyntheticsCondition represents a New Relic Synthetics alert condition. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/types.go similarity index 99% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/types.go index 900d4a6fdd7..bc8daed73c5 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/types.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/alerts/types.go @@ -1,7 +1,7 @@ // Code generated by tutone: DO NOT EDIT package alerts -import "github.com/newrelic/newrelic-client-go/pkg/nrtime" +import "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" // AlertsDayOfWeek - The day of the week used to configure a WEEKLY scheduled MutingRule type AlertsDayOfWeek string diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/apiaccess.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/apiaccess.go similarity index 81% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/apiaccess.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/apiaccess.go index 26fb2a3a1eb..935c37aa272 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/apiaccess.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/apiaccess.go @@ -2,9 +2,9 @@ package apiaccess import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "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" ) // APIAccess is used to communicate with the New Relic APIKeys product. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/insights_keys.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/insights_keys.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/insights_keys.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/insights_keys.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/keys.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/keys.go similarity index 82% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/keys.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/keys.go index 6425f5992b0..b20e8400eda 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/keys.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/keys.go @@ -3,8 +3,9 @@ package apiaccess import ( "context" "errors" + "fmt" - "github.com/newrelic/newrelic-client-go/internal/http" + "github.com/newrelic/newrelic-client-go/v2/internal/http" ) type APIKey struct { @@ -15,9 +16,7 @@ type APIKey struct { UserID *int `json:"userId,omitempty"` } -// // Additional Interface methods -// func (x *APIAccessIngestKeyError) GetError() error { return errors.New(x.Message) } @@ -147,10 +146,28 @@ func (a *APIAccess) DeleteAPIAccessKeyWithContext(ctx context.Context, keys APIA return resp.APIAccessDeleteKeys.DeletedKeys, nil } -func formatAPIAccessKeyErrors(errs []APIAccessKeyErrorInterface) string { - errorString := "" +var AccessKeyErrorPrefix = "The following errors have been thrown.\n" + +func formatAPIAccessKeyErrors(errs []APIAccessKeyErrorResponse) string { + errorString := AccessKeyErrorPrefix for _, e := range errs { - errorString += e.GetError().Error() + "\n" + IDAsString := "" + if len(e.ID) != 0 { + // Id is returned in the 'error' block only in the case of update and delete but not with create. + // So; in the case of create, it is made an empty string to generalize the usage of IDAsString. + IDAsString = fmt.Sprintf("%s: ", e.ID) + } + if e.Type == "USER" { + errorString += fmt.Sprintf("%s: %s%s\n", e.UserKeyErrorType, IDAsString, e.Message) + } else if e.Type == "INGEST" { + errorString += fmt.Sprintf("%s: %s%s\n", e.IngestKeyErrorType, IDAsString, e.Message) + } else if len(e.Type) == 0 { + // When Ingest Keys are deleted, the "type" attribute is currently null in the response sent, + // in the "errors" attribute - hence, this condition. However, this is not the case with User Keys. + errorString += fmt.Sprintf("%s: %s%s\n", e.IngestKeyErrorType, IDAsString, e.Message) + } else { + errorString += e.Message + } } return errorString } @@ -158,16 +175,16 @@ func formatAPIAccessKeyErrors(errs []APIAccessKeyErrorInterface) string { // apiAccessKeyCreateResponse represents the JSON response returned from creating key(s). type apiAccessKeyCreateResponse struct { APIAccessCreateKeys struct { - CreatedKeys []APIKey `json:"createdKeys"` - Errors []APIAccessKeyErrorInterface `json:"errors"` + CreatedKeys []APIKey `json:"createdKeys"` + Errors []APIAccessKeyErrorResponse `json:"errors,omitempty"` } `json:"apiAccessCreateKeys"` } // apiAccessKeyUpdateResponse represents the JSON response returned from updating key(s). type apiAccessKeyUpdateResponse struct { APIAccessUpdateKeys struct { - UpdatedKeys []APIKey `json:"updatedKeys"` - Errors []APIAccessKeyErrorInterface `json:"errors"` + UpdatedKeys []APIKey `json:"updatedKeys"` + Errors []APIAccessKeyErrorResponse `json:"errors,omitempty"` } `json:"apiAccessUpdateKeys"` } @@ -192,9 +209,11 @@ type apiAccessKeySearchResponse struct { http.GraphQLErrorResponse } -// apiAccessKeyDeleteResponse represents the JSON response returned from creating key(s). type apiAccessKeyDeleteResponse struct { - APIAccessDeleteKeys APIAccessDeleteKeyResponse `json:"apiAccessDeleteKeys"` + APIAccessDeleteKeys struct { + DeletedKeys []APIAccessDeletedKey `json:"deletedKeys,omitempty"` + Errors []APIAccessKeyErrorResponse `json:"errors,omitempty"` + } `json:"apiAccessDeleteKeys"` } const ( @@ -202,6 +221,7 @@ const ( id key name + createdAt notes type ... on ApiAccessIngestKey { diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types.go index a186491516b..44f9e242529 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apiaccess/types.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/accounts" - "github.com/newrelic/newrelic-client-go/pkg/users" + "github.com/newrelic/newrelic-client-go/v2/pkg/accounts" + "github.com/newrelic/newrelic-client-go/v2/pkg/users" ) // APIAccessIngestKeyErrorType - The type of error. @@ -296,16 +296,16 @@ type APIAccessIngestKey struct { // The account attached to the ingest key. Agents using this key will report to the account the key belongs to. AccountID int `json:"accountId,omitempty"` // The UNIX epoch when the key was created, in seconds. - CreatedAt EpochSeconds `json:"createdAt,omitempty"` + CreatedAt int64 `json:"createdAt,omitempty"` // The ID of the ingest key. This can be used to identify a key without revealing the key itself (used to update and delete). ID string `json:"id,omitempty"` // The type of ingest key, which dictates what types of agents can use it to report. IngestType APIAccessIngestKeyType `json:"ingestType,omitempty"` // The keystring of the key. Key string `json:"key,omitempty"` - // The name of the key. + // The name of the key. Limited to 120 characters. Name string `json:"name,omitempty"` - // Any notes can be attached to an key. + // Any notes can be attached to an key. Limited to 120 characters. Notes string `json:"notes,omitempty"` // The type of key, indicating what New Relic APIs it can be used to access. Type APIAccessKeyType `json:"type,omitempty"` @@ -334,12 +334,12 @@ func (x *APIAccessIngestKeyError) ImplementsAPIAccessKeyError() {} // APIAccessKey - A key for accessing New Relic APIs. type APIAccessKey struct { // The UNIX epoch when the key was created, in seconds. - CreatedAt EpochSeconds `json:"createdAt,omitempty"` + CreatedAt int64 `json:"createdAt,omitempty"` // The ID of the key. This can be used to identify a key without revealing the key itself (used to update and delete). ID string `json:"id,omitempty"` // The keystring of the key. Key string `json:"key,omitempty"` - // The name of the key. This can be used a short identifier for easy reference. + // The name of the key. This can be used as a short identifier for easy reference. Name string `json:"name,omitempty"` // Any notes can be attached to a key. This is intended for more a more detailed description of the key use if desired. Notes string `json:"notes,omitempty"` @@ -540,14 +540,14 @@ type APIAccessUserKey struct { // The account ID of the key. AccountID int `json:"accountId,omitempty"` // The UNIX epoch when the key was created, in seconds. - CreatedAt EpochSeconds `json:"createdAt,omitempty"` + CreatedAt int64 `json:"createdAt,omitempty"` // The ID of the user key. This can be used to identify a key without revealing the key itself (used to update and delete). ID string `json:"id,omitempty"` // The keystring of the key. Key string `json:"key,omitempty"` - // The name of the key. + // The name of the key. Limited to 120 characters. Name string `json:"name,omitempty"` - // Any notes can be attached to a key. + // Any notes can be attached to a key. Limited to 120 characters. Notes string `json:"notes,omitempty"` // The type of key, indicating what New Relic APIs it can be used to access. Type APIAccessKeyType `json:"type,omitempty"` @@ -577,9 +577,6 @@ type APIAccessUserKeyError struct { func (x *APIAccessUserKeyError) ImplementsAPIAccessKeyError() {} -// EpochSeconds - The `EpochSeconds` scalar represents the number of seconds since the Unix epoch -type EpochSeconds string - // APIAccessKey - A key for accessing New Relic APIs. type APIAccessKeyInterface interface { ImplementsAPIAccessKey() diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types_apiaccess.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types_apiaccess.go new file mode 100644 index 00000000000..f88b6dca492 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess/types_apiaccess.go @@ -0,0 +1,11 @@ +package apiaccess + +type APIAccessKeyErrorResponse struct { + // The message with the error cause. + Message string `json:"message,omitempty"` + // Type of error. + Type string `json:"type,omitempty"` + UserKeyErrorType APIAccessUserKeyErrorType `json:"userErrorType,omitempty"` + IngestKeyErrorType APIAccessIngestKeyErrorType `json:"ingestErrorType,omitempty"` + ID string `json:"id,omitempty"` +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/apm.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/apm.go similarity index 82% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/apm.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/apm.go index b1a2a353e54..ce385213940 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/apm.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/apm.go @@ -2,8 +2,8 @@ package apm import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" + "github.com/newrelic/newrelic-client-go/v2/internal/http" + "github.com/newrelic/newrelic-client-go/v2/pkg/config" ) // APM is used to communicate with the New Relic APM product. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/application_instances.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/application_instances.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/application_instances.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/application_instances.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/applications.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/applications.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/applications.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/applications.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/applications_metrics.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/applications_metrics.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/applications_metrics.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/applications_metrics.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/applications_rest.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/applications_rest.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/applications_rest.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/applications_rest.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/deployments.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/deployments.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/deployments.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/deployments.go index e7b025464f6..ab1bbfe5ced 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/deployments.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/deployments.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/newrelic/newrelic-client-go/internal/http" + "github.com/newrelic/newrelic-client-go/v2/internal/http" ) // Deployment represents information about a New Relic application deployment. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/doc.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/doc.go index a52849440fc..5beb9ce6e04 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/doc.go @@ -10,7 +10,7 @@ APM product. It can be used for a variety of operations, including: - Creating, reading, and deleting APM labels -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic APIs that provide this functionality. See the API key documentation below for @@ -18,7 +18,7 @@ more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys -Labels +# Labels New Relic One entity tags are currently the preferred method for organizing your New Relic resources. Consider using entity tags via the `entities` package if @@ -26,6 +26,5 @@ you are just getting started. More information about entity tags and APM labels can be found at the following URL: https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor#labels - */ package apm diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/key_transactions.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/key_transactions.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/key_transactions.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/key_transactions.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/labels.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/labels.go similarity index 98% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/apm/labels.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/labels.go index 1f240c5dbc7..a91a256ee54 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/apm/labels.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/apm/labels.go @@ -3,7 +3,7 @@ package apm import ( "context" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // Label represents a New Relic label. diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement.go new file mode 100644 index 00000000000..b8a07ed060b --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement.go @@ -0,0 +1,24 @@ +package authorizationmanagement + +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 Authorizationmanagement struct { + client http.Client + logger logging.Logger + config config.Config +} + +func New(config config.Config) Authorizationmanagement { + client := http.NewClient(config) + + pkg := Authorizationmanagement{ + client: client, + logger: config.GetLogger(), + config: config, + } + return pkg +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement_api.go new file mode 100644 index 00000000000..2197d7f936b --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/authorizationmanagement_api.go @@ -0,0 +1,147 @@ +// Code generated by tutone: DO NOT EDIT +package authorizationmanagement + +import "context" + +// Grant access for a group +func (a *Authorizationmanagement) AuthorizationManagementGrantAccess( + grantAccessOptions AuthorizationManagementGrantAccess, +) (*AuthorizationManagementGrantAccessPayload, error) { + return a.AuthorizationManagementGrantAccessWithContext(context.Background(), + grantAccessOptions, + ) +} + +// Grant access for a group +func (a *Authorizationmanagement) AuthorizationManagementGrantAccessWithContext( + ctx context.Context, + grantAccessOptions AuthorizationManagementGrantAccess, +) (*AuthorizationManagementGrantAccessPayload, error) { + + resp := AuthorizationManagementGrantAccessQueryResponse{} + vars := map[string]interface{}{ + "grantAccessOptions": grantAccessOptions, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AuthorizationManagementGrantAccessMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AuthorizationManagementGrantAccessPayload, nil +} + +type AuthorizationManagementGrantAccessQueryResponse struct { + AuthorizationManagementGrantAccessPayload AuthorizationManagementGrantAccessPayload `json:"AuthorizationManagementGrantAccess"` +} + +const AuthorizationManagementGrantAccessMutation = `mutation( + $grantAccessOptions: AuthorizationManagementGrantAccess, +) { authorizationManagementGrantAccess( + grantAccessOptions: $grantAccessOptions, +) { + roles { + accountId + displayName + groupId + id + name + organizationId + roleId + type + } +} }` + +// Revoke access for a group +func (a *Authorizationmanagement) AuthorizationManagementRevokeAccess( + revokeAccessOptions AuthorizationManagementRevokeAccess, +) (*AuthorizationManagementRevokeAccessPayload, error) { + return a.AuthorizationManagementRevokeAccessWithContext(context.Background(), + revokeAccessOptions, + ) +} + +// Revoke access for a group +func (a *Authorizationmanagement) AuthorizationManagementRevokeAccessWithContext( + ctx context.Context, + revokeAccessOptions AuthorizationManagementRevokeAccess, +) (*AuthorizationManagementRevokeAccessPayload, error) { + + resp := AuthorizationManagementRevokeAccessQueryResponse{} + vars := map[string]interface{}{ + "revokeAccessOptions": revokeAccessOptions, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, AuthorizationManagementRevokeAccessMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.AuthorizationManagementRevokeAccessPayload, nil +} + +type AuthorizationManagementRevokeAccessQueryResponse struct { + AuthorizationManagementRevokeAccessPayload AuthorizationManagementRevokeAccessPayload `json:"AuthorizationManagementRevokeAccess"` +} + +const AuthorizationManagementRevokeAccessMutation = `mutation( + $revokeAccessOptions: AuthorizationManagementRevokeAccess, +) { authorizationManagementRevokeAccess( + revokeAccessOptions: $revokeAccessOptions, +) { + roles { + accountId + displayName + groupId + id + name + organizationId + roleId + type + } +} }` + +// list of roles +func (a *Authorizationmanagement) GetRoles( + cursor string, + iD []string, +) (*AuthorizationManagementRoleSearch, error) { + return a.GetRolesWithContext(context.Background(), + cursor, + iD, + ) +} + +// list of roles +func (a *Authorizationmanagement) GetRolesWithContext( + ctx context.Context, + cursor string, + iD []string, +) (*AuthorizationManagementRoleSearch, error) { + + resp := rolesResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "id": iD, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getRolesQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.Actor.Organization.AuthorizationManagement.Roles, nil +} + +const getRolesQuery = `query( + $id: [ID!], +) { actor { organization { authorizationManagement { roles( + id: $id, +) { + nextCursor + roles { + displayName + id + name + scope + type + } + totalCount +} } } } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/types.go new file mode 100644 index 00000000000..731309e5f72 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/authorizationmanagement/types.go @@ -0,0 +1,163 @@ +// Code generated by tutone: DO NOT EDIT +package authorizationmanagement + +// Actor - The `Actor` object contains fields that are scoped to the API user's access level. +type Actor struct { + // The `organization` field is the entry point into data that is scoped to the user's organization. + Organization Organization `json:"organization,omitempty"` +} + +// AuthorizationManagementAccountAccessGrant - The Account and Role a Group should have access to +type AuthorizationManagementAccountAccessGrant struct { + // The Account ID the Role will grant access to + AccountID int `json:"accountId"` + // The Role ID that will define the access + RoleId string `json:"roleId"` +} + +// AuthorizationManagementGrantAccess - The input object representing the access to grant for the group +type AuthorizationManagementGrantAccess struct { + // The Role and the Account the Target Group should have access to + AccountAccessGrants []AuthorizationManagementAccountAccessGrant `json:"accountAccessGrants,omitempty"` + // The Role and the Group the Target Group should have access to + GroupAccessGrants []AuthorizationManagementGroupAccessGrant `json:"groupAccessGrants,omitempty"` + // The Group ID that will have access granted + GroupId string `json:"groupId"` + // The Role and the Organization the Target Group should have access to + OrganizationAccessGrants []AuthorizationManagementOrganizationAccessGrant `json:"organizationAccessGrants,omitempty"` +} + +// AuthorizationManagementGrantAccessPayload - Autogenerated return type of GrantAccess +type AuthorizationManagementGrantAccessPayload struct { + // the roles that were granted to this group + Roles []AuthorizationManagementGrantedRole `json:"roles"` +} + +// AuthorizationManagementGrantedRole - A Granted Role represents the access given to a group. +type AuthorizationManagementGrantedRole struct { + // the account that this role grants access to + AccountID int `json:"accountId,omitempty"` + // the name of the object + DisplayName string `json:"displayName,omitempty"` + // the group that this role grants access to + GroupId string `json:"groupId,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` + // the organization this role grants access to + OrganizationId string `json:"organizationId,omitempty"` + // the role that defines this access + RoleId int `json:"roleId"` + // the type of the role + Type string `json:"type"` +} + +// AuthorizationManagementGrantedRoleSearch - container for roles enabling cursor based pagination +type AuthorizationManagementGrantedRoleSearch struct { + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the roles granted to this group + Roles []AuthorizationManagementGrantedRole `json:"roles"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// AuthorizationManagementGroupAccessGrant - The Group and Role another Group should have access to +type AuthorizationManagementGroupAccessGrant struct { + // The Group ID the Role will grant access to + GroupId string `json:"groupId"` + // The Role ID that will define the access + RoleId string `json:"roleId"` +} + +// AuthorizationManagementOrganizationAccessGrant - The Organization Role a Group should have access to +type AuthorizationManagementOrganizationAccessGrant struct { + // The Role ID that will define the Organization access + RoleId string `json:"roleId"` +} + +type AuthorizationManagementOrganizationStitchedFields struct { + // list of roles + Roles AuthorizationManagementRoleSearch `json:"roles,omitempty"` +} + +// AuthorizationManagementRevokeAccess - The input object representing the access to revoke for the group +type AuthorizationManagementRevokeAccess struct { + // The Role and the Account the Target Group should no longer have access to + AccountAccessGrants []AuthorizationManagementAccountAccessGrant `json:"accountAccessGrants,omitempty"` + // The Role and the Group the Target Group should no longer have access to + GroupAccessGrants []AuthorizationManagementGroupAccessGrant `json:"groupAccessGrants,omitempty"` + // The Group ID that will have access revoked + GroupId string `json:"groupId"` + // The Role and the Organization the Target Group should no longer have access to + OrganizationAccessGrants []AuthorizationManagementOrganizationAccessGrant `json:"organizationAccessGrants,omitempty"` +} + +// AuthorizationManagementRevokeAccessPayload - Autogenerated return type of RevokeAccess +type AuthorizationManagementRevokeAccessPayload struct { + // the roles that were revoked from this group + Roles []AuthorizationManagementGrantedRole `json:"roles"` +} + +// AuthorizationManagementRole - a role grants access on an account or organization to groups of users +type AuthorizationManagementRole struct { + // the name of the object + DisplayName string `json:"displayName,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` + // the scope of the role + Scope string `json:"scope"` + // the type of the role + Type string `json:"type"` +} + +// AuthorizationManagementRoleSearch - container for roles enabling cursor based pagination +type AuthorizationManagementRoleSearch struct { + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // control the access granted to groups + Roles []AuthorizationManagementRole `json:"roles"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// MultiTenantAuthorizationRole - Describes a role within the system +type MultiTenantAuthorizationRole struct { + // a value that uniquely identifies this object + ID int `json:"id"` + // the name of the object + Name string `json:"name"` + // The scope the role applies to + Scope string `json:"scope"` + // The type of role + Type string `json:"type"` +} + +// MultiTenantAuthorizationRoleCollection - An iterable collection of roles +type MultiTenantAuthorizationRoleCollection struct { + // collection of roles + Items []MultiTenantAuthorizationRole `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// Organization - The `Organization` object provides basic data about an organization. +type Organization struct { + // This field provides access to AuthorizationManagement data. + AuthorizationManagement AuthorizationManagementOrganizationStitchedFields `json:"authorizationManagement,omitempty"` + // The customer id for the organization. + CustomerId string `json:"customerId,omitempty"` + // The name of the organization. + Name string `json:"name,omitempty"` + // The telemetry id for the organization + TelemetryId string `json:"telemetryId,omitempty"` +} + +type rolesResponse struct { + Actor Actor `json:"actor"` +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking.go new file mode 100644 index 00000000000..bd247447d49 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking.go @@ -0,0 +1,29 @@ +package changetracking + +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 Changetracking struct { + client http.Client + config config.Config + logger logging.Logger + pager http.Pager +} + +func New(config config.Config) Changetracking { + + client := http.NewClient(config) + client.SetAuthStrategy(&http.PersonalAPIKeyCapableV2Authorizer{}) + + pkg := Changetracking{ + client: client, + config: config, + logger: config.GetLogger(), + pager: &http.LinkHeaderPager{}, + } + + return pkg +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking_api.go new file mode 100644 index 00000000000..f341986880f --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/changetracking_api.go @@ -0,0 +1,71 @@ +// Code generated by tutone: DO NOT EDIT +package changetracking + +import ( + "context" + + "github.com/newrelic/newrelic-client-go/v2/internal/utils" +) + +// Creates a new deployment record in NRDB and its associated deployment marker. +func (a *Changetracking) ChangeTrackingCreateDeployment( + dataHandlingRules ChangeTrackingDataHandlingRules, + deployment ChangeTrackingDeploymentInput, +) (*ChangeTrackingDeployment, error) { + // DO NOT DELETE the following function call + // This is NOT covered by Tutone, but is needed to reformat milliseconds in timestamps + // in order to align with the expected format of the timestamp by the API + inputTimestamp := deployment.Timestamp + timestamp := utils.GetSafeTimestampWithMilliseconds(inputTimestamp) + deployment.Timestamp = timestamp + // DO NOT DELETE the above function call + + return a.ChangeTrackingCreateDeploymentWithContext(context.Background(), + dataHandlingRules, + deployment, + ) +} + +// Creates a new deployment record in NRDB and its associated deployment marker. +func (a *Changetracking) ChangeTrackingCreateDeploymentWithContext( + ctx context.Context, + dataHandlingRules ChangeTrackingDataHandlingRules, + deployment ChangeTrackingDeploymentInput, +) (*ChangeTrackingDeployment, error) { + + resp := ChangeTrackingCreateDeploymentQueryResponse{} + vars := map[string]interface{}{ + "dataHandlingRules": dataHandlingRules, + "deployment": deployment, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, ChangeTrackingCreateDeploymentMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.ChangeTrackingDeployment, nil +} + +type ChangeTrackingCreateDeploymentQueryResponse struct { + ChangeTrackingDeployment ChangeTrackingDeployment `json:"ChangeTrackingCreateDeployment"` +} + +const ChangeTrackingCreateDeploymentMutation = `mutation( + $dataHandlingRules: ChangeTrackingDataHandlingRules, + $deployment: ChangeTrackingDeploymentInput!, +) { changeTrackingCreateDeployment( + dataHandlingRules: $dataHandlingRules, + deployment: $deployment, +) { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version +} }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/types.go new file mode 100644 index 00000000000..587b89651f4 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/changetracking/types.go @@ -0,0 +1,127 @@ +// Code generated by tutone: DO NOT EDIT +package changetracking + +import ( + "github.com/newrelic/newrelic-client-go/v2/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" +) + +// ChangeTrackingDeploymentType - Type of deployment. +type ChangeTrackingDeploymentType string + +var ChangeTrackingDeploymentTypeTypes = struct { + // A vanilla deployment + BASIC ChangeTrackingDeploymentType + // Blue-green deployment + BLUE_GREEN ChangeTrackingDeploymentType + // Canary deployment + CANARY ChangeTrackingDeploymentType + // Other types of deployment. + OTHER ChangeTrackingDeploymentType + // Rolling deployment. + ROLLING ChangeTrackingDeploymentType + // Shadow deployment + SHADOW ChangeTrackingDeploymentType +}{ + // A vanilla deployment + BASIC: "BASIC", + // Blue-green deployment + BLUE_GREEN: "BLUE_GREEN", + // Canary deployment + CANARY: "CANARY", + // Other types of deployment. + OTHER: "OTHER", + // Rolling deployment. + ROLLING: "ROLLING", + // Shadow deployment + SHADOW: "SHADOW", +} + +// ChangeTrackingValidationFlag - Validation flags to determine how we handle input data. +type ChangeTrackingValidationFlag string + +var ChangeTrackingValidationFlagTypes = struct { + // Will validate all string fields to be within max size limit. An error is returned and data is not saved if any of the fields exceeds max size limit. + FAIL_ON_FIELD_LENGTH ChangeTrackingValidationFlag + // For APM entities, a call is made to the legacy New Relic v2 REST API. When this flag is set, if the call fails for any reason, an error will be returned containing the failure message. + FAIL_ON_REST_API_FAILURES ChangeTrackingValidationFlag +}{ + // Will validate all string fields to be within max size limit. An error is returned and data is not saved if any of the fields exceeds max size limit. + FAIL_ON_FIELD_LENGTH: "FAIL_ON_FIELD_LENGTH", + // For APM entities, a call is made to the legacy New Relic v2 REST API. When this flag is set, if the call fails for any reason, an error will be returned containing the failure message. + FAIL_ON_REST_API_FAILURES: "FAIL_ON_REST_API_FAILURES", +} + +// ChangeTrackingDataHandlingRules - Validation and data handling rules to be applied to deployment input data. +type ChangeTrackingDataHandlingRules struct { + // Flags for validation, for example, ‘FAIL_ON_FIELD_LENGTH’. + ValidationFlags []ChangeTrackingValidationFlag `json:"validationFlags"` +} + +// ChangeTrackingDeployment - A deployment. +type ChangeTrackingDeployment struct { + // A URL to the changelog or, if not linkable, a list of changes. + Changelog string `json:"changelog,omitempty"` + // The commit identifier, for example, a Git commit SHA. + Commit string `json:"commit,omitempty"` + // Represents key-value pairs of custom attributes in JSON format. + CustomAttributes ChangeTrackingRawCustomAttributesMap `json:"customAttributes,omitempty"` + // A link to the system that generated the deployment. + DeepLink string `json:"deepLink,omitempty"` + // A unique deployment identifier. + DeploymentId string `json:"deploymentId,omitempty"` + // The type of deployment, for example, ‘Blue green’ or ‘Rolling’. + DeploymentType ChangeTrackingDeploymentType `json:"deploymentType,omitempty"` + // A description of the deployment. + Description string `json:"description,omitempty"` + // The NR entity that was deployed. + EntityGUID common.EntityGUID `json:"entityGuid"` + // An identifier used to correlate two or more events. + GroupId string `json:"groupId,omitempty"` + // The start time of the deployment as the number of milliseconds since the Unix epoch. + Timestamp nrtime.EpochMilliseconds `json:"timestamp"` + // The username of the deployer or bot. + User string `json:"user,omitempty"` + // The version of the deployed software, for example, something like v1.1. + Version string `json:"version"` +} + +// ChangeTrackingDeploymentInput - A deployment. +type ChangeTrackingDeploymentInput struct { + // A URL for the changelog or, if not linkable, a list of changes. + Changelog string `json:"changelog,omitempty"` + // The commit identifier, for example, a Git commit SHA. + Commit string `json:"commit,omitempty"` + // Represents key-value pairs of custom attributes in JSON format. Attribute values can be of type string, boolean, or numeric. + // + // **Restricted attributes names:** accountId, appID, changelog, commit, customAttributes, deepLink, deploymentType, description, entity.guid, entity.name, entity.type, entityGuid, entityName, eventType, groupId, timestamp, user, version + // + // **Restricted attribute name prefixes:** 'nr.', 'newrelic.' + // + // For more information on limitations, see [our docs](https://docs.newrelic.com/docs/change-tracking/change-tracking-graphql/) + // + // **Examples:** + // + // • {cloudVendor : "vendorName", region : "us-east-1", environment : "staging"} + // • {isProd : true, region : "us-east-1", instances: 2, deployTime : 10.5} + CustomAttributes ChangeTrackingRawCustomAttributesMap `json:"customAttributes,omitempty"` + // A URL to the system that generated the deployment. + DeepLink string `json:"deepLink,omitempty"` + // The type of deployment, for example, ‘Blue green’ or ‘Rolling’. + DeploymentType ChangeTrackingDeploymentType `json:"deploymentType,omitempty"` + // A description of the deployment. + Description string `json:"description,omitempty"` + // The NR entity that was deployed. + EntityGUID common.EntityGUID `json:"entityGuid"` + // An identifier used to correlate two or more events. + GroupId string `json:"groupId,omitempty"` + // The start time of the deployment as the number of milliseconds since the Unix epoch. Should be within the boundary of the past or future 24 hours. Defaults to now. + Timestamp nrtime.EpochMilliseconds `json:"timestamp,omitempty"` + // The username of the deployer or bot. + User string `json:"user,omitempty"` + // The version of the deployed software, for example, something like v1.1 + Version string `json:"version"` +} + +// ChangeTrackingRawCustomAttributesMap - A JSON scalar +type ChangeTrackingRawCustomAttributesMap map[string]interface{} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/cloud.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/cloud.go similarity index 70% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/cloud.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/cloud.go index 7915c8a76e7..976b169a094 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/cloud.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/cloud.go @@ -1,9 +1,9 @@ package cloud import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "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 Cloud struct { diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/cloud_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/cloud_api.go similarity index 73% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/cloud_api.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/cloud_api.go index f4619452165..18ddf543a2c 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/cloud_api.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/cloud_api.go @@ -4,7 +4,7 @@ package cloud import ( "context" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // Create or modify a cloud integration. @@ -172,6 +172,11 @@ const CloudConfigureIntegrationMutation = `mutation( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsMsElasticacheIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAwsMskIntegration { __typename awsRegions @@ -333,18 +338,40 @@ const CloudConfigureIntegrationMutation = `mutation( metricsPollingInterval resourceGroups } + ... on CloudAzureMonitorIntegration { + __typename + enabled + excludeTags + includeTags + inventoryPollingInterval + metricsPollingInterval + resourceGroups + resourceTypes + } ... on CloudAzureMysqlIntegration { __typename inventoryPollingInterval metricsPollingInterval resourceGroups } + ... on CloudAzureMysqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } ... on CloudAzurePostgresqlIntegration { __typename inventoryPollingInterval metricsPollingInterval resourceGroups } + ... on CloudAzurePostgresqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } ... on CloudAzurePowerbidedicatedIntegration { __typename inventoryPollingInterval @@ -450,6 +477,7 @@ const CloudConfigureIntegrationMutation = `mutation( ... on CloudEc2Integration { __typename awsRegions + duplicateEc2Tags fetchIpAddresses inventoryPollingInterval metricsPollingInterval @@ -519,6 +547,16 @@ const CloudConfigureIntegrationMutation = `mutation( tagKey tagValue } + ... on CloudGcpAiplatformIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpAlloydbIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } ... on CloudGcpAppengineIntegration { __typename inventoryPollingInterval @@ -526,6 +564,7 @@ const CloudConfigureIntegrationMutation = `mutation( } ... on CloudGcpBigqueryIntegration { __typename + fetchTableMetrics fetchTags inventoryPollingInterval metricsPollingInterval @@ -806,6 +845,7 @@ type CloudDisableIntegrationQueryResponse struct { CloudDisableIntegrationPayload CloudDisableIntegrationPayload `json:"CloudDisableIntegration"` } +// Note: Do not make "$integrations" an optional field (as fetched from Tutone) to avoid a breaking change const CloudDisableIntegrationMutation = `mutation( $accountId: Int!, $integrations: CloudDisableIntegrationsInput!, @@ -923,6 +963,11 @@ const CloudDisableIntegrationMutation = `mutation( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsMsElasticacheIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAwsMskIntegration { __typename awsRegions @@ -1084,18 +1129,40 @@ const CloudDisableIntegrationMutation = `mutation( metricsPollingInterval resourceGroups } + ... on CloudAzureMonitorIntegration { + __typename + enabled + excludeTags + includeTags + inventoryPollingInterval + metricsPollingInterval + resourceGroups + resourceTypes + } ... on CloudAzureMysqlIntegration { __typename inventoryPollingInterval metricsPollingInterval resourceGroups } + ... on CloudAzureMysqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } ... on CloudAzurePostgresqlIntegration { __typename inventoryPollingInterval metricsPollingInterval resourceGroups } + ... on CloudAzurePostgresqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } ... on CloudAzurePowerbidedicatedIntegration { __typename inventoryPollingInterval @@ -1201,6 +1268,7 @@ const CloudDisableIntegrationMutation = `mutation( ... on CloudEc2Integration { __typename awsRegions + duplicateEc2Tags fetchIpAddresses inventoryPollingInterval metricsPollingInterval @@ -1270,6 +1338,16 @@ const CloudDisableIntegrationMutation = `mutation( tagKey tagValue } + ... on CloudGcpAiplatformIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpAlloydbIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } ... on CloudGcpAppengineIntegration { __typename inventoryPollingInterval @@ -1277,6 +1355,7 @@ const CloudDisableIntegrationMutation = `mutation( } ... on CloudGcpBigqueryIntegration { __typename + fetchTableMetrics fetchTags inventoryPollingInterval metricsPollingInterval @@ -1729,6 +1808,61 @@ const CloudUnlinkAccountMutation = `mutation( } } }` +// Update one or more Cloud Provider accounts to a NewRelic account. Updates each Linked account with the passed parameters. +func (a *Cloud) CloudUpdateAccount( + accountID int, + accounts CloudUpdateCloudAccountsInput, +) (*CloudUpdateAccountPayload, error) { + return a.CloudUpdateAccountWithContext(context.Background(), + accountID, + accounts, + ) +} + +// Update one or more Cloud Provider accounts to a NewRelic account. Updates each Linked account with the passed parameters. +func (a *Cloud) CloudUpdateAccountWithContext( + ctx context.Context, + accountID int, + accounts CloudUpdateCloudAccountsInput, +) (*CloudUpdateAccountPayload, error) { + + resp := CloudUpdateAccountQueryResponse{} + vars := map[string]interface{}{ + "accountId": accountID, + "accounts": accounts, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, CloudUpdateAccountMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.CloudUpdateAccountPayload, nil +} + +type CloudUpdateAccountQueryResponse struct { + CloudUpdateAccountPayload CloudUpdateAccountPayload `json:"CloudUpdateAccount"` +} + +const CloudUpdateAccountMutation = `mutation( + $accountId: Int!, + $accounts: CloudUpdateCloudAccountsInput!, +) { cloudUpdateAccount( + accountId: $accountId, + accounts: $accounts, +) { + linkedAccounts { + authLabel + createdAt + disabled + externalId + id + metricCollectionMode + name + nrAccountId + updatedAt + } +} }` + // Get one linked provider account. func (a *Cloud) GetLinkedAccount( accountID int, @@ -1760,6 +1894,7 @@ func (a *Cloud) GetLinkedAccountWithContext( return &resp.Actor.Account.Cloud.LinkedAccount, nil } +// Note: Do not make "$id" an optional field (as fetched from Tutone) to avoid a breaking change const getLinkedAccountQuery = `query( $accountID: Int!, $id: Int!, @@ -1901,6 +2036,11 @@ const getLinkedAccountQuery = `query( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsMsElasticacheIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAwsMskIntegration { __typename awsRegions @@ -2062,18 +2202,40 @@ const getLinkedAccountQuery = `query( metricsPollingInterval resourceGroups } + ... on CloudAzureMonitorIntegration { + __typename + enabled + excludeTags + includeTags + inventoryPollingInterval + metricsPollingInterval + resourceGroups + resourceTypes + } ... on CloudAzureMysqlIntegration { __typename inventoryPollingInterval metricsPollingInterval resourceGroups } + ... on CloudAzureMysqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } ... on CloudAzurePostgresqlIntegration { __typename inventoryPollingInterval metricsPollingInterval resourceGroups } + ... on CloudAzurePostgresqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } ... on CloudAzurePowerbidedicatedIntegration { __typename inventoryPollingInterval @@ -2179,6 +2341,7 @@ const getLinkedAccountQuery = `query( ... on CloudEc2Integration { __typename awsRegions + duplicateEc2Tags fetchIpAddresses inventoryPollingInterval metricsPollingInterval @@ -2248,6 +2411,16 @@ const getLinkedAccountQuery = `query( tagKey tagValue } + ... on CloudGcpAiplatformIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpAlloydbIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } ... on CloudGcpAppengineIntegration { __typename inventoryPollingInterval @@ -2255,6 +2428,7 @@ const getLinkedAccountQuery = `query( } ... on CloudGcpBigqueryIntegration { __typename + fetchTableMetrics fetchTags inventoryPollingInterval metricsPollingInterval @@ -2511,6 +2685,14 @@ const getLinkedAccountQuery = `query( updatedAt } slug + templateParams { + autocomplete + immutable + label + name + placeholder + type + } updatedAt ... on CloudAwsGovCloudProvider { __typename @@ -2573,16 +2755,24 @@ const getLinkedAccountsQuery = `query( disabled externalId id - metricCollectionMode - name - nrAccountId - provider { + integrations { __typename createdAt - icon id + linkedAccount { + authLabel + createdAt + disabled + externalId + id + metricCollectionMode + name + nrAccountId + updatedAt + } name - services { + nrAccountId + service { createdAt icon id @@ -2591,7 +2781,767 @@ const getLinkedAccountsQuery = `query( slug updatedAt } - slug + updatedAt + ... on CloudAlbIntegration { + __typename + awsRegions + fetchExtendedInventory + fetchTags + inventoryPollingInterval + loadBalancerPrefixes + metricsPollingInterval + tagKey + tagValue + } + ... on CloudApigatewayIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + stagePrefixes + tagKey + tagValue + } + ... on CloudAutoscalingIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsAppsyncIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsAthenaIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsCognitoIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsConnectIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsDirectconnectIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsDocdbIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsFsxIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsGlueIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsKinesisanalyticsIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsMediaconvertIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsMediapackagevodIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsMetadataIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsMqIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsMsElasticacheIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsMskIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsNeptuneIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsQldbIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsRoute53resolverIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsStatesIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsTagsGlobalIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsTransitgatewayIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsWafIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsWafv2Integration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAwsXrayIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudAzureApimanagementIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureAppgatewayIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureAppserviceIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureContainersIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureCosmosdbIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureCostmanagementIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + tagKeys + } + ... on CloudAzureDatafactoryIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureEventhubIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureExpressrouteIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureFirewallsIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureFrontdoorIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureFunctionsIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureKeyvaultIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureLoadbalancerIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureLogicappsIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureMachinelearningIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureMariadbIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureMonitorIntegration { + __typename + enabled + excludeTags + includeTags + inventoryPollingInterval + metricsPollingInterval + resourceGroups + resourceTypes + } + ... on CloudAzureMysqlIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureMysqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzurePostgresqlIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzurePostgresqlflexibleIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzurePowerbidedicatedIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureRediscacheIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureServicebusIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureSqlIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureSqlmanagedIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureStorageIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureVirtualmachineIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureVirtualnetworksIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureVmsIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudAzureVpngatewaysIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + resourceGroups + } + ... on CloudBaseIntegration { + __typename + } + ... on CloudBillingIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudCloudfrontIntegration { + __typename + fetchLambdasAtEdge + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudCloudtrailIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudDynamodbIntegration { + __typename + awsRegions + fetchExtendedInventory + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudEbsIntegration { + __typename + awsRegions + fetchExtendedInventory + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudEc2Integration { + __typename + awsRegions + duplicateEc2Tags + fetchIpAddresses + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudEcsIntegration { + __typename + awsRegions + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudEfsIntegration { + __typename + awsRegions + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudElasticacheIntegration { + __typename + awsRegions + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudElasticbeanstalkIntegration { + __typename + awsRegions + fetchExtendedInventory + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudElasticsearchIntegration { + __typename + awsRegions + fetchNodes + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudElbIntegration { + __typename + awsRegions + fetchExtendedInventory + fetchTags + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudEmrIntegration { + __typename + awsRegions + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudGcpAiplatformIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpAlloydbIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpAppengineIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpBigqueryIntegration { + __typename + fetchTableMetrics + fetchTags + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpBigtableIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpComposerIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpDataflowIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpDataprocIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpDatastoreIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpFirebasedatabaseIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpFirebasehostingIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpFirebasestorageIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpFirestoreIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpFunctionsIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpInterconnectIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpKubernetesIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpLoadbalancingIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpMemcacheIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpPubsubIntegration { + __typename + fetchTags + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpRedisIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpRouterIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpRunIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpSpannerIntegration { + __typename + fetchTags + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpSqlIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpStorageIntegration { + __typename + fetchTags + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpVmsIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudGcpVpcaccessIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudHealthIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudIamIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudIotIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudKinesisFirehoseIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudKinesisIntegration { + __typename + awsRegions + fetchShards + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudLambdaIntegration { + __typename + awsRegions + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudRdsIntegration { + __typename + awsRegions + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudRedshiftIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudRoute53Integration { + __typename + fetchExtendedInventory + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudS3Integration { + __typename + fetchExtendedInventory + fetchTags + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + ... on CloudSesIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudSnsIntegration { + __typename + awsRegions + fetchExtendedInventory + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudSqsIntegration { + __typename + awsRegions + fetchExtendedInventory + fetchTags + inventoryPollingInterval + metricsPollingInterval + queuePrefixes + tagKey + tagValue + } + ... on CloudTrustedadvisorIntegration { + __typename + inventoryPollingInterval + metricsPollingInterval + } + ... on CloudVpcIntegration { + __typename + awsRegions + fetchNatGateway + fetchVpn + inventoryPollingInterval + metricsPollingInterval + tagKey + tagValue + } + } + metricCollectionMode + name + nrAccountId + provider { + __typename + createdAt + icon + id + name + services { + createdAt + icon + id + isEnabled + name + slug + updatedAt + } + slug + templateParams { + autocomplete + immutable + label + name + placeholder + type + } updatedAt ... on CloudAwsGovCloudProvider { __typename diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/types.go similarity index 93% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/types.go index 9df2434ec81..afd4da063b6 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/cloud/types.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/cloud/types.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/nrtime" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" ) // CloudMetricCollectionMode - How metrics will be collected. @@ -33,13 +33,10 @@ type Account struct { // // For details and query examples visit // [our docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/manage-your-aws-azure-google-cloud-integrations-graphql-api). - Cloud CloudAccountFields `json:"cloud,omitempty"` - // - ID int `json:"id,omitempty"` - // - LicenseKey string `json:"licenseKey,omitempty"` - // - Name string `json:"name,omitempty"` + Cloud CloudAccountFields `json:"cloud,omitempty"` + ID int `json:"id,omitempty"` + LicenseKey string `json:"licenseKey,omitempty"` + Name string `json:"name,omitempty"` } // Actor - The `Actor` object contains fields that are scoped to the API user's access level. @@ -127,7 +124,6 @@ type CloudAccountMutationError struct { Type string `json:"type"` } -// CloudActorFields - type CloudActorFields struct { // Get all linked cloud provider accounts scoped to the Actor. LinkedAccounts []CloudLinkedAccount `json:"linkedAccounts,omitempty"` @@ -453,6 +449,8 @@ type CloudAwsDisableIntegrationsInput struct { AwsMetadata []CloudDisableAccountIntegrationInput `json:"awsMetadata,omitempty"` // MQ integration AwsMq []CloudDisableAccountIntegrationInput `json:"awsMq,omitempty"` + // Fetch ElastiCache entities integration + AwsMsElasticache []CloudDisableAccountIntegrationInput `json:"awsMsElasticache,omitempty"` // Managed Kafka integration AwsMsk []CloudDisableAccountIntegrationInput `json:"awsMsk,omitempty"` // Neptune integration @@ -645,6 +643,20 @@ type CloudAwsGlueIntegrationInput struct { MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` } +// CloudAwsGovCloudLinkAccountInput - Information required to link an AWS GovCloud account to a NewRelic account. +type CloudAwsGovCloudLinkAccountInput struct { + // The key used to make requests to AWS service APIs + AccessKeyId string `json:"accessKeyId"` + // The AWS account id + AwsAccountId string `json:"awsAccountId"` + // How metrics will be collected. + MetricCollectionMode CloudMetricCollectionMode `json:"metricCollectionMode,omitempty"` + // The linked account name. + Name string `json:"name"` + // The secret key used to make requests to AWS service APIs + SecretAccessKey SecureValue `json:"secretAccessKey"` +} + // CloudAwsGovCloudProvider - The Amazon Web Services cloud provider (GovCloud) type CloudAwsGovCloudProvider struct { // The AWS Account ID @@ -663,12 +675,30 @@ type CloudAwsGovCloudProvider struct { Services []CloudService `json:"services"` // The cloud provider short name. Slug string `json:"slug"` + // Get template params of one cloud provider service. + TemplateParams []CloudTemplateParam `json:"templateParams"` // The object last update date, in epoch (Unix) time UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } func (x *CloudAwsGovCloudProvider) ImplementsCloudProvider() {} +// CloudAwsGovCloudUpdateAccountInput - Information required to update an AWS GovCloud account to a NewRelic account. +type CloudAwsGovCloudUpdateAccountInput struct { + // The key used to make requests to AWS service APIs + AccessKeyId string `json:"accessKeyId,omitempty"` + // The AWS account id + AwsAccountId string `json:"awsAccountId,omitempty"` + // Disable the linked account. + Disabled bool `json:"disabled,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The linked account new name. + Name string `json:"name,omitempty"` + // The secret key used to make requests to AWS service APIs + SecretAccessKey SecureValue `json:"secretAccessKey,omitempty"` +} + // CloudAwsGovcloudDisableIntegrationsInput - List of integrations type CloudAwsGovcloudDisableIntegrationsInput struct { // API Gateway integration @@ -757,20 +787,6 @@ type CloudAwsGovcloudIntegrationsInput struct { Sqs []CloudSqsIntegrationInput `json:"sqs,omitempty"` } -// CloudAwsGovcloudLinkAccountInput - Information required to link an AWS GovCloud account to a NewRelic account. -type CloudAwsGovcloudLinkAccountInput struct { - // The key used to make requests to AWS service APIs - AccessKeyId string `json:"accessKeyId"` - // The AWS account id - AwsAccountId string `json:"awsAccountId"` - // How metrics will be collected. - MetricCollectionMode CloudMetricCollectionMode `json:"metricCollectionMode,omitempty"` - // The linked account name. - Name string `json:"name"` - // The secret key used to make requests to AWS service APIs - SecretAccessKey SecureValue `json:"secretAccessKey"` -} - // CloudAwsIntegrationsInput - List of integrations type CloudAwsIntegrationsInput struct { // API Gateway integration @@ -805,6 +821,8 @@ type CloudAwsIntegrationsInput struct { AwsMetadata []CloudAwsMetadataIntegrationInput `json:"awsMetadata,omitempty"` // MQ integration AwsMq []CloudAwsMqIntegrationInput `json:"awsMq,omitempty"` + // Fetch ElastiCache entities integration + AwsMsElasticache []CloudAwsMsElasticacheIntegrationInput `json:"awsMsElasticache,omitempty"` // Managed Kafka integration AwsMsk []CloudAwsMskIntegrationInput `json:"awsMsk,omitempty"` // Neptune integration @@ -1079,6 +1097,40 @@ type CloudAwsMqIntegrationInput struct { MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` } +// CloudAwsMsElasticacheIntegration - Fetch ElastiCache entities Integration +type CloudAwsMsElasticacheIntegration struct { + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The cloud service integration identifier. + ID int `json:"id,omitempty"` + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The parent linked account identifier. + LinkedAccount CloudLinkedAccount `json:"linkedAccount,omitempty"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // The cloud service integration name. + Name string `json:"name,omitempty"` + // The parent NewRelic account identifier. + NrAccountId int `json:"nrAccountId"` + // The cloud service used in the integration. + Service CloudService `json:"service,omitempty"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + +func (x *CloudAwsMsElasticacheIntegration) ImplementsCloudIntegration() {} + +// CloudAwsMsElasticacheIntegrationInput - Fetch ElastiCache entities +type CloudAwsMsElasticacheIntegrationInput struct { + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` +} + // CloudAwsMskIntegration - Managed Kafka Integration type CloudAwsMskIntegration struct { // Specify each AWS region that includes the resources that you want to monitor. @@ -1175,6 +1227,8 @@ type CloudAwsProvider struct { Services []CloudService `json:"services"` // The cloud provider short name. Slug string `json:"slug"` + // Get template params of one cloud provider service. + TemplateParams []CloudTemplateParam `json:"templateParams"` // The object last update date, in epoch (Unix) time UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } @@ -1367,6 +1421,18 @@ type CloudAwsTransitgatewayIntegrationInput struct { MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` } +// CloudAwsUpdateAccountInput - Information required to update a AWS account to a NewRelic account. +type CloudAwsUpdateAccountInput struct { + // The AWS role ARN (used to fetch data). + Arn string `json:"arn,omitempty"` + // Disable the linked account. + Disabled bool `json:"disabled,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The linked account new name. + Name string `json:"name,omitempty"` +} + // CloudAwsWafIntegration - WAF Integration type CloudAwsWafIntegration struct { // Specify each AWS region that includes the resources that you want to monitor. @@ -1783,18 +1849,22 @@ type CloudAzureDisableIntegrationsInput struct { AzureMachinelearning []CloudDisableAccountIntegrationInput `json:"azureMachinelearning,omitempty"` // Database for MariaDB integration AzureMariadb []CloudDisableAccountIntegrationInput `json:"azureMariadb,omitempty"` + // Azure Monitor metrics integration + AzureMonitor []CloudDisableAccountIntegrationInput `json:"azureMonitor,omitempty"` // Database for MySQL integration AzureMysql []CloudDisableAccountIntegrationInput `json:"azureMysql,omitempty"` + // MySQL Flexible Server integration + AzureMysqlflexible []CloudDisableAccountIntegrationInput `json:"azureMysqlflexible,omitempty"` // Database for PostgreSQL integration AzurePostgresql []CloudDisableAccountIntegrationInput `json:"azurePostgresql,omitempty"` + // PostgreSQL Flexible Server integration + AzurePostgresqlflexible []CloudDisableAccountIntegrationInput `json:"azurePostgresqlflexible,omitempty"` // Power BI Dedicated integration AzurePowerbidedicated []CloudDisableAccountIntegrationInput `json:"azurePowerbidedicated,omitempty"` // Redis Cache integration AzureRediscache []CloudDisableAccountIntegrationInput `json:"azureRediscache,omitempty"` // Service Bus integration AzureServicebus []CloudDisableAccountIntegrationInput `json:"azureServicebus,omitempty"` - // Service Fabric integration - AzureServicefabric []CloudDisableAccountIntegrationInput `json:"azureServicefabric,omitempty"` // SQL Database integration AzureSql []CloudDisableAccountIntegrationInput `json:"azureSql,omitempty"` // SQL Managed Instances integration @@ -2037,18 +2107,22 @@ type CloudAzureIntegrationsInput struct { AzureMachinelearning []CloudAzureMachinelearningIntegrationInput `json:"azureMachinelearning,omitempty"` // Database for MariaDB integration AzureMariadb []CloudAzureMariadbIntegrationInput `json:"azureMariadb,omitempty"` + // Azure Monitor metrics integration + AzureMonitor []CloudAzureMonitorIntegrationInput `json:"azureMonitor,omitempty"` // Database for MySQL integration AzureMysql []CloudAzureMysqlIntegrationInput `json:"azureMysql,omitempty"` + // MySQL Flexible Server integration + AzureMysqlflexible []CloudAzureMysqlflexibleIntegrationInput `json:"azureMysqlflexible,omitempty"` // Database for PostgreSQL integration AzurePostgresql []CloudAzurePostgresqlIntegrationInput `json:"azurePostgresql,omitempty"` + // PostgreSQL Flexible Server integration + AzurePostgresqlflexible []CloudAzurePostgresqlflexibleIntegrationInput `json:"azurePostgresqlflexible,omitempty"` // Power BI Dedicated integration AzurePowerbidedicated []CloudAzurePowerbidedicatedIntegrationInput `json:"azurePowerbidedicated,omitempty"` // Redis Cache integration AzureRediscache []CloudAzureRediscacheIntegrationInput `json:"azureRediscache,omitempty"` // Service Bus integration AzureServicebus []CloudAzureServicebusIntegrationInput `json:"azureServicebus,omitempty"` - // Service Fabric integration - AzureServicefabric []CloudAzureServicefabricIntegrationInput `json:"azureServicefabric,omitempty"` // SQL Database integration AzureSql []CloudAzureSqlIntegrationInput `json:"azureSql,omitempty"` // SQL Managed Instances integration @@ -2269,6 +2343,60 @@ type CloudAzureMariadbIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } +// CloudAzureMonitorIntegration - Azure Monitor metrics Integration +type CloudAzureMonitorIntegration struct { + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // Specify if integration is active + Enabled bool `json:"enabled,omitempty"` + // Specify resource tags (in 'key:value' form) associated with the resources that you want to exclude from monitoring. Exclusion takes precedence over inclusion. + ExcludeTags []string `json:"excludeTags,omitempty"` + // The cloud service integration identifier. + ID int `json:"id,omitempty"` + // Specify resource tags (in 'key:value' form) associated with the resources that you want to monitor. If empty, all resources will be monitored. + IncludeTags []string `json:"includeTags,omitempty"` + // The polling interval for metadata and tags, in seconds. + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The parent linked account identifier. + LinkedAccount CloudLinkedAccount `json:"linkedAccount,omitempty"` + // The polling interval for metrics, in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // The cloud service integration name. + Name string `json:"name,omitempty"` + // The parent NewRelic account identifier. + NrAccountId int `json:"nrAccountId"` + // Specify each Resource group associated with the resources that you want to monitor. Filter values are case-sensitive. + ResourceGroups []string `json:"resourceGroups,omitempty"` + // Specify each Azure resource type that you want to monitor. + ResourceTypes []string `json:"resourceTypes,omitempty"` + // The cloud service used in the integration. + Service CloudService `json:"service,omitempty"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + +func (x *CloudAzureMonitorIntegration) ImplementsCloudIntegration() {} + +// CloudAzureMonitorIntegrationInput - Azure Monitor metrics +type CloudAzureMonitorIntegrationInput struct { + // Specify if integration is active + Enabled bool `json:"enabled,omitempty"` + // Specify resource tags (in 'key:value' form) associated with the resources that you want to exclude from monitoring. Exclusion takes precedence over inclusion. + ExcludeTags []string `json:"excludeTags,omitempty"` + // Specify resource tags (in 'key:value' form) associated with the resources that you want to monitor. If empty, all resources will be monitored. + IncludeTags []string `json:"includeTags,omitempty"` + // The polling interval for metadata and tags, in seconds. + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The polling interval for metrics, in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // Specify each Resource group associated with the resources that you want to monitor. Filter values are case-sensitive. + ResourceGroups []string `json:"resourceGroups,omitempty"` + // Specify each Azure resource type that you want to monitor. + ResourceTypes []string `json:"resourceTypes,omitempty"` +} + // CloudAzureMysqlIntegration - Database for MySQL Integration type CloudAzureMysqlIntegration struct { // The object creation date, in epoch (Unix) time @@ -2307,6 +2435,44 @@ type CloudAzureMysqlIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } +// CloudAzureMysqlflexibleIntegration - MySQL Flexible Server Integration +type CloudAzureMysqlflexibleIntegration struct { + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The cloud service integration identifier. + ID int `json:"id,omitempty"` + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The parent linked account identifier. + LinkedAccount CloudLinkedAccount `json:"linkedAccount,omitempty"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // The cloud service integration name. + Name string `json:"name,omitempty"` + // The parent NewRelic account identifier. + NrAccountId int `json:"nrAccountId"` + // Specify each Resource group associated with the resources that you want to monitor. Filter values are case-sensitive. + ResourceGroups []string `json:"resourceGroups,omitempty"` + // The cloud service used in the integration. + Service CloudService `json:"service,omitempty"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + +func (x *CloudAzureMysqlflexibleIntegration) ImplementsCloudIntegration() {} + +// CloudAzureMysqlflexibleIntegrationInput - MySQL Flexible Server +type CloudAzureMysqlflexibleIntegrationInput struct { + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // Specify each Resource group associated with the resources that you want to monitor. Filter values are case-sensitive. + ResourceGroups []string `json:"resourceGroups,omitempty"` +} + // CloudAzurePostgresqlIntegration - Database for PostgreSQL Integration type CloudAzurePostgresqlIntegration struct { // The object creation date, in epoch (Unix) time @@ -2345,8 +2511,8 @@ type CloudAzurePostgresqlIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } -// CloudAzurePowerbidedicatedIntegration - Power BI Dedicated Integration -type CloudAzurePowerbidedicatedIntegration struct { +// CloudAzurePostgresqlflexibleIntegration - PostgreSQL Flexible Server Integration +type CloudAzurePostgresqlflexibleIntegration struct { // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` // The cloud service integration identifier. @@ -2369,10 +2535,10 @@ type CloudAzurePowerbidedicatedIntegration struct { UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } -func (x *CloudAzurePowerbidedicatedIntegration) ImplementsCloudIntegration() {} +func (x *CloudAzurePostgresqlflexibleIntegration) ImplementsCloudIntegration() {} -// CloudAzurePowerbidedicatedIntegrationInput - Power BI Dedicated -type CloudAzurePowerbidedicatedIntegrationInput struct { +// CloudAzurePostgresqlflexibleIntegrationInput - PostgreSQL Flexible Server +type CloudAzurePostgresqlflexibleIntegrationInput struct { // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` // The linked account identifier. @@ -2383,8 +2549,8 @@ type CloudAzurePowerbidedicatedIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } -// CloudAzureRediscacheIntegration - Redis Cache Integration -type CloudAzureRediscacheIntegration struct { +// CloudAzurePowerbidedicatedIntegration - Power BI Dedicated Integration +type CloudAzurePowerbidedicatedIntegration struct { // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` // The cloud service integration identifier. @@ -2407,10 +2573,10 @@ type CloudAzureRediscacheIntegration struct { UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } -func (x *CloudAzureRediscacheIntegration) ImplementsCloudIntegration() {} +func (x *CloudAzurePowerbidedicatedIntegration) ImplementsCloudIntegration() {} -// CloudAzureRediscacheIntegrationInput - Azure Redis Cache -type CloudAzureRediscacheIntegrationInput struct { +// CloudAzurePowerbidedicatedIntegrationInput - Power BI Dedicated +type CloudAzurePowerbidedicatedIntegrationInput struct { // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` // The linked account identifier. @@ -2421,8 +2587,8 @@ type CloudAzureRediscacheIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } -// CloudAzureServicebusIntegration - Service Bus Integration -type CloudAzureServicebusIntegration struct { +// CloudAzureRediscacheIntegration - Redis Cache Integration +type CloudAzureRediscacheIntegration struct { // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` // The cloud service integration identifier. @@ -2445,10 +2611,10 @@ type CloudAzureServicebusIntegration struct { UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } -func (x *CloudAzureServicebusIntegration) ImplementsCloudIntegration() {} +func (x *CloudAzureRediscacheIntegration) ImplementsCloudIntegration() {} -// CloudAzureServicebusIntegrationInput - Azure Service Bus -type CloudAzureServicebusIntegrationInput struct { +// CloudAzureRediscacheIntegrationInput - Azure Redis Cache +type CloudAzureRediscacheIntegrationInput struct { // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` // The linked account identifier. @@ -2459,8 +2625,8 @@ type CloudAzureServicebusIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } -// CloudAzureServicefabricIntegration - Service Fabric Integration -type CloudAzureServicefabricIntegration struct { +// CloudAzureServicebusIntegration - Service Bus Integration +type CloudAzureServicebusIntegration struct { // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` // The cloud service integration identifier. @@ -2483,10 +2649,10 @@ type CloudAzureServicefabricIntegration struct { UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } -func (x *CloudAzureServicefabricIntegration) ImplementsCloudIntegration() {} +func (x *CloudAzureServicebusIntegration) ImplementsCloudIntegration() {} -// CloudAzureServicefabricIntegrationInput - Service Fabric -type CloudAzureServicefabricIntegrationInput struct { +// CloudAzureServicebusIntegrationInput - Azure Service Bus +type CloudAzureServicebusIntegrationInput struct { // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` // The linked account identifier. @@ -2611,6 +2777,24 @@ type CloudAzureStorageIntegrationInput struct { ResourceGroups []string `json:"resourceGroups,omitempty"` } +// CloudAzureUpdateAccountInput - Information required to update a Azure account to a NewRelic account. +type CloudAzureUpdateAccountInput struct { + // The Azure account application identifier (used to fetch data). + ApplicationID string `json:"applicationId,omitempty"` + // The Azure account application secret key. + ClientSecret SecureValue `json:"clientSecret,omitempty"` + // Disable the linked account. + Disabled *bool `json:"disabled,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The linked account new name. + Name string `json:"name,omitempty"` + // The Azure account subscription identifier. + SubscriptionId string `json:"subscriptionId,omitempty"` + // The Azure account tenant identifier. + TenantId string `json:"tenantId,omitempty"` +} + // CloudAzureVirtualmachineIntegration - Virtual machine scale sets Integration type CloudAzureVirtualmachineIntegration struct { // The object creation date, in epoch (Unix) time @@ -2799,6 +2983,8 @@ type CloudBaseProvider struct { Services []CloudService `json:"services"` // The cloud provider short name. Slug string `json:"slug"` + // Get template params of one cloud provider service. + TemplateParams []CloudTemplateParam `json:"templateParams"` // The object last update date, in epoch (Unix) time UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } @@ -2980,6 +3166,36 @@ func (x *CloudConfigureIntegrationPayload) UnmarshalJSON(b []byte) error { return nil } +// CloudConfluentUpdateAccountInput - Information required to update a Confluent Cloud account to a NewRelic account. +type CloudConfluentUpdateAccountInput struct { + // The Confluent account API key. + APIKey SecureValue `json:"apiKey"` + // The Confluent Cloud account API Secret key. + APISecret SecureValue `json:"apiSecret"` + // Disable the linked account. + Disabled bool `json:"disabled,omitempty"` + // The Confluent Cloud account identifier. + ExternalId string `json:"externalId,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The linked account new name. + Name string `json:"name,omitempty"` +} + +// CloudDashboardTemplate - A cloud service dashboard template. +type CloudDashboardTemplate struct { + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The dashboard layout position. + Layout int `json:"layout"` + // The dashboard template name. + Name string `json:"name"` + // The dashboard template slug. + Slug string `json:"slug"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + // CloudDisableAccountIntegrationInput - Information required to disable a cloud service integration from a linked account. type CloudDisableAccountIntegrationInput struct { // The linked account identifier @@ -3161,6 +3377,8 @@ type CloudEc2Integration struct { AwsRegions []string `json:"awsRegions,omitempty"` // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // Specify if the old legacy metadata and tag names have to be kept, it will consume more ingest data size + DuplicateEc2Tags bool `json:"duplicateEc2Tags,omitempty"` // Specify if IP addresses of ec2 instance should be collected FetchIpAddresses bool `json:"fetchIpAddresses,omitempty"` // The cloud service integration identifier. @@ -3191,6 +3409,8 @@ func (x *CloudEc2Integration) ImplementsCloudIntegration() {} type CloudEc2IntegrationInput struct { // Specify each AWS region that includes the resources that you want to monitor. AwsRegions []string `json:"awsRegions,omitempty"` + // Specify if the old legacy metadata and tag names have to be kept, it will consume more ingest data size + DuplicateEc2Tags bool `json:"duplicateEc2Tags,omitempty"` // Specify if IP addresses of ec2 instance should be collected FetchIpAddresses bool `json:"fetchIpAddresses,omitempty"` // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval @@ -3555,6 +3775,88 @@ type CloudEmrIntegrationInput struct { TagValue string `json:"tagValue,omitempty"` } +// CloudFossaUpdateAccountInput - Information required to update a Fossa account to a NewRelic account. +type CloudFossaUpdateAccountInput struct { + // The Fossa account application api key(bearer token). + APIKey SecureValue `json:"apiKey"` + // Disable the linked account. + Disabled bool `json:"disabled,omitempty"` + // The Fossa account identifier. + ExternalId string `json:"externalId,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The linked account new name. + Name string `json:"name,omitempty"` +} + +// CloudGcpAiplatformIntegration - Vertex AI Integration +type CloudGcpAiplatformIntegration struct { + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The cloud service integration identifier. + ID int `json:"id,omitempty"` + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The parent linked account identifier. + LinkedAccount CloudLinkedAccount `json:"linkedAccount,omitempty"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // The cloud service integration name. + Name string `json:"name,omitempty"` + // The parent NewRelic account identifier. + NrAccountId int `json:"nrAccountId"` + // The cloud service used in the integration. + Service CloudService `json:"service,omitempty"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + +func (x *CloudGcpAiplatformIntegration) ImplementsCloudIntegration() {} + +// CloudGcpAiplatformIntegrationInput - Vertex AI +type CloudGcpAiplatformIntegrationInput struct { + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` +} + +// CloudGcpAlloydbIntegration - AlloyDB Integration +type CloudGcpAlloydbIntegration struct { + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The cloud service integration identifier. + ID int `json:"id,omitempty"` + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The parent linked account identifier. + LinkedAccount CloudLinkedAccount `json:"linkedAccount,omitempty"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // The cloud service integration name. + Name string `json:"name,omitempty"` + // The parent NewRelic account identifier. + NrAccountId int `json:"nrAccountId"` + // The cloud service used in the integration. + Service CloudService `json:"service,omitempty"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + +func (x *CloudGcpAlloydbIntegration) ImplementsCloudIntegration() {} + +// CloudGcpAlloydbIntegrationInput - AlloyDB +type CloudGcpAlloydbIntegrationInput struct { + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` +} + // CloudGcpAppengineIntegration - App Engine Integration type CloudGcpAppengineIntegration struct { // The object creation date, in epoch (Unix) time @@ -3593,6 +3895,8 @@ type CloudGcpAppengineIntegrationInput struct { type CloudGcpBigqueryIntegration struct { // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // Fetch BigQuery Table metrics, disabled by default + FetchTableMetrics bool `json:"fetchTableMetrics,omitempty"` // Specify if labels and the extended inventory should be collected. May affect total data collection time and contribute to the Cloud provider API rate limit. FetchTags bool `json:"fetchTags,omitempty"` // The cloud service integration identifier. @@ -3617,6 +3921,8 @@ func (x *CloudGcpBigqueryIntegration) ImplementsCloudIntegration() {} // CloudGcpBigqueryIntegrationInput - BigQuery type CloudGcpBigqueryIntegrationInput struct { + // Fetch BigQuery Table metrics, disabled by default + FetchTableMetrics bool `json:"fetchTableMetrics,omitempty"` // Specify if labels and the extended inventory should be collected. May affect total data collection time and contribute to the Cloud provider API rate limit. FetchTags bool `json:"fetchTags,omitempty"` // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval @@ -3799,6 +4105,10 @@ type CloudGcpDatastoreIntegrationInput struct { // CloudGcpDisableIntegrationsInput - List of integrations type CloudGcpDisableIntegrationsInput struct { + // Vertex AI integration + GcpAiplatform []CloudDisableAccountIntegrationInput `json:"gcpAiplatform,omitempty"` + // AlloyDB integration + GcpAlloydb []CloudDisableAccountIntegrationInput `json:"gcpAlloydb,omitempty"` // App Engine integration GcpAppengine []CloudDisableAccountIntegrationInput `json:"gcpAppengine,omitempty"` // BigQuery integration @@ -4023,6 +4333,10 @@ type CloudGcpFunctionsIntegrationInput struct { // CloudGcpIntegrationsInput - List of integrations type CloudGcpIntegrationsInput struct { + // Vertex AI integration + GcpAiplatform []CloudGcpAiplatformIntegrationInput `json:"gcpAiplatform,omitempty"` + // AlloyDB integration + GcpAlloydb []CloudGcpAlloydbIntegrationInput `json:"gcpAlloydb,omitempty"` // App Engine integration GcpAppengine []CloudGcpAppengineIntegrationInput `json:"gcpAppengine,omitempty"` // BigQuery integration @@ -4237,6 +4551,8 @@ type CloudGcpProvider struct { Services []CloudService `json:"services"` // The cloud provider short name. Slug string `json:"slug"` + // Get template params of one cloud provider service. + TemplateParams []CloudTemplateParam `json:"templateParams"` // The object last update date, in epoch (Unix) time UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } @@ -4493,6 +4809,18 @@ type CloudGcpStorageIntegrationInput struct { MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` } +// CloudGcpUpdateAccountInput - Information required to update a GCP account to a NewRelic account. +type CloudGcpUpdateAccountInput struct { + // Disable the linked account. + Disabled bool `json:"disabled,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The linked account new name. + Name string `json:"name,omitempty"` + // The GCP project identifier. + ProjectId string `json:"projectId,omitempty"` +} + // CloudGcpVmsIntegration - Compute Engine Integration type CloudGcpVmsIntegration struct { // The object creation date, in epoch (Unix) time @@ -4875,8 +5203,8 @@ type CloudLinkAccountPayload struct { type CloudLinkCloudAccountsInput struct { // Aws provider Aws []CloudAwsLinkAccountInput `json:"aws,omitempty"` - // AwsGovcloud provider - AwsGovcloud []CloudAwsGovcloudLinkAccountInput `json:"awsGovcloud,omitempty"` + // AwsGovCloud provider + AwsGovcloud []CloudAwsGovCloudLinkAccountInput `json:"awsGovcloud,omitempty"` // Azure provider Azure []CloudAzureLinkAccountInput `json:"azure,omitempty"` // Gcp provider @@ -5036,6 +5364,8 @@ type CloudProvider struct { Services []CloudService `json:"services"` // The cloud provider short name. Slug string `json:"slug"` + // Get template params of one cloud provider service. + TemplateParams []CloudTemplateParam `json:"templateParams"` // The object last update date, in epoch (Unix) time UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` } @@ -5246,6 +5576,8 @@ type CloudS3IntegrationInput struct { type CloudService struct { // The object creation date, in epoch (Unix) time CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The cloud service dashboard templates. + Dashboards []CloudDashboardTemplate `json:"dashboards"` // The cloud service identifier in NewRelic. ID int `json:"id"` // The cloud service icon name. @@ -5281,6 +5613,11 @@ func (x *CloudService) UnmarshalJSON(b []byte) error { if err != nil { return err } + case "dashboards": + err = json.Unmarshal(*v, &x.Dashboards) + if err != nil { + return err + } case "id": err = json.Unmarshal(*v, &x.ID) if err != nil { @@ -5467,6 +5804,22 @@ type CloudSqsIntegrationInput struct { TagValue string `json:"tagValue,omitempty"` } +// CloudTemplateParam - Provider template form params +type CloudTemplateParam struct { + // The provider template param autocomplete. + Autocomplete string `json:"autocomplete,omitempty"` + // The provider template param immutable. + Immutable bool `json:"immutable,omitempty"` + // The provider template param label. + Label string `json:"label,omitempty"` + // The provider template param name. + Name string `json:"name"` + // The provider template param placeholder. + Placeholder string `json:"placeholder,omitempty"` + // The provider template param type. + Type string `json:"type"` +} + // CloudTrustedadvisorIntegration - Trusted Advisor Integration type CloudTrustedadvisorIntegration struct { // The object creation date, in epoch (Unix) time @@ -5515,6 +5868,28 @@ type CloudUnlinkAccountsInput struct { LinkedAccountId int `json:"linkedAccountId"` } +// CloudUpdateAccountPayload - Autogenerated return type of UpdateAccount +type CloudUpdateAccountPayload struct { + // The updated Linked accounts. + LinkedAccounts []CloudLinkedAccount `json:"linkedAccounts"` +} + +// CloudUpdateCloudAccountsInput - Specific Cloud provider information required to update the Cloud provider account to a NewRelic account. +type CloudUpdateCloudAccountsInput struct { + // Aws provider + Aws []CloudAwsUpdateAccountInput `json:"aws,omitempty"` + // AwsGovCloud provider + AwsGovcloud []CloudAwsGovCloudUpdateAccountInput `json:"awsGovcloud,omitempty"` + // Azure provider + Azure []CloudAzureUpdateAccountInput `json:"azure,omitempty"` + // Confluent Cloud provider + Confluent []CloudConfluentUpdateAccountInput `json:"confluent,omitempty"` + // Fossa provider + Fossa []CloudFossaUpdateAccountInput `json:"fossa,omitempty"` + // Gcp provider + Gcp []CloudGcpUpdateAccountInput `json:"gcp,omitempty"` +} + // CloudVpcIntegration - VPC Integration type CloudVpcIntegration struct { // Specify each AWS region that includes the resources that you want to monitor. @@ -5769,6 +6144,16 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil + case "CloudAwsMsElasticacheIntegration": + var interfaceType CloudAwsMsElasticacheIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil case "CloudAwsMskIntegration": var interfaceType CloudAwsMskIntegration @@ -6039,6 +6424,16 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil + case "CloudAzureMonitorIntegration": + var interfaceType CloudAzureMonitorIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil case "CloudAzureMysqlIntegration": var interfaceType CloudAzureMysqlIntegration @@ -6049,6 +6444,16 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil + case "CloudAzureMysqlflexibleIntegration": + var interfaceType CloudAzureMysqlflexibleIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil case "CloudAzurePostgresqlIntegration": var interfaceType CloudAzurePostgresqlIntegration @@ -6060,8 +6465,8 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType return &xxx, nil - case "CloudAzurePowerbidedicatedIntegration": - var interfaceType CloudAzurePowerbidedicatedIntegration + case "CloudAzurePostgresqlflexibleIntegration": + var interfaceType CloudAzurePostgresqlflexibleIntegration err = json.Unmarshal(b, &interfaceType) if err != nil { return nil, err @@ -6070,8 +6475,8 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType return &xxx, nil - case "CloudAzureRediscacheIntegration": - var interfaceType CloudAzureRediscacheIntegration + case "CloudAzurePowerbidedicatedIntegration": + var interfaceType CloudAzurePowerbidedicatedIntegration err = json.Unmarshal(b, &interfaceType) if err != nil { return nil, err @@ -6080,8 +6485,8 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType return &xxx, nil - case "CloudAzureServicebusIntegration": - var interfaceType CloudAzureServicebusIntegration + case "CloudAzureRediscacheIntegration": + var interfaceType CloudAzureRediscacheIntegration err = json.Unmarshal(b, &interfaceType) if err != nil { return nil, err @@ -6090,8 +6495,8 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType return &xxx, nil - case "CloudAzureServicefabricIntegration": - var interfaceType CloudAzureServicefabricIntegration + case "CloudAzureServicebusIntegration": + var interfaceType CloudAzureServicebusIntegration err = json.Unmarshal(b, &interfaceType) if err != nil { return nil, err @@ -6309,6 +6714,26 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil + case "CloudGcpAiplatformIntegration": + var interfaceType CloudGcpAiplatformIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx CloudIntegrationInterface = &interfaceType + + return &xxx, nil + case "CloudGcpAlloydbIntegration": + var interfaceType CloudGcpAlloydbIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil case "CloudGcpAppengineIntegration": var interfaceType CloudGcpAppengineIntegration diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/common/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/common/types.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/common/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/common/types.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/config/compression.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/compression.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/config/compression.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/compression.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/config/config.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/config.go similarity index 73% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/config/config.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/config.go index f07c4cb358d..c741ece6ee7 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/config/config.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/config.go @@ -2,12 +2,15 @@ package config import ( + "errors" + "fmt" "net/http" + "os" "time" - "github.com/newrelic/newrelic-client-go/internal/version" - "github.com/newrelic/newrelic-client-go/pkg/logging" - "github.com/newrelic/newrelic-client-go/pkg/region" + "github.com/newrelic/newrelic-client-go/v2/internal/version" + "github.com/newrelic/newrelic-client-go/v2/pkg/logging" + "github.com/newrelic/newrelic-client-go/v2/pkg/region" ) // Config contains all the configuration data for the API Client. @@ -68,6 +71,27 @@ func New() Config { } } +func (cfg *Config) Init(opts []ConfigOption) error { + // Loop through config options + for _, fn := range opts { + if nil != fn { + if err := fn(cfg); err != nil { + return err + } + } + } + + if cfg.PersonalAPIKey == "" && cfg.AdminAPIKey == "" && cfg.InsightsInsertKey == "" { + return errors.New("must use at least one of: ConfigPersonalAPIKey, ConfigAdminAPIKey, ConfigInsightsInsertKey") + } + + if cfg.Logger == nil { + cfg.Logger = cfg.GetLogger() + } + + return nil +} + // Region returns the region configuration struct // if one has not been set, use the default region func (c *Config) Region() *region.Region { @@ -90,6 +114,19 @@ func (c *Config) SetRegion(reg *region.Region) error { return nil } +func (c *Config) SetServiceName(serviceName string) error { + if c.ServiceName == "" { + c.ServiceName = serviceName + } + + customServiceName := os.Getenv("NEW_RELIC_SERVICE_NAME") + if customServiceName != "" { + c.ServiceName = fmt.Sprintf("%s|%s", customServiceName, c.ServiceName) + } + + return nil +} + // GetLogger returns a logger instance based on the config values. func (c *Config) GetLogger() logging.Logger { if c.Logger != nil { diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/config/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/doc.go similarity index 95% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/config/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/doc.go index fbfe14e7fb6..d5b2407bf34 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/config/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/doc.go @@ -2,13 +2,12 @@ Package config provides a configuration surface area for configuring the underlying client. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic APIs that power the client. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package config diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/main.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/main.go new file mode 100644 index 00000000000..1b51143a4a3 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/config/main.go @@ -0,0 +1,194 @@ +package config + +import ( + "errors" + "net/http" + "time" + + log "github.com/sirupsen/logrus" + + "github.com/newrelic/newrelic-client-go/v2/pkg/logging" + "github.com/newrelic/newrelic-client-go/v2/pkg/region" +) + +// ConfigOption configures the Config when provided to NewApplication. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +type ConfigOption func(*Config) error + +// ConfigPersonalAPIKey sets the New Relic Admin API key this client will use. +// This key should be used to create a client instance. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +func ConfigPersonalAPIKey(apiKey string) ConfigOption { + return func(cfg *Config) error { + cfg.PersonalAPIKey = apiKey + return nil + } +} + +// ConfigInsightsInsertKey sets the New Relic Insights insert key this client will use. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +func ConfigInsightsInsertKey(insightsInsertKey string) ConfigOption { + return func(cfg *Config) error { + cfg.InsightsInsertKey = insightsInsertKey + return nil + } +} + +// ConfigAdminAPIKey sets the New Relic Admin API key this client will use. +// Deprecated. Use a personal API key for authentication. +// https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys +func ConfigAdminAPIKey(adminAPIKey string) ConfigOption { + return func(cfg *Config) error { + cfg.AdminAPIKey = adminAPIKey + return nil + } +} + +// ConfigRegion sets the New Relic Region this client will use. +func ConfigRegion(r string) ConfigOption { + return func(cfg *Config) error { + // We can ignore this error since we will be defaulting in the next step + regName, _ := region.Parse(r) + + reg, err := region.Get(regName) + if err != nil { + if _, ok := err.(region.UnknownUsingDefaultError); ok { + // If region wasn't provided, output a warning message + // indicating the default region "US" is being used. + log.Warn(err) + return nil + } + + return err + } + + err = cfg.SetRegion(reg) + + return err + } +} + +// ConfigHTTPTimeout sets the timeout for HTTP requests. +func ConfigHTTPTimeout(t time.Duration) ConfigOption { + return func(cfg *Config) error { + var timeout = &t + cfg.Timeout = timeout + return nil + } +} + +// ConfigHTTPTransport sets the HTTP Transporter. +func ConfigHTTPTransport(transport http.RoundTripper) ConfigOption { + return func(cfg *Config) error { + if transport != nil { + cfg.HTTPTransport = transport + return nil + } + + return errors.New("HTTP Transport can not be nil") + } +} + +// ConfigUserAgent sets the HTTP UserAgent for API requests. +func ConfigUserAgent(ua string) ConfigOption { + return func(cfg *Config) error { + if ua != "" { + cfg.UserAgent = ua + return nil + } + + return errors.New("user-agent can not be empty") + } +} + +// ConfigServiceName sets the service name logged +func ConfigServiceName(name string) ConfigOption { + return func(cfg *Config) error { + if name != "" { + cfg.ServiceName = name + } + + return nil + } +} + +// ConfigBaseURL sets the base URL used to make requests to the REST API V2. +func ConfigBaseURL(url string) ConfigOption { + return func(cfg *Config) error { + if url != "" { + cfg.Region().SetRestBaseURL(url) + return nil + } + + return errors.New("base URL can not be empty") + } +} + +// ConfigInfrastructureBaseURL sets the base URL used to make requests to the Infrastructure API. +func ConfigInfrastructureBaseURL(url string) ConfigOption { + return func(cfg *Config) error { + if url != "" { + cfg.Region().SetInfrastructureBaseURL(url) + return nil + } + + return errors.New("infrastructure base URL can not be empty") + } +} + +// ConfigSyntheticsBaseURL sets the base URL used to make requests to the Synthetics API. +func ConfigSyntheticsBaseURL(url string) ConfigOption { + return func(cfg *Config) error { + if url != "" { + cfg.Region().SetSyntheticsBaseURL(url) + return nil + } + + return errors.New("synthetics base URL can not be empty") + } +} + +// ConfigNerdGraphBaseURL sets the base URL used to make requests to the NerdGraph API. +func ConfigNerdGraphBaseURL(url string) ConfigOption { + return func(cfg *Config) error { + if url != "" { + cfg.Region().SetNerdGraphBaseURL(url) + return nil + } + + return errors.New("nerdgraph base URL can not be empty") + } +} + +// ConfigLogLevel sets the log level for the client. +func ConfigLogLevel(logLevel string) ConfigOption { + return func(cfg *Config) error { + if logLevel != "" { + cfg.LogLevel = logLevel + return nil + } + + return errors.New("log level can not be empty") + } +} + +// ConfigLogJSON toggles JSON formatting on for the logger if set to true. +func ConfigLogJSON(logJSON bool) ConfigOption { + return func(cfg *Config) error { + cfg.LogJSON = logJSON + return nil + } +} + +// ConfigLogger can be used to customize the client's logger. +// Custom loggers must conform to the logging.Logger interface. +func ConfigLogger(logger logging.Logger) ConfigOption { + return func(cfg *Config) error { + if logger != nil { + cfg.Logger = logger + return nil + } + + return errors.New("logger can not be nil") + } +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/contextkeys/contextkeys.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/contextkeys/contextkeys.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/contextkeys/contextkeys.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/contextkeys/contextkeys.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration.go new file mode 100644 index 00000000000..30ff7d9d55b --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration.go @@ -0,0 +1,24 @@ +package customeradministration + +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 Customeradministration struct { + client http.Client + logger logging.Logger + config config.Config +} + +func New(config config.Config) Customeradministration { + client := http.NewClient(config) + + pkg := Customeradministration{ + client: client, + logger: config.GetLogger(), + config: config, + } + return pkg +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration_api.go new file mode 100644 index 00000000000..b6d6dfcd223 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/customeradministration_api.go @@ -0,0 +1,692 @@ +// Code generated by tutone: DO NOT EDIT +package customeradministration + +import "context" + +// Accessible account shares +func (a *Customeradministration) GetAccountShares( + cursor string, + filter OrganizationAccountShareFilterInput, + sort []OrganizationAccountShareSortInput, +) (*OrganizationAccountShareCollection, error) { + return a.GetAccountSharesWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// Accessible account shares +func (a *Customeradministration) GetAccountSharesWithContext( + ctx context.Context, + cursor string, + filter OrganizationAccountShareFilterInput, + sort []OrganizationAccountShareSortInput, +) (*OrganizationAccountShareCollection, error) { + + resp := accountSharesResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getAccountSharesQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.AccountShares, nil +} + +const getAccountSharesQuery = `query( + $filter: OrganizationAccountShareFilterInput!, + $sort: [OrganizationAccountShareSortInput!], +) { customerAdministration { accountShares( + filter: $filter, + sort: $sort, +) { + items { + accountId + id + limitingRole { + id + } + name + source { + id + name + } + target { + id + name + } + } + nextCursor +} } }` + +// accounts +func (a *Customeradministration) GetAccounts( + cursor string, + filter OrganizationAccountFilterInput, + sort []OrganizationAccountSortInput, +) (*OrganizationAccountCollection, error) { + return a.GetAccountsWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// accounts +func (a *Customeradministration) GetAccountsWithContext( + ctx context.Context, + cursor string, + filter OrganizationAccountFilterInput, + sort []OrganizationAccountSortInput, +) (*OrganizationAccountCollection, error) { + + resp := accountsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getAccountsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Accounts, nil +} + +const getAccountsQuery = `query( + $filter: OrganizationAccountFilterInput!, + $sort: [OrganizationAccountSortInput!], +) { customerAdministration { accounts( + filter: $filter, + sort: $sort, +) { + items { + createdAt + id + name + parentId + partnershipId + partnershipName + payMethod + regionCode + status + } + nextCursor + totalCount +} } }` + +// Authentication domains +func (a *Customeradministration) GetAuthenticationDomains( + cursor string, + filter OrganizationAuthenticationDomainFilterInput, + sort []OrganizationAuthenticationDomainSortInput, +) (*OrganizationAuthenticationDomainCollection, error) { + return a.GetAuthenticationDomainsWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// Authentication domains +func (a *Customeradministration) GetAuthenticationDomainsWithContext( + ctx context.Context, + cursor string, + filter OrganizationAuthenticationDomainFilterInput, + sort []OrganizationAuthenticationDomainSortInput, +) (*OrganizationAuthenticationDomainCollection, error) { + + resp := authenticationDomainsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getAuthenticationDomainsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.AuthenticationDomains, nil +} + +const getAuthenticationDomainsQuery = `query( + $filter: OrganizationAuthenticationDomainFilterInput!, + $sort: [OrganizationAuthenticationDomainSortInput!], +) { customerAdministration { authenticationDomains( + filter: $filter, + sort: $sort, +) { + items { + authenticationType + id + name + organizationId + provisioningType + } + nextCursor +} } }` + +// The `consumption` field is the entry point into a customer's consumption data that is scoped to the ID of the customer. +func (a *Customeradministration) GetConsumption( + customerId string, +) (*Consumption, error) { + return a.GetConsumptionWithContext(context.Background(), + customerId, + ) +} + +// The `consumption` field is the entry point into a customer's consumption data that is scoped to the ID of the customer. +func (a *Customeradministration) GetConsumptionWithContext( + ctx context.Context, + customerId string, +) (*Consumption, error) { + + resp := consumptionResponse{} + vars := map[string]interface{}{ + "customerId": customerId, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getConsumptionQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Consumption, nil +} + +const getConsumptionQuery = `query( + $customerId: ID!, +) { customerAdministration { consumption( + customerId: $customerId, +) { + customerId +} } }` + +// Accessible contracts +func (a *Customeradministration) GetContracts( + cursor string, + filter OrganizationCustomerContractFilterInput, +) (*OrganizationCustomerContractWrapper, error) { + return a.GetContractsWithContext(context.Background(), + cursor, + filter, + ) +} + +// Accessible contracts +func (a *Customeradministration) GetContractsWithContext( + ctx context.Context, + cursor string, + filter OrganizationCustomerContractFilterInput, +) (*OrganizationCustomerContractWrapper, error) { + + resp := contractsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getContractsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Contracts, nil +} + +const getContractsQuery = `query { customerAdministration { contracts { + items { + billingStructure + customerId + id + organizationGroups { + items { + id + name + } + nextCursor + } + telemetryId + } + nextCursor +} } }` + +// list of grants +func (a *Customeradministration) GetGrants( + cursor string, + filter MultiTenantAuthorizationGrantFilterInputExpression, + sort []MultiTenantAuthorizationGrantSortInput, +) (*MultiTenantAuthorizationGrantCollection, error) { + return a.GetGrantsWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// list of grants +func (a *Customeradministration) GetGrantsWithContext( + ctx context.Context, + cursor string, + filter MultiTenantAuthorizationGrantFilterInputExpression, + sort []MultiTenantAuthorizationGrantSortInput, +) (*MultiTenantAuthorizationGrantCollection, error) { + + resp := grantsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getGrantsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Grants, nil +} + +const getGrantsQuery = `query( + $filter: MultiTenantAuthorizationGrantFilterInputExpression!, + $sort: [MultiTenantAuthorizationGrantSortInput!], +) { customerAdministration { grants( + filter: $filter, + sort: $sort, +) { + items { + group { + id + } + id + role { + id + name + } + scope { + id + type + } + } + nextCursor +} } }` + +// Named sets of New Relic users within an authentication domain +func (a *Customeradministration) GetGroups( + cursor string, + filter MultiTenantIdentityGroupFilterInput, + sort []MultiTenantIdentityGroupSortInput, +) (*MultiTenantIdentityGroupCollection, error) { + return a.GetGroupsWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// Named sets of New Relic users within an authentication domain +func (a *Customeradministration) GetGroupsWithContext( + ctx context.Context, + cursor string, + filter MultiTenantIdentityGroupFilterInput, + sort []MultiTenantIdentityGroupSortInput, +) (*MultiTenantIdentityGroupCollection, error) { + + resp := groupsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getGroupsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Groups, nil +} + +const getGroupsQuery = `query( + $filter: MultiTenantIdentityGroupFilterInput!, + $sort: [MultiTenantIdentityGroupSortInput!], +) { customerAdministration { groups( + filter: $filter, + sort: $sort, +) { + items { + authenticationDomainId + id + name + users { + items { + email + id + name + timeZone + } + nextCursor + totalCount + } + } + nextCursor + totalCount +} } }` + +// This provides access to fields you can use to check the status of asynchronous jobs related to customer administration. +func (a *Customeradministration) GetJobs() (*CustomerAdministrationJobs, error) { + return a.GetJobsWithContext(context.Background()) +} + +// This provides access to fields you can use to check the status of asynchronous jobs related to customer administration. +func (a *Customeradministration) GetJobsWithContext( + ctx context.Context, +) (*CustomerAdministrationJobs, error) { + + resp := jobsResponse{} + vars := map[string]interface{}{} + + if err := a.client.NerdGraphQueryWithContext(ctx, getJobsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Jobs, nil +} + +const getJobsQuery = `query { customerAdministration { jobs { + +} } }` + +// Organization Create job results +func (a *Customeradministration) GetOrganizationCreateAsyncResults( + cursor string, + filter OrganizationOrganizationCreateAsyncResultFilterInput, +) (*OrganizationOrganizationCreateAsyncResultCollection, error) { + return a.GetOrganizationCreateAsyncResultsWithContext(context.Background(), + cursor, + filter, + ) +} + +// Organization Create job results +func (a *Customeradministration) GetOrganizationCreateAsyncResultsWithContext( + ctx context.Context, + cursor string, + filter OrganizationOrganizationCreateAsyncResultFilterInput, +) (*OrganizationOrganizationCreateAsyncResultCollection, error) { + + resp := organizationCreateAsyncResultsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getOrganizationCreateAsyncResultsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Jobs.OrganizationCreateAsyncResults, nil +} + +const getOrganizationCreateAsyncResultsQuery = `query( + $filter: OrganizationOrganizationCreateAsyncResultFilterInput!, +) { customerAdministration { jobs { organizationCreateAsyncResults( + filter: $filter, +) { + items { + customer { + customerId + } + job { + createdUtc + errorMessage + finishedUtc + id + status + } + organization { + id + name + } + } + nextCursor +} } } }` + +// Accessible organizations +func (a *Customeradministration) GetOrganizations( + cursor string, + filter OrganizationCustomerOrganizationFilterInput, +) (*OrganizationCustomerOrganizationWrapper, error) { + return a.GetOrganizationsWithContext(context.Background(), + cursor, + filter, + ) +} + +// Accessible organizations +func (a *Customeradministration) GetOrganizationsWithContext( + ctx context.Context, + cursor string, + filter OrganizationCustomerOrganizationFilterInput, +) (*OrganizationCustomerOrganizationWrapper, error) { + + resp := organizationsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getOrganizationsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Organizations, nil +} + +const getOrganizationsQuery = `query { customerAdministration { organizations { + items { + contractId + customerId + id + name + } + nextCursor +} } }` + +// list of permissions +func (a *Customeradministration) GetPermissions( + cursor string, + filter MultiTenantAuthorizationPermissionFilter, +) (*MultiTenantAuthorizationPermissionCollection, error) { + return a.GetPermissionsWithContext(context.Background(), + cursor, + filter, + ) +} + +// list of permissions +func (a *Customeradministration) GetPermissionsWithContext( + ctx context.Context, + cursor string, + filter MultiTenantAuthorizationPermissionFilter, +) (*MultiTenantAuthorizationPermissionCollection, error) { + + resp := permissionsResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getPermissionsQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Permissions, nil +} + +const getPermissionsQuery = `query { customerAdministration { permissions { + items { + category + feature + id + name + product + } + nextCursor +} } }` + +// list of roles +func (a *Customeradministration) GetRoles( + cursor string, + filter MultiTenantAuthorizationRoleFilterInputExpression, + sort []MultiTenantAuthorizationRoleSortInput, +) (*MultiTenantAuthorizationRoleCollection, error) { + return a.GetRolesWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// list of roles +func (a *Customeradministration) GetRolesWithContext( + ctx context.Context, + cursor string, + filter MultiTenantAuthorizationRoleFilterInputExpression, + sort []MultiTenantAuthorizationRoleSortInput, +) (*MultiTenantAuthorizationRoleCollection, error) { + + resp := rolesResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getRolesQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Roles, nil +} + +const getRolesQuery = `query( + $filter: MultiTenantAuthorizationRoleFilterInputExpression!, + $sort: [MultiTenantAuthorizationRoleSortInput!], +) { customerAdministration { roles( + filter: $filter, + sort: $sort, +) { + items { + id + name + scope + type + } + nextCursor + totalCount +} } }` + +// The authenticated `User` who made this request. +func (a *Customeradministration) GetUser() (*User, error) { + return a.GetUserWithContext(context.Background()) +} + +// The authenticated `User` who made this request. +func (a *Customeradministration) GetUserWithContext( + ctx context.Context, +) (*User, error) { + + resp := userResponse{} + vars := map[string]interface{}{} + + if err := a.client.NerdGraphQueryWithContext(ctx, getUserQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.User, nil +} + +const getUserQuery = `query { customerAdministration { user { + email + id + name +} } }` + +// A collection of New Relic users +func (a *Customeradministration) GetUsers( + cursor string, + filter MultiTenantIdentityUserFilterInput, + sort []MultiTenantIdentityUserSortInput, +) (*MultiTenantIdentityUserCollection, error) { + return a.GetUsersWithContext(context.Background(), + cursor, + filter, + sort, + ) +} + +// A collection of New Relic users +func (a *Customeradministration) GetUsersWithContext( + ctx context.Context, + cursor string, + filter MultiTenantIdentityUserFilterInput, + sort []MultiTenantIdentityUserSortInput, +) (*MultiTenantIdentityUserCollection, error) { + + resp := usersResponse{} + vars := map[string]interface{}{ + "cursor": cursor, + "filter": filter, + "sort": sort, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getUsersQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.CustomerAdministration.Users, nil +} + +const getUsersQuery = `query( + $filter: MultiTenantIdentityUserFilterInput!, + $sort: [MultiTenantIdentityUserSortInput!], +) { customerAdministration { users( + filter: $filter, + sort: $sort, +) { + items { + authenticationDomainId + email + emailVerificationState + groups { + items { + id + name + } + nextCursor + totalCount + } + id + lastActive + name + pendingUpgradeRequest { + id + message + requestedUserType { + id + name + } + } + timeZone + type { + id + name + } + } + nextCursor + totalCount +} } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/types.go new file mode 100644 index 00000000000..d2fdb16ac4c --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/customeradministration/types.go @@ -0,0 +1,2053 @@ +// Code generated by tutone: DO NOT EDIT +package customeradministration + +import ( + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" +) + +// DashboardEntityPermissions - Permisions that represent visibility & editability +type DashboardEntityPermissions string + +var DashboardEntityPermissionsTypes = struct { + // Private + PRIVATE DashboardEntityPermissions + // Public read only + PUBLIC_READ_ONLY DashboardEntityPermissions + // Public read & write + PUBLIC_READ_WRITE DashboardEntityPermissions +}{ + // Private + PRIVATE: "PRIVATE", + // Public read only + PUBLIC_READ_ONLY: "PUBLIC_READ_ONLY", + // Public read & write + PUBLIC_READ_WRITE: "PUBLIC_READ_WRITE", +} + +// DashboardPermissions - Permissions that represent visibility & editing. +type DashboardPermissions string + +var DashboardPermissionsTypes = struct { + // Only you can see the dashboard. Everything but the metadata is hidden. + PRIVATE DashboardPermissions + // All users are able to see the dashboard, but only you have full rights to work with the dashboard. Other users can access the dashboard but are not able to edit or delete it, although they can duplicate it. + PUBLIC_READ_ONLY DashboardPermissions + // All users have full rights to the dashboard. + PUBLIC_READ_WRITE DashboardPermissions +}{ + // Only you can see the dashboard. Everything but the metadata is hidden. + PRIVATE: "PRIVATE", + // All users are able to see the dashboard, but only you have full rights to work with the dashboard. Other users can access the dashboard but are not able to edit or delete it, although they can duplicate it. + PUBLIC_READ_ONLY: "PUBLIC_READ_ONLY", + // All users have full rights to the dashboard. + PUBLIC_READ_WRITE: "PUBLIC_READ_WRITE", +} + +// MultiTenantAuthorizationGrantScopeEnum - Provides the types of grant scopes available +type MultiTenantAuthorizationGrantScopeEnum string + +var MultiTenantAuthorizationGrantScopeEnumTypes = struct { + // Grant scoped to an account + ACCOUNT MultiTenantAuthorizationGrantScopeEnum + // Grant scoped to a group + GROUP MultiTenantAuthorizationGrantScopeEnum + // Grant scoped to an organization + ORGANIZATION MultiTenantAuthorizationGrantScopeEnum +}{ + // Grant scoped to an account + ACCOUNT: "ACCOUNT", + // Grant scoped to a group + GROUP: "GROUP", + // Grant scoped to an organization + ORGANIZATION: "ORGANIZATION", +} + +// MultiTenantAuthorizationGrantSortEnum - The possible fields a grant can be sorted on +type MultiTenantAuthorizationGrantSortEnum string + +var MultiTenantAuthorizationGrantSortEnumTypes = struct { + // Id of the grant + ID MultiTenantAuthorizationGrantSortEnum +}{ + // Id of the grant + ID: "ID", +} + +// MultiTenantAuthorizationPermissionCategoryEnum - The kind of access granted by permissions +type MultiTenantAuthorizationPermissionCategoryEnum string + +var MultiTenantAuthorizationPermissionCategoryEnumTypes = struct { + // Delete access + DELETE MultiTenantAuthorizationPermissionCategoryEnum + // Create and update access + MANAGE MultiTenantAuthorizationPermissionCategoryEnum + // Create and update access + MODIFY MultiTenantAuthorizationPermissionCategoryEnum + // Other access + OTHER MultiTenantAuthorizationPermissionCategoryEnum + // View access + READ MultiTenantAuthorizationPermissionCategoryEnum + // View access + VIEW MultiTenantAuthorizationPermissionCategoryEnum +}{ + // Delete access + DELETE: "DELETE", + // Create and update access + MANAGE: "MANAGE", + // Create and update access + MODIFY: "MODIFY", + // Other access + OTHER: "OTHER", + // View access + READ: "READ", + // View access + VIEW: "VIEW", +} + +// MultiTenantAuthorizationRoleScopeEnum - Enumerations of role scopes +type MultiTenantAuthorizationRoleScopeEnum string + +var MultiTenantAuthorizationRoleScopeEnumTypes = struct { + // Account scoped role + ACCOUNT MultiTenantAuthorizationRoleScopeEnum + // Group scoped role + GROUP MultiTenantAuthorizationRoleScopeEnum + // Organization scoped role + ORGANIZATION MultiTenantAuthorizationRoleScopeEnum +}{ + // Account scoped role + ACCOUNT: "ACCOUNT", + // Group scoped role + GROUP: "GROUP", + // Organization scoped role + ORGANIZATION: "ORGANIZATION", +} + +// MultiTenantAuthorizationRoleSortEnum - The list of sortable fields +type MultiTenantAuthorizationRoleSortEnum string + +var MultiTenantAuthorizationRoleSortEnumTypes = struct { + // Id of the role + ID MultiTenantAuthorizationRoleSortEnum + // Name of the role + NAME MultiTenantAuthorizationRoleSortEnum + // Scope of the role + SCOPE MultiTenantAuthorizationRoleSortEnum + // Type of the role + TYPE MultiTenantAuthorizationRoleSortEnum +}{ + // Id of the role + ID: "ID", + // Name of the role + NAME: "NAME", + // Scope of the role + SCOPE: "SCOPE", + // Type of the role + TYPE: "TYPE", +} + +// MultiTenantAuthorizationRoleTypeEnum - Enumerations of role types +type MultiTenantAuthorizationRoleTypeEnum string + +var MultiTenantAuthorizationRoleTypeEnumTypes = struct { + // Custom role + CUSTOM MultiTenantAuthorizationRoleTypeEnum + // Standard role + STANDARD MultiTenantAuthorizationRoleTypeEnum +}{ + // Custom role + CUSTOM: "CUSTOM", + // Standard role + STANDARD: "STANDARD", +} + +// MultiTenantAuthorizationSortDirectionEnum - Provides the directions data can be sorted +type MultiTenantAuthorizationSortDirectionEnum string + +var MultiTenantAuthorizationSortDirectionEnumTypes = struct { + // Sort in ascending order + ASCENDING MultiTenantAuthorizationSortDirectionEnum + // Sort in descending order + DESCENDING MultiTenantAuthorizationSortDirectionEnum +}{ + // Sort in ascending order + ASCENDING: "ASCENDING", + // Sort in descending order + DESCENDING: "DESCENDING", +} + +// MultiTenantIdentityCapability - Provides the types of group capabilities available +type MultiTenantIdentityCapability string + +var MultiTenantIdentityCapabilityTypes = struct { + // The capability to delete a group + DELETE_GROUP MultiTenantIdentityCapability + // The capability to grant membership to a group + GRANT_GROUP_MEMBERSHIP MultiTenantIdentityCapability + // The capability to revoke membership from a group + REVOKE_GROUP_MEMBERSHIP MultiTenantIdentityCapability + // The capability to update a group's display name + UPDATE_GROUP_NAME MultiTenantIdentityCapability +}{ + // The capability to delete a group + DELETE_GROUP: "DELETE_GROUP", + // The capability to grant membership to a group + GRANT_GROUP_MEMBERSHIP: "GRANT_GROUP_MEMBERSHIP", + // The capability to revoke membership from a group + REVOKE_GROUP_MEMBERSHIP: "REVOKE_GROUP_MEMBERSHIP", + // The capability to update a group's display name + UPDATE_GROUP_NAME: "UPDATE_GROUP_NAME", +} + +// MultiTenantIdentityEmailVerificationState - Email verification validates that a user's email address exists and can receive email. One of: "Not Verifiable", "Verified", and "Pending". +type MultiTenantIdentityEmailVerificationState string + +var MultiTenantIdentityEmailVerificationStateTypes = struct { + // The user's email does not require verification. + NOT_VERIFIABLE MultiTenantIdentityEmailVerificationState + // The user's email requires verification and has not been verified. + PENDING MultiTenantIdentityEmailVerificationState + // The user's email requires verification and has been verified. + VERIFIED MultiTenantIdentityEmailVerificationState +}{ + // The user's email does not require verification. + NOT_VERIFIABLE: "NOT_VERIFIABLE", + // The user's email requires verification and has not been verified. + PENDING: "PENDING", + // The user's email requires verification and has been verified. + VERIFIED: "VERIFIED", +} + +// MultiTenantIdentitySortDirection - Available directions for sorting +type MultiTenantIdentitySortDirection string + +var MultiTenantIdentitySortDirectionTypes = struct { + // Sort in ascending order + ASCENDING MultiTenantIdentitySortDirection + // Sort in descending order + DESCENDING MultiTenantIdentitySortDirection +}{ + // Sort in ascending order + ASCENDING: "ASCENDING", + // Sort in descending order + DESCENDING: "DESCENDING", +} + +// MultiTenantIdentitySortKeyEnum - Available keys for sorting groups +type MultiTenantIdentitySortKeyEnum string + +var MultiTenantIdentitySortKeyEnumTypes = struct { + // Authentication domain ID + AUTHENTICATION_DOMAIN_ID MultiTenantIdentitySortKeyEnum + // Group ID + ID MultiTenantIdentitySortKeyEnum + // Group name + NAME MultiTenantIdentitySortKeyEnum +}{ + // Authentication domain ID + AUTHENTICATION_DOMAIN_ID: "AUTHENTICATION_DOMAIN_ID", + // Group ID + ID: "ID", + // Group name + NAME: "NAME", +} + +// MultiTenantIdentityUserSortKey - Available keys for sorting users +type MultiTenantIdentityUserSortKey string + +var MultiTenantIdentityUserSortKeyTypes = struct { + // User email address + EMAIL MultiTenantIdentityUserSortKey + // User id + ID MultiTenantIdentityUserSortKey + // User last active date + LAST_ACTIVE MultiTenantIdentityUserSortKey + // User name + NAME MultiTenantIdentityUserSortKey + // User type + TYPE MultiTenantIdentityUserSortKey +}{ + // User email address + EMAIL: "EMAIL", + // User id + ID: "ID", + // User last active date + LAST_ACTIVE: "LAST_ACTIVE", + // User name + NAME: "NAME", + // User type + TYPE: "TYPE", +} + +// OrganizationAccountShareSortDirectionEnum - Provides the available values of possible directions to sort the result +type OrganizationAccountShareSortDirectionEnum string + +var OrganizationAccountShareSortDirectionEnumTypes = struct { + // Sort in ascending order + ASCENDING OrganizationAccountShareSortDirectionEnum + // Sort in descending order + DESCENDING OrganizationAccountShareSortDirectionEnum +}{ + // Sort in ascending order + ASCENDING: "ASCENDING", + // Sort in descending order + DESCENDING: "DESCENDING", +} + +// OrganizationAccountShareSortKeyEnum - Provides the available values of possible fields that can be sorted +type OrganizationAccountShareSortKeyEnum string + +var OrganizationAccountShareSortKeyEnumTypes = struct { + // Account id + ACCOUNT_ID OrganizationAccountShareSortKeyEnum + // Name of the target organization the account is shared with + TARGET_ORGANIZATION_NAME OrganizationAccountShareSortKeyEnum +}{ + // Account id + ACCOUNT_ID: "ACCOUNT_ID", + // Name of the target organization the account is shared with + TARGET_ORGANIZATION_NAME: "TARGET_ORGANIZATION_NAME", +} + +// OrganizationAccountSortDirectionEnum - Provides the available values of possible directions to sort the result +type OrganizationAccountSortDirectionEnum string + +var OrganizationAccountSortDirectionEnumTypes = struct { + // Sort in ascending order + ASCENDING OrganizationAccountSortDirectionEnum + // Sort in descending order + DESCENDING OrganizationAccountSortDirectionEnum +}{ + // Sort in ascending order + ASCENDING: "ASCENDING", + // Sort in descending order + DESCENDING: "DESCENDING", +} + +// OrganizationAccountSortKeyEnum - Provides the available values of possible fields that can be sorted +type OrganizationAccountSortKeyEnum string + +var OrganizationAccountSortKeyEnumTypes = struct { + // Account ID + ID OrganizationAccountSortKeyEnum + // Account Name + NAME OrganizationAccountSortKeyEnum +}{ + // Account ID + ID: "ID", + // Account Name + NAME: "NAME", +} + +// OrganizationAccountStatus - Provides the types of account statuses available +type OrganizationAccountStatus string + +var OrganizationAccountStatusTypes = struct { + // Accounts that are not in canceled status + ACTIVE OrganizationAccountStatus + // Accounts that have been canceled + CANCELED OrganizationAccountStatus +}{ + // Accounts that are not in canceled status + ACTIVE: "ACTIVE", + // Accounts that have been canceled + CANCELED: "CANCELED", +} + +// OrganizationAuthenticationTypeEnum - Provides the available values for authentication type +type OrganizationAuthenticationTypeEnum string + +var OrganizationAuthenticationTypeEnumTypes = struct { + // Authentication not configured + DISABLED OrganizationAuthenticationTypeEnum + // Heroku Single Sign-On + HEROKU_SSO OrganizationAuthenticationTypeEnum + // Oidc Single Sign-On + OIDC_SSO OrganizationAuthenticationTypeEnum + // Username and password authentication + PASSWORD OrganizationAuthenticationTypeEnum + // SAML Single Sign-On + SAML_SSO OrganizationAuthenticationTypeEnum +}{ + // Authentication not configured + DISABLED: "DISABLED", + // Heroku Single Sign-On + HEROKU_SSO: "HEROKU_SSO", + // Oidc Single Sign-On + OIDC_SSO: "OIDC_SSO", + // Username and password authentication + PASSWORD: "PASSWORD", + // SAML Single Sign-On + SAML_SSO: "SAML_SSO", +} + +// OrganizationBillingStructure - Valid billing structure values +type OrganizationBillingStructure string + +var OrganizationBillingStructureTypes = struct { + // Account Hierarchy + ACCOUNT_HIERARCHY OrganizationBillingStructure + // Customer Contract + CUSTOMER_CONTRACT OrganizationBillingStructure + // Unstructured + UNSTRUCTURED OrganizationBillingStructure +}{ + // Account Hierarchy + ACCOUNT_HIERARCHY: "ACCOUNT_HIERARCHY", + // Customer Contract + CUSTOMER_CONTRACT: "CUSTOMER_CONTRACT", + // Unstructured + UNSTRUCTURED: "UNSTRUCTURED", +} + +// OrganizationOrganizationCreateJobResultStatusEnum - The possible status values for job results +type OrganizationOrganizationCreateJobResultStatusEnum string + +var OrganizationOrganizationCreateJobResultStatusEnumTypes = struct { + // Jobs that have been created but not yet started running + CREATED OrganizationOrganizationCreateJobResultStatusEnum + // Jobs that have failed and stopped running + FAILED OrganizationOrganizationCreateJobResultStatusEnum + // Jobs that are still running + RUNNING OrganizationOrganizationCreateJobResultStatusEnum + // Jobs that completed successfully + SUCCEEDED OrganizationOrganizationCreateJobResultStatusEnum +}{ + // Jobs that have been created but not yet started running + CREATED: "CREATED", + // Jobs that have failed and stopped running + FAILED: "FAILED", + // Jobs that are still running + RUNNING: "RUNNING", + // Jobs that completed successfully + SUCCEEDED: "SUCCEEDED", +} + +// OrganizationOrganizationCreateJobStatusEnum - The list of valid job statuses to search for +type OrganizationOrganizationCreateJobStatusEnum string + +var OrganizationOrganizationCreateJobStatusEnumTypes = struct { + // All jobs regardless of status + ALL OrganizationOrganizationCreateJobStatusEnum + // Jobs that have been created but not yet started running + CREATED OrganizationOrganizationCreateJobStatusEnum + // Jobs that have failed and stopped running + FAILED OrganizationOrganizationCreateJobStatusEnum + // Jobs that are still running + RUNNING OrganizationOrganizationCreateJobStatusEnum + // Jobs that completed successfully + SUCCEEDED OrganizationOrganizationCreateJobStatusEnum +}{ + // All jobs regardless of status + ALL: "ALL", + // Jobs that have been created but not yet started running + CREATED: "CREATED", + // Jobs that have failed and stopped running + FAILED: "FAILED", + // Jobs that are still running + RUNNING: "RUNNING", + // Jobs that completed successfully + SUCCEEDED: "SUCCEEDED", +} + +// OrganizationProvisioningTypeEnum - Provides the available values for provisioning type +type OrganizationProvisioningTypeEnum string + +var OrganizationProvisioningTypeEnumTypes = struct { + // Provisioning not configured + DISABLED OrganizationProvisioningTypeEnum + // Manual provisioning + MANUAL OrganizationProvisioningTypeEnum + // SCIM automated provisioning + SCIM OrganizationProvisioningTypeEnum +}{ + // Provisioning not configured + DISABLED: "DISABLED", + // Manual provisioning + MANUAL: "MANUAL", + // SCIM automated provisioning + SCIM: "SCIM", +} + +// OrganizationSharingMode - Provides the types of sharing modes available +type OrganizationSharingMode string + +var OrganizationSharingModeTypes = struct { + // Accounts that are accessible to this organization + ALL OrganizationSharingMode + // Accounts that are managed by this organization + MANAGED OrganizationSharingMode + // Accounts managed by this organization that are currently shared with other organizations + SHARED_WITH_OTHER_ORGANIZATIONS OrganizationSharingMode + // Accounts that are shared with this organization + SHARED_WITH_THIS_ORGANIZATION OrganizationSharingMode +}{ + // Accounts that are accessible to this organization + ALL: "ALL", + // Accounts that are managed by this organization + MANAGED: "MANAGED", + // Accounts managed by this organization that are currently shared with other organizations + SHARED_WITH_OTHER_ORGANIZATIONS: "SHARED_WITH_OTHER_ORGANIZATIONS", + // Accounts that are shared with this organization + SHARED_WITH_THIS_ORGANIZATION: "SHARED_WITH_THIS_ORGANIZATION", +} + +// OrganizationSortDirectionEnum - Provides the available values of possible directions to sort the result +type OrganizationSortDirectionEnum string + +var OrganizationSortDirectionEnumTypes = struct { + // Sort in ascending order + ASCENDING OrganizationSortDirectionEnum + // Sort in descending order + DESCENDING OrganizationSortDirectionEnum +}{ + // Sort in ascending order + ASCENDING: "ASCENDING", + // Sort in descending order + DESCENDING: "DESCENDING", +} + +// OrganizationSortKeyEnum - Provides the available values of possible fields that can be sorted +type OrganizationSortKeyEnum string + +var OrganizationSortKeyEnumTypes = struct { + // Authentication domain id + ID OrganizationSortKeyEnum + // Authentication domain name + NAME OrganizationSortKeyEnum +}{ + // Authentication domain id + ID: "ID", + // Authentication domain name + NAME: "NAME", +} + +// UserManagementGroupSortKey - Available keys for sorting groups +type UserManagementGroupSortKey string + +var UserManagementGroupSortKeyTypes = struct { + // Sort by display name + DISPLAY_NAME UserManagementGroupSortKey + // Sort by ID + ID UserManagementGroupSortKey +}{ + // Sort by display name + DISPLAY_NAME: "DISPLAY_NAME", + // Sort by ID + ID: "ID", +} + +// UserManagementSortDirection - Available directions for sorting +type UserManagementSortDirection string + +var UserManagementSortDirectionTypes = struct { + // Sort in ascending order + ASCENDING UserManagementSortDirection + // Sort in descending order + DESCENDING UserManagementSortDirection +}{ + // Sort in ascending order + ASCENDING: "ASCENDING", + // Sort in descending order + DESCENDING: "DESCENDING", +} + +// UserManagementTypeEnum - Available values for Type +type UserManagementTypeEnum string + +var UserManagementTypeEnumTypes = struct { + // Basic type + BASIC UserManagementTypeEnum + // Core type + CORE UserManagementTypeEnum + // Full type + FULL_PLATFORM UserManagementTypeEnum +}{ + // Basic type + BASIC: "BASIC", + // Core type + CORE: "CORE", + // Full type + FULL_PLATFORM: "FULL_PLATFORM", +} + +// AccountOutline - The `AccountOutline` object provides basic data about an account. +type AccountOutline struct { + ID int `json:"id,omitempty"` + Name string `json:"name,omitempty"` + // Returns event types that are currently reporting in the account. + ReportingEventTypes []string `json:"reportingEventTypes,omitempty"` +} + +// AccountReference - The `AccountReference` object provides basic identifying information about the account. +type AccountReference struct { + ID int `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} + +// AuthorizationManagementAuthenticationDomain - An "authentication domain" is a grouping of New Relic users governed by the same user management settings, like how they're provisioned (added and updated), how they're authenticated (logged in), session settings, and how user upgrades are managed. +type AuthorizationManagementAuthenticationDomain struct { + // container for groups enabling cursor based pagination + Groups AuthorizationManagementGroupSearch `json:"groups"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` +} + +// AuthorizationManagementAuthenticationDomainSearch - container for authentication domains enabling cursor based pagination +type AuthorizationManagementAuthenticationDomainSearch struct { + // containers of users and groups + AuthenticationDomains []AuthorizationManagementAuthenticationDomain `json:"authenticationDomains"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// AuthorizationManagementGrantedRole - A Granted Role represents the access given to a group. +type AuthorizationManagementGrantedRole struct { + // the account that this role grants access to + AccountID int `json:"accountId,omitempty"` + // the name of the object + DisplayName string `json:"displayName,omitempty"` + // the group that this role grants access to + GroupId string `json:"groupId,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` + // the organization this role grants access to + OrganizationId string `json:"organizationId,omitempty"` + // the role that defines this access + RoleId int `json:"roleId"` + // the type of the role + Type string `json:"type"` +} + +// AuthorizationManagementGrantedRoleSearch - container for roles enabling cursor based pagination +type AuthorizationManagementGrantedRoleSearch struct { + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the roles granted to this group + Roles []AuthorizationManagementGrantedRole `json:"roles"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// AuthorizationManagementGroup - For users on our New Relic One user model, a "group" represents a group of users. Putting users in a group allows the managing of permissions for multiple users at the same time. +type AuthorizationManagementGroup struct { + // the name of the object + DisplayName string `json:"displayName"` + // a value that uniquely identifies this object + ID string `json:"id"` + // container for roles enabling cursor based pagination + Roles AuthorizationManagementGrantedRoleSearch `json:"roles"` +} + +// AuthorizationManagementGroupSearch - container for groups enabling cursor based pagination +type AuthorizationManagementGroupSearch struct { + // contains roles granted to users's groups + Groups []AuthorizationManagementGroup `json:"groups"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// AuthorizationManagementRole - a role grants access on an account or organization to groups of users +type AuthorizationManagementRole struct { + // the name of the object + DisplayName string `json:"displayName,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` + // the scope of the role + Scope string `json:"scope"` + // the type of the role + Type string `json:"type"` +} + +// AuthorizationManagementRoleSearch - container for roles enabling cursor based pagination +type AuthorizationManagementRoleSearch struct { + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // control the access granted to groups + Roles []AuthorizationManagementRole `json:"roles"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +type Consumption struct { + // The `Consumption` object provides consumption data about a user. + CustomerId string `json:"customerId,omitempty"` +} + +// CustomerAdministration - The `CustomerAdministration` object contains fields for managing the configuration that defines the business relationships between New Relic, partners, and customers. +type CustomerAdministration struct { + // Accessible account shares + AccountShares OrganizationAccountShareCollection `json:"accountShares,omitempty"` + // accounts + Accounts OrganizationAccountCollection `json:"accounts,omitempty"` + // Authentication domains + AuthenticationDomains OrganizationAuthenticationDomainCollection `json:"authenticationDomains,omitempty"` + // The `consumption` field is the entry point into a customer's consumption data that is scoped to the ID of the customer. + Consumption Consumption `json:"consumption,omitempty"` + // Accessible contracts + Contracts OrganizationCustomerContractWrapper `json:"contracts,omitempty"` + // list of grants + Grants MultiTenantAuthorizationGrantCollection `json:"grants,omitempty"` + // Named sets of New Relic users within an authentication domain + Groups MultiTenantIdentityGroupCollection `json:"groups,omitempty"` + // This provides access to fields you can use to check the status of asynchronous jobs related to customer administration. + Jobs CustomerAdministrationJobs `json:"jobs,omitempty"` + // Accessible organizations + Organizations OrganizationCustomerOrganizationWrapper `json:"organizations,omitempty"` + // list of permissions + Permissions MultiTenantAuthorizationPermissionCollection `json:"permissions,omitempty"` + // list of roles + Roles MultiTenantAuthorizationRoleCollection `json:"roles,omitempty"` + // The authenticated `User` who made this request. + User User `json:"user,omitempty"` + // A collection of New Relic users + Users MultiTenantIdentityUserCollection `json:"users,omitempty"` +} + +type CustomerAdministrationJobs struct { + // Organization Create job results + OrganizationCreateAsyncResults OrganizationOrganizationCreateAsyncResultCollection `json:"organizationCreateAsyncResults,omitempty"` +} + +// MultiTenantAuthorizationGrant - A grant within the system +type MultiTenantAuthorizationGrant struct { + // The group associated to the grant + Group MultiTenantAuthorizationGrantGroup `json:"group"` + // The id of the grant + ID int `json:"id"` + // The role associated to the grant + Role MultiTenantAuthorizationGrantRole `json:"role"` + // The scope associated to the grant + Scope MultiTenantAuthorizationGrantScope `json:"scope"` +} + +// MultiTenantAuthorizationGrantAuthenticationDomainIdInputFilter - Filters grants by authentication domain id +type MultiTenantAuthorizationGrantAuthenticationDomainIdInputFilter struct { + // Performs an equals operation + Eq string `json:"eq,omitempty"` + // Performs an in operation + In []string `json:"in"` +} + +// MultiTenantAuthorizationGrantCollection - A list of grants +type MultiTenantAuthorizationGrantCollection struct { + // List of grants + Items []MultiTenantAuthorizationGrant `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// MultiTenantAuthorizationGrantFilterInputExpression - Provides all the available filters on a grant +type MultiTenantAuthorizationGrantFilterInputExpression struct { + // The authentication domain id of the grant + AuthenticationDomainId *MultiTenantAuthorizationGrantAuthenticationDomainIdInputFilter `json:"authenticationDomainId,omitempty"` + // The group id of the grant + GroupId *MultiTenantAuthorizationGrantGroupIdInputFilter `json:"groupId,omitempty"` + // The id of the grant + ID *MultiTenantAuthorizationGrantIdInputFilter `json:"id,omitempty"` + // The organization id the grant belongs to + OrganizationId *MultiTenantAuthorizationGrantOrganizationIdInputFilter `json:"organizationId,omitempty"` + // The role id of the grant + RoleId *MultiTenantAuthorizationGrantRoleIdInputFilter `json:"roleId,omitempty"` + // the scope id of the grant + ScopeId *MultiTenantAuthorizationGrantScopeIdInputFilter `json:"scopeId,omitempty"` + // The scope type of the grant + ScopeType *MultiTenantAuthorizationGrantScopeTypeInputFilter `json:"scopeType,omitempty"` +} + +// MultiTenantAuthorizationGrantGroup - The group associated to the grant +type MultiTenantAuthorizationGrantGroup struct { + // The id of the group + ID string `json:"id"` +} + +// MultiTenantAuthorizationGrantGroupIdInputFilter - Filters on grants group id +type MultiTenantAuthorizationGrantGroupIdInputFilter struct { + // Performs an equals operation + Eq string `json:"eq,omitempty"` + // Performs an in operation + In []string `json:"in"` +} + +// MultiTenantAuthorizationGrantIdInputFilter - Fitlers on grants id +type MultiTenantAuthorizationGrantIdInputFilter struct { + // Performs an equals operation + Eq int `json:"eq"` +} + +// MultiTenantAuthorizationGrantOrganizationIdInputFilter - Filters on the grants organization id +type MultiTenantAuthorizationGrantOrganizationIdInputFilter struct { + // Performs an equals operation + Eq string `json:"eq"` +} + +// MultiTenantAuthorizationGrantRole - The role associated to the grant +type MultiTenantAuthorizationGrantRole struct { + // The id of the role + ID int `json:"id"` + // The name of the role + Name string `json:"name"` +} + +// MultiTenantAuthorizationGrantRoleIdInputFilter - Filters on the grants role id +type MultiTenantAuthorizationGrantRoleIdInputFilter struct { + // Performs an equals operation + Eq int `json:"eq,omitempty"` + // Performs an in operation + In []int `json:"in"` +} + +// MultiTenantAuthorizationGrantScope - The scope associated to the grant +type MultiTenantAuthorizationGrantScope struct { + // The id of the resource in scope + ID string `json:"id"` + // The type of the resource in scope + Type MultiTenantAuthorizationGrantScopeEnum `json:"type"` +} + +// MultiTenantAuthorizationGrantScopeIdInputFilter - Filters on the grants scope id +type MultiTenantAuthorizationGrantScopeIdInputFilter struct { + // Performs an equals operation + Eq string `json:"eq,omitempty"` + // Performs an in operation + In []string `json:"in"` +} + +// MultiTenantAuthorizationGrantScopeTypeInputFilter - Filters on the grants scope type +type MultiTenantAuthorizationGrantScopeTypeInputFilter struct { + // Performs an equals operation + Eq MultiTenantAuthorizationGrantScopeEnum `json:"eq"` +} + +// MultiTenantAuthorizationGrantSortInput - Provides the sorting options for grants +type MultiTenantAuthorizationGrantSortInput struct { + // The direction which the field should be sorted + Direction MultiTenantAuthorizationSortDirectionEnum `json:"direction,omitempty"` + // The field to be sorted + Key MultiTenantAuthorizationGrantSortEnum `json:"key"` +} + +// MultiTenantAuthorizationPermission - An allowed action +type MultiTenantAuthorizationPermission struct { + // The kind of access + Category MultiTenantAuthorizationPermissionCategoryEnum `json:"category,omitempty"` + // The feature the permission controls access to + Feature string `json:"feature,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // Name of the permission if category is OTHER + Name string `json:"name,omitempty"` + // The product the permission controls access to + Product string `json:"product,omitempty"` +} + +// MultiTenantAuthorizationPermissionCollection - A collection of permissions +type MultiTenantAuthorizationPermissionCollection struct { + // collection of permissions + Items []MultiTenantAuthorizationPermission `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// MultiTenantAuthorizationPermissionFilter - Provides all the available filters on permissions +type MultiTenantAuthorizationPermissionFilter struct { + // Filter permissions by role id + RoleId MultiTenantAuthorizationPermissionFilterRoleIdInput `json:"roleId,omitempty"` +} + +// MultiTenantAuthorizationPermissionFilterRoleIdInput - Filter permissions by role id +type MultiTenantAuthorizationPermissionFilterRoleIdInput struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// MultiTenantAuthorizationRole - Describes a role within the system +type MultiTenantAuthorizationRole struct { + // a value that uniquely identifies this object + ID int `json:"id"` + // the name of the object + Name string `json:"name"` + // The scope the role applies to + Scope string `json:"scope"` + // The type of role + Type string `json:"type"` +} + +// MultiTenantAuthorizationRoleCollection - An iterable collection of roles +type MultiTenantAuthorizationRoleCollection struct { + // collection of roles + Items []MultiTenantAuthorizationRole `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// MultiTenantAuthorizationRoleFilterInputExpression - Provides all the available filters on a role +type MultiTenantAuthorizationRoleFilterInputExpression struct { + // The group id the role has been granted to + GroupId *MultiTenantAuthorizationRoleGroupIdInputFilter `json:"groupId,omitempty"` + // The id of the role + ID *MultiTenantAuthorizationRoleIdInputFilter `json:"id,omitempty"` + // The name of the role + Name *MultiTenantAuthorizationRoleNameInputFilter `json:"name,omitempty"` + // The organization id the role belongs to + OrganizationId *MultiTenantAuthorizationRoleOrganizationIdInputFilter `json:"organizationId,omitempty"` + // The scope of the role + Scope *MultiTenantAuthorizationRoleScopeInputFilter `json:"scope,omitempty"` + // The type of the role + Type *MultiTenantAuthorizationRoleTypeInputFilter `json:"type,omitempty"` +} + +// MultiTenantAuthorizationRoleGroupIdInputFilter - Provides all the available filters on the group id +type MultiTenantAuthorizationRoleGroupIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq,omitempty"` + // A list of group IDs + In []string `json:"in"` +} + +// MultiTenantAuthorizationRoleIdInputFilter - Provides all the available filters on the role id +type MultiTenantAuthorizationRoleIdInputFilter struct { + // performs an equals operation + Eq int `json:"eq"` +} + +// MultiTenantAuthorizationRoleNameInputFilter - Provides all the available filters on the role name +type MultiTenantAuthorizationRoleNameInputFilter struct { + // performs a contains operation + Contains string `json:"contains,omitempty"` + // performs an equals operation + Eq string `json:"eq,omitempty"` +} + +// MultiTenantAuthorizationRoleOrganizationIdInputFilter - Provides all the available filters on the organization id +type MultiTenantAuthorizationRoleOrganizationIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// MultiTenantAuthorizationRoleScopeInputFilter - Provides all the available filters on the role scope +type MultiTenantAuthorizationRoleScopeInputFilter struct { + // performs an equals operation + Eq MultiTenantAuthorizationRoleScopeEnum `json:"eq"` +} + +// MultiTenantAuthorizationRoleSortInput - Provides the field and direction the result should be sorted +type MultiTenantAuthorizationRoleSortInput struct { + // The direction the field should be sorted + Direction MultiTenantAuthorizationSortDirectionEnum `json:"direction,omitempty"` + // The field which should be sorted + Key MultiTenantAuthorizationRoleSortEnum `json:"key"` +} + +// MultiTenantAuthorizationRoleTypeInputFilter - Provides all the available filters on the role type +type MultiTenantAuthorizationRoleTypeInputFilter struct { + // performs an equals operation + Eq MultiTenantAuthorizationRoleTypeEnum `json:"eq"` +} + +// MultiTenantIdentityAllowsCapabilityInput - The input object representing parameters for the allowed capability filter +type MultiTenantIdentityAllowsCapabilityInput struct { + // A list of capabilities. If set, groups with atleast one of the given capabilities granted on them for the user will be returned. Otherwise, only groups with read access granted are returned. + In []MultiTenantIdentityCapability `json:"in"` +} + +// MultiTenantIdentityAuthenticationDomainIdInput - The input object representing parameters for the authentication domain ID filter +type MultiTenantIdentityAuthenticationDomainIdInput struct { + // An authentication domain ID + Eq string `json:"eq"` +} + +// MultiTenantIdentityEmailVerificationStateInput - Available filtering types for email verification states +type MultiTenantIdentityEmailVerificationStateInput struct { + // An email verification state + Pending bool `json:"pending"` +} + +// MultiTenantIdentityGroup - For users on our New Relic One user model, a "group" represents a group of users. Putting users in a group allows the managing of permissions for multiple users at the same time. +type MultiTenantIdentityGroup struct { + // The authentication domain the group belongs to + AuthenticationDomainId string `json:"authenticationDomainId"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` + // Active users belonging to a group + Users MultiTenantIdentityGroupUsers `json:"users,omitempty"` +} + +// MultiTenantIdentityGroupCollection - List of groups representing named sets of New Relic users within an authentication domain +type MultiTenantIdentityGroupCollection struct { + // groups + Items []MultiTenantIdentityGroup `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// MultiTenantIdentityGroupFilterInput - The input object representing the filter parameters for groups +type MultiTenantIdentityGroupFilterInput struct { + // Filter groups by capabilities + AllowsCapability *MultiTenantIdentityAllowsCapabilityInput `json:"allowsCapability,omitempty"` + // Filter groups by authentication domain + AuthenticationDomainId *MultiTenantIdentityAuthenticationDomainIdInput `json:"authenticationDomainId,omitempty"` + // Filter groups by ID + ID *MultiTenantIdentityGroupIdInput `json:"id,omitempty"` + // Filter groups that contain specific members + Members *MultiTenantIdentityGroupMemberIdInput `json:"members,omitempty"` + // Filter groups by display name + Name *MultiTenantIdentityGroupNameInput `json:"name,omitempty"` + // An organization ID to filter groups by + OrganizationId *MultiTenantIdentityOrganizationIdInput `json:"organizationId,omitempty"` +} + +// MultiTenantIdentityGroupIdInput - The input object representing parameters for the ID input filter +type MultiTenantIdentityGroupIdInput struct { + // A group ID + Eq string `json:"eq"` +} + +// MultiTenantIdentityGroupMemberIdInput - The input object representing parameters for the Members filter +type MultiTenantIdentityGroupMemberIdInput struct { + // A list of user IDs. A group will be returned if all listed users are members. + Contains []string `json:"contains"` + // A list of user IDS. A group will be returned if no listed users are members. + Excludes []string `json:"excludes"` +} + +// MultiTenantIdentityGroupNameInput - The input object representing parameters for the name filter +type MultiTenantIdentityGroupNameInput struct { + // Part of a group name + Contains string `json:"contains,omitempty"` + // A group name + Eq string `json:"eq,omitempty"` +} + +// MultiTenantIdentityGroupSortInput - The input object representing the sort parameters for groups +type MultiTenantIdentityGroupSortInput struct { + // Order by which to sort groups + Direction MultiTenantIdentitySortDirection `json:"direction,omitempty"` + // Group attribute to sort on + Key MultiTenantIdentitySortKeyEnum `json:"key,omitempty"` +} + +// MultiTenantIdentityGroupUser - Active user within group +type MultiTenantIdentityGroupUser struct { + // The email of the user. + Email string `json:"email"` + // a value that uniquely identifies this object + ID string `json:"id"` + // The full name of the user. + Name string `json:"name"` + // The configured time zone of the user. + TimeZone string `json:"timeZone,omitempty"` +} + +// MultiTenantIdentityGroupUserFilterInput - The input object representing the filter parameters for user groups +type MultiTenantIdentityGroupUserFilterInput struct { + // Filter users by IDs + ID *MultiTenantIdentityUserIdInput `json:"id,omitempty"` +} + +// MultiTenantIdentityGroupUsers - List of active users belonging to a group +type MultiTenantIdentityGroupUsers struct { + // Active users within group + Items []MultiTenantIdentityGroupUser `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// MultiTenantIdentityOrganizationIdInput - The input object representing parameters for the organization ID filter +type MultiTenantIdentityOrganizationIdInput struct { + // An organization ID + Eq string `json:"eq"` +} + +// MultiTenantIdentityPendingUpgradeRequest - Exists only if a user has a pending upgrade request. +type MultiTenantIdentityPendingUpgradeRequest struct { + // a value that uniquely identifies this object + ID string `json:"id"` + // Requester message, why the user believes they require the upgrade. + Message string `json:"message,omitempty"` + // Requested user type for the user. + RequestedUserType MultiTenantIdentityUserType `json:"requestedUserType,omitempty"` +} + +// MultiTenantIdentityPendingUpgradeRequestInput - Available filtering types for pending upgrade requests +type MultiTenantIdentityPendingUpgradeRequestInput struct { + // Whether a request exists or not + Exists bool `json:"exists"` +} + +// MultiTenantIdentityUser - A New Relic user +type MultiTenantIdentityUser struct { + // The authentication domain the user belongs to. + AuthenticationDomainId string `json:"authenticationDomainId"` + // Email address of the user. + Email string `json:"email,omitempty"` + // One of: "Not Verifiable", "Verified", and "Pending". + // + // Not Verifiable: the user's email does not require verification. + // + // Verified: the user's email requires verification and has been. + // + // Pending: the user's email requires verification and has not been. + EmailVerificationState MultiTenantIdentityEmailVerificationState `json:"emailVerificationState"` + // container for groups enabling cursor based pagination + Groups MultiTenantIdentityUserGroups `json:"groups,omitempty"` + // The user id. + ID string `json:"id"` + // The last active date of the user. + LastActive nrtime.DateTime `json:"lastActive,omitempty"` + // The full name of the user. + Name string `json:"name,omitempty"` + // The pending upgrade request for the user (if any). + PendingUpgradeRequest MultiTenantIdentityPendingUpgradeRequest `json:"pendingUpgradeRequest,omitempty"` + // Time zone of the user in IANA Time Zone database format, also known as the "Olson" time zone database format (for exmaple, "America/Los_Angeles"). + TimeZone string `json:"timeZone,omitempty"` + // A "user type" is what determines the set of New Relic capabilities a user can theoretically access. + Type MultiTenantIdentityUserType `json:"type"` +} + +// MultiTenantIdentityUserCollection - A collection of New Relic users +type MultiTenantIdentityUserCollection struct { + // Users + Items []MultiTenantIdentityUser `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // The total number of users found. + // Note: Not necessarily the same as number of users returned, due to pagination. + TotalCount int `json:"totalCount"` +} + +// MultiTenantIdentityUserEmailInput - Filters by user email address +type MultiTenantIdentityUserEmailInput struct { + // Part of an email address + Contains string `json:"contains,omitempty"` + // An email address + Eq string `json:"eq,omitempty"` +} + +// MultiTenantIdentityUserFilterInput - Filter users +type MultiTenantIdentityUserFilterInput struct { + // Filter users by authentication domain + AuthenticationDomainId *MultiTenantIdentityAuthenticationDomainIdInput `json:"authenticationDomainId,omitempty"` + // Filter users by email address + Email *MultiTenantIdentityUserEmailInput `json:"email,omitempty"` + // Filter users by email verification state + EmailVerificationState *MultiTenantIdentityEmailVerificationStateInput `json:"emailVerificationState,omitempty"` + // Filter users by group id + GroupId *MultiTenantIdentityUserGroupIdInput `json:"groupId,omitempty"` + // Filter users by id + ID *MultiTenantIdentityUserIdInput `json:"id,omitempty"` + // Filter users by name + Name *MultiTenantIdentityUserNameInput `json:"name,omitempty"` + // Filter users by pending upgrade request + PendingUpgradeRequest *MultiTenantIdentityPendingUpgradeRequestInput `json:"pendingUpgradeRequest,omitempty"` +} + +// MultiTenantIdentityUserGroup - A group of users. +type MultiTenantIdentityUserGroup struct { + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` +} + +// MultiTenantIdentityUserGroupIdInput - Filters by group id +type MultiTenantIdentityUserGroupIdInput struct { + // A group id + Eq string `json:"eq,omitempty"` + // A list of group IDs + In []string `json:"in"` + // Filter users not in group + Not MultiTenantIdentityUserNotGroupIdInput `json:"not,omitempty"` +} + +// MultiTenantIdentityUserGroups - List of groups representing named sets of New Relic users within an authentication domain +type MultiTenantIdentityUserGroups struct { + // User groups + Items []MultiTenantIdentityUserGroup `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// MultiTenantIdentityUserIdInput - Filters by user id +type MultiTenantIdentityUserIdInput struct { + // A user id + Eq string `json:"eq,omitempty"` + // A list of user IDs + In []string `json:"in"` +} + +// MultiTenantIdentityUserNameInput - Filters by user name +type MultiTenantIdentityUserNameInput struct { + // Part of a user name + Contains string `json:"contains,omitempty"` + // A user name + Eq string `json:"eq,omitempty"` +} + +// MultiTenantIdentityUserNotGroupIdInput - Filters by group id +type MultiTenantIdentityUserNotGroupIdInput struct { + // A group id + Eq string `json:"eq"` +} + +// MultiTenantIdentityUserSortInput - Sort users +type MultiTenantIdentityUserSortInput struct { + // Direction to sort in + Direction MultiTenantIdentitySortDirection `json:"direction,omitempty"` + // User attribute to sort on + Key MultiTenantIdentityUserSortKey `json:"key,omitempty"` +} + +// MultiTenantIdentityUserType - A "user type" is what determines the set of New Relic capabilities a user can theoretically access. +type MultiTenantIdentityUserType struct { + // The id of the user type. + ID string `json:"id"` + // The name of the user type. + Name string `json:"name"` +} + +// OrganizationAccount - The account type contains the properties of an account +type OrganizationAccount struct { + // The creation time + CreatedAt nrtime.DateTime `json:"createdAt"` + // The account id + ID int `json:"id"` + // The account name + Name string `json:"name"` + // The parent ID + ParentId int `json:"parentId,omitempty"` + // The partnership ID + PartnershipId int `json:"partnershipId,omitempty"` + // The partnership Name + PartnershipName string `json:"partnershipName,omitempty"` + // The pay method + PayMethod string `json:"payMethod,omitempty"` + // The account region code + RegionCode string `json:"regionCode"` + // The status + Status string `json:"status"` +} + +// OrganizationAccountCollection - Accounts +type OrganizationAccountCollection struct { + // Accounts + Items []OrganizationAccount `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// OrganizationAccountFilterInput - A filter for Accounts +type OrganizationAccountFilterInput struct { + // Filter by account ID + ID OrganizationAccountIdFilterInput `json:"id,omitempty"` + // Filter by Account Name + Name OrganizationAccountNameFilterInput `json:"name,omitempty"` + // Filter by organization ID + OrganizationId OrganizationAccountOrganizationIdFilterInput `json:"organizationId,omitempty"` + // Filter by Sharing Mode + SharingMode OrganizationAccountSharingModeFilterInput `json:"sharingMode,omitempty"` + // Filter by an account status. By default filters to active accounts. + Status OrganizationAccountStatusFilterInput `json:"status,omitempty"` +} + +// OrganizationAccountIdFilterInput - A filter for an AccountID +type OrganizationAccountIdFilterInput struct { + // An Account ID + Eq int `json:"eq,omitempty"` +} + +// OrganizationAccountIdInput - Provides the operations available on the account id +type OrganizationAccountIdInput struct { + // An account id + Eq int `json:"eq"` +} + +// OrganizationAccountNameFilterInput - A filter for Account name +type OrganizationAccountNameFilterInput struct { + // Search text for an account name + Contains string `json:"contains,omitempty"` +} + +// OrganizationAccountOrganizationIdFilterInput - A filter for OrganizationID +type OrganizationAccountOrganizationIdFilterInput struct { + // An Organization ID + Eq string `json:"eq"` +} + +// OrganizationAccountShare - An account share +type OrganizationAccountShare struct { + // The ID of the account being shared + AccountID int `json:"accountId"` + // The account share ID + ID string `json:"id"` + // The limiting role + LimitingRole OrganizationAccountShareLimitingRoleWrapper `json:"limitingRole"` + // The name of the account share + Name string `json:"name"` + // The organization sending the account share. + Source OrganizationAccountShareOrganizationWrapper `json:"source"` + // The organization receiving the account share. + Target OrganizationAccountShareOrganizationWrapper `json:"target"` +} + +// OrganizationAccountShareCollection - An organization's shared accounts, both given and received. +type OrganizationAccountShareCollection struct { + // An organization's shared accounts, both given and received. + Items []OrganizationAccountShare `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// OrganizationAccountShareFilterInput - A filter for account shares +type OrganizationAccountShareFilterInput struct { + // Filter by account id + AccountID OrganizationAccountIdInput `json:"accountId,omitempty"` + // Filter by target id + TargetId *OrganizationTargetIdInput `json:"targetId,omitempty"` +} + +// OrganizationAccountShareLimitingRoleWrapper - An account share's limiting role +type OrganizationAccountShareLimitingRoleWrapper struct { + // id + ID string `json:"id"` +} + +// OrganizationAccountShareOrganizationWrapper - An account share's source or target organization +type OrganizationAccountShareOrganizationWrapper struct { + // id + ID string `json:"id,omitempty"` + // name + Name string `json:"name,omitempty"` +} + +// OrganizationAccountShareSortInput - Sort key and direction for account shares +type OrganizationAccountShareSortInput struct { + // Direction to sort in + Direction OrganizationAccountShareSortDirectionEnum `json:"direction,omitempty"` + // Account share attribute to sort on + Key OrganizationAccountShareSortKeyEnum `json:"key,omitempty"` +} + +// OrganizationAccountShares - An organization's shared accounts, both given and received. +type OrganizationAccountShares struct { + // An organization's shared accounts, both given and received. + SharedAccounts []OrganizationSharedAccount `json:"sharedAccounts"` +} + +// OrganizationAccountSharingModeFilterInput - A filter for Sharing Mode +type OrganizationAccountSharingModeFilterInput struct { + // A Sharing Mode for the account. + Eq OrganizationSharingMode `json:"eq,omitempty"` +} + +// OrganizationAccountSortInput - Sort key and direction for accounts +type OrganizationAccountSortInput struct { + // Direction to sort in + Direction OrganizationAccountSortDirectionEnum `json:"direction,omitempty"` + // Account share attribute to sort on + Key OrganizationAccountSortKeyEnum `json:"key,omitempty"` +} + +// OrganizationAccountStatusFilterInput - A filter for Account Status +type OrganizationAccountStatusFilterInput struct { + // An account status + Eq OrganizationAccountStatus `json:"eq,omitempty"` +} + +// OrganizationAuthenticationDomain - A grouping of users governed by the same user management settings +type OrganizationAuthenticationDomain struct { + // Method of authenticating users + AuthenticationType OrganizationAuthenticationTypeEnum `json:"authenticationType"` + // The authentication domain id + ID string `json:"id"` + // The authentication domain name + Name string `json:"name"` + // The organization the authentication domain belongs to + OrganizationId string `json:"organizationId"` + // Method of provisioning users + ProvisioningType OrganizationProvisioningTypeEnum `json:"provisioningType"` +} + +// OrganizationAuthenticationDomainCollection - Authentication domains +type OrganizationAuthenticationDomainCollection struct { + // Authentication domains + Items []OrganizationAuthenticationDomain `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// OrganizationAuthenticationDomainFilterInput - A filter for authentication domains +type OrganizationAuthenticationDomainFilterInput struct { + // Filter authentication domains by id + ID *OrganizationIdInput `json:"id,omitempty"` + // Filter authentication domains by name + Name *OrganizationNameInput `json:"name,omitempty"` + // Filter authentication domains by organization + OrganizationId *OrganizationOrganizationIdInput `json:"organizationId,omitempty"` +} + +// OrganizationAuthenticationDomainSortInput - Sort key and direction for authentication domains +type OrganizationAuthenticationDomainSortInput struct { + // Direction to sort in + Direction OrganizationSortDirectionEnum `json:"direction,omitempty"` + // Authentication domain attribute to sort on + Key OrganizationSortKeyEnum `json:"key,omitempty"` +} + +// OrganizationContractCustomerIdInputFilter - Provides all the available filters on the customer id +type OrganizationContractCustomerIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationContractOrganizationIdInputFilter - Provides all the available filters on the organization id +type OrganizationContractOrganizationIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationCustomerContract - A customer +type OrganizationCustomerContract struct { + // The customer contract''s billing structure + BillingStructure OrganizationBillingStructure `json:"billingStructure,omitempty"` + // The customers id + CustomerId string `json:"customerId"` + // The customer contracts ID + ID string `json:"id"` + // The customer contracts organization groups + OrganizationGroups OrganizationOrganizationGroupWrapper `json:"organizationGroups"` + // The customer contracts''s telemetry id + TelemetryId string `json:"telemetryId,omitempty"` +} + +// OrganizationCustomerContractFilterInput - A filter for customer contracts +type OrganizationCustomerContractFilterInput struct { + // The id of the customer + CustomerId OrganizationContractCustomerIdInputFilter `json:"customerId,omitempty"` + // The id of the organization + OrganizationId OrganizationContractOrganizationIdInputFilter `json:"organizationId,omitempty"` +} + +// OrganizationCustomerContractWrapper - Accessible customers +type OrganizationCustomerContractWrapper struct { + // Accessible customers + Items []OrganizationCustomerContract `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// OrganizationCustomerOrganization - A customer organization +type OrganizationCustomerOrganization struct { + // The ID of the organization group + ContractId string `json:"contractId,omitempty"` + // The ID of the customer + CustomerId string `json:"customerId,omitempty"` + // The ID of the organization + ID string `json:"id"` + // The name of the organization + Name string `json:"name,omitempty"` +} + +// OrganizationCustomerOrganizationFilterInput - A filter for customer organizations +type OrganizationCustomerOrganizationFilterInput struct { + // The id of the owned account + AccountID OrganizationOrganizationAccountIdInputFilter `json:"accountId,omitempty"` + // The id of the authentication domain + AuthenticationDomainId OrganizationOrganizationAuthenticationDomainIdInputFilter `json:"authenticationDomainId,omitempty"` + // The id of the customer + CustomerId OrganizationOrganizationCustomerIdInputFilter `json:"customerId,omitempty"` + // The id of the organization + ID OrganizationOrganizationIdInputFilter `json:"id,omitempty"` + // The name of the organization + Name OrganizationOrganizationNameInputFilter `json:"name,omitempty"` +} + +// OrganizationCustomerOrganizationWrapper - A customer organization +type OrganizationCustomerOrganizationWrapper struct { + // Accessible customers + Items []OrganizationCustomerOrganization `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// OrganizationIdInput - Provides the operations available on the id +type OrganizationIdInput struct { + // An authentication domain id + Eq string `json:"eq"` +} + +// OrganizationNameInput - Provides the operations available on the name +type OrganizationNameInput struct { + // Part of an authentication domain name + Contains string `json:"contains,omitempty"` + // An authentication domain name + Eq string `json:"eq,omitempty"` +} + +// OrganizationOrganizationAccountIdInputFilter - Provides all the available filters on the account id +type OrganizationOrganizationAccountIdInputFilter struct { + // performs an equals operation + Eq int `json:"eq"` +} + +// OrganizationOrganizationAuthenticationDomainIdInputFilter - Provides all the available filters on the authentication domain id +type OrganizationOrganizationAuthenticationDomainIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationOrganizationCreateAsyncCustomerResult - An async organization creation result customer +type OrganizationOrganizationCreateAsyncCustomerResult struct { + // The customer ID + CustomerId string `json:"customerId,omitempty"` +} + +// OrganizationOrganizationCreateAsyncJobResult - An async organization creation job result +type OrganizationOrganizationCreateAsyncJobResult struct { + // The date and time the job was created in UTC + CreatedUtc string `json:"createdUtc"` + // The error message in case of job failure + ErrorMessage string `json:"errorMessage,omitempty"` + // The date and time the job was completed in UTC + FinishedUtc string `json:"finishedUtc,omitempty"` + // The id of the job + ID string `json:"id"` + // The status of the job + Status OrganizationOrganizationCreateJobResultStatusEnum `json:"status"` +} + +// OrganizationOrganizationCreateAsyncOrganizationResult - An async organization creation result organization +type OrganizationOrganizationCreateAsyncOrganizationResult struct { + // Organization ID + ID string `json:"id,omitempty"` + // Organization name + Name string `json:"name,omitempty"` +} + +// OrganizationOrganizationCreateAsyncResult - An async organization creation result +type OrganizationOrganizationCreateAsyncResult struct { + // Organization Creation Async Job Customer + Customer OrganizationOrganizationCreateAsyncCustomerResult `json:"customer,omitempty"` + // Organization Creation Async Job Result + Job OrganizationOrganizationCreateAsyncJobResult `json:"job"` + // Organization Creation Async Job Organization + Organization OrganizationOrganizationCreateAsyncOrganizationResult `json:"organization,omitempty"` +} + +// OrganizationOrganizationCreateAsyncResultCollection - Organization create async result collection +type OrganizationOrganizationCreateAsyncResultCollection struct { + // Organization create async results + Items []OrganizationOrganizationCreateAsyncResult `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// OrganizationOrganizationCreateAsyncResultFilterInput - A filter for organization create job results +type OrganizationOrganizationCreateAsyncResultFilterInput struct { + // Filter organization create job results by customer ID + CustomerId *OrganizationOrganizationCreateJobCustomerIdInput `json:"customerId,omitempty"` + // Filter oganization create job results by id + JobId *OrganizationOrganizationCreateJobIdInput `json:"jobId,omitempty"` + // Filter organization create job results by status + Status *OrganizationOrganizationCreateJobStatusInput `json:"status,omitempty"` +} + +// OrganizationOrganizationCreateJobCustomerIdInput - The customer id search for jobs +type OrganizationOrganizationCreateJobCustomerIdInput struct { + // A customer id to search for jobs in + Eq string `json:"eq"` +} + +// OrganizationOrganizationCreateJobIdInput - The id of the job to retrieve +type OrganizationOrganizationCreateJobIdInput struct { + // An organization create job id + Eq string `json:"eq,omitempty"` + // A set of job ids to search for + In []string `json:"in"` +} + +// OrganizationOrganizationCreateJobStatusInput - The status of the jobs to search for +type OrganizationOrganizationCreateJobStatusInput struct { + // a job status to search for + Eq OrganizationOrganizationCreateJobStatusEnum `json:"eq,omitempty"` + // a set of job statuses to search for + In []OrganizationOrganizationCreateJobStatusEnum `json:"in"` +} + +// OrganizationOrganizationCustomerIdInputFilter - Provides all the available filters on the customer id +type OrganizationOrganizationCustomerIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationOrganizationGroup - A customers organization group +type OrganizationOrganizationGroup struct { + // The ID of the organization group + ID string `json:"id"` + // The name of the organization group + Name string `json:"name"` +} + +// OrganizationOrganizationGroupFilterInput - A filter for organization groups +type OrganizationOrganizationGroupFilterInput struct { + // The id of the organization group + ID OrganizationOrganizationGroupIdInputFilter `json:"id,omitempty"` + // The name of the organization group + Name OrganizationOrganizationGroupNameInputFilter `json:"name,omitempty"` + // The ID of the organization + OrganizationId OrganizationOrganizationGroupOrganizationIdInputFilter `json:"organizationId,omitempty"` +} + +// OrganizationOrganizationGroupIdInputFilter - Provides all the available filters on the organization group id +type OrganizationOrganizationGroupIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationOrganizationGroupNameInputFilter - Provides all the available filters on the organization group name +type OrganizationOrganizationGroupNameInputFilter struct { + // performs a contains operation + Contains string `json:"contains,omitempty"` + // performs an equals operation + Eq string `json:"eq,omitempty"` +} + +// OrganizationOrganizationGroupOrganizationIdInputFilter - Provides all the available filters on the organization group organization id +type OrganizationOrganizationGroupOrganizationIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationOrganizationGroupWrapper - A customers organization groups +type OrganizationOrganizationGroupWrapper struct { + // A customers organization groups + Items []OrganizationOrganizationGroup `json:"items"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` +} + +// OrganizationOrganizationIdInput - Provides the operations available on the organization id +type OrganizationOrganizationIdInput struct { + // An organization id + Eq string `json:"eq"` +} + +// OrganizationOrganizationIdInputFilter - Provides all the available filters on the organization id +type OrganizationOrganizationIdInputFilter struct { + // performs an equals operation + Eq string `json:"eq"` +} + +// OrganizationOrganizationNameInputFilter - Provides all the available filters on the organization name +type OrganizationOrganizationNameInputFilter struct { + // performs a contains operation + Contains string `json:"contains,omitempty"` + // performs an equals operation + Eq string `json:"eq,omitempty"` +} + +// OrganizationSharedAccount - The attributes of an account share. +type OrganizationSharedAccount struct { + // The ID of the account being shared. + AccountID int `json:"accountId"` + // The ID of the account share. + ID string `json:"id"` + // The ID of the limiting role for the account share. + LimitingRoleId int `json:"limitingRoleId"` + // The name of the account share. + Name string `json:"name,omitempty"` + // The ID of the organization sending the account share. + SourceOrganizationId string `json:"sourceOrganizationId"` + // The name of the organization sending the account share. + SourceOrganizationName string `json:"sourceOrganizationName,omitempty"` + // The ID of the organization receiving the account share. + TargetOrganizationId string `json:"targetOrganizationId"` + // The name of the organization receiving the account share. + TargetOrganizationName string `json:"targetOrganizationName,omitempty"` +} + +// OrganizationTargetIdInput - Provides the operations available on the target id +type OrganizationTargetIdInput struct { + // An organization id + Eq string `json:"eq"` +} + +// TimeWindowInput - Represents a time window input. +type TimeWindowInput struct { + // The end time of the time window the number of milliseconds since the Unix epoch. + EndTime EpochMilliseconds `json:"endTime"` + // The start time of the time window the number of milliseconds since the Unix epoch. + StartTime EpochMilliseconds `json:"startTime"` +} + +// User - The `User` object provides general data about the user. +type User struct { + Email string `json:"email,omitempty"` + ID int `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} + +// UserManagementAuthenticationDomain - An "authentication domain" is a grouping of New Relic users governed by the same user management settings, like how they're provisioned (added and updated), how they're authenticated (logged in), session settings, and how user upgrades are managed. +type UserManagementAuthenticationDomain struct { + // container for groups enabling cursor based pagination + Groups UserManagementGroups `json:"groups,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // the name of the object + Name string `json:"name"` + // the method used to provision users in this authentication domain + ProvisioningType string `json:"provisioningType"` + // container for users enabling cursor based pagination + Users UserManagementUsers `json:"users,omitempty"` +} + +// UserManagementAuthenticationDomains - container for authentication domains enabling cursor based pagination +type UserManagementAuthenticationDomains struct { + // container for authentication_domains enabling cursor based pagination + AuthenticationDomains []UserManagementAuthenticationDomain `json:"authenticationDomains"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// UserManagementDisplayNameInput - Available filtering types for group display names +type UserManagementDisplayNameInput struct { + // Part of a display name + Contains string `json:"contains,omitempty"` + // A display name + Eq string `json:"eq,omitempty"` +} + +// UserManagementEmailInput - Available filtering types for email addresses +type UserManagementEmailInput struct { + // Part of a user email + Contains string `json:"contains,omitempty"` + // A user email + Eq string `json:"eq,omitempty"` +} + +// UserManagementEmailVerificationStateInput - Available filtering types for email verification states +type UserManagementEmailVerificationStateInput struct { + // An email verification state + Pending bool `json:"pending"` +} + +// UserManagementGroup - For users on our New Relic One user model, a "group" represents a group of users. Putting users in a group allows the managing of permissions for multiple users at the same time. +type UserManagementGroup struct { + // the name of the object + DisplayName string `json:"displayName"` + // a value that uniquely identifies this object + ID string `json:"id"` + // container for users enabling cursor based pagination + Users UserManagementGroupUsers `json:"users,omitempty"` +} + +// UserManagementGroupFilterInput - The input object representing the filter parameters for groups +type UserManagementGroupFilterInput struct { + // Filter groups by display name + DisplayName UserManagementDisplayNameInput `json:"displayName,omitempty"` + // Filter groups by group ID + ID UserManagementGroupIdInput `json:"id,omitempty"` +} + +// UserManagementGroupIdInput - Available filtering types for group IDs +type UserManagementGroupIdInput struct { + // A group ID + Eq string `json:"eq,omitempty"` + // An array of group IDs + In []string `json:"in"` +} + +// UserManagementGroupSortInput - The input object representing the sort parameters for groups +type UserManagementGroupSortInput struct { + // Sort groups in this direction + Direction UserManagementSortDirection `json:"direction,omitempty"` + // Sort groups by this key + Key UserManagementGroupSortKey `json:"key,omitempty"` +} + +// UserManagementGroupUser - User information returned within Groups +type UserManagementGroupUser struct { + // The email of the user. + Email string `json:"email"` + // a value that uniquely identifies this object + ID string `json:"id"` + // The full name of the user. + Name string `json:"name"` + // The configured time zone of the user. + TimeZone string `json:"timeZone"` +} + +// UserManagementGroupUsers - container for users enabling cursor based pagination +type UserManagementGroupUsers struct { + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` + // container for users enabling cursor based pagination + Users []UserManagementGroupUser `json:"users"` +} + +// UserManagementGroups - container for groups enabling cursor based pagination +type UserManagementGroups struct { + // container for groups enabling cursor based pagination + Groups []UserManagementGroup `json:"groups"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// UserManagementNameInput - Available filtering types for names +type UserManagementNameInput struct { + // Part of a user name + Contains string `json:"contains,omitempty"` + // A user name + Eq string `json:"eq,omitempty"` +} + +// UserManagementPendingUpgradeRequest - Exists only if a user has a pending upgrade request. +type UserManagementPendingUpgradeRequest struct { + // a value that uniquely identifies this object + ID string `json:"id"` + // Requester message, why the user believes they require the upgrade. + Message string `json:"message,omitempty"` + // Requested user type for the user. + RequestedUserType UserManagementUserType `json:"requestedUserType,omitempty"` +} + +// UserManagementPendingUpgradeRequestInput - Available filtering types for pending upgrade requests +type UserManagementPendingUpgradeRequestInput struct { + // Whether a request exists or not + Exists bool `json:"exists"` +} + +// UserManagementTypeInput - Available filtering types for user type +type UserManagementTypeInput struct { + // A user type + Eq UserManagementTypeEnum `json:"eq"` +} + +// UserManagementUser - A user of New Relic scoped to an authentication domain. +type UserManagementUser struct { + // Email address of the user. + Email string `json:"email,omitempty"` + // One of: "Not Verifiable", "Verified", and "Pending". + // + // Not Verifiable: the user's email does not require verification. + // + // Verified: the user's email requires verification and has been. + // + // Pending: the user's email requires verification and has not been. + EmailVerificationState string `json:"emailVerificationState"` + // container for groups enabling cursor based pagination + Groups UserManagementUserGroups `json:"groups,omitempty"` + // a value that uniquely identifies this object + ID string `json:"id"` + // The last active date of the user. + LastActive nrtime.DateTime `json:"lastActive,omitempty"` + // The full name of the user. + Name string `json:"name,omitempty"` + // The pending upgrade request for the user (if any). + PendingUpgradeRequest UserManagementPendingUpgradeRequest `json:"pendingUpgradeRequest,omitempty"` + // Time zone of the user in IANA Time Zone database format, also known as the "Olson" time zone database format (for exmaple, "America/Los_Angeles"). + TimeZone string `json:"timeZone,omitempty"` + // A "user type" is what determines the set of New Relic capabilities a user can theoretically access. + Type UserManagementUserType `json:"type"` +} + +// UserManagementUserFilterInput - The input object representing the filter parameters for users +type UserManagementUserFilterInput struct { + // Filter users by email address + Email UserManagementEmailInput `json:"email,omitempty"` + // Filter users by email verification state + EmailVerificationState UserManagementEmailVerificationStateInput `json:"emailVerificationState,omitempty"` + // Filter users by user ID + ID UserManagementUserIdInput `json:"id,omitempty"` + // Filter users by name + Name UserManagementNameInput `json:"name,omitempty"` + // Filter users by pending upgrade request + PendingUpgradeRequest UserManagementPendingUpgradeRequestInput `json:"pendingUpgradeRequest,omitempty"` + // Filter users by type + Type UserManagementTypeInput `json:"type,omitempty"` +} + +// UserManagementUserGroup - For users on our New Relic One user model, a "group" represents a group of users. Putting users in a group allows the managing of permissions for multiple users at the same time. +type UserManagementUserGroup struct { + // the name of the object + DisplayName string `json:"displayName"` + // a value that uniquely identifies this object + ID string `json:"id"` +} + +// UserManagementUserGroups - container for groups enabling cursor based pagination +type UserManagementUserGroups struct { + // container for groups enabling cursor based pagination + Groups []UserManagementUserGroup `json:"groups"` + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` +} + +// UserManagementUserIdInput - Available filtering types for user IDs +type UserManagementUserIdInput struct { + // A user ID + Eq string `json:"eq,omitempty"` + // An array of user IDs + In []string `json:"in"` +} + +// UserManagementUserType - A "user type" is what determines the set of New Relic capabilities a user can theoretically access. +type UserManagementUserType struct { + // the name of the object + DisplayName string `json:"displayName"` + // a value that uniquely identifies this object + ID string `json:"id"` +} + +// UserManagementUsers - container for users enabling cursor based pagination +type UserManagementUsers struct { + // an opaque cursor to supply with subsequent requests to get the next page of results, null if there are no more pages + NextCursor string `json:"nextCursor,omitempty"` + // the total number of results + TotalCount int `json:"totalCount"` + // container for users enabling cursor based pagination + Users []UserManagementUser `json:"users"` +} + +// UserReference - The `UserReference` object provides basic identifying information about the user. +type UserReference struct { + Email string `json:"email,omitempty"` + Gravatar string `json:"gravatar,omitempty"` + ID int `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} + +type UsersActorStitchedFields struct { + // Search for users using a custom query. + // If no query is provided, returns all visible users. + // NOTE: this API only supports users in the New Relic One user model. + UserSearch UsersUserSearchResult `json:"userSearch,omitempty"` +} + +// UsersUserSearch - User information returned for UserSearch +type UsersUserSearch struct { + // The email of the user. + Email string `json:"email,omitempty"` + // The full name of the user. + Name string `json:"name,omitempty"` + // The unique identifier of the user. + UserID string `json:"userId,omitempty"` +} + +// UsersUserSearchQuery - Query object for UserSearch. +type UsersUserSearchQuery struct { + // The scope to filter the search response by. + Scope UsersUserSearchScope `json:"scope,omitempty"` +} + +// UsersUserSearchResult - The result object for UserSearch. +type UsersUserSearchResult struct { + // The cursor for the next page. + NextCursor string `json:"nextCursor,omitempty"` + // The total number of users found. + // Note: Not necessarily the same as number of users returned, due to pagination. + TotalCount int `json:"totalCount"` + // Set of all users returned from the query. + Users []UsersUserSearch `json:"users"` +} + +// UsersUserSearchScope - Different scopes that can be used to filter the returned users. +type UsersUserSearchScope struct { + // Filter by string that will partially match a User's `email`. Same as `name` it will partially match and case is ignored. + Email string `json:"email,omitempty"` + // Filter by string that will partially match a User's `name`. So argument `name='Ste'` will match `name='Steve'` and case is ignored so `name='Koester'` would also match. + Name string `json:"name,omitempty"` + // Will match both a User's `email` and `name`. So argument `search='ple'` will match `name='Johnny Appleseed'` and `email='mary@example.com'`. + Search string `json:"search,omitempty"` + // List of 1 or more userIds to filter by. Will only return data for users with ids that match the full ID, no partial matching. (so 2 ids provided will yield at most 2 users) + UserIDs []string `json:"userIds"` +} + +type accountSharesResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type accountsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type authenticationDomainsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type consumptionResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type contractsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type grantsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type groupsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type jobsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type organizationCreateAsyncResultsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type organizationsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type permissionsResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type rolesResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type userResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +type usersResponse struct { + CustomerAdministration CustomerAdministration `json:"customerAdministration"` +} + +// EpochMilliseconds - The `EpochMilliseconds` scalar represents the number of milliseconds since the Unix epoch +type EpochMilliseconds string diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboard.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboard.go similarity index 81% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboard.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboard.go index 58c7d57581a..7785848bfc3 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboard.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboard.go @@ -3,9 +3,9 @@ package dashboards import ( "context" - "github.com/newrelic/newrelic-client-go/pkg/common" - "github.com/newrelic/newrelic-client-go/pkg/entities" - "github.com/newrelic/newrelic-client-go/pkg/errors" + "github.com/newrelic/newrelic-client-go/v2/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/entities" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" ) // GetDashboardEntity is used to retrieve a single New Relic One Dashboard @@ -87,6 +87,30 @@ const getDashboardEntityQuery = `query ($guid: EntityGuid!) { tags { key values } tagsWithMetadata { key values { mutable value } } updatedAt + variables { + defaultValues { + value { + string + } + } + isMultiSelection + items { + title + value + } + name + options { + excluded + ignoreTimeRange + } + nrqlQuery { + accountIds + query + } + replacementStrategy + title + type + } } } } diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards.go similarity index 79% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards.go index 02503d0d5f6..e9da1cd49cd 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards.go @@ -2,9 +2,9 @@ package dashboards import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "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" ) // Dashboards is used to communicate with the New Relic Dashboards product. diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_api.go new file mode 100644 index 00000000000..15da5c4d0d4 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_api.go @@ -0,0 +1,4310 @@ +// Code generated by tutone: DO NOT EDIT +package dashboards + +import ( + "context" + "fmt" + + "github.com/newrelic/newrelic-client-go/v2/pkg/common" +) + +// Create a `DashboardEntity` +func (a *Dashboards) DashboardCreate( + accountID int, + dashboard DashboardInput, +) (*DashboardCreateResult, error) { + return a.DashboardCreateWithContext(context.Background(), + accountID, + dashboard, + ) +} + +// Create a `DashboardEntity` +func (a *Dashboards) DashboardCreateWithContext( + ctx context.Context, + accountID int, + dashboard DashboardInput, +) (*DashboardCreateResult, error) { + + resp := DashboardCreateQueryResponse{} + vars := map[string]interface{}{ + "accountId": accountID, + "dashboard": dashboard, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, DashboardCreateMutation, vars, &resp); err != nil { + return nil, err + } + + if len(resp.DashboardCreateResult.Errors) > 0 { + errs := fmt.Errorf("query error") + for _, err := range resp.DashboardCreateResult.Errors { + errs = fmt.Errorf("%w; %s", errs, err.Description) + } + return nil, errs + } + + return &resp.DashboardCreateResult, nil +} + +type DashboardCreateQueryResponse struct { + DashboardCreateResult DashboardCreateResult `json:"DashboardCreate"` +} + +const DashboardCreateMutation = `mutation( + $accountId: Int!, + $dashboard: DashboardInput!, +) { dashboardCreate( + accountId: $accountId, + dashboard: $dashboard, +) { + entityResult { + accountId + createdAt + description + guid + name + owner { + email + userId + } + pages { + createdAt + description + guid + name + owner { + email + userId + } + updatedAt + widgets { + configuration { + area { + nrqlQueries { + accountId + query + } + } + bar { + nrqlQueries { + accountId + query + } + } + billboard { + nrqlQueries { + accountId + query + } + thresholds { + alertSeverity + value + } + } + line { + nrqlQueries { + accountId + query + } + } + markdown { + text + } + pie { + nrqlQueries { + accountId + query + } + } + table { + nrqlQueries { + accountId + query + } + } + } + id + layout { + column + height + row + width + } + linkedEntities { + __typename + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + apmBrowserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + } + apmSummary { + apdexScore + errorRate + hostCount + instanceCount + nonWebResponseTimeAverage + nonWebThroughput + responseTimeAverage + throughput + webResponseTimeAverage + webThroughput + } + applicationId + language + runningAgentVersions { + maxVersion + minVersion + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + settings { + apdexTarget + serverSideConfig + } + tags { + key + values + } + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + host + portOrPath + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + externalSummary { + responseTimeAverage + throughput + } + host + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on BrowserApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + agentInstallType + applicationId + browserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + pageLoadTimeMedian + spaResponseTimeAverage + spaResponseTimeMedian + } + runningAgentVersions { + maxSemanticVersion + maxVersion + minSemanticVersion + minVersion + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + servingApmApplicationId + settings { + apdexTarget + } + tags { + key + values + } + } + ... on DashboardEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + createdAt + dashboardParentGuid + owner { + email + userId + } + permissions + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + updatedAt + } + ... on ExternalEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on GenericEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on GenericInfrastructureEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + runtime + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on InfrastructureHostEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + hostSummary { + cpuUtilizationPercent + diskUsedPercent + memoryUsedPercent + networkReceiveRate + networkTransmitRate + servicesCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on KeyTransactionEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on MobileApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + applicationId + mobileSummary { + appLaunchCount + crashCount + crashRate + httpErrorRate + httpRequestCount + httpRequestRate + httpResponseTimeAverage + mobileSessionCount + networkFailureRate + usersAffectedCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on SecureCredentialEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + description + secureCredentialId + secureCredentialSummary { + failingMonitorCount + monitorCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + monitorId + monitorSummary { + locationsFailing + locationsRunning + status + successRate + } + monitorType + monitoredUrl + period + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on TeamEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on ThirdPartyServiceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on UnavailableEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on WorkloadEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + createdAt + createdByUser { + email + gravatar + id + name + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + updatedAt + workloadStatus { + description + statusSource + statusValue + summary + } + } + } + rawConfiguration + title + visualization { + id + } + } + } + permissions + updatedAt + variables { + defaultValue { + string + } + defaultValues { + value { + string + } + } + isMultiSelection + items { + title + value + } + name + nrqlQuery { + accountIds + query + } + options { + excluded + ignoreTimeRange + } + replacementStrategy + title + type + } + } + errors { + description + type + } +} }` + +// Delete an existing `DashboardEntity` +func (a *Dashboards) DashboardDelete( + gUID common.EntityGUID, +) (*DashboardDeleteResult, error) { + return a.DashboardDeleteWithContext(context.Background(), + gUID, + ) +} + +// Delete an existing `DashboardEntity` +func (a *Dashboards) DashboardDeleteWithContext( + ctx context.Context, + gUID common.EntityGUID, +) (*DashboardDeleteResult, error) { + + resp := DashboardDeleteQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, DashboardDeleteMutation, vars, &resp); err != nil { + return nil, err + } + + // If we got errors back, wrap them all up + if len(resp.DashboardDeleteResult.Errors) > 0 { + errs := fmt.Errorf("query error") + for _, err := range resp.DashboardDeleteResult.Errors { + errs = fmt.Errorf("%w; %s", errs, err.Description) + } + return nil, errs + } + + return &resp.DashboardDeleteResult, nil +} + +type DashboardDeleteQueryResponse struct { + DashboardDeleteResult DashboardDeleteResult `json:"DashboardDelete"` +} + +const DashboardDeleteMutation = `mutation( + $guid: EntityGuid!, +) { dashboardDelete( + guid: $guid, +) { + errors { + description + type + } + status +} }` + +// Update an existing `DashboardEntity` +func (a *Dashboards) DashboardUpdate( + dashboard DashboardInput, + gUID common.EntityGUID, +) (*DashboardUpdateResult, error) { + return a.DashboardUpdateWithContext(context.Background(), + dashboard, + gUID, + ) +} + +// Update an existing `DashboardEntity` +func (a *Dashboards) DashboardUpdateWithContext( + ctx context.Context, + dashboard DashboardInput, + gUID common.EntityGUID, +) (*DashboardUpdateResult, error) { + + resp := DashboardUpdateQueryResponse{} + vars := map[string]interface{}{ + "dashboard": dashboard, + "guid": gUID, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, DashboardUpdateMutation, vars, &resp); err != nil { + return nil, err + } + + // If we got errors back, wrap them all up + if len(resp.DashboardUpdateResult.Errors) > 0 { + errs := fmt.Errorf("query error") + for _, err := range resp.DashboardUpdateResult.Errors { + errs = fmt.Errorf("%w; %s", errs, err.Description) + } + return nil, errs + } + + return &resp.DashboardUpdateResult, nil +} + +type DashboardUpdateQueryResponse struct { + DashboardUpdateResult DashboardUpdateResult `json:"DashboardUpdate"` +} + +const DashboardUpdateMutation = `mutation( + $dashboard: DashboardInput!, + $guid: EntityGuid!, +) { dashboardUpdate( + dashboard: $dashboard, + guid: $guid, +) { + entityResult { + accountId + createdAt + description + guid + name + owner { + email + userId + } + pages { + createdAt + description + guid + name + owner { + email + userId + } + updatedAt + widgets { + configuration { + area { + nrqlQueries { + accountId + query + } + } + bar { + nrqlQueries { + accountId + query + } + } + billboard { + nrqlQueries { + accountId + query + } + thresholds { + alertSeverity + value + } + } + line { + nrqlQueries { + accountId + query + } + } + markdown { + text + } + pie { + nrqlQueries { + accountId + query + } + } + table { + nrqlQueries { + accountId + query + } + } + } + id + layout { + column + height + row + width + } + linkedEntities { + __typename + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + apmBrowserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + } + apmSummary { + apdexScore + errorRate + hostCount + instanceCount + nonWebResponseTimeAverage + nonWebThroughput + responseTimeAverage + throughput + webResponseTimeAverage + webThroughput + } + applicationId + language + runningAgentVersions { + maxVersion + minVersion + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + settings { + apdexTarget + serverSideConfig + } + tags { + key + values + } + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + host + portOrPath + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + externalSummary { + responseTimeAverage + throughput + } + host + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on BrowserApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + agentInstallType + applicationId + browserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + pageLoadTimeMedian + spaResponseTimeAverage + spaResponseTimeMedian + } + runningAgentVersions { + maxSemanticVersion + maxVersion + minSemanticVersion + minVersion + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + servingApmApplicationId + settings { + apdexTarget + } + tags { + key + values + } + } + ... on DashboardEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + createdAt + dashboardParentGuid + owner { + email + userId + } + permissions + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + updatedAt + } + ... on ExternalEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on GenericEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on GenericInfrastructureEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + runtime + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on InfrastructureHostEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + hostSummary { + cpuUtilizationPercent + diskUsedPercent + memoryUsedPercent + networkReceiveRate + networkTransmitRate + servicesCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on KeyTransactionEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on MobileApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + applicationId + mobileSummary { + appLaunchCount + crashCount + crashRate + httpErrorRate + httpRequestCount + httpRequestRate + httpResponseTimeAverage + mobileSessionCount + networkFailureRate + usersAffectedCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on SecureCredentialEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + description + secureCredentialId + secureCredentialSummary { + failingMonitorCount + monitorCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + monitorId + monitorSummary { + locationsFailing + locationsRunning + status + successRate + } + monitorType + monitoredUrl + period + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on TeamEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on ThirdPartyServiceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on UnavailableEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + } + ... on WorkloadEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + createdAt + createdByUser { + email + gravatar + id + name + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + select { + attribute + function + threshold + } + where + } + goodEvents { + from + select { + attribute + function + threshold + } + where + } + validEvents { + from + select { + attribute + function + threshold + } + where + } + } + guid + id + name + objectives { + description + name + resultQueries { + attainment { + nrql + } + } + target + timeWindow { + rolling { + count + unit + } + } + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + slug + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + updatedAt + workloadStatus { + description + statusSource + statusValue + summary + } + } + } + rawConfiguration + title + visualization { + id + } + } + } + permissions + updatedAt + variables { + defaultValue { + string + } + defaultValues { + value { + string + } + } + isMultiSelection + items { + title + value + } + name + nrqlQuery { + accountIds + query + } + options { + excluded + ignoreTimeRange + } + replacementStrategy + title + type + } + } + errors { + description + type + } +} }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_types.go similarity index 77% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_types.go index 5979e17c44b..a4238c2e103 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/dashboards_types.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/dashboards_types.go @@ -1,6 +1,8 @@ package dashboards -import "time" +import ( + "time" +) // Dashboard represents information about a New Relic dashboard. type Dashboard struct { @@ -305,11 +307,91 @@ type RawConfiguration struct { // Used by viz.markdown Text string `json:"text,omitempty"` - // Used by viz.billboard - Thresholds []DashboardBillboardWidgetThresholdInput `json:"thresholds,omitempty"` + Thresholds interface{} `json:"thresholds,omitempty"` + Legend *DashboardWidgetLegend `json:"legend,omitempty"` + YAxisLeft *DashboardWidgetYAxisLeft `json:"yAxisLeft,omitempty"` + YAxisRight *DashboardWidgetYAxisRight `json:"yAxisRight,omitempty"` + NullValues *DashboardWidgetNullValues `json:"nullValues,omitempty"` + Units *DashboardWidgetUnits `json:"units,omitempty"` + Colors *DashboardWidgetColors `json:"colors,omitempty"` + Facet *DashboardWidgetFacet `json:"facet,omitempty"` + RefreshRate *DashboardWidgetRefreshRate `json:"refreshRate,omitempty"` + InitialSorting *DashboardWidgetInitialSorting `json:"initialSorting,omitempty"` + DataFormat []*DashboardWidgetDataFormat `json:"dataFormatters,omitempty"` } -// RawConfigurationPlatformOptions represents the platform widget options +// RawConfigurationPlatformOptions represents platform widget options type RawConfigurationPlatformOptions struct { IgnoreTimeRange bool `json:"ignoreTimeRange,omitempty"` } + +type DashboardWidgetLegend struct { + Enabled *bool `json:"enabled,omitempty"` +} + +type DashboardWidgetRefreshRate struct { + Frequency interface{} `json:"frequency,omitempty"` +} + +type DashboardWidgetInitialSorting struct { + Direction string `json:"direction,omitempty"` + Name string `json:"name,omitempty"` +} + +type DashboardWidgetDataFormat struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Format string `json:"format,omitempty"` + Precision int `json:"precision,omitempty"` +} + +type DashboardWidgetYAxisLeft struct { + Max float64 `json:"max,omitempty"` + Min *float64 `json:"min,omitempty"` + Zero *bool `json:"zero,omitempty"` +} + +type DashboardWidgetYAxisRight struct { + Max float64 `json:"max,omitempty"` + Min *float64 `json:"min,omitempty"` + Zero *bool `json:"zero,omitempty"` + Series []DashboardWidgetYAxisRightSeries `json:"series,omitempty"` +} + +type DashboardWidgetYAxisRightSeries struct { + Name DashboardWidgetYAxisRightSeriesName `json:"name,omitempty"` +} + +type DashboardWidgetYAxisRightSeriesName string + +type DashboardWidgetNullValues struct { + NullValue string `json:"nullValue,omitempty"` + SeriesOverrides []DashboardWidgetNullValueOverrides `json:"seriesOverrides,omitempty"` +} + +type DashboardWidgetNullValueOverrides struct { + NullValue string `json:"nullValue,omitempty"` + SeriesName string `json:"seriesName,omitempty"` +} +type DashboardWidgetUnits struct { + Unit string `json:"unit,omitempty"` + SeriesOverrides []DashboardWidgetUnitOverrides `json:"seriesOverrides,omitempty"` +} + +type DashboardWidgetUnitOverrides struct { + Unit string `json:"unit,omitempty"` + SeriesName string `json:"seriesName"` +} + +type DashboardWidgetColors struct { + Color string `json:"color,omitempty"` + SeriesOverrides []DashboardWidgetColorOverrides `json:"seriesOverrides,omitempty"` +} + +type DashboardWidgetColorOverrides struct { + Color string `json:"color,omitempty"` + SeriesName string `json:"seriesName,omitempty"` +} +type DashboardWidgetFacet struct { + ShowOtherSeries bool `json:"showOtherSeries,omitempty"` +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/doc.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/doc.go index b7af2988b15..4efac3e26d0 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/dashboards/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/doc.go @@ -6,13 +6,12 @@ on working with these resources: https://docs.newrelic.com/docs/insights/insights-api/manage-dashboards/insights-dashboard-api -Authentication +# Authentication You will need a Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package dashboards diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/type_overrides.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/type_overrides.go new file mode 100644 index 00000000000..dba23c216ac --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/type_overrides.go @@ -0,0 +1,46 @@ +// DashboardBillboardWidgetThresholdInput - Billboard widget threshold input. +package dashboards + +import "github.com/newrelic/newrelic-client-go/v2/pkg/entities" + +type DashboardBillboardWidgetThresholdInput struct { + // alert severity. + AlertSeverity entities.DashboardAlertSeverity `json:"alertSeverity,omitempty"` + // value. + Value *float64 `json:"value,omitempty"` +} + +type DashboardLineWidgetThresholdInput struct { + IsLabelVisible *bool `json:"isLabelVisible,omitempty"` + Thresholds []DashboardLineWidgetThresholdThresholdInput `json:"thresholds,omitempty"` +} + +type DashboardLineWidgetThresholdThresholdInput struct { + From string `json:"from,omitempty"` + To string `json:"to,omitempty"` + Name string `json:"name,omitempty"` + Severity DashboardLineTableWidgetsAlertSeverity `json:"severity,omitempty"` +} + +type DashboardTableWidgetThresholdInput struct { + From string `json:"from,omitempty"` + To string `json:"to,omitempty"` + ColumnName string `json:"columnName,omitempty"` + Severity DashboardLineTableWidgetsAlertSeverity `json:"severity,omitempty"` +} + +type DashboardLineTableWidgetsAlertSeverity string + +var DashboardLineTableWidgetsAlertSeverityTypes = struct { + SUCCESS DashboardLineTableWidgetsAlertSeverity + WARNING DashboardLineTableWidgetsAlertSeverity + UNAVAILABLE DashboardLineTableWidgetsAlertSeverity + SEVERE DashboardLineTableWidgetsAlertSeverity + CRITICAL DashboardLineTableWidgetsAlertSeverity +}{ + SUCCESS: "success", + WARNING: "warning", + UNAVAILABLE: "unavailable", + SEVERE: "severe", + CRITICAL: "critical", +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/types.go new file mode 100644 index 00000000000..7da90f527d4 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/dashboards/types.go @@ -0,0 +1,584 @@ +// Code generated by tutone: DO NOT EDIT +package dashboards + +import ( + "github.com/newrelic/newrelic-client-go/v2/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/entities" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrdb" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" +) + +// DashboardCreateErrorType - Expected error types that can be returned by create operation. +type DashboardCreateErrorType string + +var DashboardCreateErrorTypeTypes = struct { + // Invalid input error. + INVALID_INPUT DashboardCreateErrorType +}{ + // Invalid input error. + INVALID_INPUT: "INVALID_INPUT", +} + +// DashboardDeleteErrorType - Expected error types that can be returned by delete operation. +type DashboardDeleteErrorType string + +var DashboardDeleteErrorTypeTypes = struct { + // Dashboard not found in the system. + DASHBOARD_NOT_FOUND DashboardDeleteErrorType + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION DashboardDeleteErrorType +}{ + // Dashboard not found in the system. + DASHBOARD_NOT_FOUND: "DASHBOARD_NOT_FOUND", + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", +} + +// DashboardDeleteResultStatus - Result status of delete operation. +type DashboardDeleteResultStatus string + +var DashboardDeleteResultStatusTypes = struct { + // FAILURE. + FAILURE DashboardDeleteResultStatus + // SUCCESS. + SUCCESS DashboardDeleteResultStatus +}{ + // FAILURE. + FAILURE: "FAILURE", + // SUCCESS. + SUCCESS: "SUCCESS", +} + +// DashboardLiveURLType - Live URL type. +type DashboardLiveURLType string + +var DashboardLiveURLTypeTypes = struct { + // Dashboard. + DASHBOARD DashboardLiveURLType + // Widget. + WIDGET DashboardLiveURLType +}{ + // Dashboard. + DASHBOARD: "DASHBOARD", + // Widget. + WIDGET: "WIDGET", +} + +// DashboardUpdateErrorType - Expected error types that can be returned by update operation. +type DashboardUpdateErrorType string + +var DashboardUpdateErrorTypeTypes = struct { + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION DashboardUpdateErrorType + // Invalid input error. + INVALID_INPUT DashboardUpdateErrorType +}{ + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", + // Invalid input error. + INVALID_INPUT: "INVALID_INPUT", +} + +// DashboardUpdatePageErrorType - Expected error types that can be returned by updatePage operation. +type DashboardUpdatePageErrorType string + +var DashboardUpdatePageErrorTypeTypes = struct { + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION DashboardUpdatePageErrorType + // Invalid input error. + INVALID_INPUT DashboardUpdatePageErrorType + // Page not found in the system. + PAGE_NOT_FOUND DashboardUpdatePageErrorType +}{ + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", + // Invalid input error. + INVALID_INPUT: "INVALID_INPUT", + // Page not found in the system. + PAGE_NOT_FOUND: "PAGE_NOT_FOUND", +} + +// DashboardUpdateWidgetsInPageErrorType - Expected error types that can be returned by updateWidgetsInPage operation. +type DashboardUpdateWidgetsInPageErrorType string + +var DashboardUpdateWidgetsInPageErrorTypeTypes = struct { + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION DashboardUpdateWidgetsInPageErrorType + // Invalid input error. + INVALID_INPUT DashboardUpdateWidgetsInPageErrorType + // Page not found in the system. + PAGE_NOT_FOUND DashboardUpdateWidgetsInPageErrorType + // Widget not found in the system. + WIDGET_NOT_FOUND DashboardUpdateWidgetsInPageErrorType +}{ + // User is not allowed to execute the operation. + FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", + // Invalid input error. + INVALID_INPUT: "INVALID_INPUT", + // Page not found in the system. + PAGE_NOT_FOUND: "PAGE_NOT_FOUND", + // Widget not found in the system. + WIDGET_NOT_FOUND: "WIDGET_NOT_FOUND", +} + +// DashboardVariableReplacementStrategy - Possible strategies when replacing variables in a NRQL query. +type DashboardVariableReplacementStrategy string + +var DashboardVariableReplacementStrategyTypes = struct { + // Replace the variable based on its automatically-inferred type. + DEFAULT DashboardVariableReplacementStrategy + // Replace the variable value as an identifier. + IDENTIFIER DashboardVariableReplacementStrategy + // Replace the variable value as a number. + NUMBER DashboardVariableReplacementStrategy + // Replace the variable value as a string. + STRING DashboardVariableReplacementStrategy +}{ + // Replace the variable based on its automatically-inferred type. + DEFAULT: "DEFAULT", + // Replace the variable value as an identifier. + IDENTIFIER: "IDENTIFIER", + // Replace the variable value as a number. + NUMBER: "NUMBER", + // Replace the variable value as a string. + STRING: "STRING", +} + +// DashboardVariableType - Indicates where a variable's possible values may come from. +type DashboardVariableType string + +var DashboardVariableTypeTypes = struct { + // Value comes from an enumerated list of possible values. + ENUM DashboardVariableType + // Value comes from the results of a NRQL query. + NRQL DashboardVariableType + // Dashboard user can supply an arbitrary string value to variable. + STRING DashboardVariableType +}{ + // Value comes from an enumerated list of possible values. + ENUM: "ENUM", + // Value comes from the results of a NRQL query. + NRQL: "NRQL", + // Dashboard user can supply an arbitrary string value to variable. + STRING: "STRING", +} + +// DashboardAreaWidgetConfigurationInput - Configuration for visualization type 'viz.area' +type DashboardAreaWidgetConfigurationInput struct { + // NRQL queries. + NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` +} + +// DashboardBarWidgetConfigurationInput - Configuration for visualization type 'viz.bar'. Learn more about [bar](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#bar) widget. +type DashboardBarWidgetConfigurationInput struct { + // NRQL queries. + NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` +} + +// DashboardBillboardWidgetConfigurationInput - Configuration for visualization type 'viz.billboard'. Learn more about [billboard](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#billboard) widget. +type DashboardBillboardWidgetConfigurationInput struct { + // NRQL queries. + NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` + // Array of thresholds to categorize the results of the query in different groups. + Thresholds []DashboardBillboardWidgetThresholdInput `json:"thresholds,omitempty"` +} + +// DashboardCreateError - Expected errors that can be returned by create operation. +type DashboardCreateError struct { + // Error description. + Description string `json:"description,omitempty"` + // Error type. + Type DashboardCreateErrorType `json:"type"` +} + +// DashboardCreateResult - Result of create operation. +type DashboardCreateResult struct { + // Dashboard creation result. + EntityResult DashboardEntityResult `json:"entityResult,omitempty"` + // Expected errors while processing request. + Errors []DashboardCreateError `json:"errors,omitempty"` +} + +// DashboardDeleteError - Expected error types that can be returned by delete operation. +type DashboardDeleteError struct { + // Error description. + Description string `json:"description,omitempty"` + // Error type. + Type DashboardDeleteErrorType `json:"type"` +} + +// DashboardDeleteResult - Result of delete operation. +type DashboardDeleteResult struct { + // Expected errors while processing request. + Errors []DashboardDeleteError `json:"errors,omitempty"` + // The status of the attempted delete. + Status DashboardDeleteResultStatus `json:"status,omitempty"` +} + +// DashboardEntityResult - Public schema - `DashboardEntity` result representation for mutations. It's a subset of the `DashboardEntity` that inherits from the Entity type, but a complete different type. +type DashboardEntityResult struct { + // The New Relic account where the dashboard is created. + AccountID int `json:"accountId,omitempty"` + // Dashboard creation timestamp. + CreatedAt nrtime.DateTime `json:"createdAt,omitempty"` + // Brief text describing the dashboard. + Description string `json:"description,omitempty"` + // Unique entity identifier. + GUID common.EntityGUID `json:"guid,omitempty"` + // The name of the dashboard. + Name string `json:"name,omitempty"` + // Information of the user that owns the dashboard. + Owner entities.DashboardOwnerInfo `json:"owner,omitempty"` + // A nested block of all pages belonging to the dashboard. + Pages []entities.DashboardPage `json:"pages,omitempty"` + // Dashboard permissions configuration. + Permissions entities.DashboardPermissions `json:"permissions,omitempty"` + // Dashboard update timestamp. + UpdatedAt nrtime.DateTime `json:"updatedAt,omitempty"` + // Dashboard-local variable definitions. + Variables []entities.DashboardVariable `json:"variables,omitempty"` +} + +// DashboardInput - Dashboard input. +type DashboardInput struct { + // Brief text describing the dashboard. + Description string `json:"description,omitempty"` + // The name of the dashboard. + Name string `json:"name"` + // A nested block of all pages belonging to the dashboard. + Pages []DashboardPageInput `json:"pages,omitempty"` + // Permissions to set level of visibility & editing. + Permissions entities.DashboardPermissions `json:"permissions"` + // Dashboard-local variable definitions. + Variables []DashboardVariableInput `json:"variables,omitempty"` +} + +// DashboardLineWidgetConfigurationInput - Configuration for visualization type 'viz.line'. Learn more about [line](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#line) widget. +type DashboardLineWidgetConfigurationInput struct { + // NRQL queries. + NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` +} + +// DashboardLiveURL - Live URL. +type DashboardLiveURL struct { + // Creation date. + CreatedAt nrtime.EpochMilliseconds `json:"createdAt,omitempty"` + // Title that describes the source entity that is accessible through the public live URL. + Title string `json:"title,omitempty"` + // Live URL type. + Type DashboardLiveURLType `json:"type,omitempty"` + // Public URL. + URL string `json:"url"` + // The unique identifier of the public live URL. + Uuid string `json:"uuid"` +} + +// DashboardMarkdownWidgetConfigurationInput - Configuration for visualization type 'viz.markdown'. Learn more about [markdown](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#markdown) widget. +type DashboardMarkdownWidgetConfigurationInput struct { + // Markdown content of the widget. + Text string `json:"text"` +} + +// DashboardPageInput - Page input. +type DashboardPageInput struct { + // Brief text describing the page. + Description string `json:"description,omitempty"` + // Unique entity identifier of the Page to be updated. When null, it means a new Page will be created. + GUID common.EntityGUID `json:"guid,omitempty"` + // The name of the page. + Name string `json:"name"` + + // NOTE: The JSON description of the following attribute, "Widgets" has been modified manually + // (removal of "omitempty") to facilitate creating pages with no widgets (empty pages). + // Please DO NOT regenerate/modify this attribute and its datatype via Tutone (which would add "omitempty" back). + + // A nested block of all widgets belonging to the page. + Widgets []DashboardWidgetInput `json:"widgets"` +} + +// DashboardPieWidgetConfigurationInput - Configuration for visualization type 'viz.pie'. Learn more about [pie](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#pie) widget. +type DashboardPieWidgetConfigurationInput struct { + // NRQL queries. + NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` +} + +// DashboardSnapshotURLInput - Parameters that affect the data and the rendering of the dashboards returned by the snapshot url mutation. +type DashboardSnapshotURLInput struct { + // Period of time from which the data to be displayed on the dashboard will be obtained. + TimeWindow DashboardSnapshotURLTimeWindowInput `json:"timeWindow,omitempty"` +} + +// DashboardSnapshotURLTimeWindowInput - Period of time from which the data to be displayed on the dashboard will be obtained. +type DashboardSnapshotURLTimeWindowInput struct { + // The starting time of the time window. If specified, an endTime or a duration must also be specified. + BeginTime nrtime.EpochMilliseconds `json:"beginTime,omitempty"` + // The duration of the time window. + Duration nrtime.Milliseconds `json:"duration,omitempty"` + // The end time of the time window. If specified, a beginTime or a duration must also be specified. + EndTime nrtime.EpochMilliseconds `json:"endTime,omitempty"` +} + +// DashboardTableWidgetConfigurationInput - Configuration for visualization type 'viz.table'. Learn more about [table](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#table) widget. +type DashboardTableWidgetConfigurationInput struct { + // NRQL queries. + NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` +} + +// DashboardUpdateError - Expected errors that can be returned by update operation. +type DashboardUpdateError struct { + // Error description. + Description string `json:"description,omitempty"` + // Error type. + Type DashboardUpdateErrorType `json:"type"` +} + +// DashboardUpdatePageError - Expected errors that can be returned by updatePage operation. +type DashboardUpdatePageError struct { + // Error description. + Description string `json:"description,omitempty"` + // Error type. + Type DashboardUpdatePageErrorType `json:"type"` +} + +// DashboardUpdatePageInput - Page input used when updating an individual page. +type DashboardUpdatePageInput struct { + // Page description. + Description string `json:"description,omitempty"` + // Page name. + Name string `json:"name"` + + // NOTE: The JSON description of the following attribute, "Widgets" has been modified manually + // (removal of "omitempty") to facilitate creating pages with no widgets (empty pages). + // Please DO NOT regenerate/modify this attribute and its datatype via Tutone (which would add "omitempty" back). + + // Page widgets. + Widgets []DashboardWidgetInput `json:"widgets"` +} + +// DashboardUpdatePageResult - Result of updatePage operation. +type DashboardUpdatePageResult struct { + // Expected errors while processing request. No errors means successful request. + Errors []DashboardUpdatePageError `json:"errors,omitempty"` +} + +// DashboardUpdateResult - Result of update operation. +type DashboardUpdateResult struct { + // Dashboard update result. + EntityResult DashboardEntityResult `json:"entityResult,omitempty"` + // Expected errors while processing request. + Errors []DashboardUpdateError `json:"errors,omitempty"` +} + +// DashboardUpdateWidgetInput - Input type used when updating widgets. +type DashboardUpdateWidgetInput struct { + // Typed widgets are area, bar, billboard, line, markdown, pie, and table. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-typed) for more info. + Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"` + // ID of the widget to be updated. + ID string `json:"id"` + // The widget's position and size in the dashboard. + Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` + // Entities related to the widget. Currently only supports one Dashboard entity guid, but may allow other cases in the future. + LinkedEntityGUIDs []common.EntityGUID `json:"linkedEntityGuids"` + // Untyped widgets are all other widgets, such as bullet, histogram, inventory, etc. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-untyped) for more info. + RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` + // A title for the widget. + Title string `json:"title,omitempty"` + // Specifies how this widget will be visualized. If null, the WidgetConfigurationInput will be used to determine the visualization. + Visualization DashboardWidgetVisualizationInput `json:"visualization,omitempty"` +} + +// DashboardUpdateWidgetsInPageError - Expected errors that can be returned by updateWidgetsInPage operation. +type DashboardUpdateWidgetsInPageError struct { + // Error description. + Description string `json:"description,omitempty"` + // Error type. + Type DashboardUpdateWidgetsInPageErrorType `json:"type"` +} + +// DashboardUpdateWidgetsInPageResult - Result of updateWidgetsInPage operation. +type DashboardUpdateWidgetsInPageResult struct { + // Expected errors while processing request. No errors means successful request. + Errors []DashboardUpdateWidgetsInPageError `json:"errors,omitempty"` +} + +// DashboardVariable - Definition of a variable that is local to this dashboard. Variables are placeholders for dynamic values in widget NRQLs. +type DashboardVariable struct { + // [DEPRECATED] Default value for this variable. The actual value to be used will depend on the type. + DefaultValue DashboardVariableDefaultValue `json:"defaultValue,omitempty"` + // Default values for this variable. The actual value to be used will depend on the type. + DefaultValues []DashboardVariableDefaultItem `json:"defaultValues,omitempty"` + // Indicates whether this variable supports multiple selection or not. Only applies to variables of type NRQL or ENUM. + IsMultiSelection bool `json:"isMultiSelection,omitempty"` + // List of possible values for variables of type ENUM. + Items []DashboardVariableEnumItem `json:"items,omitempty"` + // Configuration for variables of type NRQL. + NRQLQuery DashboardVariableNRQLQuery `json:"nrqlQuery,omitempty"` + // Variable identifier. + Name string `json:"name,omitempty"` + // Options applied to the variable. + Options DashboardVariableOptions `json:"options,omitempty"` + // Indicates the strategy to apply when replacing a variable in a NRQL query. + ReplacementStrategy DashboardVariableReplacementStrategy `json:"replacementStrategy,omitempty"` + // Human-friendly display string for this variable. + Title string `json:"title,omitempty"` + // Specifies the data type of the variable and where its possible values may come from. + Type DashboardVariableType `json:"type,omitempty"` +} + +// DashboardVariableDefaultItem - Represents a possible default value item. +type DashboardVariableDefaultItem struct { + // The value of this default item. + Value DashboardVariableDefaultValue `json:"value,omitempty"` +} + +// DashboardVariableDefaultItemInput - Represents a possible default value item. +type DashboardVariableDefaultItemInput struct { + // The value of this default item. + Value DashboardVariableDefaultValueInput `json:"value,omitempty"` +} + +// DashboardVariableDefaultValue - Specifies a default value for variables. +type DashboardVariableDefaultValue struct { + // Default string value. + String string `json:"string,omitempty"` +} + +// DashboardVariableDefaultValueInput - Specifies a default value for variables. +type DashboardVariableDefaultValueInput struct { + // Default string value. + String string `json:"string,omitempty"` +} + +// DashboardVariableEnumItem - Represents a possible value for a variable of type ENUM. +type DashboardVariableEnumItem struct { + // A human-friendly display string for this value. + Title string `json:"title,omitempty"` + // A possible variable value. + Value string `json:"value,omitempty"` +} + +// DashboardVariableEnumItemInput - Input type that represents a possible value for a variable of type ENUM. +type DashboardVariableEnumItemInput struct { + // A human-friendly display string for this value. + Title string `json:"title,omitempty"` + // A possible variable value + Value string `json:"value"` +} + +// DashboardVariableInput - Definition of a variable that is local to this dashboard. Variables are placeholders for dynamic values in widget NRQLs. +type DashboardVariableInput struct { + // [DEPRECATED] Default value for this variable. The actual value to be used will depend on the type. + DefaultValue *DashboardVariableDefaultValueInput `json:"defaultValue,omitempty"` + // Default values for this variable. The actual value to be used will depend on the type. + DefaultValues *[]DashboardVariableDefaultItemInput `json:"defaultValues,omitempty"` + // Indicates whether this variable supports multiple selection or not. Only applies to variables of type NRQL or ENUM. + IsMultiSelection bool `json:"isMultiSelection,omitempty"` + // List of possible values for variables of type ENUM + Items []DashboardVariableEnumItemInput `json:"items,omitempty"` + // Configuration for variables of type NRQL. + NRQLQuery *DashboardVariableNRQLQueryInput `json:"nrqlQuery,omitempty"` + // Variable identifier. + Name string `json:"name"` + // Options applied to the variable + Options *DashboardVariableOptionsInput `json:"options,omitempty"` + // Indicates the strategy to apply when replacing a variable in a NRQL query. + ReplacementStrategy DashboardVariableReplacementStrategy `json:"replacementStrategy,omitempty"` + // Human-friendly display string for this variable. + Title string `json:"title,omitempty"` + // Specifies the data type of the variable and where its possible values may come from. + Type DashboardVariableType `json:"type"` +} + +// DashboardVariableNRQLQuery - Configuration for variables of type NRQL. +type DashboardVariableNRQLQuery struct { + // New Relic account ID(s) to issue the query against. + AccountIDs []int `json:"accountIds,omitempty"` + // NRQL formatted query. + Query nrdb.NRQL `json:"query"` +} + +// DashboardVariableNRQLQueryInput - Configuration for variables of type NRQL. +type DashboardVariableNRQLQueryInput struct { + // New Relic account ID(s) to issue the query against. + AccountIDs []int `json:"accountIds"` + // NRQL formatted query. + Query nrdb.NRQL `json:"query"` +} + +// DashboardVariableOptions - Options applied to the variable. +type DashboardVariableOptions struct { + // With this turned on, query condition defined with the variable will not be included in the query. + Excluded bool `json:"excluded,omitempty"` + // Only applies to variables of type NRQL. With this turned on, the time range for the NRQL query will override the time picker on dashboards and other pages. Turn this off to use the time picker as normal. + IgnoreTimeRange bool `json:"ignoreTimeRange,omitempty"` +} + +// DashboardVariableOptionsInput - Options applied to the variable +type DashboardVariableOptionsInput struct { + // With this turned on, query condition defined with the variable will not be included in the query. + Excluded *bool `json:"excluded,omitempty"` + // Only applies to variables of type NRQL. With this turned on, the time range for the NRQL query will override the time picker on dashboards and other pages. Turn this off to use the time picker as normal. + IgnoreTimeRange *bool `json:"ignoreTimeRange,omitempty"` +} + +// DashboardWidgetConfigurationInput - Typed configuration for known visualizations. At most one may be populated. +type DashboardWidgetConfigurationInput struct { + // Configuration for visualization type 'viz.area' + Area *DashboardAreaWidgetConfigurationInput `json:"area,omitempty"` + // Configuration for visualization type 'viz.bar' + Bar *DashboardBarWidgetConfigurationInput `json:"bar,omitempty"` + // Configuration for visualization type 'viz.billboard' + Billboard *DashboardBillboardWidgetConfigurationInput `json:"billboard,omitempty"` + // Configuration for visualization type 'viz.line' + Line *DashboardLineWidgetConfigurationInput `json:"line,omitempty"` + // Configuration for visualization type 'viz.markdown' + Markdown *DashboardMarkdownWidgetConfigurationInput `json:"markdown,omitempty"` + // Configuration for visualization type 'viz.pie' + Pie *DashboardPieWidgetConfigurationInput `json:"pie,omitempty"` + // Configuration for visualization type 'viz.table' + Table *DashboardTableWidgetConfigurationInput `json:"table,omitempty"` +} + +// DashboardWidgetInput - Widget input. +type DashboardWidgetInput struct { + // Typed widgets are area, bar, billboard, line, markdown, pie, and table. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-typed) for more info. + Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"` + // ID of the widget. If null, a new widget will be created and added to a dashboard. + ID string `json:"id,omitempty"` + // The widget's position and size in the dashboard. + Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` + // Entities related to the widget. Currently only supports one Dashboard entity guid, but may allow other cases in the future. + LinkedEntityGUIDs []common.EntityGUID `json:"linkedEntityGuids"` + // Untyped widgets are all other widgets, such as bullet, histogram, inventory, etc. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-untyped) for more info. + RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` + // A title for the widget. + Title string `json:"title,omitempty"` + // Specifies how this widget will be visualized. If null, the WidgetConfigurationInput will be used to determine the visualization. + Visualization DashboardWidgetVisualizationInput `json:"visualization,omitempty"` +} + +// DashboardWidgetLayoutInput - Widget layout input. +type DashboardWidgetLayoutInput struct { + // Column position of widget from top left, starting at 1. + Column int `json:"column,omitempty"` + // Height of the widget. Valid values are 1 to 12 inclusive. Defaults to 3. + Height int `json:"height,omitempty"` + // Row position of widget from top left, starting at 1. + Row int `json:"row,omitempty"` + // Width of the widget. Valid values are 1 to 12 inclusive. Defaults to 4. + Width int `json:"width,omitempty"` +} + +// DashboardWidgetNRQLQueryInput - NRQL query used by a widget. +type DashboardWidgetNRQLQueryInput struct { + // New Relic account ID to issue the query against. + AccountID int `json:"accountId"` + // NRQL formatted query. + Query nrdb.NRQL `json:"query"` +} + +// DashboardWidgetVisualizationInput - Visualization configuration. +type DashboardWidgetVisualizationInput struct { + // This field can either have a known type like `viz.area` or `.` in the case of [custom visualizations](https://developer.newrelic.com/explore-docs/custom-viz/build-visualization/). Check out [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-schema) for more info. + ID string `json:"id,omitempty"` +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/edge/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/doc.go similarity index 96% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/edge/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/doc.go index f16d30cb6cf..c9d6fd90d13 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/edge/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/doc.go @@ -3,13 +3,12 @@ Package edge provides a programmatic API for interacting with New Relic Edge wit infinite tracing. It can be used to enable New Relic Edge and retrieve relevant config parameters. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package edge diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/edge/edge.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/edge.go similarity index 71% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/edge/edge.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/edge.go index f9581afc045..c01e626e600 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/edge/edge.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/edge.go @@ -2,9 +2,9 @@ package edge import ( - "github.com/newrelic/newrelic-client-go/internal/http" - "github.com/newrelic/newrelic-client-go/pkg/config" - "github.com/newrelic/newrelic-client-go/pkg/logging" + "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" ) // Edge is used to communicate with the New Relic Edge product. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/edge/trace_observers.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/trace_observers.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/edge/trace_observers.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/trace_observers.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/edge/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/types.go similarity index 100% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/edge/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/edge/types.go diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/doc.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/doc.go similarity index 97% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/entities/doc.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/doc.go index a5864915cf8..5267e0dd9ea 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/doc.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/doc.go @@ -6,13 +6,12 @@ entities. It can be used for a variety of operations, including: - Creating, reading, updating, and deleting New Relic One entity tags -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package entities diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities.go new file mode 100644 index 00000000000..d981cb64dc4 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities.go @@ -0,0 +1,133 @@ +// Package entities provides a programmatic API for interacting with New Relic One entities. +package entities + +import ( + "errors" + "fmt" + "strconv" + "strings" + + "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" +) + +// Entities is used to communicate with the New Relic Entities product. +type Entities struct { + client http.Client + logger logging.Logger +} + +// New returns a new client for interacting with New Relic One entities. +func New(config config.Config) Entities { + return Entities{ + client: http.NewClient(config), + logger: config.GetLogger(), + } +} + +type EntitySearchParams struct { + Name string + Domain string + Type string + AlertSeverity string + IsReporting *bool + IsCaseSensitive bool + Tags []map[string]string +} + +func BuildEntitySearchNrqlQuery(params EntitySearchParams) string { + paramsMap := map[string]string{ + "name": params.Name, + "domain": params.Domain, + "type": params.Type, + } + + count := 0 + query := "" + for k, v := range paramsMap { + if v == "" { + continue + } + + // The default entity name search operator is `LIKE`. + // Change to `=` if case-sensitive option set to `true`. + matchOperator := "LIKE" + if k == "name" && params.IsCaseSensitive { + matchOperator = "=" + } + + if count == 0 { + if k == "name" { + // Handle case-sensitive name param + query = fmt.Sprintf("%s %s '%s'", k, matchOperator, v) + } else { + query = fmt.Sprintf("%s = '%s'", k, v) + } + } else { + if k == "name" { + // Handle case-sensitive name param + query = fmt.Sprintf("%s AND %s %s '%s'", query, k, matchOperator, v) + } else { + query = fmt.Sprintf("%s AND %s = '%s'", query, k, v) + } + + query = fmt.Sprintf("%s AND %s = '%s'", query, k, v) + } + + count++ + } + + if len(params.Tags) > 0 { + if count > 0 { + query = fmt.Sprintf("%s AND %s", query, BuildTagsNrqlQueryFragment(params.Tags)) + } else { + query = BuildTagsNrqlQueryFragment(params.Tags) + } + } + + if params.IsReporting != nil { + if count == 0 { + query = fmt.Sprintf("reporting = '%s'", strconv.FormatBool(*params.IsReporting)) + } else { + query = fmt.Sprintf("%s AND reporting = '%s'", query, strconv.FormatBool(*params.IsReporting)) + } + } + + return query +} + +func BuildTagsNrqlQueryFragment(tags []map[string]string) string { + var query string + + for i, t := range tags { + var q string + if i > 0 { + q = fmt.Sprintf(" AND tags.`%s` = '%s'", t["key"], t["value"]) + } else { + q = fmt.Sprintf("tags.`%s` = '%s'", t["key"], t["value"]) + } + + query = fmt.Sprintf("%s%s", query, q) + } + + return query +} + +func ConvertTagsToMap(tags []string) ([]map[string]string, error) { + tagBuilder := make([]map[string]string, 0) + + for _, x := range tags { + if !strings.Contains(x, ":") { + return []map[string]string{}, errors.New("tags must be specified as colon separated key:value pairs") + } + + v := strings.SplitN(x, ":", 2) + + tagBuilder = append(tagBuilder, map[string]string{ + "key": v[0], + "value": v[1], + }) + } + return tagBuilder, nil +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api.go new file mode 100644 index 00000000000..c0b63216258 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api.go @@ -0,0 +1,9093 @@ +// Code generated by tutone: DO NOT EDIT +package entities + +import ( + "context" + + "github.com/newrelic/newrelic-client-go/v2/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/errors" +) + +// Adds the provided tags to your specified entity, without deleting existing ones. +// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingAddTagsToEntity( + gUID common.EntityGUID, + tags []TaggingTagInput, +) (*TaggingMutationResult, error) { + return a.TaggingAddTagsToEntityWithContext(context.Background(), + gUID, + tags, + ) +} + +// Adds the provided tags to your specified entity, without deleting existing ones. +// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingAddTagsToEntityWithContext( + ctx context.Context, + gUID common.EntityGUID, + tags []TaggingTagInput, +) (*TaggingMutationResult, error) { + + resp := TaggingAddTagsToEntityQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + "tags": tags, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, TaggingAddTagsToEntityMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.TaggingMutationResult, nil +} + +type TaggingAddTagsToEntityQueryResponse struct { + TaggingMutationResult TaggingMutationResult `json:"TaggingAddTagsToEntity"` +} + +const TaggingAddTagsToEntityMutation = `mutation( + $guid: EntityGuid!, + $tags: [TaggingTagInput!]!, +) { taggingAddTagsToEntity( + guid: $guid, + tags: $tags, +) { + errors { + message + type + } +} }` + +// Delete specific tag keys from the entity. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingDeleteTagFromEntity( + gUID common.EntityGUID, + tagKeys []string, +) (*TaggingMutationResult, error) { + return a.TaggingDeleteTagFromEntityWithContext(context.Background(), + gUID, + tagKeys, + ) +} + +// Delete specific tag keys from the entity. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingDeleteTagFromEntityWithContext( + ctx context.Context, + gUID common.EntityGUID, + tagKeys []string, +) (*TaggingMutationResult, error) { + + resp := TaggingDeleteTagFromEntityQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + "tagKeys": tagKeys, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, TaggingDeleteTagFromEntityMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.TaggingMutationResult, nil +} + +type TaggingDeleteTagFromEntityQueryResponse struct { + TaggingMutationResult TaggingMutationResult `json:"TaggingDeleteTagFromEntity"` +} + +const TaggingDeleteTagFromEntityMutation = `mutation( + $guid: EntityGuid!, + $tagKeys: [String!]!, +) { taggingDeleteTagFromEntity( + guid: $guid, + tagKeys: $tagKeys, +) { + errors { + message + type + } +} }` + +// Delete specific tag key-values from the entity. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingDeleteTagValuesFromEntity( + gUID common.EntityGUID, + tagValues []TaggingTagValueInput, +) (*TaggingMutationResult, error) { + return a.TaggingDeleteTagValuesFromEntityWithContext(context.Background(), + gUID, + tagValues, + ) +} + +// Delete specific tag key-values from the entity. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingDeleteTagValuesFromEntityWithContext( + ctx context.Context, + gUID common.EntityGUID, + tagValues []TaggingTagValueInput, +) (*TaggingMutationResult, error) { + + resp := TaggingDeleteTagValuesFromEntityQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + "tagValues": tagValues, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, TaggingDeleteTagValuesFromEntityMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.TaggingMutationResult, nil +} + +type TaggingDeleteTagValuesFromEntityQueryResponse struct { + TaggingMutationResult TaggingMutationResult `json:"TaggingDeleteTagValuesFromEntity"` +} + +const TaggingDeleteTagValuesFromEntityMutation = `mutation( + $guid: EntityGuid!, + $tagValues: [TaggingTagValueInput!]!, +) { taggingDeleteTagValuesFromEntity( + guid: $guid, + tagValues: $tagValues, +) { + errors { + message + type + } +} }` + +// Replaces the entity's entire set of tags with the provided tag set. +// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingReplaceTagsOnEntity( + gUID common.EntityGUID, + tags []TaggingTagInput, +) (*TaggingMutationResult, error) { + return a.TaggingReplaceTagsOnEntityWithContext(context.Background(), + gUID, + tags, + ) +} + +// Replaces the entity's entire set of tags with the provided tag set. +// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +func (a *Entities) TaggingReplaceTagsOnEntityWithContext( + ctx context.Context, + gUID common.EntityGUID, + tags []TaggingTagInput, +) (*TaggingMutationResult, error) { + + resp := TaggingReplaceTagsOnEntityQueryResponse{} + vars := map[string]interface{}{ + "guid": gUID, + "tags": tags, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, TaggingReplaceTagsOnEntityMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.TaggingMutationResult, nil +} + +type TaggingReplaceTagsOnEntityQueryResponse struct { + TaggingMutationResult TaggingMutationResult `json:"TaggingReplaceTagsOnEntity"` +} + +const TaggingReplaceTagsOnEntityMutation = `mutation( + $guid: EntityGuid!, + $tags: [TaggingTagInput!]!, +) { taggingReplaceTagsOnEntity( + guid: $guid, + tags: $tags, +) { + errors { + message + type + } +} }` + +// Fetch a list of entities. +// +// You can fetch a max of 25 entities in one query. +// +// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +func (a *Entities) GetEntities( + gUIDs []common.EntityGUID, +) (*[]EntityInterface, error) { + return a.GetEntitiesWithContext(context.Background(), + gUIDs, + ) +} + +// Fetch a list of entities. +// +// You can fetch a max of 25 entities in one query. +// +// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +func (a *Entities) GetEntitiesWithContext( + ctx context.Context, + gUIDs []common.EntityGUID, +) (*[]EntityInterface, error) { + + resp := entitiesResponse{} + vars := map[string]interface{}{ + "guids": gUIDs, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getEntitiesQuery, vars, &resp); err != nil { + return nil, err + } + + if len(resp.Actor.Entities) == 0 { + return nil, errors.NewNotFound("") + } + + return &resp.Actor.Entities, nil +} + +const getEntitiesQuery = `query( + $guids: [EntityGuid]!, +) { actor { entities( + guids: $guids, +) { + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + domain + entityType + firstIndexedAt + goldenMetrics { + context { + account + guid + } + metrics { + metricName + name + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + guid + indexedAt + lastReportingChangeAt + name + permalink + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entityType + guid + } + target { + accountId + entityType + guid + } + type + } + reporting + serviceLevel { + indicators { + createdAt + description + entityGuid + guid + id + name + updatedAt + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + type + ... on ApmApplicationEntity { + __typename + account { + id + name + reportingEventTypes + } + apmBrowserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + } + apmSettings { + alias + captureMemcacheKeys + originalName + tracerType + } + apmSummary { + apdexScore + errorRate + hostCount + instanceCount + nonWebResponseTimeAverage + nonWebThroughput + responseTimeAverage + throughput + webResponseTimeAverage + webThroughput + } + applicationId + applicationInstancesV2 { + nextCursor + } + deployments { + changelog + description + permalink + revision + timestamp + user + } + language + metricGroupingIssues { + deniedMetricsCount + deniedMetricsRatePerMinute + metricNormalizationRuleId + mitigated + mitigationRateThreshold + mitigationRateWindowSize + } + metricNormalizationRules { + action + applicationGuid + applicationName + createdAt + enabled + evalOrder + id + matchExpression + notes + replacement + terminateChain + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + runningAgentVersions { + maxVersion + minVersion + } + settings { + apdexTarget + serverSideConfig + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on ApmDatabaseInstanceEntity { + __typename + account { + id + name + reportingEventTypes + } + host + portOrPath + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + vendor + } + ... on ApmExternalServiceEntity { + __typename + account { + id + name + reportingEventTypes + } + externalSummary { + responseTimeAverage + throughput + } + host + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on BrowserApplicationEntity { + __typename + account { + id + name + reportingEventTypes + } + agentInstallType + applicationId + browserProperties { + jsConfig + jsConfigScript + jsLoaderScript + } + browserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + pageLoadTimeMedian + spaResponseTimeAverage + spaResponseTimeMedian + } + metricGroupingIssues { + deniedMetricsCount + deniedMetricsRatePerMinute + metricNormalizationRuleId + mitigated + mitigationRateThreshold + mitigationRateWindowSize + } + metricNormalizationRules { + action + applicationGuid + applicationName + createdAt + enabled + evalOrder + id + matchExpression + notes + replacement + terminateChain + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + runningAgentVersions { + maxSemanticVersion + maxVersion + minSemanticVersion + minVersion + } + segmentAllowListAggregate { + segments + } + servingApmApplicationId + settings { + apdexTarget + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on DashboardEntity { + __typename + account { + id + name + reportingEventTypes + } + createdAt + dashboardParentGuid + description + owner { + email + userId + } + pages { + createdAt + description + guid + name + updatedAt + } + permissions + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + updatedAt + variables { + isMultiSelection + name + replacementStrategy + title + type + } + } + ... on ExternalEntity { + __typename + account { + id + name + reportingEventTypes + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on GenericEntity { + __typename + account { + id + name + reportingEventTypes + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on GenericInfrastructureEntity { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on InfrastructureAwsLambdaFunctionEntity { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + runtime + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on InfrastructureHostEntity { + __typename + account { + id + name + reportingEventTypes + } + hostSummary { + cpuUtilizationPercent + diskUsedPercent + memoryUsedPercent + networkReceiveRate + networkTransmitRate + servicesCount + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on KeyTransactionEntity { + __typename + account { + id + name + reportingEventTypes + } + apdexTarget + application { + guid + } + browserApdexTarget + metricName + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on MobileApplicationEntity { + __typename + account { + id + name + reportingEventTypes + } + applicationId + metricGroupingIssues { + deniedMetricsCount + deniedMetricsRatePerMinute + metricNormalizationRuleId + mitigated + mitigationRateThreshold + mitigationRateWindowSize + } + metricNormalizationRules { + action + applicationGuid + applicationName + createdAt + enabled + evalOrder + id + matchExpression + notes + replacement + terminateChain + } + mobileProperties { + applicationToken + } + mobileSettings { + useCrashReports + } + mobileSummary { + appLaunchCount + crashCount + crashRate + httpErrorRate + httpRequestCount + httpRequestRate + httpResponseTimeAverage + mobileSessionCount + networkFailureRate + usersAffectedCount + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on SecureCredentialEntity { + __typename + account { + id + name + reportingEventTypes + } + description + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + secureCredentialId + secureCredentialSummary { + failingMonitorCount + monitorCount + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + updatedAt + } + ... on SyntheticMonitorEntity { + __typename + account { + id + name + reportingEventTypes + } + monitorId + monitorSummary { + locationsFailing + locationsRunning + status + successRate + } + monitorType + monitoredUrl + period + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on TeamEntity { + __typename + account { + id + name + reportingEventTypes + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on ThirdPartyServiceEntity { + __typename + account { + id + name + reportingEventTypes + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on UnavailableEntity { + __typename + account { + id + name + reportingEventTypes + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on WorkloadEntity { + __typename + account { + id + name + reportingEventTypes + } + createdAt + createdByUser { + email + gravatar + id + name + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + } + relationships { + type + } + tags { + key + values + } + tagsWithMetadata { + key + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + updatedAt + workloadStatus { + description + statusSource + statusValue + summary + } + } +} } }` + +// Fetch a single entity. +// +// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +func (a *Entities) GetEntity( + gUID common.EntityGUID, +) (*EntityInterface, error) { + return a.GetEntityWithContext(context.Background(), + gUID, + ) +} + +// Fetch a single entity. +// +// For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +func (a *Entities) GetEntityWithContext( + ctx context.Context, + gUID common.EntityGUID, +) (*EntityInterface, error) { + + resp := entityResponse{} + vars := map[string]interface{}{ + "guid": gUID, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getEntityQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.Actor.Entity, nil +} + +const getEntityQuery = `query( + $guid: EntityGuid!, +) { actor { entity( + guid: $guid, +) { + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + domain + entityType + firstIndexedAt + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + definition { + eventId + eventObjectId + facet + from + select + where + } + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + guid + indexedAt + lastReportingChangeAt + name + permalink + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + source { + accountId + guid + } + target { + accountId + guid + } + } + ... on EntityRelationshipUserDefinedEdge { + __typename + createdByUser { + email + gravatar + id + name + } + source { + accountId + guid + } + target { + accountId + guid + } + } + } + } + relationships { + source { + accountId + entity { + __typename + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + reporting + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + events { + account { + id + name + } + badEvents { + from + where + } + goodEvents { + from + where + } + validEvents { + from + where + } + } + guid + id + name + objectives { + description + name + target + } + resultQueries { + goodEvents { + nrql + } + indicator { + nrql + } + validEvents { + nrql + } + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + type + ... on ApmApplicationEntity { + __typename + account { + id + name + reportingEventTypes + } + apmBrowserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + } + apmSettings { + alias + apmConfig { + apdexTarget + useServerSideConfig + } + captureMemcacheKeys + errorCollector { + enabled + expectedErrorClasses + expectedErrorCodes + ignoredErrorClasses + ignoredErrorCodes + } + jfr { + enabled + } + originalName + slowSql { + enabled + } + threadProfiler { + enabled + } + tracerType + transactionTracer { + captureMemcacheKeys + enabled + explainEnabled + explainThresholdType + explainThresholdValue + logSql + recordSql + stackTraceThreshold + transactionThresholdType + transactionThresholdValue + } + } + apmSummary { + apdexScore + errorRate + hostCount + instanceCount + nonWebResponseTimeAverage + nonWebThroughput + responseTimeAverage + throughput + webResponseTimeAverage + webThroughput + } + applicationId + applicationInstances { + agentSettingsAttributes { + attribute + value + } + details { + host + hostDisplayName + id + instanceName + language + name + } + environmentAttributes { + attribute + value + } + modules { + attributes { + name + value + } + name + version + } + } + applicationInstancesV2 { + applicationInstances { + agentSettingsAttributes { + attribute + value + } + details { + host + hostDisplayName + id + instanceName + language + name + } + environmentAttributes { + attribute + value + } + modules { + name + version + } + } + nextCursor + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + deployments { + changelog + description + permalink + revision + timestamp + user + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + language + metricGroupingIssues { + deniedMetricsCount + deniedMetricsRatePerMinute + metricNormalizationRuleId + mitigated + mitigationRateThreshold + mitigationRateWindowSize + } + metricNormalizationRules { + action + applicationGuid + applicationName + createdAt + enabled + evalOrder + id + matchExpression + notes + replacement + terminateChain + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + runningAgentVersions { + maxVersion + minVersion + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + settings { + apdexTarget + serverSideConfig + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on ApmDatabaseInstanceEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + host + portOrPath + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + vendor + } + ... on ApmExternalServiceEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + externalSummary { + responseTimeAverage + throughput + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + host + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on BrowserApplicationEntity { + __typename + account { + id + name + reportingEventTypes + } + agentInstallType + applicationId + browserProperties { + jsConfig + jsConfigScript + jsLoaderScript + } + browserSettings { + browserConfig { + apdexTarget + } + browserMonitoring { + ajax { + denyList + } + distributedTracing { + allowedOrigins + corsEnabled + corsUseNewrelicHeader + corsUseTracecontextHeaders + enabled + excludeNewrelicHeader + } + loader + pinnedVersion + privacy { + cookiesEnabled + } + } + sessionReplay { + autoStart + blockSelector + collectFonts + enabled + errorSamplingRate + inlineImages + inlineStylesheet + maskAllInputs + maskInputOptions { + color + date + datetimeLocal + email + month + number + range + search + select + tel + text + textArea + time + url + week + } + maskTextSelector + samplingRate + } + sessionTrace { + enabled + errorSamplingRate + mode + samplingRate + } + } + browserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + pageLoadTimeMedian + spaResponseTimeAverage + spaResponseTimeMedian + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + metricGroupingIssues { + deniedMetricsCount + deniedMetricsRatePerMinute + metricNormalizationRuleId + mitigated + mitigationRateThreshold + mitigationRateWindowSize + } + metricNormalizationRules { + action + applicationGuid + applicationName + createdAt + enabled + evalOrder + id + matchExpression + notes + replacement + terminateChain + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + runningAgentVersions { + maxSemanticVersion + maxVersion + minSemanticVersion + minVersion + } + segmentAllowListAggregate { + segments + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + servingApmApplicationId + settings { + apdexTarget + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on DashboardEntity { + __typename + account { + id + name + reportingEventTypes + } + createdAt + dashboardParentGuid + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + description + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + owner { + email + userId + } + pages { + createdAt + description + guid + name + owner { + email + userId + } + updatedAt + widgets { + id + layout { + column + height + row + width + } + linkedEntities { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + rawConfiguration + title + visualization { + id + } + } + } + permissions + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + updatedAt + variables { + defaultValue { + string + } + defaultValues { + value { + string + } + } + isMultiSelection + items { + title + value + } + name + nrqlQuery { + accountIds + query + } + options { + excluded + ignoreTimeRange + } + replacementStrategy + title + type + } + } + ... on ExternalEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on GenericEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on GenericInfrastructureEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + integrationTypeCode + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on InfrastructureAwsLambdaFunctionEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + integrationTypeCode + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + runtime + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on InfrastructureHostEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + hostSummary { + cpuUtilizationPercent + diskUsedPercent + memoryUsedPercent + networkReceiveRate + networkTransmitRate + servicesCount + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on KeyTransactionEntity { + __typename + account { + id + name + reportingEventTypes + } + apdexTarget + application { + entity { + __typename + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + guid + } + browserApdexTarget + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + metricName + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on MobileApplicationEntity { + __typename + account { + id + name + reportingEventTypes + } + applicationId + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + exception { + stackTrace { + frames { + filepath + formatted + line + name + } + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + metricGroupingIssues { + deniedMetricsCount + deniedMetricsRatePerMinute + metricNormalizationRuleId + mitigated + mitigationRateThreshold + mitigationRateWindowSize + } + metricNormalizationRules { + action + applicationGuid + applicationName + createdAt + enabled + evalOrder + id + matchExpression + notes + replacement + terminateChain + } + mobileProperties { + applicationToken + } + mobileSettings { + applicationExitInfo { + enabled + } + networkSettings { + aliases { + alias + hosts + } + filterMode + hideList + ignoredStatusCodeRules { + hosts + statusCodes + } + showList + } + useCrashReports + } + mobileSummary { + appLaunchCount + crashCount + crashRate + httpErrorRate + httpRequestCount + httpRequestRate + httpResponseTimeAverage + mobileSessionCount + networkFailureRate + usersAffectedCount + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on SecureCredentialEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + description + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + secureCredentialId + secureCredentialSummary { + failingMonitorCount + monitorCount + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + updatedAt + } + ... on SyntheticMonitorEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + monitorId + monitorSummary { + locationsFailing + locationsRunning + status + successRate + } + monitorType + monitoredUrl + period + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on TeamEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on ThirdPartyServiceEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on UnavailableEntity { + __typename + account { + id + name + reportingEventTypes + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + } + ... on WorkloadEntity { + __typename + account { + id + name + reportingEventTypes + } + createdAt + createdByUser { + email + gravatar + id + name + } + deploymentSearch { + results { + changelog + commit + deepLink + deploymentId + deploymentType + description + entityGuid + groupId + timestamp + user + version + } + } + goldenMetrics { + context { + account + guid + } + metrics { + definition { + eventId + eventObjectId + facet + from + select + where + } + metricName + name + originalDefinitions { + selectorValue + } + originalQueries { + query + selectorValue + } + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + recentAlertViolations { + agentUrl + alertSeverity + closedAt + label + level + openedAt + violationId + violationUrl + } + relatedEntities { + nextCursor + results { + __typename + createdAt + source { + accountId + guid + } + target { + accountId + guid + } + type + ... on EntityRelationshipDetectedEdge { + __typename + } + ... on EntityRelationshipUserDefinedEdge { + __typename + } + } + } + relationships { + source { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + target { + accountId + entity { + __typename + accountId + alertSeverity + domain + entityType + firstIndexedAt + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on KeyTransactionEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on TeamEntityOutline { + __typename + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + entityType + guid + } + type + } + serviceLevel { + indicators { + createdAt + createdBy { + email + gravatar + id + name + } + description + entityGuid + guid + id + name + objectives { + description + name + target + } + updatedAt + updatedBy { + email + gravatar + id + name + } + } + } + tags { + key + values + } + tagsWithMetadata { + key + values { + mutable + value + } + } + tracingSummary { + errorTraceCount + percentOfAllErrorTraces + } + updatedAt + workloadStatus { + description + statusSource + statusValue + summary + } + } +} } }` + +// Search for entities using a custom query. +// +// For more details on how to create a custom query +// and what entity data you can request, visit our +// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +// +// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. +func (a *Entities) GetEntitySearch( + options EntitySearchOptions, + query string, + queryBuilder EntitySearchQueryBuilder, + sortBy []EntitySearchSortCriteria, + sortByWithDirection []SortCriterionWithDirection, +) (*EntitySearch, error) { + return a.GetEntitySearchWithContext(context.Background(), + options, + query, + queryBuilder, + sortBy, + sortByWithDirection, + ) +} + +// Search for entities using a custom query. +// +// For more details on how to create a custom query +// and what entity data you can request, visit our +// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +// +// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. +func (a *Entities) GetEntitySearchWithContext( + ctx context.Context, + options EntitySearchOptions, + query string, + queryBuilder EntitySearchQueryBuilder, + sortBy []EntitySearchSortCriteria, + sortByWithDirection []SortCriterionWithDirection, +) (*EntitySearch, error) { + + resp := entitySearchResponse{} + vars := map[string]interface{}{ + "options": options, + "query": query, + "queryBuilder": queryBuilder, + "sortBy": sortBy, + "sortByWithDirection": sortByWithDirection, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getEntitySearchQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.Actor.EntitySearch, nil +} + +const getEntitySearchQuery = `query( + $queryBuilder: EntitySearchQueryBuilder, +) { actor { entitySearch( + queryBuilder: $queryBuilder, +) { + count + query + results { + entities { + __typename + account { + id + name + reportingEventTypes + } + accountId + alertSeverity + domain + entityType + firstIndexedAt + goldenMetrics { + context { + account + guid + } + metrics { + metricName + name + query + title + unit + } + } + goldenTags { + context { + account + guid + } + tags { + key + } + } + guid + indexedAt + lastReportingChangeAt + name + permalink + reporting + serviceLevel { + indicators { + createdAt + description + entityGuid + guid + id + name + updatedAt + } + } + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + apmBrowserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + } + apmSummary { + apdexScore + errorRate + hostCount + instanceCount + nonWebResponseTimeAverage + nonWebThroughput + responseTimeAverage + throughput + webResponseTimeAverage + webThroughput + } + applicationId + language + runningAgentVersions { + maxVersion + minVersion + } + settings { + apdexTarget + serverSideConfig + } + tags { + key + values + } + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + host + portOrPath + tags { + key + values + } + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + externalSummary { + responseTimeAverage + throughput + } + host + tags { + key + values + } + } + ... on BrowserApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + agentInstallType + applicationId + browserSummary { + ajaxRequestThroughput + ajaxResponseTimeAverage + jsErrorRate + pageLoadThroughput + pageLoadTimeAverage + pageLoadTimeMedian + spaResponseTimeAverage + spaResponseTimeMedian + } + runningAgentVersions { + maxSemanticVersion + maxVersion + minSemanticVersion + minVersion + } + servingApmApplicationId + settings { + apdexTarget + } + tags { + key + values + } + } + ... on DashboardEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + createdAt + dashboardParentGuid + owner { + email + userId + } + permissions + tags { + key + values + } + updatedAt + } + ... on ExternalEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + tags { + key + values + } + } + ... on GenericEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + tags { + key + values + } + } + ... on GenericInfrastructureEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + tags { + key + values + } + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + integrationTypeCode + runtime + tags { + key + values + } + } + ... on InfrastructureHostEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + hostSummary { + cpuUtilizationPercent + diskUsedPercent + memoryUsedPercent + networkReceiveRate + networkTransmitRate + servicesCount + } + tags { + key + values + } + } + ... on KeyTransactionEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + tags { + key + values + } + } + ... on MobileApplicationEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + applicationId + mobileSummary { + appLaunchCount + crashCount + crashRate + httpErrorRate + httpRequestCount + httpRequestRate + httpResponseTimeAverage + mobileSessionCount + networkFailureRate + usersAffectedCount + } + tags { + key + values + } + } + ... on SecureCredentialEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + description + secureCredentialId + secureCredentialSummary { + failingMonitorCount + monitorCount + } + tags { + key + values + } + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + monitorId + monitorSummary { + locationsFailing + locationsRunning + status + successRate + } + monitorType + monitoredUrl + period + tags { + key + values + } + } + ... on TeamEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + tags { + key + values + } + } + ... on ThirdPartyServiceEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + tags { + key + values + } + } + ... on UnavailableEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + tags { + key + values + } + } + ... on WorkloadEntityOutline { + __typename + account { + id + name + reportingEventTypes + } + createdAt + createdByUser { + email + gravatar + id + name + } + tags { + key + values + } + updatedAt + workloadStatus { + description + statusSource + statusValue + summary + } + } + } + nextCursor + } + types { + count + domain + entityType + type + } +} } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api_.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api_.go new file mode 100644 index 00000000000..f980e4bb7a5 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entities_api_.go @@ -0,0 +1,164 @@ +package entities + +import ( + "context" +) + +// Search for entities using a custom query. +// For more details on how to create a custom query +// and what entity data you can request, visit our +// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +// +// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. +func (a *Entities) GetEntitySearchByQuery( + options EntitySearchOptions, + query string, + sortBy []EntitySearchSortCriteria, +) (*EntitySearch, error) { + return a.GetEntitySearchByQueryWithContext(context.Background(), + options, + query, + sortBy, + ) +} + +// Search for entities using a custom query. +// +// For more details on how to create a custom query +// and what entity data you can request, visit our +// [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). +// +// Note: you must supply either a `query` OR a `queryBuilder` argument, not both. +func (a *Entities) GetEntitySearchByQueryWithContext( + ctx context.Context, + options EntitySearchOptions, + query string, + sortBy []EntitySearchSortCriteria, +) (*EntitySearch, error) { + + resp := entitySearchResponse{} + vars := map[string]interface{}{ + "options": options, + "query": query, + "sortBy": sortBy, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, getEntitySearchByQuery, vars, &resp); err != nil { + return nil, err + } + + return &resp.Actor.EntitySearch, nil +} + +const getEntitySearchByQuery = `query( + $query: String, +) { actor { entitySearch( + query: $query, +) { + count + query + results { + entities { + __typename + accountId + alertSeverity + domain + entityType + guid + indexedAt + name + permalink + reporting + tags { + key + values + } + type + ... on ApmApplicationEntityOutline { + __typename + applicationId + language + } + ... on ApmDatabaseInstanceEntityOutline { + __typename + host + portOrPath + vendor + } + ... on ApmExternalServiceEntityOutline { + __typename + host + } + ... on BrowserApplicationEntityOutline { + __typename + agentInstallType + applicationId + servingApmApplicationId + } + ... on DashboardEntityOutline { + __typename + createdAt + dashboardParentGuid + permissions + updatedAt + } + ... on ExternalEntityOutline { + __typename + } + ... on GenericEntityOutline { + __typename + tags { + key + values + } + } + ... on GenericInfrastructureEntityOutline { + __typename + integrationTypeCode + } + ... on InfrastructureAwsLambdaFunctionEntityOutline { + __typename + integrationTypeCode + runtime + } + ... on InfrastructureHostEntityOutline { + __typename + } + ... on MobileApplicationEntityOutline { + __typename + applicationId + } + ... on SecureCredentialEntityOutline { + __typename + description + secureCredentialId + updatedAt + } + ... on SyntheticMonitorEntityOutline { + __typename + monitorId + monitorType + monitoredUrl + period + } + ... on ThirdPartyServiceEntityOutline { + __typename + } + ... on UnavailableEntityOutline { + __typename + } + ... on WorkloadEntityOutline { + __typename + createdAt + updatedAt + } + } + nextCursor + } + types { + count + domain + entityType + type + } +} } }` diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entity.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity.go similarity index 94% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entity.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity.go index 0ef2c07a9f3..75f780dc347 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/entity.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity.go @@ -3,6 +3,7 @@ package entities import ( "encoding/json" "errors" + "strings" log "github.com/sirupsen/logrus" ) @@ -105,3 +106,13 @@ func (d *DashboardWidgetRawConfiguration) UnmarshalJSON(data []byte) error { *d = append((*d)[0:0], data...) return nil } + +func FindTagByKey(tags []EntityTag, key string) []string { + for _, t := range tags { + if strings.EqualFold(t.Key, key) { + return t.Values + } + } + + return []string{} +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity_guid_validator.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity_guid_validator.go new file mode 100644 index 00000000000..c75d9eed449 --- /dev/null +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/entity_guid_validator.go @@ -0,0 +1,70 @@ +package entities + +import ( + "encoding/base64" + "errors" + "fmt" + "strconv" + "strings" +) + +const ( + DELIMITER = "|" +) + +var EntityGUIDValidationErrorTypes = struct { + INVALID_ENTITY_GUID_ERROR EntityGUIDValidationError + EMPTY_ENTITY_TYPE_ERROR EntityGUIDValidationError + EMPTY_DOMAIN_ID_ERROR EntityGUIDValidationError +}{ + INVALID_ENTITY_GUID_ERROR: errors.New("invalid entity GUID format"), + EMPTY_ENTITY_TYPE_ERROR: errors.New("entity type is required"), + EMPTY_DOMAIN_ID_ERROR: errors.New("domain ID is required"), +} + +type EntityGUIDValidationError error + +// DecodedEntity represents the decoded entity information +type DecodedEntity struct { + AccountId int64 `json:"accountId"` + Domain string `json:"domain"` + EntityType string `json:"entityType"` + DomainId string `json:"domainId"` +} + +// DecodeEntityGuid decodes a string representation of an entity GUID and returns an GenericEntity (replaced with struct) +func DecodeEntityGuid(entityGuid string) (*DecodedEntity, error) { + decodedGuid, err := base64.RawStdEncoding.DecodeString(entityGuid) + if err != nil { + return nil, EntityGUIDValidationErrorTypes.INVALID_ENTITY_GUID_ERROR + } + + parts := strings.Split(string(decodedGuid), "|") + if len(parts) < 4 { + return nil, fmt.Errorf("%s: expected at least 4 parts delimited by '%s': %s", EntityGUIDValidationErrorTypes.INVALID_ENTITY_GUID_ERROR, DELIMITER, entityGuid) + } + + accountId, err := strconv.ParseInt(parts[0], 10, 64) + if err != nil { + return nil, fmt.Errorf("invalid account ID: %w", err) + } + + domain := parts[1] + entityType := parts[2] + domainId := parts[3] + + if entityType == "" { + return nil, EntityGUIDValidationErrorTypes.EMPTY_ENTITY_TYPE_ERROR + } + + if domainId == "" { + return nil, EntityGUIDValidationErrorTypes.EMPTY_DOMAIN_ID_ERROR + } + + return &DecodedEntity{ + AccountId: accountId, + Domain: domain, + EntityType: entityType, + DomainId: domainId, + }, nil +} diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/tags.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/tags.go similarity index 99% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/entities/tags.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/tags.go index c714a707fd6..ee903100586 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/tags.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/tags.go @@ -5,7 +5,7 @@ import ( "errors" "strings" - "github.com/newrelic/newrelic-client-go/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/common" ) // Tag represents a New Relic One entity tag. diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/types.go b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/types.go similarity index 57% rename from vendor/github.com/newrelic/newrelic-client-go/pkg/entities/types.go rename to vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/types.go index f2c73d77839..56b76e15bc9 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/entities/types.go +++ b/vendor/github.com/newrelic/newrelic-client-go/v2/pkg/entities/types.go @@ -5,69 +5,84 @@ import ( "encoding/json" "fmt" - "github.com/newrelic/newrelic-client-go/pkg/accounts" - "github.com/newrelic/newrelic-client-go/pkg/ai" - "github.com/newrelic/newrelic-client-go/pkg/common" - "github.com/newrelic/newrelic-client-go/pkg/nrdb" - "github.com/newrelic/newrelic-client-go/pkg/nrtime" - "github.com/newrelic/newrelic-client-go/pkg/servicelevel" - "github.com/newrelic/newrelic-client-go/pkg/users" + "github.com/newrelic/newrelic-client-go/v2/pkg/accounts" + "github.com/newrelic/newrelic-client-go/v2/pkg/common" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrdb" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" + "github.com/newrelic/newrelic-client-go/v2/pkg/servicelevel" + "github.com/newrelic/newrelic-client-go/v2/pkg/users" ) -type AccountStatus string - -var AccountStatusTypes = struct { - ACTIVE AccountStatus - AWAITING_USER_FROM_API AccountStatus - CANCELLED AccountStatus - DOWNGRADED AccountStatus - NEW AccountStatus - PAID_ACTIVE AccountStatus - PAID_NEW AccountStatus - PAID_PENDING AccountStatus - PENDING AccountStatus - UPGRADED AccountStatus +// AgentApplicationSegmentsListType - Allow lists have two different types. They are either internal lists or user lists. +type AgentApplicationSegmentsListType string + +var AgentApplicationSegmentsListTypeTypes = struct { + // INTERNAL refers to a list that has been generated by New Relic. + INTERNAL AgentApplicationSegmentsListType + // USER refers to a list that has been generated by the customer. + USER AgentApplicationSegmentsListType }{ - ACTIVE: "ACTIVE", - AWAITING_USER_FROM_API: "AWAITING_USER_FROM_API", - CANCELLED: "CANCELLED", - DOWNGRADED: "DOWNGRADED", - NEW: "NEW", - PAID_ACTIVE: "PAID_ACTIVE", - PAID_NEW: "PAID_NEW", - PAID_PENDING: "PAID_PENDING", - PENDING: "PENDING", - UPGRADED: "UPGRADED", -} - -// AgentApplicationSettingsBrowserLoader - Determines which Browser Loader will be configured. Some allowed return values are specified for backwards-compatibility and do not represent currently allowed values for new applications. + // INTERNAL refers to a list that has been generated by New Relic. + INTERNAL: "INTERNAL", + // USER refers to a list that has been generated by the customer. + USER: "USER", +} + +// AgentApplicationSettingsBrowserLoader - Determines which browser loader will be configured. Some allowed return values are specified for backwards-compatability and do not represent currently allowed values for new applications. // See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types) for further information. type AgentApplicationSettingsBrowserLoader string var AgentApplicationSettingsBrowserLoaderTypes = struct { - // "full" maps to "FULL". + // Use PRO instead FULL AgentApplicationSettingsBrowserLoader - // "lite" maps to "LITE". + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. LITE AgentApplicationSettingsBrowserLoader - // "none" maps to "NONE". + // Don't use an agent. NONE AgentApplicationSettingsBrowserLoader - // "spa" maps to "SPA". + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO AgentApplicationSettingsBrowserLoader + // This value is no longer in use. + RUM AgentApplicationSettingsBrowserLoader + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. SPA AgentApplicationSettingsBrowserLoader - // "xhr" maps to "XHR". + // This value is specified for backwards-compatability. XHR AgentApplicationSettingsBrowserLoader }{ - // "full" maps to "FULL". + // Use PRO instead FULL: "FULL", - // "lite" maps to "LITE". + // Lite: Gives you information about some basic page load timing and browser user information. Lacks the Browser Pro features and SPA features. LITE: "LITE", - // "none" maps to "NONE". + // Don't use an agent. NONE: "NONE", - // "spa" maps to "SPA". + // Pro: Gives you access to the Browser Pro features. Lacks the functionality designed for single page app monitoring. + PRO: "PRO", + // This value is no longer in use. + RUM: "RUM", + // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. SPA: "SPA", - // "xhr" maps to "XHR". + // This value is specified for backwards-compatability. XHR: "XHR", } +// AgentApplicationSettingsNetworkFilterMode - Configuration setting to apply either the show or hide strategy for network filtering. +type AgentApplicationSettingsNetworkFilterMode string + +var AgentApplicationSettingsNetworkFilterModeTypes = struct { + // Disables both show and hide confurations. + DISABLED AgentApplicationSettingsNetworkFilterMode + // Use the hide list configuration. + HIDE AgentApplicationSettingsNetworkFilterMode + // Use the show list configuration. + SHOW AgentApplicationSettingsNetworkFilterMode +}{ + // Disables both show and hide confurations. + DISABLED: "DISABLED", + // Use the hide list configuration. + HIDE: "HIDE", + // Use the show list configuration. + SHOW: "SHOW", +} + // AgentApplicationSettingsRecordSqlEnum - Obfuscation level for SQL queries reported in transaction trace nodes. // // When turned on, the New Relic agent will attempt to remove values from SQL qeries. @@ -84,7 +99,7 @@ var AgentApplicationSettingsBrowserLoaderTypes = struct { // SELECT * FROM Table WHERE ssn=? // ``` // -// This can behave differently for differnet applications and frameworks, please test for your specific case. +// This can behave differently for differnet applications and frameworks. Please test for your specific case. // Note: RAW collection is not campatible with High Security mode and cannot be set if your agent is running in that mode. type AgentApplicationSettingsRecordSqlEnum string @@ -93,27 +108,46 @@ var AgentApplicationSettingsRecordSqlEnumTypes = struct { OBFUSCATED AgentApplicationSettingsRecordSqlEnum // Query collection is turned off entirely. OFF AgentApplicationSettingsRecordSqlEnum - // If you are confident that full query data collection will not impact your data security or your users' privacy, you can change the setting to Raw, which will record all query values. NOTE: 'Raw' is not permitted when 'High security mode' is enabled. + // If you are confident that full query data collection will not impact your data security or your users' privacy, you can change the setting to RAW, which will record all query values. NOTE: 'RAW' is not permitted when 'High security mode' is enabled. RAW AgentApplicationSettingsRecordSqlEnum }{ // This is the default value. This setting strips string literals and numeric sequences from your queries and replaces them with the ? character. For example: the query select * from table where ssn='123-45-6789' would become select * from table where ssn=?. OBFUSCATED: "OBFUSCATED", // Query collection is turned off entirely. OFF: "OFF", - // If you are confident that full query data collection will not impact your data security or your users' privacy, you can change the setting to Raw, which will record all query values. NOTE: 'Raw' is not permitted when 'High security mode' is enabled. + // If you are confident that full query data collection will not impact your data security or your users' privacy, you can change the setting to RAW, which will record all query values. NOTE: 'RAW' is not permitted when 'High security mode' is enabled. RAW: "RAW", } +// AgentApplicationSettingsSessionTraceMode - Default (fixed_rate) or custom (probabilistic) option used to collect session traces. +type AgentApplicationSettingsSessionTraceMode string + +var AgentApplicationSettingsSessionTraceModeTypes = struct { + // Fixed Rate mode for Session Trace + // (Default) Session traces are randomly sampled and stored at a rate of 90/hour. + FIXED_RATE AgentApplicationSettingsSessionTraceMode + // Probabilistic mode for Session Trace + // (Custom) Opt to collect more session traces using percentage from 0-100. + PROBABILISTIC AgentApplicationSettingsSessionTraceMode +}{ + // Fixed Rate mode for Session Trace + // (Default) Session traces are randomly sampled and stored at a rate of 90/hour. + FIXED_RATE: "FIXED_RATE", + // Probabilistic mode for Session Trace + // (Custom) Opt to collect more session traces using percentage from 0-100. + PROBABILISTIC: "PROBABILISTIC", +} + // AgentApplicationSettingsThresholdTypeEnum - Determines whether a threshold is statically configured or dynamically configured. type AgentApplicationSettingsThresholdTypeEnum string var AgentApplicationSettingsThresholdTypeEnumTypes = struct { - // Configures the threshold to be 4 times the value of APDEX_T + // Configures the threshold to be 4 times the value of APDEX_T. APDEX_F AgentApplicationSettingsThresholdTypeEnum // Threshold will be statically configured via the corresponding "value" field. VALUE AgentApplicationSettingsThresholdTypeEnum }{ - // Configures the threshold to be 4 times the value of APDEX_T + // Configures the threshold to be 4 times the value of APDEX_T. APDEX_F: "APDEX_F", // Threshold will be statically configured via the corresponding "value" field. VALUE: "VALUE", @@ -123,113 +157,21 @@ var AgentApplicationSettingsThresholdTypeEnumTypes = struct { type AgentApplicationSettingsTracer string var AgentApplicationSettingsTracerTypes = struct { - // cross application tracing feature enabled + // Cross-application tracing feature enabled. CROSS_APPLICATION_TRACER AgentApplicationSettingsTracer - // distributed tracing feature enabled + // Distributed tracing feature enabled. DISTRIBUTED_TRACING AgentApplicationSettingsTracer - // both cross application & distributed tracing disabled + // Both cross-application and distributed tracing disabled. NONE AgentApplicationSettingsTracer }{ - // cross application tracing feature enabled + // Cross-application tracing feature enabled. CROSS_APPLICATION_TRACER: "CROSS_APPLICATION_TRACER", - // distributed tracing feature enabled + // Distributed tracing feature enabled. DISTRIBUTED_TRACING: "DISTRIBUTED_TRACING", - // both cross application & distributed tracing disabled + // Both cross-application and distributed tracing disabled. NONE: "NONE", } -// AgentTracesErrorTraceOrderByField - The different error trace fields to order by. -type AgentTracesErrorTraceOrderByField string - -var AgentTracesErrorTraceOrderByFieldTypes = struct { - // Error count. - COUNT AgentTracesErrorTraceOrderByField - // Error exception class. - EXCEPTION_CLASS AgentTracesErrorTraceOrderByField - // Error message. - MESSAGE AgentTracesErrorTraceOrderByField - // Error trace path. - PATH AgentTracesErrorTraceOrderByField - // Trace start time. - TIMESTAMP AgentTracesErrorTraceOrderByField -}{ - // Error count. - COUNT: "COUNT", - // Error exception class. - EXCEPTION_CLASS: "EXCEPTION_CLASS", - // Error message. - MESSAGE: "MESSAGE", - // Error trace path. - PATH: "PATH", - // Trace start time. - TIMESTAMP: "TIMESTAMP", -} - -// AgentTracesOrderByDirection - Order by diraction -type AgentTracesOrderByDirection string - -var AgentTracesOrderByDirectionTypes = struct { - // Ascending. - ASC AgentTracesOrderByDirection - // Descending. - DESC AgentTracesOrderByDirection -}{ - // Ascending. - ASC: "ASC", - // Descending. - DESC: "DESC", -} - -// AgentTracesSqlTraceOrderByField - The different SQL trace fields to order by. -type AgentTracesSqlTraceOrderByField string - -var AgentTracesSqlTraceOrderByFieldTypes = struct { - // Trace duration. - DURATION AgentTracesSqlTraceOrderByField - // Call time, maximum of all `call_count` traces. - MAX_CALL_TIME AgentTracesSqlTraceOrderByField - // SQL trace path. - PATH AgentTracesSqlTraceOrderByField - // Agent generated `sql_id`. - SQL_ID AgentTracesSqlTraceOrderByField - // Trace start time. - TIMESTAMP AgentTracesSqlTraceOrderByField - // Call time, as added across all `call_count` traces. - TOTAL_CALL_TIME AgentTracesSqlTraceOrderByField -}{ - // Trace duration. - DURATION: "DURATION", - // Call time, maximum of all `call_count` traces. - MAX_CALL_TIME: "MAX_CALL_TIME", - // SQL trace path. - PATH: "PATH", - // Agent generated `sql_id`. - SQL_ID: "SQL_ID", - // Trace start time. - TIMESTAMP: "TIMESTAMP", - // Call time, as added across all `call_count` traces. - TOTAL_CALL_TIME: "TOTAL_CALL_TIME", -} - -// AgentTracesTransactionTraceOrderByField - The different transaction trace fields to order by. -type AgentTracesTransactionTraceOrderByField string - -var AgentTracesTransactionTraceOrderByFieldTypes = struct { - // Trace duration. - DURATION AgentTracesTransactionTraceOrderByField - // Transaction trace path. - PATH AgentTracesTransactionTraceOrderByField - // Trace start time. - TIMESTAMP AgentTracesTransactionTraceOrderByField -}{ - // Trace duration. - DURATION: "DURATION", - // Transaction trace path. - PATH: "PATH", - // Trace start time. - TIMESTAMP: "TIMESTAMP", -} - // AiNotificationsChannelStatus - Channel statuses type AiNotificationsChannelStatus string @@ -281,6 +223,8 @@ var AiNotificationsChannelTypeTypes = struct { JIRA_CLASSIC AiNotificationsChannelType // Jira Nextgen channel type JIRA_NEXTGEN AiNotificationsChannelType + // Mobile push channel type + MOBILE_PUSH AiNotificationsChannelType // PagerDuty channel type PAGERDUTY_ACCOUNT_INTEGRATION AiNotificationsChannelType // Pager Duty channel type @@ -289,8 +233,14 @@ var AiNotificationsChannelTypeTypes = struct { SERVICENOW_EVENTS AiNotificationsChannelType // Servicenow incidents channel type SERVICENOW_INCIDENTS AiNotificationsChannelType + // ServiceNow app channel type + SERVICE_NOW_APP AiNotificationsChannelType // Slack channel type SLACK AiNotificationsChannelType + // Slack Collaboration channel type + SLACK_COLLABORATION AiNotificationsChannelType + // Legacy Slack channel type based on Incoming Webhooks + SLACK_LEGACY AiNotificationsChannelType // Webhook channel type WEBHOOK AiNotificationsChannelType }{ @@ -302,6 +252,8 @@ var AiNotificationsChannelTypeTypes = struct { JIRA_CLASSIC: "JIRA_CLASSIC", // Jira Nextgen channel type JIRA_NEXTGEN: "JIRA_NEXTGEN", + // Mobile push channel type + MOBILE_PUSH: "MOBILE_PUSH", // PagerDuty channel type PAGERDUTY_ACCOUNT_INTEGRATION: "PAGERDUTY_ACCOUNT_INTEGRATION", // Pager Duty channel type @@ -310,8 +262,14 @@ var AiNotificationsChannelTypeTypes = struct { SERVICENOW_EVENTS: "SERVICENOW_EVENTS", // Servicenow incidents channel type SERVICENOW_INCIDENTS: "SERVICENOW_INCIDENTS", + // ServiceNow app channel type + SERVICE_NOW_APP: "SERVICE_NOW_APP", // Slack channel type SLACK: "SLACK", + // Slack Collaboration channel type + SLACK_COLLABORATION: "SLACK_COLLABORATION", + // Legacy Slack channel type based on Incoming Webhooks + SLACK_LEGACY: "SLACK_LEGACY", // Webhook channel type WEBHOOK: "WEBHOOK", } @@ -326,6 +284,8 @@ var AiNotificationsDestinationStatusTypes = struct { AUTHORIZATION_ERROR AiNotificationsDestinationStatus // Authorization Warning destination status AUTHORIZATION_WARNING AiNotificationsDestinationStatus + // Auth Error destination status + AUTH_ERROR AiNotificationsDestinationStatus // Configuration Error destination status CONFIGURATION_ERROR AiNotificationsDestinationStatus // Default destination status @@ -334,6 +294,8 @@ var AiNotificationsDestinationStatusTypes = struct { DRAFT AiNotificationsDestinationStatus // Error channel status ERROR AiNotificationsDestinationStatus + // External Server Error destination status + EXTERNAL_SERVER_ERROR AiNotificationsDestinationStatus // Temporary Warning destination status TEMPORARY_WARNING AiNotificationsDestinationStatus // Tested channel status @@ -342,6 +304,10 @@ var AiNotificationsDestinationStatusTypes = struct { THROTTLED AiNotificationsDestinationStatus // Throttling Warning destination status THROTTLING_WARNING AiNotificationsDestinationStatus + // Timeout Error destination status + TIMEOUT_ERROR AiNotificationsDestinationStatus + // Uninstalled destination status + UNINSTALLED AiNotificationsDestinationStatus // Unknown Error destination status UNKNOWN_ERROR AiNotificationsDestinationStatus }{ @@ -351,6 +317,8 @@ var AiNotificationsDestinationStatusTypes = struct { AUTHORIZATION_ERROR: "AUTHORIZATION_ERROR", // Authorization Warning destination status AUTHORIZATION_WARNING: "AUTHORIZATION_WARNING", + // Auth Error destination status + AUTH_ERROR: "AUTH_ERROR", // Configuration Error destination status CONFIGURATION_ERROR: "CONFIGURATION_ERROR", // Default destination status @@ -359,6 +327,8 @@ var AiNotificationsDestinationStatusTypes = struct { DRAFT: "DRAFT", // Error channel status ERROR: "ERROR", + // External Server Error destination status + EXTERNAL_SERVER_ERROR: "EXTERNAL_SERVER_ERROR", // Temporary Warning destination status TEMPORARY_WARNING: "TEMPORARY_WARNING", // Tested channel status @@ -367,6 +337,10 @@ var AiNotificationsDestinationStatusTypes = struct { THROTTLED: "THROTTLED", // Throttling Warning destination status THROTTLING_WARNING: "THROTTLING_WARNING", + // Timeout Error destination status + TIMEOUT_ERROR: "TIMEOUT_ERROR", + // Uninstalled destination status + UNINSTALLED: "UNINSTALLED", // Unknown Error destination status UNKNOWN_ERROR: "UNKNOWN_ERROR", } @@ -381,14 +355,22 @@ var AiNotificationsDestinationTypeTypes = struct { EVENT_BRIDGE AiNotificationsDestinationType // Jira destination type JIRA AiNotificationsDestinationType + // Mobile push destination type + MOBILE_PUSH AiNotificationsDestinationType // PagerDuty destination type PAGERDUTY_ACCOUNT_INTEGRATION AiNotificationsDestinationType // PagerDuty destination type} PAGERDUTY_SERVICE_INTEGRATION AiNotificationsDestinationType // ServiceNow destination type SERVICE_NOW AiNotificationsDestinationType + // ServiceNow app destination type + SERVICE_NOW_APP AiNotificationsDestinationType // Slack destination type SLACK AiNotificationsDestinationType + // Slack Collaboration destination type + SLACK_COLLABORATION AiNotificationsDestinationType + // Legacy Slack destination type based on Incoming Webhooks + SLACK_LEGACY AiNotificationsDestinationType // WebHook destination type WEBHOOK AiNotificationsDestinationType }{ @@ -398,14 +380,22 @@ var AiNotificationsDestinationTypeTypes = struct { EVENT_BRIDGE: "EVENT_BRIDGE", // Jira destination type JIRA: "JIRA", + // Mobile push destination type + MOBILE_PUSH: "MOBILE_PUSH", // PagerDuty destination type PAGERDUTY_ACCOUNT_INTEGRATION: "PAGERDUTY_ACCOUNT_INTEGRATION", // PagerDuty destination type} PAGERDUTY_SERVICE_INTEGRATION: "PAGERDUTY_SERVICE_INTEGRATION", // ServiceNow destination type SERVICE_NOW: "SERVICE_NOW", + // ServiceNow app destination type + SERVICE_NOW_APP: "SERVICE_NOW_APP", // Slack destination type SLACK: "SLACK", + // Slack Collaboration destination type + SLACK_COLLABORATION: "SLACK_COLLABORATION", + // Legacy Slack destination type based on Incoming Webhooks + SLACK_LEGACY: "SLACK_LEGACY", // WebHook destination type WEBHOOK: "WEBHOOK", } @@ -416,6 +406,14 @@ type AiNotificationsProduct string var AiNotificationsProductTypes = struct { // Alerts product type ALERTS AiNotificationsProduct + // APM product type + APM AiNotificationsProduct + // Change tracking product type + CHANGE_TRACKING AiNotificationsProduct + // CSSP (EOPs) product type + CSSP AiNotificationsProduct + // Discussions and comments product type + DISCUSSIONS AiNotificationsProduct // Error Tracking product type ERROR_TRACKING AiNotificationsProduct // Incident Intelligence product type @@ -424,11 +422,21 @@ var AiNotificationsProductTypes = struct { NTFC AiNotificationsProduct // Proactive Detection product type PD AiNotificationsProduct + // Security product type + SECURITY AiNotificationsProduct // Sharing product type SHARING AiNotificationsProduct }{ // Alerts product type ALERTS: "ALERTS", + // APM product type + APM: "APM", + // Change tracking product type + CHANGE_TRACKING: "CHANGE_TRACKING", + // CSSP (EOPs) product type + CSSP: "CSSP", + // Discussions and comments product type + DISCUSSIONS: "DISCUSSIONS", // Error Tracking product type ERROR_TRACKING: "ERROR_TRACKING", // Incident Intelligence product type @@ -437,10 +445,51 @@ var AiNotificationsProductTypes = struct { NTFC: "NTFC", // Proactive Detection product type PD: "PD", + // Security product type + SECURITY: "SECURITY", // Sharing product type SHARING: "SHARING", } +// AiNotificationsVariableCategory - Category fields to group by +type AiNotificationsVariableCategory string + +var AiNotificationsVariableCategoryTypes = struct { + // Condition category + CONDITION AiNotificationsVariableCategory + // Entities category + ENTITIES AiNotificationsVariableCategory + // Incident category + INCIDENT AiNotificationsVariableCategory + // Issue category + ISSUE AiNotificationsVariableCategory + // Default category + OTHER AiNotificationsVariableCategory + // Policy category + POLICY AiNotificationsVariableCategory + // Tags category + TAGS AiNotificationsVariableCategory + // Workflow category + WORKFLOW AiNotificationsVariableCategory +}{ + // Condition category + CONDITION: "CONDITION", + // Entities category + ENTITIES: "ENTITIES", + // Incident category + INCIDENT: "INCIDENT", + // Issue category + ISSUE: "ISSUE", + // Default category + OTHER: "OTHER", + // Policy category + POLICY: "POLICY", + // Tags category + TAGS: "TAGS", + // Workflow category + WORKFLOW: "WORKFLOW", +} + // AiNotificationsVariableType - Variable types type AiNotificationsVariableType string @@ -468,216 +517,6 @@ var AiNotificationsVariableTypeTypes = struct { STRING: "STRING", } -// AiOpsEventsQueryContext - User preference context by which to scope event query results -type AiOpsEventsQueryContext string - -var AiOpsEventsQueryContextTypes = struct { - // AiOps overview and anomaly pages - AI_OPS AiOpsEventsQueryContext - // Activity feeds and other NR One contexts - GLOBAL AiOpsEventsQueryContext -}{ - // AiOps overview and anomaly pages - AI_OPS: "AI_OPS", - // Activity feeds and other NR One contexts - GLOBAL: "GLOBAL", -} - -// AiOpsProactiveDetectionEventConfigurationType - The type of configuration that is monitoring the event. -type AiOpsProactiveDetectionEventConfigurationType string - -var AiOpsProactiveDetectionEventConfigurationTypeTypes = struct { - // Entity is not monitored by a specific configuration and was automatically detected. - AUTOMATIC AiOpsProactiveDetectionEventConfigurationType - // Entity is being monitored by a Proactive Detection configuration. - CONFIGURATION AiOpsProactiveDetectionEventConfigurationType - // Entity is being monitored by a custom configuration - CUSTOM AiOpsProactiveDetectionEventConfigurationType - // Unknown configuration type. - UNKNOWN AiOpsProactiveDetectionEventConfigurationType -}{ - // Entity is not monitored by a specific configuration and was automatically detected. - AUTOMATIC: "AUTOMATIC", - // Entity is being monitored by a Proactive Detection configuration. - CONFIGURATION: "CONFIGURATION", - // Entity is being monitored by a custom configuration - CUSTOM: "CUSTOM", - // Unknown configuration type. - UNKNOWN: "UNKNOWN", -} - -// AiOpsProactiveDetectionEventMonitoringStatus - Proactive Detection monitoring status -type AiOpsProactiveDetectionEventMonitoringStatus string - -var AiOpsProactiveDetectionEventMonitoringStatusTypes = struct { - // Event recorded for an entity that is monitored by Proactive Detection - MONITORED AiOpsProactiveDetectionEventMonitoringStatus - // Unknown Proactive Detection event monitoring status - UNKNOWN AiOpsProactiveDetectionEventMonitoringStatus - // Event recorded for an entity that is NOT monitored by Proactive Detection - UNMONITORED AiOpsProactiveDetectionEventMonitoringStatus -}{ - // Event recorded for an entity that is monitored by Proactive Detection - MONITORED: "MONITORED", - // Unknown Proactive Detection event monitoring status - UNKNOWN: "UNKNOWN", - // Event recorded for an entity that is NOT monitored by Proactive Detection - UNMONITORED: "UNMONITORED", -} - -// AiOpsProactiveDetectionEventType - Proactive Detection event types -type AiOpsProactiveDetectionEventType string - -var AiOpsProactiveDetectionEventTypeTypes = struct { - // Event recorded when a Proactive Detection anomaly has ended - ANOMALY_CLOSE AiOpsProactiveDetectionEventType - // Event recorded when a Proactive Detection anomaly has begun - ANOMALY_OPEN AiOpsProactiveDetectionEventType - // Unknown Proactive Detection event type - UNKNOWN AiOpsProactiveDetectionEventType -}{ - // Event recorded when a Proactive Detection anomaly has ended - ANOMALY_CLOSE: "ANOMALY_CLOSE", - // Event recorded when a Proactive Detection anomaly has begun - ANOMALY_OPEN: "ANOMALY_OPEN", - // Unknown Proactive Detection event type - UNKNOWN: "UNKNOWN", -} - -// AiOpsSignalType - The signal type -type AiOpsSignalType string - -var AiOpsSignalTypeTypes = struct { - // APM application error count - APM_APPLICATION_ERRORCOUNT AiOpsSignalType - // APM application response time ms - APM_APPLICATION_RESPONSETIMEMS AiOpsSignalType - // APM application throughput - APM_APPLICATION_THROUGHPUT AiOpsSignalType - // Browser application errors - BROWSER_APPLICATION_ERRORS AiOpsSignalType - // Browser application first Input Delay (75 percentile) (ms) - BROWSER_APPLICATION_FIRSTINPUTDELAY75PERCENTILEMS AiOpsSignalType - // Browser application largest Contentful Paint (75 percentile) (s) - BROWSER_APPLICATION_LARGESTCONTENTFULPAINT75PERCENTILES AiOpsSignalType - // Browser application throughput (ppm) - BROWSER_APPLICATION_THROUGHPUTPPM AiOpsSignalType - // Error rate - ERROR_RATE AiOpsSignalType - // AWS volume average write time - INFRA_AWSEBSVOLUME_AVERAGEWRITETIMEMS AiOpsSignalType - // Container cpu usage - INFRA_CONTAINER_CPUUSAGE AiOpsSignalType - // Container cpu utilitization - INFRA_CONTAINER_CPUUTILIZATION AiOpsSignalType - // Container memory usage - INFRA_CONTAINER_MEMORYUSAGE AiOpsSignalType - // Container storage usage - INFRA_CONTAINER_STORAGEUSAGE AiOpsSignalType - // Host network traffic - INFRA_HOST_NETWORKTRAFFIC AiOpsSignalType - // Redis instance connected clients - INFRA_REDISINSTANCE_CONNECTEDCLIENTS AiOpsSignalType - // Redis instance keyspace misses per second - INFRA_REDISINSTANCE_KEYSPACEMISSESPERSECOND AiOpsSignalType - // Mobile application HTTP errors and network failures - MOBILE_APPLICATION_HTTPERRORSANDNETWORKFAILURES AiOpsSignalType - // Mobile application HTTP response time (95%) (s) - MOBILE_APPLICATION_HTTPRESPONSETIME95S AiOpsSignalType - // Mobile application requests per minute - MOBILE_APPLICATION_REQUESTSPERMINUTE AiOpsSignalType - // Custom NRQL query - NRQL AiOpsSignalType - // Non-web response time - RESPONSE_TIME_NON_WEB AiOpsSignalType - // Web Response time - RESPONSE_TIME_WEB AiOpsSignalType - // Synthetic monitor failures - SYNTH_MONITOR_FAILURES AiOpsSignalType - // Synthetic monitor median duration (s) - SYNTH_MONITOR_MEDIANDURATIONS AiOpsSignalType - // Non-web throughput - THROUGHPUT_NON_WEB AiOpsSignalType - // Web throughput - THROUGHPUT_WEB AiOpsSignalType - // Unknown - UNKNOWN AiOpsSignalType -}{ - // APM application error count - APM_APPLICATION_ERRORCOUNT: "APM_APPLICATION_ERRORCOUNT", - // APM application response time ms - APM_APPLICATION_RESPONSETIMEMS: "APM_APPLICATION_RESPONSETIMEMS", - // APM application throughput - APM_APPLICATION_THROUGHPUT: "APM_APPLICATION_THROUGHPUT", - // Browser application errors - BROWSER_APPLICATION_ERRORS: "BROWSER_APPLICATION_ERRORS", - // Browser application first Input Delay (75 percentile) (ms) - BROWSER_APPLICATION_FIRSTINPUTDELAY75PERCENTILEMS: "BROWSER_APPLICATION_FIRSTINPUTDELAY75PERCENTILEMS", - // Browser application largest Contentful Paint (75 percentile) (s) - BROWSER_APPLICATION_LARGESTCONTENTFULPAINT75PERCENTILES: "BROWSER_APPLICATION_LARGESTCONTENTFULPAINT75PERCENTILES", - // Browser application throughput (ppm) - BROWSER_APPLICATION_THROUGHPUTPPM: "BROWSER_APPLICATION_THROUGHPUTPPM", - // Error rate - ERROR_RATE: "ERROR_RATE", - // AWS volume average write time - INFRA_AWSEBSVOLUME_AVERAGEWRITETIMEMS: "INFRA_AWSEBSVOLUME_AVERAGEWRITETIMEMS", - // Container cpu usage - INFRA_CONTAINER_CPUUSAGE: "INFRA_CONTAINER_CPUUSAGE", - // Container cpu utilitization - INFRA_CONTAINER_CPUUTILIZATION: "INFRA_CONTAINER_CPUUTILIZATION", - // Container memory usage - INFRA_CONTAINER_MEMORYUSAGE: "INFRA_CONTAINER_MEMORYUSAGE", - // Container storage usage - INFRA_CONTAINER_STORAGEUSAGE: "INFRA_CONTAINER_STORAGEUSAGE", - // Host network traffic - INFRA_HOST_NETWORKTRAFFIC: "INFRA_HOST_NETWORKTRAFFIC", - // Redis instance connected clients - INFRA_REDISINSTANCE_CONNECTEDCLIENTS: "INFRA_REDISINSTANCE_CONNECTEDCLIENTS", - // Redis instance keyspace misses per second - INFRA_REDISINSTANCE_KEYSPACEMISSESPERSECOND: "INFRA_REDISINSTANCE_KEYSPACEMISSESPERSECOND", - // Mobile application HTTP errors and network failures - MOBILE_APPLICATION_HTTPERRORSANDNETWORKFAILURES: "MOBILE_APPLICATION_HTTPERRORSANDNETWORKFAILURES", - // Mobile application HTTP response time (95%) (s) - MOBILE_APPLICATION_HTTPRESPONSETIME95S: "MOBILE_APPLICATION_HTTPRESPONSETIME95S", - // Mobile application requests per minute - MOBILE_APPLICATION_REQUESTSPERMINUTE: "MOBILE_APPLICATION_REQUESTSPERMINUTE", - // Custom NRQL query - NRQL: "NRQL", - // Non-web response time - RESPONSE_TIME_NON_WEB: "RESPONSE_TIME_NON_WEB", - // Web Response time - RESPONSE_TIME_WEB: "RESPONSE_TIME_WEB", - // Synthetic monitor failures - SYNTH_MONITOR_FAILURES: "SYNTH_MONITOR_FAILURES", - // Synthetic monitor median duration (s) - SYNTH_MONITOR_MEDIANDURATIONS: "SYNTH_MONITOR_MEDIANDURATIONS", - // Non-web throughput - THROUGHPUT_NON_WEB: "THROUGHPUT_NON_WEB", - // Web throughput - THROUGHPUT_WEB: "THROUGHPUT_WEB", - // Unknown - UNKNOWN: "UNKNOWN", -} - -// AiOpsWebhookPayloadTemplateType - The type of template that will be used when the webhook is called. -type AiOpsWebhookPayloadTemplateType string - -var AiOpsWebhookPayloadTemplateTypeTypes = struct { - // The webhook will use a template that was provided by the user. - // No new attributes will be included uness the user manually updates the custom template. - CUSTOM AiOpsWebhookPayloadTemplateType - // The webhook to use the most recent default template. - // Any new attributes available to the webhook will be automatically included in the payload. - DEFAULT AiOpsWebhookPayloadTemplateType -}{ - // The webhook will use a template that was provided by the user. - // No new attributes will be included uness the user manually updates the custom template. - CUSTOM: "CUSTOM", - // The webhook to use the most recent default template. - // Any new attributes available to the webhook will be automatically included in the payload. - DEFAULT: "DEFAULT", -} - // AiWorkflowsDestinationType - Type of Destination Configuration type AiWorkflowsDestinationType string @@ -688,6 +527,8 @@ var AiWorkflowsDestinationTypeTypes = struct { EVENT_BRIDGE AiWorkflowsDestinationType // Jira Destination Configuration type JIRA AiWorkflowsDestinationType + // New Relic Mobile Push Destination Configuration type + MOBILE_PUSH AiWorkflowsDestinationType // Pager Duty Destination Configuration type PAGERDUTY AiWorkflowsDestinationType // Pager Duty with account integration Destination Configuration type @@ -696,8 +537,12 @@ var AiWorkflowsDestinationTypeTypes = struct { PAGERDUTY_SERVICE_INTEGRATION AiWorkflowsDestinationType // Service Now Destination Configuration type SERVICE_NOW AiWorkflowsDestinationType + // ServiceNow official NewRelic app Configuration type + SERVICE_NOW_APP AiWorkflowsDestinationType // Slack Destination Configuration type SLACK AiWorkflowsDestinationType + // Slack legacy Destination Configuration type + SLACK_LEGACY AiWorkflowsDestinationType // Webhook Destination Configuration type WEBHOOK AiWorkflowsDestinationType }{ @@ -707,6 +552,8 @@ var AiWorkflowsDestinationTypeTypes = struct { EVENT_BRIDGE: "EVENT_BRIDGE", // Jira Destination Configuration type JIRA: "JIRA", + // New Relic Mobile Push Destination Configuration type + MOBILE_PUSH: "MOBILE_PUSH", // Pager Duty Destination Configuration type PAGERDUTY: "PAGERDUTY", // Pager Duty with account integration Destination Configuration type @@ -715,8 +562,12 @@ var AiWorkflowsDestinationTypeTypes = struct { PAGERDUTY_SERVICE_INTEGRATION: "PAGERDUTY_SERVICE_INTEGRATION", // Service Now Destination Configuration type SERVICE_NOW: "SERVICE_NOW", + // ServiceNow official NewRelic app Configuration type + SERVICE_NOW_APP: "SERVICE_NOW_APP", // Slack Destination Configuration type SLACK: "SLACK", + // Slack legacy Destination Configuration type + SLACK_LEGACY: "SLACK_LEGACY", // Webhook Destination Configuration type WEBHOOK: "WEBHOOK", } @@ -747,88 +598,115 @@ var AiWorkflowsFilterTypeTypes = struct { VIEW: "VIEW", } +// AiWorkflowsMutingRulesHandling - The wanted behavior for muted issues in the workflow +type AiWorkflowsMutingRulesHandling string + +var AiWorkflowsMutingRulesHandlingTypes = struct { + // Notify only about partially muted and unmuted issues + DONT_NOTIFY_FULLY_MUTED_ISSUES AiWorkflowsMutingRulesHandling + // Notify only about unmuted issues + DONT_NOTIFY_FULLY_OR_PARTIALLY_MUTED_ISSUES AiWorkflowsMutingRulesHandling + // Notify about all issues + NOTIFY_ALL_ISSUES AiWorkflowsMutingRulesHandling +}{ + // Notify only about partially muted and unmuted issues + DONT_NOTIFY_FULLY_MUTED_ISSUES: "DONT_NOTIFY_FULLY_MUTED_ISSUES", + // Notify only about unmuted issues + DONT_NOTIFY_FULLY_OR_PARTIALLY_MUTED_ISSUES: "DONT_NOTIFY_FULLY_OR_PARTIALLY_MUTED_ISSUES", + // Notify about all issues + NOTIFY_ALL_ISSUES: "NOTIFY_ALL_ISSUES", +} + +// AiWorkflowsNotificationTrigger - Notification Triggers for the Destination Configuration +type AiWorkflowsNotificationTrigger string + +var AiWorkflowsNotificationTriggerTypes = struct { + // Send a notification when the issue is acknowledged + ACKNOWLEDGED AiWorkflowsNotificationTrigger + // Send a notification when the issue is activated + ACTIVATED AiWorkflowsNotificationTrigger + // Send a notification when the issue is closed + CLOSED AiWorkflowsNotificationTrigger + // Sends notification when the issue has other updates + OTHER_UPDATES AiWorkflowsNotificationTrigger + // Send a notification when the issue's priority has changed + PRIORITY_CHANGED AiWorkflowsNotificationTrigger +}{ + // Send a notification when the issue is acknowledged + ACKNOWLEDGED: "ACKNOWLEDGED", + // Send a notification when the issue is activated + ACTIVATED: "ACTIVATED", + // Send a notification when the issue is closed + CLOSED: "CLOSED", + // Sends notification when the issue has other updates + OTHER_UPDATES: "OTHER_UPDATES", + // Send a notification when the issue's priority has changed + PRIORITY_CHANGED: "PRIORITY_CHANGED", +} + // AiWorkflowsOperator - Type of Filter type AiWorkflowsOperator string var AiWorkflowsOperatorTypes = struct { - // Contains this value + // String or list attribute contains this value CONTAINS AiWorkflowsOperator - // Does not contain this value + // String or list attribute does not contain this value DOES_NOT_CONTAIN AiWorkflowsOperator - // Not equal this value + // String or Numeric attribute does not equal this value DOES_NOT_EQUAL AiWorkflowsOperator - // Does not exactly match this value + // Element in list attribute does not exactly match this value DOES_NOT_EXACTLY_MATCH AiWorkflowsOperator - // Ends with this value + // String attribute ends with this value ENDS_WITH AiWorkflowsOperator - // Equals this value + // String or Numeric attribute equals this value EQUAL AiWorkflowsOperator - // Exactly matches this value + // Element in list attribute exactly matches this value EXACTLY_MATCHES AiWorkflowsOperator - // Greater or equal to this value + // Numeric attribute is greater or equal to this value GREATER_OR_EQUAL AiWorkflowsOperator - // Greater than + // Numeric attribute is greater than this value GREATER_THAN AiWorkflowsOperator - // is this boolean value + // Boolean attribute equals value IS AiWorkflowsOperator - // is not this boolean value + // Boolean attribute does not equal value IS_NOT AiWorkflowsOperator - // Less or equal to this value + // Numeric attribute is less or equal to this value LESS_OR_EQUAL AiWorkflowsOperator - // Less than this value + // Numeric attribute is less than this value LESS_THAN AiWorkflowsOperator - // Starts with this value + // String attribute starts with this value STARTS_WITH AiWorkflowsOperator }{ - // Contains this value + // String or list attribute contains this value CONTAINS: "CONTAINS", - // Does not contain this value + // String or list attribute does not contain this value DOES_NOT_CONTAIN: "DOES_NOT_CONTAIN", - // Not equal this value + // String or Numeric attribute does not equal this value DOES_NOT_EQUAL: "DOES_NOT_EQUAL", - // Does not exactly match this value + // Element in list attribute does not exactly match this value DOES_NOT_EXACTLY_MATCH: "DOES_NOT_EXACTLY_MATCH", - // Ends with this value + // String attribute ends with this value ENDS_WITH: "ENDS_WITH", - // Equals this value + // String or Numeric attribute equals this value EQUAL: "EQUAL", - // Exactly matches this value + // Element in list attribute exactly matches this value EXACTLY_MATCHES: "EXACTLY_MATCHES", - // Greater or equal to this value + // Numeric attribute is greater or equal to this value GREATER_OR_EQUAL: "GREATER_OR_EQUAL", - // Greater than + // Numeric attribute is greater than this value GREATER_THAN: "GREATER_THAN", - // is this boolean value + // Boolean attribute equals value IS: "IS", - // is not this boolean value + // Boolean attribute does not equal value IS_NOT: "IS_NOT", - // Less or equal to this value + // Numeric attribute is less or equal to this value LESS_OR_EQUAL: "LESS_OR_EQUAL", - // Less than this value + // Numeric attribute is less than this value LESS_THAN: "LESS_THAN", - // Starts with this value + // String attribute starts with this value STARTS_WITH: "STARTS_WITH", } -// ApmApplicationRecentActivityType - Recent activity types for an APM application. -type ApmApplicationRecentActivityType string - -var ApmApplicationRecentActivityTypeTypes = struct { - // An update to the agent instrumentation on an APM application. - INSTRUMENTATION ApmApplicationRecentActivityType - // A notification relating to the APM application agent. - NOTIFICATION ApmApplicationRecentActivityType - // A change to the agent settings of an APM application. - SETTINGS_CHANGE ApmApplicationRecentActivityType -}{ - // An update to the agent instrumentation on an APM application. - INSTRUMENTATION: "INSTRUMENTATION", - // A notification relating to the APM application agent. - NOTIFICATION: "NOTIFICATION", - // A change to the agent settings of an APM application. - SETTINGS_CHANGE: "SETTINGS_CHANGE", -} - // BrowserAgentInstallType - Browser agent install types. type BrowserAgentInstallType string @@ -848,72 +726,57 @@ var BrowserAgentInstallTypeTypes = struct { PRO_SPA: "PRO_SPA", } +// ChangeTrackingDeploymentType - Type of deployment. +type ChangeTrackingDeploymentType string + +var ChangeTrackingDeploymentTypeTypes = struct { + // A vanilla deployment + BASIC ChangeTrackingDeploymentType + // Blue-green deployment + BLUE_GREEN ChangeTrackingDeploymentType + // Canary deployment + CANARY ChangeTrackingDeploymentType + // Other types of deployment. + OTHER ChangeTrackingDeploymentType + // Rolling deployment. + ROLLING ChangeTrackingDeploymentType + // Shadow deployment + SHADOW ChangeTrackingDeploymentType +}{ + // A vanilla deployment + BASIC: "BASIC", + // Blue-green deployment + BLUE_GREEN: "BLUE_GREEN", + // Canary deployment + CANARY: "CANARY", + // Other types of deployment. + OTHER: "OTHER", + // Rolling deployment. + ROLLING: "ROLLING", + // Shadow deployment + SHADOW: "SHADOW", +} + // DashboardAlertSeverity - Alert severity. type DashboardAlertSeverity string var DashboardAlertSeverityTypes = struct { - // CRITICAL + // CRITICAL. CRITICAL DashboardAlertSeverity - // NOT_ALERTING + // NOT_ALERTING. NOT_ALERTING DashboardAlertSeverity - // WARNING + // WARNING. WARNING DashboardAlertSeverity }{ - // CRITICAL + // CRITICAL. CRITICAL: "CRITICAL", - // NOT_ALERTING + // NOT_ALERTING. NOT_ALERTING: "NOT_ALERTING", - // WARNING + // WARNING. WARNING: "WARNING", } -// DashboardEditable - Editable. -type DashboardEditable string - -var DashboardEditableTypes = struct { - // EDITABLE_BY_ALL. - EDITABLE_BY_ALL DashboardEditable - // EDITABLE_BY_OWNER. - EDITABLE_BY_OWNER DashboardEditable - // READ_ONLY. - READ_ONLY DashboardEditable -}{ - // EDITABLE_BY_ALL. - EDITABLE_BY_ALL: "EDITABLE_BY_ALL", - // EDITABLE_BY_OWNER. - EDITABLE_BY_OWNER: "EDITABLE_BY_OWNER", - // READ_ONLY. - READ_ONLY: "READ_ONLY", -} - -// DashboardEntityAlertStatus - Entity alert status. -type DashboardEntityAlertStatus string - -var DashboardEntityAlertStatusTypes = struct { - // Not alerting. - GREEN DashboardEntityAlertStatus - // Entity not reporting. - GREY DashboardEntityAlertStatus - // No alerts set up. - LIGHT_GREEN DashboardEntityAlertStatus - // Critical violation. - RED DashboardEntityAlertStatus - // Warning violation. - YELLOW DashboardEntityAlertStatus -}{ - // Not alerting. - GREEN: "GREEN", - // Entity not reporting. - GREY: "GREY", - // No alerts set up. - LIGHT_GREEN: "LIGHT_GREEN", - // Critical violation. - RED: "RED", - // Warning violation. - YELLOW: "YELLOW", -} - -// DashboardEntityPermissions - Permissions that represent visibility & editability +// DashboardEntityPermissions - Permisions that represent visibility & editability type DashboardEntityPermissions string var DashboardEntityPermissionsTypes = struct { @@ -932,276 +795,46 @@ var DashboardEntityPermissionsTypes = struct { PUBLIC_READ_WRITE: "PUBLIC_READ_WRITE", } -// DashboardEntityType - Entity type. -type DashboardEntityType string - -var DashboardEntityTypeTypes = struct { - // An APM Application. - APM_APPLICATION_ENTITY DashboardEntityType - // A database instance seen by an APM Application. - APM_DATABASE_INSTANCE_ENTITY DashboardEntityType - // An external service seen by an APM Application. - APM_EXTERNAL_SERVICE_ENTITY DashboardEntityType - // A Browser Application. - BROWSER_APPLICATION_ENTITY DashboardEntityType - // An Insights entity. - DASHBOARD_ENTITY DashboardEntityType - // A Generic Entity with no detailed data. - GENERIC_ENTITY DashboardEntityType - // An Infrastructure entity. - GENERIC_INFRASTRUCTURE_ENTITY DashboardEntityType - // An Infrastructure Integration AWS Lambda Function entity. - INFRASTRUCTURE_AWS_LAMBDA_FUNCTION_ENTITY DashboardEntityType - // An Infrastructure Host entity. - INFRASTRUCTURE_HOST_ENTITY DashboardEntityType - // A Mobile Application. - MOBILE_APPLICATION_ENTITY DashboardEntityType - // A entity that is unavailable. - UNAVAILABLE_ENTITY DashboardEntityType - // A Workload Entity. - WORKLOAD_ENTITY DashboardEntityType -}{ - // An APM Application. - APM_APPLICATION_ENTITY: "APM_APPLICATION_ENTITY", - // A database instance seen by an APM Application. - APM_DATABASE_INSTANCE_ENTITY: "APM_DATABASE_INSTANCE_ENTITY", - // An external service seen by an APM Application. - APM_EXTERNAL_SERVICE_ENTITY: "APM_EXTERNAL_SERVICE_ENTITY", - // A Browser Application. - BROWSER_APPLICATION_ENTITY: "BROWSER_APPLICATION_ENTITY", - // An Insights entity. - DASHBOARD_ENTITY: "DASHBOARD_ENTITY", - // A Generic Entity with no detailed data. - GENERIC_ENTITY: "GENERIC_ENTITY", - // An Infrastructure entity. - GENERIC_INFRASTRUCTURE_ENTITY: "GENERIC_INFRASTRUCTURE_ENTITY", - // An Infrastructure Integration AWS Lambda Function entity. - INFRASTRUCTURE_AWS_LAMBDA_FUNCTION_ENTITY: "INFRASTRUCTURE_AWS_LAMBDA_FUNCTION_ENTITY", - // An Infrastructure Host entity. - INFRASTRUCTURE_HOST_ENTITY: "INFRASTRUCTURE_HOST_ENTITY", - // A Mobile Application. - MOBILE_APPLICATION_ENTITY: "MOBILE_APPLICATION_ENTITY", - // A entity that is unavailable. - UNAVAILABLE_ENTITY: "UNAVAILABLE_ENTITY", - // A Workload Entity. - WORKLOAD_ENTITY: "WORKLOAD_ENTITY", -} - -// DashboardFacetChartWidgetVisualizationType - Facet chart widget visualization type. -type DashboardFacetChartWidgetVisualizationType string - -var DashboardFacetChartWidgetVisualizationTypeTypes = struct { - // FACETED_AREA_CHART. - FACETED_AREA_CHART DashboardFacetChartWidgetVisualizationType - // FACETED_LINE_CHART. - FACETED_LINE_CHART DashboardFacetChartWidgetVisualizationType - // FACET_BAR_CHART. - FACET_BAR_CHART DashboardFacetChartWidgetVisualizationType - // FACET_PIE_CHART. - FACET_PIE_CHART DashboardFacetChartWidgetVisualizationType - // FACET_TABLE. - FACET_TABLE DashboardFacetChartWidgetVisualizationType - // HEATMAP. - HEATMAP DashboardFacetChartWidgetVisualizationType -}{ - // FACETED_AREA_CHART. - FACETED_AREA_CHART: "FACETED_AREA_CHART", - // FACETED_LINE_CHART. - FACETED_LINE_CHART: "FACETED_LINE_CHART", - // FACET_BAR_CHART. - FACET_BAR_CHART: "FACET_BAR_CHART", - // FACET_PIE_CHART. - FACET_PIE_CHART: "FACET_PIE_CHART", - // FACET_TABLE. - FACET_TABLE: "FACET_TABLE", - // HEATMAP. - HEATMAP: "HEATMAP", -} - -// DashboardInaccessibleWidgetVisualizationType - Inaccessible widget visualization type. -type DashboardInaccessibleWidgetVisualizationType string - -var DashboardInaccessibleWidgetVisualizationTypeTypes = struct { - // INACCESSIBLE. - INACCESSIBLE DashboardInaccessibleWidgetVisualizationType -}{ - // INACCESSIBLE. - INACCESSIBLE: "INACCESSIBLE", -} - -// DashboardInventoryWidgetVisualizationType - Inventory widget visualization type. -type DashboardInventoryWidgetVisualizationType string - -var DashboardInventoryWidgetVisualizationTypeTypes = struct { - // INVENTORY. - INVENTORY DashboardInventoryWidgetVisualizationType -}{ - // INVENTORY. - INVENTORY: "INVENTORY", -} - -// DashboardMarkdownWidgetVisualizationType - Markdown widget visualization type. -type DashboardMarkdownWidgetVisualizationType string - -var DashboardMarkdownWidgetVisualizationTypeTypes = struct { - // MARKDOWN. - MARKDOWN DashboardMarkdownWidgetVisualizationType -}{ - // MARKDOWN. - MARKDOWN: "MARKDOWN", -} - -// DashboardMetricLineChartWidgetVisualizationType - Metric line chart widget visualization type. -type DashboardMetricLineChartWidgetVisualizationType string +// DashboardVariableReplacementStrategy - Possible strategies when replacing variables in a NRQL query. +type DashboardVariableReplacementStrategy string -var DashboardMetricLineChartWidgetVisualizationTypeTypes = struct { - // METRIC_LINE_CHART. - METRIC_LINE_CHART DashboardMetricLineChartWidgetVisualizationType +var DashboardVariableReplacementStrategyTypes = struct { + // Replace the variable based on its automatically-inferred type. + DEFAULT DashboardVariableReplacementStrategy + // Replace the variable value as an identifier. + IDENTIFIER DashboardVariableReplacementStrategy + // Replace the variable value as a number. + NUMBER DashboardVariableReplacementStrategy + // Replace the variable value as a string. + STRING DashboardVariableReplacementStrategy }{ - // METRIC_LINE_CHART. - METRIC_LINE_CHART: "METRIC_LINE_CHART", + // Replace the variable based on its automatically-inferred type. + DEFAULT: "DEFAULT", + // Replace the variable value as an identifier. + IDENTIFIER: "IDENTIFIER", + // Replace the variable value as a number. + NUMBER: "NUMBER", + // Replace the variable value as a string. + STRING: "STRING", } -// DashboardPermissions - Permissions that represent visibility & editability -type DashboardPermissions string - -var DashboardPermissionsTypes = struct { - // Private - PRIVATE DashboardPermissions - // Public read only - PUBLIC_READ_ONLY DashboardPermissions - // Public read & write - PUBLIC_READ_WRITE DashboardPermissions -}{ - // Private - PRIVATE: "PRIVATE", - // Public read only - PUBLIC_READ_ONLY: "PUBLIC_READ_ONLY", - // Public read & write - PUBLIC_READ_WRITE: "PUBLIC_READ_WRITE", -} +// DashboardVariableType - Indicates where a variable's possible values may come from. +type DashboardVariableType string -// DashboardPredefinedMetricChartWidgetVisualizationType - Predefined metric chart widget visualization type. -type DashboardPredefinedMetricChartWidgetVisualizationType string - -var DashboardPredefinedMetricChartWidgetVisualizationTypeTypes = struct { - // APPLICATION_BREAKDOWN. - APPLICATION_BREAKDOWN DashboardPredefinedMetricChartWidgetVisualizationType - // BACKGROUND_BREAKDOWN. - BACKGROUND_BREAKDOWN DashboardPredefinedMetricChartWidgetVisualizationType - // BROWSER_BREAKDOWN. - BROWSER_BREAKDOWN DashboardPredefinedMetricChartWidgetVisualizationType - // GC_RUNS_BREAKDOWN. - GC_RUNS_BREAKDOWN DashboardPredefinedMetricChartWidgetVisualizationType - // SCOPE_BREAKDOWN. - SCOPE_BREAKDOWN DashboardPredefinedMetricChartWidgetVisualizationType - // SOLR_BREAKDOWN. - SOLR_BREAKDOWN DashboardPredefinedMetricChartWidgetVisualizationType +var DashboardVariableTypeTypes = struct { + // Value comes from an enumerated list of possible values. + ENUM DashboardVariableType + // Value comes from the results of a NRQL query. + NRQL DashboardVariableType + // Dashboard user can supply an arbitrary string value to variable. + STRING DashboardVariableType }{ - // APPLICATION_BREAKDOWN. - APPLICATION_BREAKDOWN: "APPLICATION_BREAKDOWN", - // BACKGROUND_BREAKDOWN. - BACKGROUND_BREAKDOWN: "BACKGROUND_BREAKDOWN", - // BROWSER_BREAKDOWN. - BROWSER_BREAKDOWN: "BROWSER_BREAKDOWN", - // GC_RUNS_BREAKDOWN. - GC_RUNS_BREAKDOWN: "GC_RUNS_BREAKDOWN", - // SCOPE_BREAKDOWN. - SCOPE_BREAKDOWN: "SCOPE_BREAKDOWN", - // SOLR_BREAKDOWN. - SOLR_BREAKDOWN: "SOLR_BREAKDOWN", -} - -// DashboardServiceMapWidgetVisualizationType - Service map widget visualization type. -type DashboardServiceMapWidgetVisualizationType string - -var DashboardServiceMapWidgetVisualizationTypeTypes = struct { - // SERVICE_MAP. - SERVICE_MAP DashboardServiceMapWidgetVisualizationType -}{ - // SERVICE_MAP. - SERVICE_MAP: "SERVICE_MAP", -} - -// DashboardSimpleEventWidgetVisualizationType - Simple event widget visualization type. -type DashboardSimpleEventWidgetVisualizationType string - -var DashboardSimpleEventWidgetVisualizationTypeTypes = struct { - // ATTRIBUTE_SHEET. - ATTRIBUTE_SHEET DashboardSimpleEventWidgetVisualizationType - // COMPARISON_LINE_CHART. - COMPARISON_LINE_CHART DashboardSimpleEventWidgetVisualizationType - // EVENT_FEED. - EVENT_FEED DashboardSimpleEventWidgetVisualizationType - // EVENT_TABLE. - EVENT_TABLE DashboardSimpleEventWidgetVisualizationType - // FUNNEL. - FUNNEL DashboardSimpleEventWidgetVisualizationType - // HISTOGRAM. - HISTOGRAM DashboardSimpleEventWidgetVisualizationType - // LINE_CHART. - LINE_CHART DashboardSimpleEventWidgetVisualizationType - // RAW_JSON. - RAW_JSON DashboardSimpleEventWidgetVisualizationType - // SINGLE_EVENT. - SINGLE_EVENT DashboardSimpleEventWidgetVisualizationType - // UNIQUES_LIST. - UNIQUES_LIST DashboardSimpleEventWidgetVisualizationType -}{ - // ATTRIBUTE_SHEET. - ATTRIBUTE_SHEET: "ATTRIBUTE_SHEET", - // COMPARISON_LINE_CHART. - COMPARISON_LINE_CHART: "COMPARISON_LINE_CHART", - // EVENT_FEED. - EVENT_FEED: "EVENT_FEED", - // EVENT_TABLE. - EVENT_TABLE: "EVENT_TABLE", - // FUNNEL. - FUNNEL: "FUNNEL", - // HISTOGRAM. - HISTOGRAM: "HISTOGRAM", - // LINE_CHART. - LINE_CHART: "LINE_CHART", - // RAW_JSON. - RAW_JSON: "RAW_JSON", - // SINGLE_EVENT. - SINGLE_EVENT: "SINGLE_EVENT", - // UNIQUES_LIST. - UNIQUES_LIST: "UNIQUES_LIST", -} - -// DashboardThresholdEventWidgetVisualizationType - Threshold event widget visualization type. -type DashboardThresholdEventWidgetVisualizationType string - -var DashboardThresholdEventWidgetVisualizationTypeTypes = struct { - // BILLBOARD. - BILLBOARD DashboardThresholdEventWidgetVisualizationType - // BILLBOARD_COMPARISON. - BILLBOARD_COMPARISON DashboardThresholdEventWidgetVisualizationType - // GAUGE. - GAUGE DashboardThresholdEventWidgetVisualizationType -}{ - // BILLBOARD. - BILLBOARD: "BILLBOARD", - // BILLBOARD_COMPARISON. - BILLBOARD_COMPARISON: "BILLBOARD_COMPARISON", - // GAUGE. - GAUGE: "GAUGE", -} - -// DashboardVisibility - Visibility. -type DashboardVisibility string - -var DashboardVisibilityTypes = struct { - // ALL. - ALL DashboardVisibility - // OWNER. - OWNER DashboardVisibility -}{ - // ALL. - ALL: "ALL", - // OWNER. - OWNER: "OWNER", + // Value comes from an enumerated list of possible values. + ENUM: "ENUM", + // Value comes from the results of a NRQL query. + NRQL: "NRQL", + // Dashboard user can supply an arbitrary string value to variable. + STRING: "STRING", } // EntityAlertSeverity - The alert severity of the entity. @@ -1227,41 +860,19 @@ var EntityAlertSeverityTypes = struct { WARNING: "WARNING", } -type EntityAlertStatus string - -var EntityAlertStatusTypes = struct { - // Not alerting - GREEN EntityAlertStatus - // Entity not reporting - GREY EntityAlertStatus - // No alerts set up - LIGHT_GREEN EntityAlertStatus - // Critical violation - RED EntityAlertStatus - // Warning violation - YELLOW EntityAlertStatus -}{ - // Not alerting - GREEN: "GREEN", - // Entity not reporting - GREY: "GREY", - // No alerts set up - LIGHT_GREEN: "LIGHT_GREEN", - // Critical violation - RED: "RED", - // Warning violation - YELLOW: "YELLOW", -} - // EntityCollectionType - Indicates where this collection is used type EntityCollectionType string var EntityCollectionTypeTypes = struct { + // Collections that define the entities that belong to a team + TEAM EntityCollectionType // Collections that define the entities that belong to a workload WORKLOAD EntityCollectionType // Collections that define the entity groups that are used to calculate the status of a workload WORKLOAD_STATUS_RULE_GROUP EntityCollectionType }{ + // Collections that define the entities that belong to a team + TEAM: "TEAM", // Collections that define the entities that belong to a workload WORKLOAD: "WORKLOAD", // Collections that define the entity groups that are used to calculate the status of a workload @@ -1309,12 +920,16 @@ var EntityGoldenMetricUnitTypes = struct { HERTZ EntityGoldenMetricUnit // Messages per second. MESSAGES_PER_SECOND EntityGoldenMetricUnit + // Milliseconds. + MS EntityGoldenMetricUnit // Operations per second. OPERATIONS_PER_SECOND EntityGoldenMetricUnit // Pages loaded per second. PAGES_PER_SECOND EntityGoldenMetricUnit // Percentage. PERCENTAGE EntityGoldenMetricUnit + // Requests received per minute. + REQUESTS_PER_MINUTE EntityGoldenMetricUnit // Requests received per second. REQUESTS_PER_SECOND EntityGoldenMetricUnit // Seconds. @@ -1340,12 +955,16 @@ var EntityGoldenMetricUnitTypes = struct { HERTZ: "HERTZ", // Messages per second. MESSAGES_PER_SECOND: "MESSAGES_PER_SECOND", + // Milliseconds. + MS: "MS", // Operations per second. OPERATIONS_PER_SECOND: "OPERATIONS_PER_SECOND", // Pages loaded per second. PAGES_PER_SECOND: "PAGES_PER_SECOND", // Percentage. PERCENTAGE: "PERCENTAGE", + // Requests received per minute. + REQUESTS_PER_MINUTE: "REQUESTS_PER_MINUTE", // Requests received per second. REQUESTS_PER_SECOND: "REQUESTS_PER_SECOND", // Seconds. @@ -1354,21 +973,6 @@ var EntityGoldenMetricUnitTypes = struct { TIMESTAMP: "TIMESTAMP", } -// EntityGraphEntityFlags - Flags used to indicate special information about an entity -type EntityGraphEntityFlags string - -var EntityGraphEntityFlagsTypes = struct { - // This entity does not match the normal filters, but was included because it is realted to an entity in the results. - RELATED_ENTITY EntityGraphEntityFlags - // This entity is the source of a relationshipOf filter. - RELATIONSHIP_OF_SOURCE EntityGraphEntityFlags -}{ - // This entity does not match the normal filters, but was included because it is realted to an entity in the results. - RELATED_ENTITY: "RELATED_ENTITY", - // This entity is the source of a relationshipOf filter. - RELATIONSHIP_OF_SOURCE: "RELATIONSHIP_OF_SOURCE", -} - // EntityInfrastructureIntegrationType - The type of Infrastructure Integration type EntityInfrastructureIntegrationType string @@ -2141,14 +1745,30 @@ var EntityRelationshipEdgeTypeTypes = struct { CALLS EntityRelationshipEdgeType // The source entity has a connection to the target entity. CONNECTS_TO EntityRelationshipEdgeType + // The source entity consumes messages from a target kafka topic or other queue systems. + CONSUMES EntityRelationshipEdgeType // The source entity contains the target entity. CONTAINS EntityRelationshipEdgeType // The source entity hosts the target. HOSTS EntityRelationshipEdgeType // The source and target entities are perspectives on the same thing. IS EntityRelationshipEdgeType + // The source entity manages the target, that represents a subsystem of the source. + MANAGES EntityRelationshipEdgeType + // The source entity is used to measure the target entity. + MEASURES EntityRelationshipEdgeType + // The source entity monitors the target entity. + MONITORS EntityRelationshipEdgeType + // The source operates in the target entity, e.g. a region or a data center. + OPERATES_IN EntityRelationshipEdgeType + // The source entity owns the target entity. + OWNS EntityRelationshipEdgeType + // The source entity produces messages to a target kafka topic or other queue systems. + PRODUCES EntityRelationshipEdgeType // The source is an Application that serves the target Browser application. SERVES EntityRelationshipEdgeType + // The source entity initiates an action in the target entity. + TRIGGERS EntityRelationshipEdgeType }{ // The target entity contains the code for the source entity. BUILT_FROM: "BUILT_FROM", @@ -2156,14 +1776,30 @@ var EntityRelationshipEdgeTypeTypes = struct { CALLS: "CALLS", // The source entity has a connection to the target entity. CONNECTS_TO: "CONNECTS_TO", + // The source entity consumes messages from a target kafka topic or other queue systems. + CONSUMES: "CONSUMES", // The source entity contains the target entity. CONTAINS: "CONTAINS", // The source entity hosts the target. HOSTS: "HOSTS", // The source and target entities are perspectives on the same thing. IS: "IS", + // The source entity manages the target, that represents a subsystem of the source. + MANAGES: "MANAGES", + // The source entity is used to measure the target entity. + MEASURES: "MEASURES", + // The source entity monitors the target entity. + MONITORS: "MONITORS", + // The source operates in the target entity, e.g. a region or a data center. + OPERATES_IN: "OPERATES_IN", + // The source entity owns the target entity. + OWNS: "OWNS", + // The source entity produces messages to a target kafka topic or other queue systems. + PRODUCES: "PRODUCES", // The source is an Application that serves the target Browser application. SERVES: "SERVES", + // The source entity initiates an action in the target entity. + TRIGGERS: "TRIGGERS", } // EntityRelationshipType - The type of the relationship. @@ -2242,41 +1878,6 @@ var EntitySearchCountsFacetTypes = struct { TYPE: "TYPE", } -// EntitySearchGroupingAttribute - Entity attributes to group by. -type EntitySearchGroupingAttribute string - -var EntitySearchGroupingAttributeTypes = struct { - // Group by account id. - ACCOUNT_ID EntitySearchGroupingAttribute - // Group by alert severity. - ALERT_SEVERITY EntitySearchGroupingAttribute - // Group by entity domain. - DOMAIN EntitySearchGroupingAttribute - // Group by entity domain and entity type. - DOMAIN_TYPE EntitySearchGroupingAttribute - // Group by entity name - NAME EntitySearchGroupingAttribute - // Group by reporting state. - REPORTING EntitySearchGroupingAttribute - // Group by entity type. - TYPE EntitySearchGroupingAttribute -}{ - // Group by account id. - ACCOUNT_ID: "ACCOUNT_ID", - // Group by alert severity. - ALERT_SEVERITY: "ALERT_SEVERITY", - // Group by entity domain. - DOMAIN: "DOMAIN", - // Group by entity domain and entity type. - DOMAIN_TYPE: "DOMAIN_TYPE", - // Group by entity name - NAME: "NAME", - // Group by reporting state. - REPORTING: "REPORTING", - // Group by entity type. - TYPE: "TYPE", -} - // EntitySearchQueryBuilderDomain - The domain to search type EntitySearchQueryBuilderDomain string @@ -2320,8 +1921,6 @@ var EntitySearchQueryBuilderTypeTypes = struct { HOST EntitySearchQueryBuilderType // A monitor MONITOR EntitySearchQueryBuilderType - // A service - SERVICE EntitySearchQueryBuilderType // A workload WORKLOAD EntitySearchQueryBuilderType }{ @@ -2333,8 +1932,6 @@ var EntitySearchQueryBuilderTypeTypes = struct { HOST: "HOST", // A monitor MONITOR: "MONITOR", - // A service - SERVICE: "SERVICE", // A workload WORKLOAD: "WORKLOAD", } @@ -2370,77 +1967,6 @@ var EntitySearchSortCriteriaTypes = struct { TYPE: "TYPE", } -// EntitySummaryMetricUnit - The different units that can be used to express summary metrics. -type EntitySummaryMetricUnit string - -var EntitySummaryMetricUnitTypes = struct { - // Apdex (Application Performance Index). - APDEX EntitySummaryMetricUnit - // Bits. - BITS EntitySummaryMetricUnit - // Bits per second. - BITS_PER_SECOND EntitySummaryMetricUnit - // Bytes. - BYTES EntitySummaryMetricUnit - // Bytes per second. - BYTES_PER_SECOND EntitySummaryMetricUnit - // Degrees celsius. - CELSIUS EntitySummaryMetricUnit - // Count. - COUNT EntitySummaryMetricUnit - // Hertz. - HERTZ EntitySummaryMetricUnit - // Messages per second. - MESSAGES_PER_SECOND EntitySummaryMetricUnit - // Operations per second. - OPERATIONS_PER_SECOND EntitySummaryMetricUnit - // Pages loaded per second. - PAGES_PER_SECOND EntitySummaryMetricUnit - // Percentage. - PERCENTAGE EntitySummaryMetricUnit - // Requests received per second. - REQUESTS_PER_SECOND EntitySummaryMetricUnit - // Seconds. - SECONDS EntitySummaryMetricUnit - // String. - STRING EntitySummaryMetricUnit - // Timestamp. - TIMESTAMP EntitySummaryMetricUnit -}{ - // Apdex (Application Performance Index). - APDEX: "APDEX", - // Bits. - BITS: "BITS", - // Bits per second. - BITS_PER_SECOND: "BITS_PER_SECOND", - // Bytes. - BYTES: "BYTES", - // Bytes per second. - BYTES_PER_SECOND: "BYTES_PER_SECOND", - // Degrees celsius. - CELSIUS: "CELSIUS", - // Count. - COUNT: "COUNT", - // Hertz. - HERTZ: "HERTZ", - // Messages per second. - MESSAGES_PER_SECOND: "MESSAGES_PER_SECOND", - // Operations per second. - OPERATIONS_PER_SECOND: "OPERATIONS_PER_SECOND", - // Pages loaded per second. - PAGES_PER_SECOND: "PAGES_PER_SECOND", - // Percentage. - PERCENTAGE: "PERCENTAGE", - // Requests received per second. - REQUESTS_PER_SECOND: "REQUESTS_PER_SECOND", - // Seconds. - SECONDS: "SECONDS", - // String. - STRING: "STRING", - // Timestamp. - TIMESTAMP: "TIMESTAMP", -} - // EntityType - The specific type of entity type EntityType string @@ -2465,12 +1991,16 @@ var EntityTypeTypes = struct { INFRASTRUCTURE_AWS_LAMBDA_FUNCTION_ENTITY EntityType // An Infrastructure Host entity INFRASTRUCTURE_HOST_ENTITY EntityType + // A Key Transaction entity + KEY_TRANSACTION_ENTITY EntityType // A Mobile Application MOBILE_APPLICATION_ENTITY EntityType // A Secure Credential entity SECURE_CREDENTIAL_ENTITY EntityType // A Synthetic Monitor entity SYNTHETIC_MONITOR_ENTITY EntityType + // A Team Entity + TEAM_ENTITY EntityType // A Third Party Service entity THIRD_PARTY_SERVICE_ENTITY EntityType // A entity that is unavailable @@ -2498,12 +2028,16 @@ var EntityTypeTypes = struct { INFRASTRUCTURE_AWS_LAMBDA_FUNCTION_ENTITY: "INFRASTRUCTURE_AWS_LAMBDA_FUNCTION_ENTITY", // An Infrastructure Host entity INFRASTRUCTURE_HOST_ENTITY: "INFRASTRUCTURE_HOST_ENTITY", + // A Key Transaction entity + KEY_TRANSACTION_ENTITY: "KEY_TRANSACTION_ENTITY", // A Mobile Application MOBILE_APPLICATION_ENTITY: "MOBILE_APPLICATION_ENTITY", // A Secure Credential entity SECURE_CREDENTIAL_ENTITY: "SECURE_CREDENTIAL_ENTITY", // A Synthetic Monitor entity SYNTHETIC_MONITOR_ENTITY: "SYNTHETIC_MONITOR_ENTITY", + // A Team Entity + TEAM_ENTITY: "TEAM_ENTITY", // A Third Party Service entity THIRD_PARTY_SERVICE_ENTITY: "THIRD_PARTY_SERVICE_ENTITY", // A entity that is unavailable @@ -2512,107 +2046,6 @@ var EntityTypeTypes = struct { WORKLOAD_ENTITY: "WORKLOAD_ENTITY", } -// ErrorTrackingErrorGroupState - Current state of the error group. -type ErrorTrackingErrorGroupState string - -var ErrorTrackingErrorGroupStateTypes = struct { - // Error group is ignored. - IGNORED ErrorTrackingErrorGroupState - // Error group is resolved. - RESOLVED ErrorTrackingErrorGroupState - // Error group is unresolved. - UNRESOLVED ErrorTrackingErrorGroupState -}{ - // Error group is ignored. - IGNORED: "IGNORED", - // Error group is resolved. - RESOLVED: "RESOLVED", - // Error group is unresolved. - UNRESOLVED: "UNRESOLVED", -} - -// ErrorTrackingNotificationDestination - Notification Destination type -type ErrorTrackingNotificationDestination string - -var ErrorTrackingNotificationDestinationTypes = struct { - // Jira Classic destination - JIRA_CLASSIC ErrorTrackingNotificationDestination - // Slack destination - SLACK ErrorTrackingNotificationDestination -}{ - // Jira Classic destination - JIRA_CLASSIC: "JIRA_CLASSIC", - // Slack destination - SLACK: "SLACK", -} - -// ErrorTrackingNotificationEventStatus - Notification Event Status type -type ErrorTrackingNotificationEventStatus string - -var ErrorTrackingNotificationEventStatusTypes = struct { - // Failed - FAIL ErrorTrackingNotificationEventStatus - // Successful - SUCCESS ErrorTrackingNotificationEventStatus -}{ - // Failed - FAIL: "FAIL", - // Successful - SUCCESS: "SUCCESS", -} - -type FeatureFlagContext string - -var FeatureFlagContextTypes = struct { - ACCOUNT FeatureFlagContext - CRITERIA FeatureFlagContext - NR_ADMIN FeatureFlagContext - USER FeatureFlagContext -}{ - ACCOUNT: "ACCOUNT", - CRITERIA: "CRITERIA", - NR_ADMIN: "NR_ADMIN", - USER: "USER", -} - -// InfrastructureAgentInstrumentationStrategy - The strategy for how we can instrument this service -type InfrastructureAgentInstrumentationStrategy string - -var InfrastructureAgentInstrumentationStrategyTypes = struct { - // Instrumentation strategy: New Relic Java Agent. InfrastructureEvent strategy value: java_apm - JAVAAPM InfrastructureAgentInstrumentationStrategy - // Instrumentation strategy: Java Flight Recorder. InfrastructureEvent strategy value: jfr - JFR InfrastructureAgentInstrumentationStrategy - // Instrumentation strategy: Jafa Flight Recorder-Daemon. InfrastructureEvent strategy value: jfrd - JFRD InfrastructureAgentInstrumentationStrategy - // Instrumentation strategy: Java Management Extensions. InfrastructureEvent strategy value: jmx - JMX InfrastructureAgentInstrumentationStrategy -}{ - // Instrumentation strategy: New Relic Java Agent. InfrastructureEvent strategy value: java_apm - JAVAAPM: "JAVAAPM", - // Instrumentation strategy: Java Flight Recorder. InfrastructureEvent strategy value: jfr - JFR: "JFR", - // Instrumentation strategy: Jafa Flight Recorder-Daemon. InfrastructureEvent strategy value: jfrd - JFRD: "JFRD", - // Instrumentation strategy: Java Management Extensions. InfrastructureEvent strategy value: jmx - JMX: "JMX", -} - -// InfrastructureAgentServiceStatus - The status of an individual service -type InfrastructureAgentServiceStatus string - -var InfrastructureAgentServiceStatusTypes = struct { - // The service is being instrumented - INSTRUMENTED InfrastructureAgentServiceStatus - // Known service status - KNOWN InfrastructureAgentServiceStatus -}{ - // The service is being instrumented - INSTRUMENTED: "INSTRUMENTED", - // Known service status - KNOWN: "KNOWN", -} - // MetricNormalizationRuleAction - The different rule actions. type MetricNormalizationRuleAction string @@ -2632,25 +2065,6 @@ var MetricNormalizationRuleActionTypes = struct { REPLACE: "REPLACE", } -// RelatedExternalsDirection - The direction of a connected entity. -type RelatedExternalsDirection string - -var RelatedExternalsDirectionTypes = struct { - // A downstream dependency. - DOWNSTREAM RelatedExternalsDirection - // The entity at the center of these dependencies. - FOCAL_ENTITY RelatedExternalsDirection - // An upstream dependency. - UPSTREAM RelatedExternalsDirection -}{ - // A downstream dependency. - DOWNSTREAM: "DOWNSTREAM", - // The entity at the center of these dependencies. - FOCAL_ENTITY: "FOCAL_ENTITY", - // An upstream dependency. - UPSTREAM: "UPSTREAM", -} - // SortBy - The `SortBy` enum is for designating sort order. type SortBy string @@ -2666,21 +2080,6 @@ var SortByTypes = struct { DESC: "DESC", } -// SyntheticMonitorCheckStatus - The status of a synthetic monitor check. -type SyntheticMonitorCheckStatus string - -var SyntheticMonitorCheckStatusTypes = struct { - // Failed check - FAILED SyntheticMonitorCheckStatus - // Successful check - SUCCESS SyntheticMonitorCheckStatus -}{ - // Failed check - FAILED: "FAILED", - // Successful check - SUCCESS: "SUCCESS", -} - type SyntheticMonitorStatus string var SyntheticMonitorStatusTypes = struct { @@ -2703,6 +2102,7 @@ var SyntheticMonitorStatusTypes = struct { type SyntheticMonitorType string var SyntheticMonitorTypeTypes = struct { + BROKEN_LINKS SyntheticMonitorType BROWSER SyntheticMonitorType CERT_CHECK SyntheticMonitorType SCRIPT_API SyntheticMonitorType @@ -2710,6 +2110,7 @@ var SyntheticMonitorTypeTypes = struct { SIMPLE SyntheticMonitorType STEP_MONITOR SyntheticMonitorType }{ + BROKEN_LINKS: "BROKEN_LINKS", BROWSER: "BROWSER", CERT_CHECK: "CERT_CHECK", SCRIPT_API: "SCRIPT_API", @@ -2815,32 +2216,6 @@ var WorkloadStatusValueTypes = struct { UNKNOWN: "UNKNOWN", } -type AccountAccessInfo struct { - Capabilities []Capability `json:"capabilities,omitempty"` - Entitlements []AccountEntitlement `json:"entitlements,omitempty"` - // These Feature Flags will be evaluated differently depending on their context: - // * `currentUser.currentAccount` - Current User ID, current Account ID, NR admin - // * `currentUser.account(id: N)` - Current User ID, given Account ID, NR admin - // * `user(id: N).account(id: N)` - Given User ID, given Account ID, NR admin - // * `account(id: N)` - Just the given Account ID - FeatureFlags []FeatureFlag `json:"featureFlags,omitempty"` - ID int `json:"id,omitempty"` - InRegion bool `json:"inRegion,omitempty"` - Name string `json:"name,omitempty"` - Parent ParentAccountInfo `json:"parent,omitempty"` - Region Region `json:"region,omitempty"` - // Returns event types that are currently reporting in the account. - ReportingEventTypes []string `json:"reportingEventTypes,omitempty"` -} - -type AccountEntitlement struct { - Name string `json:"name,omitempty"` -} - -type AccountEntitlementFilter struct { - Names []string `json:"names"` -} - // Actor - The `Actor` object contains fields that are scoped to the API user's access level. type Actor struct { // Fetch a list of entities. @@ -2861,29 +2236,41 @@ type Actor struct { // // Note: you must supply either a `query` OR a `queryBuilder` argument, not both. EntitySearch EntitySearch `json:"entitySearch,omitempty"` - // Contains information about the entity types specified in the `entityTypes` argument. - EntityTypes []EntityTypeResults `json:"entityTypes,omitempty"` - NerdStoreCollection []NerdStoreCollectionMember `json:"nerdStoreCollection,omitempty"` - NerdStoreDocument NerdStoreDocument `json:"nerdStoreDocument,omitempty"` +} + +// AgentApplicationSegmentsBrowserSegmentAllowList - The allow list object for browser applications. +type AgentApplicationSegmentsBrowserSegmentAllowList struct { + // The url segments that are allowed. + Segments []string `json:"segments,omitempty"` +} + +// AgentApplicationSegmentsSegmentAllowListFilters - Filter the allow lists by fields specified in this object. +type AgentApplicationSegmentsSegmentAllowListFilters struct { + // INTERNAL or USER. Defaults to USER + ListType AgentApplicationSegmentsListType `json:"listType,omitempty"` } // AgentApplicationSettingsApmBase - Settings that are applicable to APM applications and their agents. type AgentApplicationSettingsApmBase struct { // The name for the application Alias string `json:"alias,omitempty"` - // General settings for the application can be accessed via this field. + // Access general settings for the application. ApmConfig AgentApplicationSettingsApmConfig `json:"apmConfig"` - // Application settings regarding how events are handled with NRDB can be accessed via this field. - DataManagement AgentApplicationSettingsDataManagement `json:"dataManagement"` - // Error Collector settings for the application can be accessed via this field. The error collector captures information about uncaught exceptions and sends them to New Relic for viewing. + // Enable or disable the capture of memcache keys. + CaptureMemcacheKeys bool `json:"captureMemcacheKeys,omitempty"` + // Access error collector settings for the application. The error collector captures information about uncaught exceptions and sends them to New Relic for viewing. ErrorCollector AgentApplicationSettingsErrorCollector `json:"errorCollector,omitempty"` + // Access enabled state for the Java Flight Recorder. This is available only for the Java language agent version 8.0.0 or later. + Jfr AgentApplicationSettingsJfr `json:"jfr,omitempty"` + // The name originally given to the application for reporting. + OriginalName string `json:"originalName,omitempty"` // In APM, when transaction traces are collected, there may be additional Slow query data available. SlowSql AgentApplicationSettingsSlowSql `json:"slowSql,omitempty"` - // Thread profiler measures wall clock time, CPU time, and method call counts in your application's threads as they run. + // Measures wall clock time, CPU time, and method call counts in your application's threads as they run. ThreadProfiler AgentApplicationSettingsThreadProfiler `json:"threadProfiler,omitempty"` - // Type of tracer used. APM's cross application tracing link transactions between APM apps in your service-oriented architecture (SOA). Distributed tracing is an improvement on the cross application tracing feature and is recommended for large, distributed systems. + // Type of tracer used. APM's cross application tracing links transactions between APM apps in your service-oriented architecture (SOA). Distributed tracing is an improvement on the cross application tracing feature, and is recommended for large, distributed systems. TracerType AgentApplicationSettingsTracer `json:"tracerType,omitempty"` - // Transaction Tracer settings for the application can be accessed via this field. + // Access transaction tracer settings for the application. TransactionTracer AgentApplicationSettingsTransactionTracer `json:"transactionTracer,omitempty"` } @@ -2891,18 +2278,32 @@ type AgentApplicationSettingsApmBase struct { type AgentApplicationSettingsApmConfig struct { // The desired target for the APDEX measurement of this APM application. ApdexTarget float64 `json:"apdexTarget,omitempty"` - // Should agents for this APM application get some of their configuration from the server. + // Sets if agents for this APM application should get some of their configuration from the server. UseServerSideConfig bool `json:"useServerSideConfig,omitempty"` } +// AgentApplicationSettingsApplicationExitInfo - Reports on application exits, which can be used to determine if an application is not responding. +type AgentApplicationSettingsApplicationExitInfo struct { + // Whether or not application exit info is collected. + Enabled bool `json:"enabled"` +} + +// AgentApplicationSettingsBrowserAjax - Enables ajax traces in the browser app. +type AgentApplicationSettingsBrowserAjax struct { + // List of domains excluded from Ajax traces by the browser agent. + DenyList []string `json:"denyList"` +} + // AgentApplicationSettingsBrowserBase - Settings that are applicable to browser applications. type AgentApplicationSettingsBrowserBase struct { - // General settings for the application can be accessed via this field. + // Access general settings for the application. BrowserConfig AgentApplicationSettingsBrowserConfig `json:"browserConfig"` - // Browser monitoring provides Real User Monitoring (RUM) that measures the speed and performance of end users as they navigate the application using different web browsers, devices, operating systems, and networks. + // browser monitoring provides real user monitoring (RUM) that measures the speed and performance of end users as they navigate the application using different web browsers, devices, operating systems, and networks. BrowserMonitoring AgentApplicationSettingsBrowserMonitoring `json:"browserMonitoring"` - // Application settings regarding how events are handled with NRDB can be accessed via this field. - DataManagement AgentApplicationSettingsDataManagement `json:"dataManagement"` + // Session Replay configuration. + SessionReplay AgentApplicationSettingsSessionReplay `json:"sessionReplay"` + // Session Trace configuration. + SessionTrace AgentApplicationSettingsSessionTrace `json:"sessionTrace"` } // AgentApplicationSettingsBrowserConfig - General settings related to APM applications. @@ -2913,17 +2314,31 @@ type AgentApplicationSettingsBrowserConfig struct { // AgentApplicationSettingsBrowserDistributedTracing - Distributed tracing type. See [documentation](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/browser-data-distributed-tracing/) for further information. type AgentApplicationSettingsBrowserDistributedTracing struct { - // Whether or not Distributed Tracing is enabled. + // List of allowed origins for use with distributed tracing. + AllowedOrigins []string `json:"allowedOrigins"` + // Whether or not CORS is enabled in distributed tracing. + CorsEnabled bool `json:"corsEnabled,omitempty"` + // Whether or not CORS uses the `newrelic` header in distributed tracing. + CorsUseNewrelicHeader bool `json:"corsUseNewrelicHeader,omitempty"` + // Whether or not CORS uses tracecontext headers in distributed tracing. + CorsUseTracecontextHeaders bool `json:"corsUseTracecontextHeaders,omitempty"` + // Whether or not distributed tracing is enabled. Enabled bool `json:"enabled,omitempty"` + // Whether or not to exclude the `newrelic` header in distributed tracing. + ExcludeNewrelicHeader bool `json:"excludeNewrelicHeader,omitempty"` } -// AgentApplicationSettingsBrowserMonitoring - Browser monitoring. +// AgentApplicationSettingsBrowserMonitoring - Provides fields to set browser monitoring application settings. type AgentApplicationSettingsBrowserMonitoring struct { - // If you use browser to monitor end-user browser activity, you can now see end-user-originating browser-side traces in distributed tracing. + // Enables ajax traces in the browser app. + Ajax AgentApplicationSettingsBrowserAjax `json:"ajax,omitempty"` + // Distributed tracing type. See [documentation](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/browser-data-distributed-tracing/) for further information. DistributedTracing AgentApplicationSettingsBrowserDistributedTracing `json:"distributedTracing"` // The type of browser agent that will be loaded. Loader AgentApplicationSettingsBrowserLoader `json:"loader"` - // Browser monitoring's page load timing feature can track sessions by using cookies that contain a simple session identifier. + // Specify the semantic version of the browser agent that you would like your app to use. Leave this blank to use the most recent version. Use 'x' in place of a numeric digit to represent the latest release within the version range. For example, '1.x.x' + PinnedVersion string `json:"pinnedVersion,omitempty"` + // Browser privacy. See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/page-load-timing-resources/cookie-collection-session-tracking/) for further information. Privacy AgentApplicationSettingsBrowserPrivacy `json:"privacy"` } @@ -2933,43 +2348,171 @@ type AgentApplicationSettingsBrowserPrivacy struct { CookiesEnabled bool `json:"cookiesEnabled"` } -// AgentApplicationSettingsDataManagement - Settings related to the management of Transaction data sent to NRDB. -type AgentApplicationSettingsDataManagement struct { - // Should transaction events be sent to the internal stream. - SendTransactionEventsToInternalStream bool `json:"sendTransactionEventsToInternalStream,omitempty"` +// AgentApplicationSettingsBrowserProperties - General Properties related to browser applications. +type AgentApplicationSettingsBrowserProperties struct { + // The configuration required to run the npm version of the JS agent. This is the "pure" JSON configuration block without surrounding HTML