signalfx

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2019 License: Apache-2.0 Imports: 18 Imported by: 2

README

Go client library for SignalFx

GoDoc

This is a programmatic interface in Go for SignalFx's metadata and ingest APIs.

SignalFlow

There is an experimental SignalFlow client in the signalflow directory. An example of its use is in signalflow/example.

Example

import "github.com/signalfx/signalfx-go"

// The client can be customized by backing options onto the end. Check the
// godoc for more info!

// Instantiate your own client if you want to customize its options
// or test with a RoundTripper
httpClient := &http.Client{…}
client := signalfx.NewClient("your-token-here", HTTPClient(httpClient))

Questions

Why are there some things missing?

We're working on it, feel free to file an issue if an endpoint is missing!

Why are the class names sometimes long and the source file names prefixed with model_?

The request and response bodies for this library are machine generated from our OpenAPI specs using OpenAPI code generator. This is a real boon for everyone, keeping the documentation as a source of truth and ensuring that this library has support for all the things!

This means that some of our type names are verbose. It's fine, you only type code once and the benefits are worth it.

Documentation

Index

Constants

View Source
const AuthHeaderKey = "X-Sf-Token"

AuthHeaderKey is the HTTP header used to pass along the auth token Note that while HTTP headers are case insensitive this header is case sensitive on the tests for convenience.

View Source
const ChartAPIURL = "/v2/chart"

ChartAPIURL is the base URL for interacting with charts.

View Source
const DashboardAPIURL = "/v2/dashboard"

DashboardAPIURL is the base URL for interacting with dashboard.

View Source
const DashboardGroupAPIURL = "/v2/dashboardgroup"

DashboardGroupAPIURL is the base URL for interacting with dashboard.

View Source
const DefaultAPIURL = "https://api.signalfx.com"

DefaultAPIURL is the default URL for making API requests

View Source
const DetectorAPIURL = "/v2/detector"

DetectorAPIURL is the base URL for interacting with detectors.

View Source
const DimensionAPIURL = "/v2/dimension"

DimensionAPIURL is the base URL for interacting with dimensions.

View Source
const IntegrationAPIURL = "/v2/integration"

IntegrationAPIURL is the base URL for interacting with intergrations.

View Source
const MetricAPIURL = "/v2/metric"

MetricAPIURL is the base URL for interacting with dimensions.

View Source
const MetricTimeSeriesAPIURL = "/v2/metrictimeseries"

MetricTimeSeriesAPIURL is the base URL for interacting with dimensions.

View Source
const OrganizationAPIURL = "/v2/organization"

OrganizationAPIURL is the base URL for interacting with detectors.

View Source
const OrganizationMemberAPIURL = "/v2/organization/member"
View Source
const OrganizationMembersAPIURL = "/v2/organization/members"
View Source
const TagAPIURL = "/v2/tag"

TagAPIURL is the base URL for interacting with dimensions.

View Source
const TeamAPIURL = "/v2/team"

TeamAPIURL is the base URL for interacting with teams.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a SignalFx API client.

func NewClient

func NewClient(token string, options ...ClientParam) (*Client, error)

NewClient creates a new SignalFx client using the specified token.

func (*Client) CreateChart

func (c *Client) CreateChart(chartRequest *chart.CreateUpdateChartRequest) (*chart.Chart, error)

CreateChart creates a chart.

func (*Client) CreateDashboard

func (c *Client) CreateDashboard(dashboardRequest *dashboard.CreateUpdateDashboardRequest) (*dashboard.Dashboard, error)

CreateDashboard creates a dashboard.

func (*Client) CreateDashboardGroup

func (c *Client) CreateDashboardGroup(dashboardGroupRequest *dashboard_group.CreateUpdateDashboardGroupRequest, skipImplicitDashboard bool) (*dashboard_group.DashboardGroup, error)

CreateDashboardGroup creates a dashboard.

func (*Client) CreateDetector

func (c *Client) CreateDetector(detectorRequest *detector.CreateUpdateDetectorRequest) (*detector.Detector, error)

CreateDetector creates a detector.

func (*Client) CreateTeam

func (c *Client) CreateTeam(t *team.CreateUpdateTeamRequest) (*team.Team, error)

CreateTeam creates a team.

func (*Client) CreateUpdateTag

func (c *Client) CreateUpdateTag(name string, cutr *metrics_metadata.CreateUpdateTagRequest) (*metrics_metadata.Tag, error)

CreateUpdateTag creates or updates a dimension.

func (*Client) DeleteChart

func (c *Client) DeleteChart(id string) error

DeleteChart deletes a chart.

func (*Client) DeleteDashboard

func (c *Client) DeleteDashboard(id string) error

DeleteDashboard deletes a dashboard.

func (*Client) DeleteDashboardGroup

func (c *Client) DeleteDashboardGroup(id string) error

DeleteDashboardGroup deletes a dashboard.

func (*Client) DeleteDetector

func (c *Client) DeleteDetector(id string) error

DeleteDetector deletes a detector.

func (*Client) DeleteIntegration

func (c *Client) DeleteIntegration(id string) error

DeleteIntegration deletes an integration.

func (*Client) DeleteMember

func (c *Client) DeleteMember(id string) error

DeleteMember deletes a detector.

func (*Client) DeleteTag

func (c *Client) DeleteTag(id string) error

DeleteTag deletes a tag.

func (*Client) DeleteTeam

func (c *Client) DeleteTeam(id string) error

DeleteTeam deletes a team.

func (*Client) DisableDetector

func (c *Client) DisableDetector(id string, labels []string) error

DisableDetector disables a detector.

func (*Client) EnableDetector

func (c *Client) EnableDetector(id string, labels []string) error

EnableDetector enables a detector.

func (*Client) GetChart

func (c *Client) GetChart(id string) (*chart.Chart, error)

GetChart gets a chart.

func (*Client) GetDashboard

func (c *Client) GetDashboard(id string) (*dashboard.Dashboard, error)

GetDashboard gets a dashboard.

func (*Client) GetDashboardGroup

func (c *Client) GetDashboardGroup(id string) (*dashboard_group.DashboardGroup, error)

GetDashboardGroup gets a dashboard group.

func (*Client) GetDetector

func (c *Client) GetDetector(id string) (*detector.Detector, error)

GetDetector gets a detector.

func (*Client) GetDimension

func (c *Client) GetDimension(key string, value string) (*metrics_metadata.Dimension, error)

GetDimension gets a dimension.

func (*Client) GetIntegration

func (c *Client) GetIntegration(id string) (map[string]interface{}, error)

GetIntegration gets a integration.

func (*Client) GetMember

func (c *Client) GetMember(id string) (*organization.Member, error)

GetMember gets a member.

func (*Client) GetMetric

func (c *Client) GetMetric(name string) (*metrics_metadata.Metric, error)

GetMetric retrieves a single metric by name.

func (*Client) GetMetricTimeSeries

func (c *Client) GetMetricTimeSeries(id string) (*metrics_metadata.MetricTimeSeries, error)

GetMetricTimeSeries retrieves a metric time series by id.

func (*Client) GetOrganization

func (c *Client) GetOrganization(id string) (*organization.Organization, error)

GetOrganization gets an organization.

func (*Client) GetOrganizationMembers

func (c *Client) GetOrganizationMembers(limit int, query string, offset int, orderBy string) (*organization.MemberSearchResults, error)

GetOrganizationMembers gets members for an org, with an optional search.

func (*Client) GetTag

func (c *Client) GetTag(name string) (*metrics_metadata.Tag, error)

GetTag gets a tag by name

func (*Client) GetTeam

func (c *Client) GetTeam(id string) (*team.Team, error)

GetTeam gets a team.

func (*Client) InviteMember

func (c *Client) InviteMember(inviteRequest *organization.CreateUpdateMemberRequest) (*organization.Member, error)

InviteMember invites a member to the organization.

func (*Client) InviteMembers

func (c *Client) InviteMembers(inviteRequest *organization.InviteMembersRequest) (*organization.InviteMembersRequest, error)

InviteMembers invites many members to the organization.

func (*Client) SearchCharts

func (c *Client) SearchCharts(limit int, name string, offset int, tags string) (*chart.SearchResult, error)

SearchCharts searches for charts, given a query string in `name`.

func (*Client) SearchDashboard

func (c *Client) SearchDashboard(limit int, name string, offset int, tags string) (*dashboard.SearchResult, error)

SearchDashboard searches for dashboards, given a query string in `name`.

func (*Client) SearchDashboardGroups

func (c *Client) SearchDashboardGroups(limit int, name string, offset int) (*dashboard_group.SearchResult, error)

SearchDashboardGroup searches for dashboard groups, given a query string in `name`.

func (*Client) SearchDetectors

func (c *Client) SearchDetectors(limit int, name string, offset int, tags string) (*detector.SearchResults, error)

SearchDetector searches for detectors, given a query string in `name`.

func (*Client) SearchDimension

func (c *Client) SearchDimension(query string, orderBy string, limit int, offset int) (*metrics_metadata.DimensionQueryResponseModel, error)

SearchDimension searches for dimensions, given a query string in `query`.

func (*Client) SearchMetric

func (c *Client) SearchMetric(query string, orderBy string, limit int, offset int) (*metrics_metadata.RetrieveMetricMetadataResponseModel, error)

SearchMetric searches for metrics, given a query string in `query`.

func (*Client) SearchMetricTimeSeries

func (c *Client) SearchMetricTimeSeries(query string, orderBy string, limit int, offset int) (*metrics_metadata.MetricTimeSeriesRetrieveResponseModel, error)

SearchMetricTimeSeries searches for metric time series, given a query string in `query`.

func (*Client) SearchTag

func (c *Client) SearchTag(query string, orderBy string, limit int, offset int) (*metrics_metadata.TagRetrieveResponseModel, error)

SearchTag searches for tags, given a query string in `query`.

func (*Client) SearchTeam

func (c *Client) SearchTeam(limit int, name string, offset int, tags string) (*team.SearchResults, error)

SearchTeam searches for teams, given a query string in `name`.

func (*Client) SignalFlow

func (c *Client) SignalFlow(options ...signalflow.ClientParam) (*signalflow.Client, error)

SignalFlow creates and returns a SignalFlow client that can be used to execute streaming jobs.

func (*Client) UpdateChart

func (c *Client) UpdateChart(id string, chartRequest *chart.CreateUpdateChartRequest) (*chart.Chart, error)

UpdateChart updates a chart.

func (*Client) UpdateDashboard

func (c *Client) UpdateDashboard(id string, dashboardRequest *dashboard.CreateUpdateDashboardRequest) (*dashboard.Dashboard, error)

UpdateDashboard updates a dashboard.

func (*Client) UpdateDashboardGroup

func (c *Client) UpdateDashboardGroup(id string, dashboardGroupRequest *dashboard_group.CreateUpdateDashboardGroupRequest) (*dashboard_group.DashboardGroup, error)

UpdateDashboardGroup updates a dashboard group.

func (*Client) UpdateDetector

func (c *Client) UpdateDetector(id string, detectorRequest *detector.CreateUpdateDetectorRequest) (*detector.Detector, error)

UpdateDetector updates a detector.

func (*Client) UpdateDimension

func (c *Client) UpdateDimension(key string, value string, dim *metrics_metadata.Dimension) (*metrics_metadata.Dimension, error)

UpdateDimension updates a dimension.

func (*Client) UpdateTeam

func (c *Client) UpdateTeam(id string, t *team.CreateUpdateTeamRequest) (*team.Team, error)

UpdateTeam updates a team.

type ClientParam

type ClientParam func(*Client) error

ClientParam is an option for NewClient. Its implementation borrows from Dave Cheney's functional options API (https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis).

func APIUrl

func APIUrl(apiURL string) ClientParam

APIUrl sets the URL that our client will communicate with, allowing it to be adjusted to another URL for testing or communication with other SignalFx clusters.

func HTTPClient

func HTTPClient(httpClient *http.Client) ClientParam

HTTPClient sets the `http.Client` that this API client will use to to communicate. This allows you to replace the client or tune it to your needs.

Directories

Path Synopsis
example
package main shows a basic usage pattern of the SiganlFlow client.
package main shows a basic usage pattern of the SiganlFlow client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL