Documentation
¶
Index ¶
- type APIKeyProvider
- type APIKeyProviderFunc
- type AWSIntegration
- type AWSIntegrationService
- type AnomalyDetectionSensitivityType
- type Client
- func (c *Client) CreateAWSIntegration(ctx context.Context, param *AWSIntegration) (*AWSIntegration, error)
- func (c *Client) CreateAWSIntegrationExternalID(ctx context.Context) (string, error)
- func (c *Client) CreateDashboard(ctx context.Context, param *Dashboard) (*Dashboard, error)
- func (c *Client) CreateDowntime(ctx context.Context, param *Downtime) (*Downtime, error)
- func (c *Client) CreateHost(ctx context.Context, param *CreateHostParam) (string, error)
- func (c *Client) CreateInvitation(ctx context.Context, email string, authority UserAuthority) (*Invitation, error)
- func (c *Client) CreateMonitor(ctx context.Context, param Monitor) (Monitor, error)
- func (c *Client) CreateNotificationChannel(ctx context.Context, ch NotificationChannel) (NotificationChannel, error)
- func (c *Client) CreateNotificationGroup(ctx context.Context, group *NotificationGroup) (*NotificationGroup, error)
- func (c *Client) CreateRole(ctx context.Context, serviceName string, param *CreateRoleParam) (*Role, error)
- func (c *Client) CreateService(ctx context.Context, param *CreateServiceParam) (*Service, error)
- func (c *Client) DeleteAWSIntegration(ctx context.Context, awsIntegrationID string) (*AWSIntegration, error)
- func (c *Client) DeleteDashboard(ctx context.Context, dashboardID string) (*Dashboard, error)
- func (c *Client) DeleteDowntime(ctx context.Context, downtimeID string) (*Downtime, error)
- func (c *Client) DeleteHostMetaData(ctx context.Context, hostID, namespace string) error
- func (c *Client) DeleteMonitor(ctx context.Context, monitorID string) (Monitor, error)
- func (c *Client) DeleteNotificationChannel(ctx context.Context, channelID string) (NotificationChannel, error)
- func (c *Client) DeleteNotificationGroup(ctx context.Context, groupID string) (*NotificationGroup, error)
- func (c *Client) DeleteRole(ctx context.Context, serviceName, roleName string) (*Role, error)
- func (c *Client) DeleteRoleMetaData(ctx context.Context, serviceName, roleName, namespace string) error
- func (c *Client) DeleteService(ctx context.Context, serviceName string) (*Service, error)
- func (c *Client) DeleteServiceMetaData(ctx context.Context, serviceName, namespace string) error
- func (c *Client) DeleteUser(ctx context.Context, userID string) (*User, error)
- func (c *Client) FindAWSIntegration(ctx context.Context, awsIntegrationID string) (*AWSIntegration, error)
- func (c *Client) FindAWSIntegrations(ctx context.Context) ([]*AWSIntegration, error)
- func (c *Client) FindAWSIntegrationsExcludableMetrics(ctx context.Context) (map[string][]string, error)
- func (c *Client) FindDashboard(ctx context.Context, dashboardID string) (*Dashboard, error)
- func (c *Client) FindDashboards(ctx context.Context) ([]*Dashboard, error)
- func (c *Client) FindDowntimes(ctx context.Context) ([]*Downtime, error)
- func (c *Client) FindInvitations(ctx context.Context) ([]*Invitation, error)
- func (c *Client) FindMonitor(ctx context.Context, monitorID string) (Monitor, error)
- func (c *Client) FindMonitors(ctx context.Context) ([]Monitor, error)
- func (c *Client) FindNotificationChannels(ctx context.Context) ([]NotificationChannel, error)
- func (c *Client) FindNotificationGroups(ctx context.Context) ([]*NotificationGroup, error)
- func (c *Client) FindServices(ctx context.Context) ([]*Service, error)
- func (c *Client) FindUsers(ctx context.Context) ([]*User, error)
- func (c *Client) GetHostMetaData(ctx context.Context, hostID, namespace string, v any) (*HostMetaMetaData, error)
- func (c *Client) GetHostMetaDataNameSpaces(ctx context.Context, hostID string) ([]string, error)
- func (c *Client) GetOrg(ctx context.Context) (*Org, error)
- func (c *Client) GetRoleMetaData(ctx context.Context, serviceName, roleName, namespace string, v any) (*RoleMetaMetaData, error)
- func (c *Client) GetRoleMetaDataNameSpaces(ctx context.Context, serviceName, roleName string) ([]string, error)
- func (c *Client) GetServiceMetaData(ctx context.Context, serviceName, namespace string, v any) (*ServiceMetaMetaData, error)
- func (c *Client) GetServiceMetaDataNameSpaces(ctx context.Context, serviceName string) ([]string, error)
- func (c *Client) PutHostMetaData(ctx context.Context, hostID, namespace string, v any) error
- func (c *Client) PutRoleMetaData(ctx context.Context, serviceName, roleName, namespace string, v any) error
- func (c *Client) PutServiceMetaData(ctx context.Context, serviceName, namespace string, v any) error
- func (c *Client) RetireHost(ctx context.Context, id string) error
- func (c *Client) RevokeInvitation(ctx context.Context, email string) error
- func (c *Client) UpdateAWSIntegration(ctx context.Context, awsIntegrationID string, param *AWSIntegration) (*AWSIntegration, error)
- func (c *Client) UpdateDashboard(ctx context.Context, dashboardID string, param *Dashboard) (*Dashboard, error)
- func (c *Client) UpdateDowntime(ctx context.Context, downtimeID string, param *Downtime) (*Downtime, error)
- func (c *Client) UpdateHost(ctx context.Context, hostID string, param *UpdateHostParam) (string, error)
- func (c *Client) UpdateMonitor(ctx context.Context, monitorID string, param Monitor) (Monitor, error)
- func (c *Client) UpdateNotificationGroup(ctx context.Context, groupID string, group *NotificationGroup) (*NotificationGroup, error)
- type CreateHostParam
- type CreateRoleParam
- type CreateServiceParam
- type Dashboard
- type Downtime
- type DowntimeRecurrence
- type DowntimeRecurrenceType
- type DowntimeWeekday
- type Error
- type Graph
- type GraphExpression
- type GraphHost
- type GraphRange
- type GraphRangeAbsolute
- type GraphRangeRelative
- type GraphRangeType
- type GraphRole
- type GraphService
- type GraphType
- type GraphUnknown
- type HeaderField
- type Host
- type HostMeta
- type HostMetaMetaData
- type Invitation
- type Layout
- type Metric
- type MetricExpression
- type MetricHost
- type MetricService
- type MetricType
- type MetricUnknown
- type Monitor
- type MonitorAnomalyDetection
- type MonitorConnectivity
- type MonitorExpression
- type MonitorExternalHTTP
- type MonitorHostMetric
- type MonitorServiceMetric
- type MonitorType
- type NotificationChannel
- type NotificationChannelBase
- func (c *NotificationChannelBase) MarshalJSON() ([]byte, error)
- func (c *NotificationChannelBase) NotificationChannelID() string
- func (c *NotificationChannelBase) NotificationChannelName() string
- func (c *NotificationChannelBase) NotificationChannelType() NotificationChannelType
- func (c *NotificationChannelBase) UnmarshalJSON(b []byte) error
- type NotificationChannelEmail
- func (c *NotificationChannelEmail) MarshalJSON() ([]byte, error)
- func (c *NotificationChannelEmail) NotificationChannelID() string
- func (c *NotificationChannelEmail) NotificationChannelName() string
- func (c *NotificationChannelEmail) NotificationChannelType() NotificationChannelType
- func (c *NotificationChannelEmail) UnmarshalJSON(b []byte) error
- type NotificationChannelSlack
- func (c *NotificationChannelSlack) MarshalJSON() ([]byte, error)
- func (c *NotificationChannelSlack) NotificationChannelID() string
- func (c *NotificationChannelSlack) NotificationChannelName() string
- func (c *NotificationChannelSlack) NotificationChannelType() NotificationChannelType
- func (c *NotificationChannelSlack) UnmarshalJSON(b []byte) error
- type NotificationChannelSlackMentions
- type NotificationChannelType
- type NotificationChannelWebHook
- func (c *NotificationChannelWebHook) MarshalJSON() ([]byte, error)
- func (c *NotificationChannelWebHook) NotificationChannelID() string
- func (c *NotificationChannelWebHook) NotificationChannelName() string
- func (c *NotificationChannelWebHook) NotificationChannelType() NotificationChannelType
- func (c *NotificationChannelWebHook) UnmarshalJSON(b []byte) error
- type NotificationEvent
- type NotificationGroup
- type NotificationGroupMonitor
- type NotificationGroupService
- type NotificationLevel
- type Org
- type Role
- type RoleMetaMetaData
- type Service
- type ServiceMetaMetaData
- type Timestamp
- type UpdateHostParam
- type User
- type UserAuthenticationMethod
- type UserAuthority
- type Widget
- type WidgetAlertStatus
- type WidgetGraph
- type WidgetMarkdown
- type WidgetType
- type WidgetValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyProvider ¶
APIKeyProvider is an api key provider.
type APIKeyProviderFunc ¶
APIKeyProviderFunc type is an adapter to allow the use of ordinary functions.
func (APIKeyProviderFunc) MackerelAPIKey ¶
func (f APIKeyProviderFunc) MackerelAPIKey(ctx context.Context) (string, error)
MackerelAPIKey implements APIKeyProvider
type AWSIntegration ¶ added in v0.0.7
type AWSIntegration struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Memo string `json:"memo"`
Key *string `json:"key,omitempty"`
SecretKey *string `json:"secretKey,omitempty"`
RoleArn *string `json:"roleArn,omitempty"`
ExternalID *string `json:"externalId,omitempty"`
Region string `json:"region"`
IncludedTags string `json:"includedTags"`
ExcludedTags string `json:"excludedTags"`
Services map[string]*AWSIntegrationService `json:"services,omitempty"`
}
AWSIntegration is an AWS integration. https://mackerel.io/api-docs/entry/aws-integration
type AWSIntegrationService ¶ added in v0.0.7
type AWSIntegrationService struct {
Enable bool `json:"enable"`
Role *string `json:"role"`
ExcludedMetrics []string `json:"excludedMetrics"`
RetireAutomatically bool `json:"retireAutomatically,omitempty"`
}
AWSIntegrationService is an AWS service.
type AnomalyDetectionSensitivityType ¶ added in v0.0.3
type AnomalyDetectionSensitivityType string
AnomalyDetectionSensitivityType is a type for sensitivity of anomaly detection monitorings.
const ( // AnomalyDetectionSensitivityInsensitive is insensitive AnomalyDetectionSensitivityInsensitive AnomalyDetectionSensitivityType = "insensitive" // AnomalyDetectionSensitivityNormal is normal AnomalyDetectionSensitivityNormal AnomalyDetectionSensitivityType = "normal" // AnomalyDetectionSensitivitySensitive is sensitive AnomalyDetectionSensitivitySensitive AnomalyDetectionSensitivityType = "sensitive" )
type Client ¶
type Client struct {
BaseURL *url.URL
APIKey string
APIKeyProvider APIKeyProvider
UserAgent string
HTTPClient *http.Client
// contains filtered or unexported fields
}
Client is a client for mackerel.io
func (*Client) CreateAWSIntegration ¶ added in v0.0.7
func (c *Client) CreateAWSIntegration(ctx context.Context, param *AWSIntegration) (*AWSIntegration, error)
CreateAWSIntegration creates a new aws integration.
func (*Client) CreateAWSIntegrationExternalID ¶ added in v0.0.7
CreateAWSIntegrationExternalID creates an external id for aws integrations.
func (*Client) CreateDashboard ¶
CreateDashboard creates a new dashboard. https://mackerel.io/api-docs/entry/dashboards#create
func (*Client) CreateDowntime ¶ added in v0.0.3
CreateDowntime creates new downtime.
func (*Client) CreateHost ¶
CreateHost creates new host
func (*Client) CreateInvitation ¶
func (c *Client) CreateInvitation(ctx context.Context, email string, authority UserAuthority) (*Invitation, error)
CreateInvitation invites a user.
func (*Client) CreateMonitor ¶
CreateMonitor creates a new monitoring.
func (*Client) CreateNotificationChannel ¶
func (c *Client) CreateNotificationChannel(ctx context.Context, ch NotificationChannel) (NotificationChannel, error)
CreateNotificationChannel creates a new notification channel.
func (*Client) CreateNotificationGroup ¶
func (c *Client) CreateNotificationGroup(ctx context.Context, group *NotificationGroup) (*NotificationGroup, error)
CreateNotificationGroup creates a new notification group.
func (*Client) CreateRole ¶
func (c *Client) CreateRole(ctx context.Context, serviceName string, param *CreateRoleParam) (*Role, error)
CreateRole creates a new role
func (*Client) CreateService ¶
CreateService creates a new service
func (*Client) DeleteAWSIntegration ¶ added in v0.0.7
func (c *Client) DeleteAWSIntegration(ctx context.Context, awsIntegrationID string) (*AWSIntegration, error)
DeleteAWSIntegration deletes an aws integration.
func (*Client) DeleteDashboard ¶
DeleteDashboard deletes a service https://mackerel.io/api-docs/entry/dashboards#delete
func (*Client) DeleteDowntime ¶ added in v0.0.3
DeleteDowntime deletes a downtime.
func (*Client) DeleteHostMetaData ¶
DeleteHostMetaData deletes host metadata by the value of v. https://mackerel.io/api-docs/entry/metadata#hostdelete
func (*Client) DeleteMonitor ¶
DeleteMonitor deletes a monitoring.
func (*Client) DeleteNotificationChannel ¶
func (c *Client) DeleteNotificationChannel(ctx context.Context, channelID string) (NotificationChannel, error)
DeleteNotificationChannel deletes a notification channel.
func (*Client) DeleteNotificationGroup ¶
func (c *Client) DeleteNotificationGroup(ctx context.Context, groupID string) (*NotificationGroup, error)
DeleteNotificationGroup deletes a notification group.
func (*Client) DeleteRole ¶
DeleteRole deletes a role
func (*Client) DeleteRoleMetaData ¶
func (c *Client) DeleteRoleMetaData(ctx context.Context, serviceName, roleName, namespace string) error
DeleteRoleMetaData deletes Role metadata by the value of v. https://mackerel.io/api-docs/entry/metadata#roledelete
func (*Client) DeleteService ¶
DeleteService deletes a service
func (*Client) DeleteServiceMetaData ¶
DeleteServiceMetaData deletes Service metadata by the value of v. https://mackerel.io/api-docs/entry/metadata#Servicedelete
func (*Client) DeleteUser ¶
DeleteUser deletes a user.
func (*Client) FindAWSIntegration ¶ added in v0.0.7
func (c *Client) FindAWSIntegration(ctx context.Context, awsIntegrationID string) (*AWSIntegration, error)
FindAWSIntegration returns an aws integration.
func (*Client) FindAWSIntegrations ¶ added in v0.0.7
func (c *Client) FindAWSIntegrations(ctx context.Context) ([]*AWSIntegration, error)
FindAWSIntegrations returns a list of aws integrations.
func (*Client) FindAWSIntegrationsExcludableMetrics ¶ added in v0.0.7
func (c *Client) FindAWSIntegrationsExcludableMetrics(ctx context.Context) (map[string][]string, error)
FindAWSIntegrationsExcludableMetrics list excludable metrics for AWS Integration.
func (*Client) FindDashboard ¶
FindDashboard find the dashboard. https://mackerel.io/api-docs/entry/dashboards#get
func (*Client) FindDashboards ¶
FindDashboards finds dashboards. https://mackerel.io/api-docs/entry/dashboards#list
func (*Client) FindDowntimes ¶ added in v0.0.3
FindDowntimes finds downtimes
func (*Client) FindInvitations ¶
func (c *Client) FindInvitations(ctx context.Context) ([]*Invitation, error)
FindInvitations returns a list of user invitations.
func (*Client) FindMonitor ¶ added in v0.0.2
FindMonitor returns a monitoring setting.
func (*Client) FindMonitors ¶ added in v0.0.2
FindMonitors returns monitoring settings.
func (*Client) FindNotificationChannels ¶
func (c *Client) FindNotificationChannels(ctx context.Context) ([]NotificationChannel, error)
FindNotificationChannels returns rhe list of notification channels.
func (*Client) FindNotificationGroups ¶
func (c *Client) FindNotificationGroups(ctx context.Context) ([]*NotificationGroup, error)
FindNotificationGroups returns the list of notification groups.
func (*Client) FindServices ¶ added in v0.0.3
FindServices return the list of services.
func (*Client) GetHostMetaData ¶
func (c *Client) GetHostMetaData(ctx context.Context, hostID, namespace string, v any) (*HostMetaMetaData, error)
GetHostMetaData gets host metadata and stores the result in the value pointed to by v. GetHostMetaData uses the json package for storing the result, see https://golang.org/pkg/encoding/json/#Unmarshal for decoding rules. https://mackerel.io/api-docs/entry/metadata#get
func (*Client) GetHostMetaDataNameSpaces ¶
GetHostMetaDataNameSpaces fetches namespaces of host metadata. https://mackerel.io/api-docs/entry/metadata#hostlist
func (*Client) GetRoleMetaData ¶
func (c *Client) GetRoleMetaData(ctx context.Context, serviceName, roleName, namespace string, v any) (*RoleMetaMetaData, error)
GetRoleMetaData gets role metadata and stores the result in the value pointed to by v. GetRoleMetaData uses the json package for storing the result, see https://golang.org/pkg/encoding/json/#Unmarshal for decoding rules. https://mackerel.io/api-docs/entry/metadata#roleget
func (*Client) GetRoleMetaDataNameSpaces ¶
func (c *Client) GetRoleMetaDataNameSpaces(ctx context.Context, serviceName, roleName string) ([]string, error)
GetRoleMetaDataNameSpaces fetches namespaces of role metadata. https://mackerel.io/api-docs/entry/metadata#rolelist
func (*Client) GetServiceMetaData ¶
func (c *Client) GetServiceMetaData(ctx context.Context, serviceName, namespace string, v any) (*ServiceMetaMetaData, error)
GetServiceMetaData gets Service metadata and stores the result in the value pointed to by v. GetServiceMetaData uses the json package for storing the result, see https://golang.org/pkg/encoding/json/#Unmarshal for decoding rules. https://mackerel.io/api-docs/entry/metadata#get
func (*Client) GetServiceMetaDataNameSpaces ¶
func (c *Client) GetServiceMetaDataNameSpaces(ctx context.Context, serviceName string) ([]string, error)
GetServiceMetaDataNameSpaces fetches namespaces of Service metadata. https://mackerel.io/api-docs/entry/metadata#Servicelist
func (*Client) PutHostMetaData ¶
PutHostMetaData creates or updates host metadata by the value of v. PutHostMetaData uses the json package for putting the metadata, see https://golang.org/pkg/encoding/json/#Marshal for encoding roles. https://mackerel.io/api-docs/entry/metadata#serviceput
func (*Client) PutRoleMetaData ¶
func (c *Client) PutRoleMetaData(ctx context.Context, serviceName, roleName, namespace string, v any) error
PutRoleMetaData creates or updates Role metadata by the value of v. PutRoleMetaData uses the json package for putting the metadata, see https://golang.org/pkg/encoding/json/#Marshal for encoding roles. https://mackerel.io/api-docs/entry/metadata#roleput
func (*Client) PutServiceMetaData ¶
func (c *Client) PutServiceMetaData(ctx context.Context, serviceName, namespace string, v any) error
PutServiceMetaData creates or updates Service metadata by the value of v. PutServiceMetaData uses the json package for putting the metadata, see https://golang.org/pkg/encoding/json/#Marshal for encoding roles. https://mackerel.io/api-docs/entry/metadata#serviceput
func (*Client) RetireHost ¶
RetireHost make the host retired.
func (*Client) RevokeInvitation ¶
RevokeInvitation revokes a user invitation.
func (*Client) UpdateAWSIntegration ¶ added in v0.0.7
func (c *Client) UpdateAWSIntegration(ctx context.Context, awsIntegrationID string, param *AWSIntegration) (*AWSIntegration, error)
UpdateAWSIntegration updates an aws integration.
func (*Client) UpdateDashboard ¶
func (c *Client) UpdateDashboard(ctx context.Context, dashboardID string, param *Dashboard) (*Dashboard, error)
UpdateDashboard deletes a service https://mackerel.io/api-docs/entry/dashboards#update
func (*Client) UpdateDowntime ¶ added in v0.0.3
func (c *Client) UpdateDowntime(ctx context.Context, downtimeID string, param *Downtime) (*Downtime, error)
UpdateDowntime updates a downtime.
func (*Client) UpdateHost ¶
func (c *Client) UpdateHost(ctx context.Context, hostID string, param *UpdateHostParam) (string, error)
UpdateHost updates the host's information.
func (*Client) UpdateMonitor ¶
func (c *Client) UpdateMonitor(ctx context.Context, monitorID string, param Monitor) (Monitor, error)
UpdateMonitor updates a monitoring.
func (*Client) UpdateNotificationGroup ¶
func (c *Client) UpdateNotificationGroup(ctx context.Context, groupID string, group *NotificationGroup) (*NotificationGroup, error)
UpdateNotificationGroup creates a new notification group.
type CreateHostParam ¶
type CreateHostParam struct {
Name string `json:"name"`
DisplayName string `json:"displayName,omitempty"`
Meta HostMeta `json:"meta"`
// Interfaces []Interface `json:"interfaces,omitempty"`
RoleFullnames []string `json:"roleFullnames,omitempty"`
// Checks []CheckConfig `json:"checks,omitempty"`
CustomIdentifier string `json:"customIdentifier,omitempty"`
}
CreateHostParam parameters for CreateHost
type CreateRoleParam ¶
CreateRoleParam parameters for CreateRole.
type CreateServiceParam ¶
CreateServiceParam parameters for CreateService.
type Dashboard ¶
type Dashboard struct {
ID string `json:"id,omitempty"`
Title string `json:"title,omitempty"`
Memo string `json:"memo,omitempty"`
URLPath string `json:"urlPath,omitempty"`
Widgets []Widget `json:"-"`
CreatedAt Timestamp `json:"createdAt,omitempty"`
UpdatedAt Timestamp `json:"updatedAt,omitempty"`
}
Dashboard is a dashboard. https://mackerel.io/api-docs/entry/dashboards#create
func (*Dashboard) MarshalJSON ¶
MarshalJSON mashal JSON.
func (*Dashboard) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshal
type Downtime ¶ added in v0.0.3
type Downtime struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Memo string `json:"memo,omitempty"`
Start Timestamp `json:"start"`
Duration int64 `json:"duration"`
Recurrence *DowntimeRecurrence `json:"recurrence,omitempty"`
ServiceScopes []string `json:"serviceScopes,omitempty"`
ServiceExcludeScopes []string `json:"serviceExcludeScopes,omitempty"`
RoleScopes []string `json:"roleScopes,omitempty"`
RoleExcludeScopes []string `json:"roleExcludeScopes,omitempty"`
MonitorScopes []string `json:"monitorScopes,omitempty"`
MonitorExcludeScopes []string `json:"monitorExcludeScopes,omitempty"`
}
Downtime is a downtime.
type DowntimeRecurrence ¶ added in v0.0.3
type DowntimeRecurrence struct {
Type DowntimeRecurrenceType `json:"type,omitempty"`
Interval int64 `json:"interval,omitempty"`
Weekdays []DowntimeWeekday `json:"weekdays,omitempty"`
Until Timestamp `json:"until,omitempty"`
}
DowntimeRecurrence is recurrence settings for a downtime.
type DowntimeRecurrenceType ¶ added in v0.0.3
type DowntimeRecurrenceType string
DowntimeRecurrenceType is a type of DowntimeRecurrence
const ( // DowntimeRecurrenceTypeHourly is a recurrence hourly. DowntimeRecurrenceTypeHourly DowntimeRecurrenceType = "hourly" // DowntimeRecurrenceTypeDaily is a recurrence daily. DowntimeRecurrenceTypeDaily DowntimeRecurrenceType = "daily" // DowntimeRecurrenceTypeWeekly is a recurrence weekly. DowntimeRecurrenceTypeWeekly DowntimeRecurrenceType = "weekly" // DowntimeRecurrenceTypeMonthly is a recurrence monthly. DowntimeRecurrenceTypeMonthly DowntimeRecurrenceType = "monthly" // DowntimeRecurrenceTypeYearly is a recurrence yearly. DowntimeRecurrenceTypeYearly DowntimeRecurrenceType = "yearly" )
func (DowntimeRecurrenceType) String ¶ added in v0.0.3
func (t DowntimeRecurrenceType) String() string
type DowntimeWeekday ¶ added in v0.0.3
DowntimeWeekday specifies a day of the week (Sunday = 0, ...)
func ParseDowntimeWeekday ¶ added in v0.0.3
func ParseDowntimeWeekday(name string) (DowntimeWeekday, error)
ParseDowntimeWeekday parses DowntimeWeekday.
func (DowntimeWeekday) MarshalJSON ¶ added in v0.0.3
func (d DowntimeWeekday) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (DowntimeWeekday) String ¶ added in v0.0.3
func (d DowntimeWeekday) String() string
func (*DowntimeWeekday) UnmarshalJSON ¶ added in v0.0.3
func (d *DowntimeWeekday) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler
func (DowntimeWeekday) Weekday ¶ added in v0.0.3
func (d DowntimeWeekday) Weekday() time.Weekday
Weekday converts d to time.Weekday.
type Graph ¶
type Graph interface {
GraphType() GraphType
}
Graph is a graph definition of a graph widget. https://mackerel.io/api-docs/entry/dashboards#graph
type GraphExpression ¶
GraphExpression is an expression metric graph.
func (*GraphExpression) GraphType ¶
func (g *GraphExpression) GraphType() GraphType
GraphType returns GraphTypeExpression.
func (*GraphExpression) MarshalJSON ¶
func (g *GraphExpression) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type GraphHost ¶
type GraphHost struct {
Type GraphType `json:"type"`
HostID string `json:"hostId"`
Name string `json:"name"`
}
GraphHost is a host metric graph.
func (*GraphHost) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type GraphRange ¶
type GraphRange interface {
GraphRangeType() GraphRangeType
}
GraphRange is a range for graph widgets. https://mackerel.io/api-docs/entry/dashboards#graph-range
type GraphRangeAbsolute ¶
type GraphRangeAbsolute struct {
Type GraphRangeType `json:"type"`
Start Timestamp `json:"start"`
End Timestamp `json:"end"`
}
GraphRangeAbsolute is an absolute range.
func (*GraphRangeAbsolute) GraphRangeType ¶
func (r *GraphRangeAbsolute) GraphRangeType() GraphRangeType
GraphRangeType returns GraphRangeTypeAbsolute.
func (*GraphRangeAbsolute) MarshalJSON ¶
func (r *GraphRangeAbsolute) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler.
func (*GraphRangeAbsolute) UnmarshalJSON ¶
func (r *GraphRangeAbsolute) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type GraphRangeRelative ¶
type GraphRangeRelative struct {
Type GraphRangeType `json:"type"`
Period int64 `json:"period"`
Offset int64 `json:"offset"`
}
GraphRangeRelative is a relative range.
func (*GraphRangeRelative) GraphRangeType ¶
func (r *GraphRangeRelative) GraphRangeType() GraphRangeType
GraphRangeType returns GraphRangeTypeRelative.
func (*GraphRangeRelative) MarshalJSON ¶
func (r *GraphRangeRelative) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler.
func (*GraphRangeRelative) UnmarshalJSON ¶
func (r *GraphRangeRelative) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type GraphRangeType ¶
type GraphRangeType string
GraphRangeType is a type of GraphRange.
const ( // GraphRangeTypeRelative is a relative range. GraphRangeTypeRelative GraphRangeType = "relative" // GraphRangeTypeAbsolute is an absolute range. GraphRangeTypeAbsolute GraphRangeType = "absolute" )
func (GraphRangeType) String ¶
func (t GraphRangeType) String() string
type GraphRole ¶
type GraphRole struct {
Type GraphType `json:"type"`
RoleFullname string `json:"roleFullname"`
Name string `json:"name"`
IsStacked bool `json:"isStacked,omitempty"`
}
GraphRole is a role metric graph.
func (*GraphRole) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type GraphService ¶
type GraphService struct {
Type GraphType `json:"type"`
ServiceName string `json:"serviceName"`
Name string `json:"name"`
}
GraphService is a service metric graph.
func (*GraphService) GraphType ¶
func (g *GraphService) GraphType() GraphType
GraphType returns GraphTypeService.
func (*GraphService) MarshalJSON ¶
func (g *GraphService) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type GraphType ¶
type GraphType string
GraphType is a type of a graph widget.
const ( // GraphTypeHost is a host metric graph. GraphTypeHost GraphType = "host" // GraphTypeRole is a role metric graph. GraphTypeRole GraphType = "role" // GraphTypeService is a service metric graph. GraphTypeService GraphType = "service" // GraphTypeExpression is an expression graph. GraphTypeExpression GraphType = "expression" // GraphTypeUnknown is an unknown graph. GraphTypeUnknown GraphType = "unknown" )
type GraphUnknown ¶
type GraphUnknown struct {
Type GraphType `json:"type"`
}
GraphUnknown is an unknown graph.
func (*GraphUnknown) GraphType ¶
func (g *GraphUnknown) GraphType() GraphType
GraphType returns GraphTypeUnknown.
func (*GraphUnknown) MarshalJSON ¶
func (g *GraphUnknown) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type HeaderField ¶
HeaderField represents key-value pairs in an HTTP header for external http monitoring.
type Host ¶
type Host struct {
ID string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"displayName,omitempty"`
CustomIdentifier string `json:"customIdentifier,omitempty"`
Type string `json:"type"`
Status string `json:"status"`
Memo string `json:"memo"`
// Roles Roles `json:"roles"`
IsRetired bool `json:"isRetired"`
CreatedAt Timestamp `json:"createdAt"`
Meta HostMeta `json:"meta"`
}
Host is host information
type HostMeta ¶
type HostMeta struct {
AgentRevision string `json:"agent-revision,omitempty"`
AgentVersion string `json:"agent-version,omitempty"`
AgentName string `json:"agent-name,omitempty"`
}
HostMeta host meta information
type HostMetaMetaData ¶
HostMetaMetaData is meta data of host meta data.
type Invitation ¶
type Invitation struct {
Email string `json:"email"`
Authority UserAuthority `json:"authority"`
ExpiresAt Timestamp `json:"expiresAt"`
}
Invitation is a user invitation.
type Layout ¶
type Layout struct {
X uint64 `json:"x"`
Y uint64 `json:"y"`
Width uint64 `json:"width"`
Height uint64 `json:"height"`
}
Layout describes the layout of the widget. https://mackerel.io/api-docs/entry/dashboards#layout
type Metric ¶
type Metric interface {
MetricType() MetricType
}
Metric is a metric of metric widget. https://mackerel.io/api-docs/entry/dashboards#metric
type MetricExpression ¶
type MetricExpression struct {
Type MetricType `json:"type"`
Expression string `json:"expression"`
}
MetricExpression is an expression metric Metric.
func (*MetricExpression) MarshalJSON ¶
func (m *MetricExpression) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MetricExpression) MetricType ¶
func (m *MetricExpression) MetricType() MetricType
MetricType returns MetricTypeExpression.
type MetricHost ¶
type MetricHost struct {
Type MetricType `json:"type"`
HostID string `json:"hostId"`
Name string `json:"name"`
}
MetricHost is a host metric.
func (*MetricHost) MarshalJSON ¶
func (m *MetricHost) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MetricHost) MetricType ¶
func (m *MetricHost) MetricType() MetricType
MetricType returns MetricTypeHost.
type MetricService ¶
type MetricService struct {
Type MetricType `json:"type"`
ServiceName string `json:"serviceName"`
Name string `json:"name"`
}
MetricService is a service metric.
func (*MetricService) MarshalJSON ¶
func (m *MetricService) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MetricService) MetricType ¶
func (m *MetricService) MetricType() MetricType
MetricType returns MetricTypeService.
type MetricType ¶
type MetricType string
MetricType is a type of a metric.
const ( // MetricTypeHost is a host metric. MetricTypeHost MetricType = "host" // MetricTypeService is a service metric graph. MetricTypeService MetricType = "service" // MetricTypeExpression is an expression graph. MetricTypeExpression MetricType = "expression" // MetricTypeUnknown is an unknown graph. MetricTypeUnknown MetricType = "unknown" )
func (MetricType) String ¶
func (t MetricType) String() string
type MetricUnknown ¶
type MetricUnknown struct {
Type MetricType `json:"type"`
}
MetricUnknown is an unknown Metric.
func (*MetricUnknown) MarshalJSON ¶
func (m *MetricUnknown) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MetricUnknown) MetricType ¶
func (m *MetricUnknown) MetricType() MetricType
MetricType returns MetricTypeUnknown.
type Monitor ¶
type Monitor interface {
json.Unmarshaler
json.Marshaler
MonitorType() MonitorType
MonitorID() string
MonitorName() string
}
Monitor represents interface to which each monitor type must confirm to.
type MonitorAnomalyDetection ¶ added in v0.0.3
type MonitorAnomalyDetection struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Memo string `json:"memo,omitempty"`
Type MonitorType `json:"type,omitempty"`
IsMute bool `json:"isMute,omitempty"`
NotificationInterval uint64 `json:"notificationInterval,omitempty"`
Scopes []string `json:"scopes"`
WarningSensitivity AnomalyDetectionSensitivityType `json:"warningSensitivity,omitempty"`
CriticalSensitivity AnomalyDetectionSensitivityType `json:"criticalSensitivity,omitempty"`
MaxCheckAttempts uint64 `json:"maxCheckAttempts,omitempty"`
TrainingPeriodFrom Timestamp `json:"trainingPeriodFrom,omitempty"`
}
MonitorAnomalyDetection represents anomaly detection monitor.
func (*MonitorAnomalyDetection) MarshalJSON ¶ added in v0.0.3
func (m *MonitorAnomalyDetection) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MonitorAnomalyDetection) MonitorID ¶ added in v0.0.3
func (m *MonitorAnomalyDetection) MonitorID() string
MonitorID returns monitor id.
func (*MonitorAnomalyDetection) MonitorName ¶ added in v0.0.3
func (m *MonitorAnomalyDetection) MonitorName() string
MonitorName returns monitor name.
func (*MonitorAnomalyDetection) MonitorType ¶ added in v0.0.3
func (m *MonitorAnomalyDetection) MonitorType() MonitorType
MonitorType returns monitor type.
func (*MonitorAnomalyDetection) UnmarshalJSON ¶ added in v0.0.3
func (m *MonitorAnomalyDetection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MonitorConnectivity ¶
type MonitorConnectivity struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Memo string `json:"memo,omitempty"`
Type MonitorType `json:"type,omitempty"`
IsMute bool `json:"isMute,omitempty"`
NotificationInterval uint64 `json:"notificationInterval,omitempty"`
Scopes []string `json:"scopes,omitempty"`
ExcludeScopes []string `json:"excludeScopes,omitempty"`
}
MonitorConnectivity represents connectivity monitor.
func (*MonitorConnectivity) MarshalJSON ¶ added in v0.0.2
func (m *MonitorConnectivity) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MonitorConnectivity) MonitorID ¶
func (m *MonitorConnectivity) MonitorID() string
MonitorID returns monitor id.
func (*MonitorConnectivity) MonitorName ¶
func (m *MonitorConnectivity) MonitorName() string
MonitorName returns monitor name.
func (*MonitorConnectivity) MonitorType ¶
func (m *MonitorConnectivity) MonitorType() MonitorType
MonitorType returns monitor type.
func (*MonitorConnectivity) UnmarshalJSON ¶ added in v0.0.2
func (m *MonitorConnectivity) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MonitorExpression ¶
type MonitorExpression struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Memo string `json:"memo,omitempty"`
Type MonitorType `json:"type,omitempty"`
IsMute bool `json:"isMute,omitempty"`
NotificationInterval uint64 `json:"notificationInterval,omitempty"`
Expression string `json:"expression,omitempty"`
Operator string `json:"operator,omitempty"`
Warning *float64 `json:"warning"`
Critical *float64 `json:"critical"`
}
MonitorExpression represents expression monitor.
func (*MonitorExpression) MarshalJSON ¶ added in v0.0.2
func (m *MonitorExpression) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MonitorExpression) MonitorID ¶
func (m *MonitorExpression) MonitorID() string
MonitorID returns monitor id.
func (*MonitorExpression) MonitorName ¶
func (m *MonitorExpression) MonitorName() string
MonitorName returns monitor name.
func (*MonitorExpression) MonitorType ¶
func (m *MonitorExpression) MonitorType() MonitorType
MonitorType returns monitor type.
func (*MonitorExpression) UnmarshalJSON ¶ added in v0.0.2
func (m *MonitorExpression) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MonitorExternalHTTP ¶
type MonitorExternalHTTP struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Memo string `json:"memo,omitempty"`
Type MonitorType `json:"type,omitempty"`
IsMute bool `json:"isMute,omitempty"`
NotificationInterval uint64 `json:"notificationInterval,omitempty"`
Method string `json:"method,omitempty"`
URL string `json:"url,omitempty"`
MaxCheckAttempts uint64 `json:"maxCheckAttempts,omitempty"`
Service string `json:"service,omitempty"`
ResponseTimeCritical *float64 `json:"responseTimeCritical,omitempty"`
ResponseTimeWarning *float64 `json:"responseTimeWarning,omitempty"`
ResponseTimeDuration *uint64 `json:"responseTimeDuration,omitempty"`
RequestBody string `json:"requestBody,omitempty"`
ContainsString string `json:"containsString,omitempty"`
CertificationExpirationCritical *uint64 `json:"certificationExpirationCritical,omitempty"`
CertificationExpirationWarning *uint64 `json:"certificationExpirationWarning,omitempty"`
SkipCertificateVerification bool `json:"skipCertificateVerification,omitempty"`
// Empty list of headers and nil are different. You have to specify empty
// list as headers explicitly if you want to remove all headers instead of
// using nil.
Headers []HeaderField `json:"headers"`
}
MonitorExternalHTTP represents external HTTP monitor.
func (*MonitorExternalHTTP) MarshalJSON ¶ added in v0.0.2
func (m *MonitorExternalHTTP) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MonitorExternalHTTP) MonitorID ¶
func (m *MonitorExternalHTTP) MonitorID() string
MonitorID returns monitor id.
func (*MonitorExternalHTTP) MonitorName ¶
func (m *MonitorExternalHTTP) MonitorName() string
MonitorName returns monitor name.
func (*MonitorExternalHTTP) MonitorType ¶
func (m *MonitorExternalHTTP) MonitorType() MonitorType
MonitorType returns monitor type.
func (*MonitorExternalHTTP) UnmarshalJSON ¶ added in v0.0.2
func (m *MonitorExternalHTTP) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MonitorHostMetric ¶
type MonitorHostMetric struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Memo string `json:"memo,omitempty"`
Type MonitorType `json:"type,omitempty"`
IsMute bool `json:"isMute,omitempty"`
NotificationInterval uint64 `json:"notificationInterval,omitempty"`
Metric string `json:"metric,omitempty"`
Operator string `json:"operator,omitempty"`
Warning *float64 `json:"warning"`
Critical *float64 `json:"critical"`
Duration uint64 `json:"duration,omitempty"`
MaxCheckAttempts uint64 `json:"maxCheckAttempts,omitempty"`
Scopes []string `json:"scopes,omitempty"`
ExcludeScopes []string `json:"excludeScopes,omitempty"`
}
MonitorHostMetric represents host metric monitor.
func (*MonitorHostMetric) MarshalJSON ¶ added in v0.0.2
func (m *MonitorHostMetric) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshal.
func (*MonitorHostMetric) MonitorID ¶
func (m *MonitorHostMetric) MonitorID() string
MonitorID returns monitor id.
func (*MonitorHostMetric) MonitorName ¶
func (m *MonitorHostMetric) MonitorName() string
MonitorName returns monitor name.
func (*MonitorHostMetric) MonitorType ¶
func (m *MonitorHostMetric) MonitorType() MonitorType
MonitorType returns monitor type.
func (*MonitorHostMetric) UnmarshalJSON ¶ added in v0.0.2
func (m *MonitorHostMetric) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshal.
type MonitorServiceMetric ¶
type MonitorServiceMetric struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Memo string `json:"memo,omitempty"`
Type MonitorType `json:"type,omitempty"`
IsMute bool `json:"isMute,omitempty"`
NotificationInterval uint64 `json:"notificationInterval,omitempty"`
Service string `json:"service,omitempty"`
Metric string `json:"metric,omitempty"`
Operator string `json:"operator,omitempty"`
Warning *float64 `json:"warning"`
Critical *float64 `json:"critical"`
Duration uint64 `json:"duration,omitempty"`
MaxCheckAttempts uint64 `json:"maxCheckAttempts,omitempty"`
MissingDurationWarning *uint64 `json:"missingDurationWarning"`
MissingDurationCritical *uint64 `json:"missingDurationCritical"`
}
MonitorServiceMetric represents service metric monitor.
func (*MonitorServiceMetric) MarshalJSON ¶ added in v0.0.2
func (m *MonitorServiceMetric) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*MonitorServiceMetric) MonitorID ¶
func (m *MonitorServiceMetric) MonitorID() string
MonitorID returns monitor id.
func (*MonitorServiceMetric) MonitorName ¶
func (m *MonitorServiceMetric) MonitorName() string
MonitorName returns monitor name.
func (*MonitorServiceMetric) MonitorType ¶
func (m *MonitorServiceMetric) MonitorType() MonitorType
MonitorType returns monitor type.
func (*MonitorServiceMetric) UnmarshalJSON ¶ added in v0.0.2
func (m *MonitorServiceMetric) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MonitorType ¶
type MonitorType string
MonitorType is a type of monitors.
const ( // MonitorTypeConnectivity is a type for host connectivity monitoring. MonitorTypeConnectivity MonitorType = "connectivity" // MonitorTypeHostMetric is a type for Host metric monitoring. MonitorTypeHostMetric MonitorType = "host" // MonitorTypeServiceMetric is a type for Service metric monitoring. MonitorTypeServiceMetric MonitorType = "service" // MonitorTypeExternalHTTP is a type for External monitoring. MonitorTypeExternalHTTP MonitorType = "external" // MonitorTypeExpression is a type for Expression monitoring. MonitorTypeExpression MonitorType = "expression" // MonitorTypeAnomalyDetection is a type for anomaly detection. MonitorTypeAnomalyDetection MonitorType = "anomalyDetection" )
func (MonitorType) String ¶
func (t MonitorType) String() string
type NotificationChannel ¶
type NotificationChannel interface {
json.Marshaler
json.Unmarshaler
NotificationChannelType() NotificationChannelType
NotificationChannelID() string
NotificationChannelName() string
}
NotificationChannel represents interface to which each notification type must confirm to.
type NotificationChannelBase ¶
type NotificationChannelBase struct {
Type NotificationChannelType `json:"type"`
ID string `json:"id,omitempty"`
Name string `json:"name"`
}
NotificationChannelBase is base type of notification channel.
func (*NotificationChannelBase) MarshalJSON ¶
func (c *NotificationChannelBase) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Unmarshaler.
func (*NotificationChannelBase) NotificationChannelID ¶
func (c *NotificationChannelBase) NotificationChannelID() string
NotificationChannelID returns the id of the channel.
func (*NotificationChannelBase) NotificationChannelName ¶
func (c *NotificationChannelBase) NotificationChannelName() string
NotificationChannelName returns the name of the channel.
func (*NotificationChannelBase) NotificationChannelType ¶
func (c *NotificationChannelBase) NotificationChannelType() NotificationChannelType
NotificationChannelType returns the type.
func (*NotificationChannelBase) UnmarshalJSON ¶
func (c *NotificationChannelBase) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NotificationChannelEmail ¶
type NotificationChannelEmail struct {
Type NotificationChannelType `json:"type"`
ID string `json:"id,omitempty"`
Name string `json:"name"`
Emails []string `json:"emails"`
UserIDs []string `json:"userIds"`
Events []NotificationEvent `json:"events"`
}
NotificationChannelEmail is an email notification channel.
func (*NotificationChannelEmail) MarshalJSON ¶
func (c *NotificationChannelEmail) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Unmarshaler.
func (*NotificationChannelEmail) NotificationChannelID ¶
func (c *NotificationChannelEmail) NotificationChannelID() string
NotificationChannelID returns the id of the channel.
func (*NotificationChannelEmail) NotificationChannelName ¶
func (c *NotificationChannelEmail) NotificationChannelName() string
NotificationChannelName returns the name of the channel.
func (*NotificationChannelEmail) NotificationChannelType ¶
func (c *NotificationChannelEmail) NotificationChannelType() NotificationChannelType
NotificationChannelType returns NotificationChannelTypeEmail
func (*NotificationChannelEmail) UnmarshalJSON ¶
func (c *NotificationChannelEmail) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NotificationChannelSlack ¶
type NotificationChannelSlack struct {
Type NotificationChannelType `json:"type"`
ID string `json:"id,omitempty"`
Name string `json:"name"`
URL string `json:"url"`
EnabledGraphImage bool `json:"enabledGraphImage"`
Mentions NotificationChannelSlackMentions `json:"mentions"`
Events []NotificationEvent `json:"events"`
}
NotificationChannelSlack is a slack notification channel.
func (*NotificationChannelSlack) MarshalJSON ¶
func (c *NotificationChannelSlack) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Unmarshaler.
func (*NotificationChannelSlack) NotificationChannelID ¶
func (c *NotificationChannelSlack) NotificationChannelID() string
NotificationChannelID returns the id of the channel.
func (*NotificationChannelSlack) NotificationChannelName ¶
func (c *NotificationChannelSlack) NotificationChannelName() string
NotificationChannelName returns the name of the channel.
func (*NotificationChannelSlack) NotificationChannelType ¶
func (c *NotificationChannelSlack) NotificationChannelType() NotificationChannelType
NotificationChannelType returns NotificationChannelTypeSlack
func (*NotificationChannelSlack) UnmarshalJSON ¶
func (c *NotificationChannelSlack) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NotificationChannelSlackMentions ¶
type NotificationChannelSlackMentions struct {
OK string `json:"ok,omitempty"`
Warning string `json:"warning,omitempty"`
Critical string `json:"critical,omitempty"`
}
NotificationChannelSlackMentions is mentions in slack notification.
type NotificationChannelType ¶
type NotificationChannelType string
NotificationChannelType is a type of notification channel.
const ( // NotificationChannelTypeEmail is email type. NotificationChannelTypeEmail NotificationChannelType = "email" // NotificationChannelTypeSlack is slack type. NotificationChannelTypeSlack NotificationChannelType = "slack" // NotificationChannelTypeWebHook is web hook type. NotificationChannelTypeWebHook NotificationChannelType = "webhook" // NotificationChannelTypeLine is LINE type. NotificationChannelTypeLine NotificationChannelType = "line" // NotificationChannelTypeWebHook is Chatwork type. NotificationChannelTypeChatwork NotificationChannelType = "chatwork" // NotificationChannelTypeTypetalk is Typetalk type. NotificationChannelTypeTypetalk NotificationChannelType = "typetalk" // NotificationChannelTypeHipchat is Hipchat type. NotificationChannelTypeHipchat NotificationChannelType = "hipchat" // NotificationChannelTypeHipchat is twilio type. NotificationChannelTypeTwilio NotificationChannelType = "twilio" // NotificationChannelTypeReactio is Hipchat type. NotificationChannelTypeReactio NotificationChannelType = "reactio" // NotificationChannelTypePagerduty is Hipchat type. NotificationChannelTypePagerduty NotificationChannelType = "pagerduty" // NotificationChannelTypeOpsgenie is Opsgenie type. NotificationChannelTypeOpsgenie NotificationChannelType = "opsgenie" // NotificationChannelTypeYammer is Yammer type. NotificationChannelTypeYammer NotificationChannelType = "yammer" // NotificationChannelTypeMicrosoftTeams is Hipchat type. NotificationChannelTypeMicrosoftTeams NotificationChannelType = "microsoft-teams" // NotificationChannelTypeAmazonEventBridge is Amazon Event Bridge type. NotificationChannelTypeAmazonEventBridge NotificationChannelType = "amazon-event-bridge" )
func (NotificationChannelType) String ¶
func (t NotificationChannelType) String() string
type NotificationChannelWebHook ¶
type NotificationChannelWebHook struct {
Type NotificationChannelType `json:"type"`
ID string `json:"id,omitempty"`
Name string `json:"name"`
URL string `json:"url"`
Events []NotificationEvent `json:"events"`
}
NotificationChannelWebHook is a web hook notification channel.
func (*NotificationChannelWebHook) MarshalJSON ¶
func (c *NotificationChannelWebHook) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Unmarshaler.
func (*NotificationChannelWebHook) NotificationChannelID ¶
func (c *NotificationChannelWebHook) NotificationChannelID() string
NotificationChannelID returns the id of the channel.
func (*NotificationChannelWebHook) NotificationChannelName ¶
func (c *NotificationChannelWebHook) NotificationChannelName() string
NotificationChannelName returns the name of the channel.
func (*NotificationChannelWebHook) NotificationChannelType ¶
func (c *NotificationChannelWebHook) NotificationChannelType() NotificationChannelType
NotificationChannelType returns NotificationChannelTypeWebHook
func (*NotificationChannelWebHook) UnmarshalJSON ¶
func (c *NotificationChannelWebHook) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NotificationEvent ¶
type NotificationEvent string
NotificationEvent is an event type to notify.
const ( // NotificationEventAlert notifies alert events. NotificationEventAlert NotificationEvent = "alert" // NotificationEventAlertGroup notifies alert group events. NotificationEventAlertGroup NotificationEvent = "alertGroup" // NotificationEventHostStatus notifies host status change events. NotificationEventHostStatus NotificationEvent = "hostStatus" // NotificationEventHostRegister notifies host registration events. NotificationEventHostRegister NotificationEvent = "hostRegister" // NotificationEventHostRetire notifies host retirement events. NotificationEventHostRetire NotificationEvent = "hostRetire" // NotificationEventMonitor notifies monitor events. NotificationEventMonitor NotificationEvent = "monitor" )
func (NotificationEvent) String ¶
func (e NotificationEvent) String() string
type NotificationGroup ¶
type NotificationGroup struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
NotificationLevel NotificationLevel `json:"notificationLevel"`
ChildNotificationGroupIDs []string `json:"childNotificationGroupIds"`
ChildChannelIDs []string `json:"childChannelIds"`
Monitors []NotificationGroupMonitor `json:"monitors,omitempty"`
Services []NotificationGroupService `json:"services,omitempty"`
}
NotificationGroup is a notification group.
type NotificationGroupMonitor ¶
type NotificationGroupMonitor struct {
ID string `json:"id"`
SkipDefault bool `json:"skipDefault"`
}
NotificationGroupMonitor is a monitor setting for a notification group.
type NotificationGroupService ¶
type NotificationGroupService struct {
Name string `json:"name"`
}
NotificationGroupService is a service setting for a notification group.
type NotificationLevel ¶
type NotificationLevel string
NotificationLevel is the notification level.
const ( // NotificationLevelAll receives all notifications. NotificationLevelAll NotificationLevel = "all" // NotificationLevelCritical receives critical notifications. NotificationLevelCritical NotificationLevel = "critical" )
func (NotificationLevel) String ¶
func (level NotificationLevel) String() string
type RoleMetaMetaData ¶
RoleMetaMetaData is meta data of Role meta data.
type Service ¶
type Service struct {
Name string `json:"name"`
Memo string `json:"memo"`
Roles []string `json:"roles"`
}
Service represents the "service" of Mackerel.
type ServiceMetaMetaData ¶
ServiceMetaMetaData is meta data of service meta data.
type Timestamp ¶ added in v0.0.3
type Timestamp int64
Timestamp is unix epoch time.
func (Timestamp) MarshalJSON ¶ added in v0.0.3
MarshalJSON implements the json.Marshaler interface.
func (Timestamp) MarshalText ¶ added in v0.0.3
MarshalText implements the encoding.TextMarshaler interface.
func (*Timestamp) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Timestamp) UnmarshalText ¶ added in v0.0.3
UnmarshalText implements the encoding.TextUnmarshaler interface.
type UpdateHostParam ¶
type UpdateHostParam CreateHostParam
UpdateHostParam is parameters for UpdateHost
type User ¶
type User struct {
ID string `json:"id"`
ScreenName string `json:"screenName"`
Email string `json:"email"`
Authority UserAuthority `json:"authority"`
IsInRegistrationProcess bool `json:"isInRegistrationProcess"`
IsMFAEnabled bool `json:"isMFAEnabled"`
AuthenticationMethods []UserAuthenticationMethod `json:"authenticationMethods"`
JoinedAt Timestamp `json:"joinedAt"`
}
User is a user in mackerel.
type UserAuthenticationMethod ¶
type UserAuthenticationMethod string
UserAuthenticationMethod is a method of authentication
const ( // UserAuthenticationMethodPassword is the password authentication. UserAuthenticationMethodPassword UserAuthenticationMethod = "password" // UserAuthenticationMethodGitHub is the GitHub authentication. UserAuthenticationMethodGitHub UserAuthenticationMethod = "github" // UserAuthenticationMethodIDCF is the IDCF authentication. UserAuthenticationMethodIDCF UserAuthenticationMethod = "idcf" // UserAuthenticationMethodGoogle is the Google authentication. UserAuthenticationMethodGoogle UserAuthenticationMethod = "google" // UserAuthenticationMethodNifty is the nifty authentication. UserAuthenticationMethodNifty UserAuthenticationMethod = "nifty" // UserAuthenticationMethodYammer is the Yammer authentication. UserAuthenticationMethodYammer UserAuthenticationMethod = "yammer" // UserAuthenticationMethodKDDI is the KDDI authentication. UserAuthenticationMethodKDDI UserAuthenticationMethod = "kddi" )
func (UserAuthenticationMethod) String ¶ added in v0.0.7
func (t UserAuthenticationMethod) String() string
type UserAuthority ¶
type UserAuthority string
UserAuthority is the authority type for user.
const ( // UserAuthorityOwner is the owner authority type UserAuthorityOwner UserAuthority = "owner" // UserAuthorityManager is the manager authority type UserAuthorityManager UserAuthority = "manager" // UserAuthorityCollaborator is the collaborator authority type UserAuthorityCollaborator UserAuthority = "collaborator" // UserAuthorityViewer is the viewer authority type UserAuthorityViewer UserAuthority = "viewer" )
func (UserAuthority) String ¶ added in v0.0.7
func (t UserAuthority) String() string
type Widget ¶
type Widget interface {
json.Marshaler
json.Unmarshaler
WidgetType() WidgetType
WidgetTitle() string
WidgetLayout() *Layout
}
Widget is a widget. https://mackerel.io/api-docs/entry/dashboards#widget
type WidgetAlertStatus ¶ added in v0.0.3
type WidgetAlertStatus struct {
Type WidgetType `json:"type"`
Title string `json:"title"`
RoleFullname *string `json:"roleFullname,omitempty"`
Layout *Layout `json:"layout,omitempty"`
}
WidgetAlertStatus is an alert status widget for dashboards.
func (*WidgetAlertStatus) MarshalJSON ¶ added in v0.0.3
func (w *WidgetAlertStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler.
func (*WidgetAlertStatus) UnmarshalJSON ¶ added in v0.0.3
func (w *WidgetAlertStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*WidgetAlertStatus) WidgetLayout ¶ added in v0.0.3
func (w *WidgetAlertStatus) WidgetLayout() *Layout
WidgetLayout returns the layout of the widget.
func (*WidgetAlertStatus) WidgetTitle ¶ added in v0.0.3
func (w *WidgetAlertStatus) WidgetTitle() string
WidgetTitle returns the title of the widget.
func (*WidgetAlertStatus) WidgetType ¶ added in v0.0.3
func (w *WidgetAlertStatus) WidgetType() WidgetType
WidgetType returns WidgetTypeAlertStatus.
type WidgetGraph ¶
type WidgetGraph struct {
Type WidgetType `json:"type"`
Title string `json:"title"`
Graph Graph `json:"graph,omitempty"`
Range GraphRange `json:"range,omitempty"`
Layout *Layout `json:"layout,omitempty"`
}
WidgetGraph is a graph widget.
func (*WidgetGraph) MarshalJSON ¶
func (w *WidgetGraph) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler.
func (*WidgetGraph) UnmarshalJSON ¶
func (w *WidgetGraph) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*WidgetGraph) WidgetLayout ¶
func (w *WidgetGraph) WidgetLayout() *Layout
WidgetLayout returns the layout of the widget.
func (*WidgetGraph) WidgetTitle ¶
func (w *WidgetGraph) WidgetTitle() string
WidgetTitle returns the title of the widget.
func (*WidgetGraph) WidgetType ¶
func (w *WidgetGraph) WidgetType() WidgetType
WidgetType returns WidgetTypeGraph.
type WidgetMarkdown ¶
type WidgetMarkdown struct {
Type WidgetType `json:"type"`
Title string `json:"title"`
Markdown string `json:"markdown,omitempty"`
Layout *Layout `json:"layout,omitempty"`
}
WidgetMarkdown is a markdown widget for dashboards.
func (*WidgetMarkdown) MarshalJSON ¶
func (w *WidgetMarkdown) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler.
func (*WidgetMarkdown) UnmarshalJSON ¶
func (w *WidgetMarkdown) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*WidgetMarkdown) WidgetLayout ¶
func (w *WidgetMarkdown) WidgetLayout() *Layout
WidgetLayout returns the layout of the widget.
func (*WidgetMarkdown) WidgetTitle ¶
func (w *WidgetMarkdown) WidgetTitle() string
WidgetTitle returns the title of the widget.
func (*WidgetMarkdown) WidgetType ¶
func (w *WidgetMarkdown) WidgetType() WidgetType
WidgetType returns WidgetTypeMarkdown.
type WidgetType ¶
type WidgetType string
WidgetType is a type of dashboard widget.
const ( // WidgetTypeGraph is a graph widget. WidgetTypeGraph WidgetType = "graph" // WidgetTypeValue is a value widget. WidgetTypeValue WidgetType = "value" // WidgetTypeMarkdown is a markdown widget. WidgetTypeMarkdown WidgetType = "markdown" // WidgetTypeAlertStatus is an alert status widget. WidgetTypeAlertStatus WidgetType = "alertStatus" )
func (WidgetType) String ¶
func (t WidgetType) String() string
type WidgetValue ¶
type WidgetValue struct {
Type WidgetType `json:"type"`
Title string `json:"title"`
Metric Metric `json:"metric,omitempty"`
Layout *Layout `json:"layout,omitempty"`
}
WidgetValue is a value widget.
func (*WidgetValue) MarshalJSON ¶
func (w *WidgetValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler.
func (*WidgetValue) UnmarshalJSON ¶
func (w *WidgetValue) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*WidgetValue) WidgetLayout ¶
func (w *WidgetValue) WidgetLayout() *Layout
WidgetLayout returns the layout of the widget.
func (*WidgetValue) WidgetTitle ¶
func (w *WidgetValue) WidgetTitle() string
WidgetTitle returns the title of the widget.
func (*WidgetValue) WidgetType ¶
func (w *WidgetValue) WidgetType() WidgetType
WidgetType returns WidgetTypeValue.