Struct mackerel_client::client::Client
source · pub struct Client { /* private fields */ }
Expand description
An API client for Mackerel.
Implementations§
source§impl Client
impl Client
sourcepub fn new(api_key: impl AsRef<str>) -> Client
pub fn new(api_key: impl AsRef<str>) -> Client
Creates a new API client from API key.
use mackerel_client::Client;
let client = Client::new("<Mackerel-API-KEY>");
If you want to configure the API base, use Client::builder()
.
use mackerel_client::Client;
let client = Client::builder()
.api_key("<Mackerel-API-KEY>")
.api_base("https://api.mackerelio.com")
.build();
You can configure user agent and timeout (default: 30s).
use mackerel_client::Client;
use std::time::Duration;
let client = Client::builder()
.api_key("<Mackerel-API-KEY>")
.user_agent("custom-user-agent/0.0")
.timeout(Duration::from_secs(60))
.build();
source§impl Client
impl Client
sourcepub async fn list_open_alerts(
&self,
cursor_opt: Option<impl Into<AlertId>>,
limit: u8
) -> Result<(Vec<Alert>, Option<AlertId>)>
pub async fn list_open_alerts( &self, cursor_opt: Option<impl Into<AlertId>>, limit: u8 ) -> Result<(Vec<Alert>, Option<AlertId>)>
Fetches open alerts.
sourcepub async fn list_all_alerts(
&self,
cursor_opt: Option<impl Into<AlertId>>,
limit: u8
) -> Result<(Vec<Alert>, Option<AlertId>)>
pub async fn list_all_alerts( &self, cursor_opt: Option<impl Into<AlertId>>, limit: u8 ) -> Result<(Vec<Alert>, Option<AlertId>)>
Fetches all (open or closed) alerts.
sourcepub async fn update_alert(
&self,
alert_id: impl Into<AlertId>,
memo: impl AsRef<str>
) -> Result<()>
pub async fn update_alert( &self, alert_id: impl Into<AlertId>, memo: impl AsRef<str> ) -> Result<()>
Updates an alert.
source§impl Client
impl Client
sourcepub async fn list_alert_group_settings(&self) -> Result<Vec<AlertGroupSetting>>
pub async fn list_alert_group_settings(&self) -> Result<Vec<AlertGroupSetting>>
Fetches all the alert group settings.
See https://mackerel.io/api-docs/entry/alert-group-settings#list.
sourcepub async fn create_alert_group_setting(
&self,
alert_group_setting_value: impl Borrow<AlertGroupSettingValue>
) -> Result<AlertGroupSetting>
pub async fn create_alert_group_setting( &self, alert_group_setting_value: impl Borrow<AlertGroupSettingValue> ) -> Result<AlertGroupSetting>
Creates a new alert group setting.
See https://mackerel.io/api-docs/entry/alert-group-settings#create.
sourcepub async fn get_alert_group_setting(
&self,
alert_group_setting_id: impl Into<AlertGroupSettingId>
) -> Result<AlertGroupSetting>
pub async fn get_alert_group_setting( &self, alert_group_setting_id: impl Into<AlertGroupSettingId> ) -> Result<AlertGroupSetting>
Gets an alert group setting.
See https://mackerel.io/api-docs/entry/alert-group-settings#get.
sourcepub async fn update_alert_group_setting(
&self,
alert_group_setting_id: impl Into<AlertGroupSettingId>,
alert_group_setting_value: impl Borrow<AlertGroupSettingValue>
) -> Result<AlertGroupSetting>
pub async fn update_alert_group_setting( &self, alert_group_setting_id: impl Into<AlertGroupSettingId>, alert_group_setting_value: impl Borrow<AlertGroupSettingValue> ) -> Result<AlertGroupSetting>
Updates an alert group setting.
See https://mackerel.io/api-docs/entry/alert-group-settings#update.
sourcepub async fn delete_alert_group_setting(
&self,
alert_group_setting_id: impl Into<AlertGroupSettingId>
) -> Result<AlertGroupSetting>
pub async fn delete_alert_group_setting( &self, alert_group_setting_id: impl Into<AlertGroupSettingId> ) -> Result<AlertGroupSetting>
Deletes an alert group setting.
See https://mackerel.io/api-docs/entry/alert-group-settings#delete.
source§impl Client
impl Client
sourcepub async fn list_aws_integrations(&self) -> Result<Vec<AWSIntegration>>
pub async fn list_aws_integrations(&self) -> Result<Vec<AWSIntegration>>
Fetches all the AWS integration settings.
See https://mackerel.io/api-docs/entry/aws-integration#list.
sourcepub async fn create_aws_integration(
&self,
aws_integration_value: impl Borrow<AWSIntegrationValue>
) -> Result<AWSIntegration>
pub async fn create_aws_integration( &self, aws_integration_value: impl Borrow<AWSIntegrationValue> ) -> Result<AWSIntegration>
Creates a new AWS integration.
See https://mackerel.io/api-docs/entry/aws-integration#create.
sourcepub async fn get_aws_integration(
&self,
aws_integration_id: impl Into<AWSIntegrationId>
) -> Result<AWSIntegration>
pub async fn get_aws_integration( &self, aws_integration_id: impl Into<AWSIntegrationId> ) -> Result<AWSIntegration>
Gets an AWS integration.
sourcepub async fn update_aws_integration(
&self,
aws_integration_id: impl Into<AWSIntegrationId>,
aws_integration_value: impl Borrow<AWSIntegrationValue>
) -> Result<AWSIntegration>
pub async fn update_aws_integration( &self, aws_integration_id: impl Into<AWSIntegrationId>, aws_integration_value: impl Borrow<AWSIntegrationValue> ) -> Result<AWSIntegration>
Updates an AWS integration.
See https://mackerel.io/api-docs/entry/aws-integration#update.
sourcepub async fn delete_aws_integration(
&self,
aws_integration_id: impl Into<AWSIntegrationId>
) -> Result<AWSIntegration>
pub async fn delete_aws_integration( &self, aws_integration_id: impl Into<AWSIntegrationId> ) -> Result<AWSIntegration>
Deletes an AWS integration.
See https://mackerel.io/api-docs/entry/aws-integration#delete.
sourcepub async fn create_aws_integration_external_id(&self) -> Result<String>
pub async fn create_aws_integration_external_id(&self) -> Result<String>
Generates AWS integration external ID.
See https://mackerel.io/api-docs/entry/aws-integration#generate-external-id.
sourcepub async fn list_aws_integration_metrics(
&self
) -> Result<HashMap<AWSServiceName, Vec<String>>>
pub async fn list_aws_integration_metrics( &self ) -> Result<HashMap<AWSServiceName, Vec<String>>>
Lists includable/excludable metrics for AWS integration.
See https://mackerel.io/api-docs/entry/aws-integration#excludable-metrics.
source§impl Client
impl Client
sourcepub async fn list_channels(&self) -> Result<Vec<Channel>>
pub async fn list_channels(&self) -> Result<Vec<Channel>>
Fetches all the channels.
sourcepub async fn create_channel(
&self,
channel_value: impl Borrow<ChannelValue>
) -> Result<Channel>
pub async fn create_channel( &self, channel_value: impl Borrow<ChannelValue> ) -> Result<Channel>
Creates a new channel.
source§impl Client
impl Client
sourcepub async fn create_check_report(
&self,
check_reports: impl IntoIterator<Item = CheckReport>
) -> Result<()>
pub async fn create_check_report( &self, check_reports: impl IntoIterator<Item = CheckReport> ) -> Result<()>
Creates a new check report.
See https://mackerel.io/api-docs/entry/check-monitoring#post.
source§impl Client
impl Client
sourcepub async fn list_dashboards(&self) -> Result<Vec<Dashboard>>
pub async fn list_dashboards(&self) -> Result<Vec<Dashboard>>
Fetches all the dashboards.
sourcepub async fn create_dashboard(
&self,
dashboard_value: impl Borrow<DashboardValue>
) -> Result<Dashboard>
pub async fn create_dashboard( &self, dashboard_value: impl Borrow<DashboardValue> ) -> Result<Dashboard>
Creates a new dashboard.
sourcepub async fn get_dashboard(
&self,
dashboard_id: impl Into<DashboardId>
) -> Result<Dashboard>
pub async fn get_dashboard( &self, dashboard_id: impl Into<DashboardId> ) -> Result<Dashboard>
Gets a dashboard.
sourcepub async fn update_dashboard(
&self,
dashboard_id: impl Into<DashboardId>,
dashboard_value: impl Borrow<DashboardValue>
) -> Result<Dashboard>
pub async fn update_dashboard( &self, dashboard_id: impl Into<DashboardId>, dashboard_value: impl Borrow<DashboardValue> ) -> Result<Dashboard>
Updates a dashboard.
sourcepub async fn delete_dashboard(
&self,
dashboard_id: impl Into<DashboardId>
) -> Result<Dashboard>
pub async fn delete_dashboard( &self, dashboard_id: impl Into<DashboardId> ) -> Result<Dashboard>
Deletes a dashboard.
source§impl Client
impl Client
sourcepub async fn list_downtimes(&self) -> Result<Vec<Downtime>>
pub async fn list_downtimes(&self) -> Result<Vec<Downtime>>
Fetches all the downtimes.
sourcepub async fn create_downtime(
&self,
downtime_value: impl Borrow<DowntimeValue>
) -> Result<Downtime>
pub async fn create_downtime( &self, downtime_value: impl Borrow<DowntimeValue> ) -> Result<Downtime>
Creates a new downtime.
sourcepub async fn update_downtime(
&self,
downtime_id: impl Into<DowntimeId>,
downtime_value: impl Borrow<DowntimeValue>
) -> Result<Downtime>
pub async fn update_downtime( &self, downtime_id: impl Into<DowntimeId>, downtime_value: impl Borrow<DowntimeValue> ) -> Result<Downtime>
Updates a downtime.
sourcepub async fn delete_downtime(
&self,
downtime_id: impl Into<DowntimeId>
) -> Result<Downtime>
pub async fn delete_downtime( &self, downtime_id: impl Into<DowntimeId> ) -> Result<Downtime>
Deletes a downtime.
source§impl Client
impl Client
sourcepub async fn list_graph_annotations(
&self,
service: impl Into<ServiceName>,
from: impl Into<DateTime<Utc>>,
to: impl Into<DateTime<Utc>>
) -> Result<Vec<GraphAnnotation>>
pub async fn list_graph_annotations( &self, service: impl Into<ServiceName>, from: impl Into<DateTime<Utc>>, to: impl Into<DateTime<Utc>> ) -> Result<Vec<GraphAnnotation>>
Fetches graph annotations.
See https://mackerel.io/api-docs/entry/graph-annotations#get.
sourcepub async fn create_graph_annotation(
&self,
graph_annotation_value: impl Borrow<GraphAnnotationValue>
) -> Result<GraphAnnotation>
pub async fn create_graph_annotation( &self, graph_annotation_value: impl Borrow<GraphAnnotationValue> ) -> Result<GraphAnnotation>
Creates a new graph annotation.
See https://mackerel.io/api-docs/entry/graph-annotations#create.
sourcepub async fn update_graph_annotation(
&self,
graph_annontation_id: impl Into<GraphAnnotationId>,
graph_annotation_value: impl Borrow<GraphAnnotationValue>
) -> Result<GraphAnnotation>
pub async fn update_graph_annotation( &self, graph_annontation_id: impl Into<GraphAnnotationId>, graph_annotation_value: impl Borrow<GraphAnnotationValue> ) -> Result<GraphAnnotation>
Updates a graph annotation.
See https://mackerel.io/api-docs/entry/graph-annotations#update.
sourcepub async fn delete_graph_annotation(
&self,
graph_annotation_id: impl Into<GraphAnnotationId>
) -> Result<GraphAnnotation>
pub async fn delete_graph_annotation( &self, graph_annotation_id: impl Into<GraphAnnotationId> ) -> Result<GraphAnnotation>
Deletes a graph annotation.
See https://mackerel.io/api-docs/entry/graph-annotations#delete.
source§impl Client
impl Client
sourcepub async fn create_graph_definitions(
&self,
graph_definitions: impl IntoIterator<Item = GraphDefinition>
) -> Result<()>
pub async fn create_graph_definitions( &self, graph_definitions: impl IntoIterator<Item = GraphDefinition> ) -> Result<()>
Creates new graph definitions.
See https://mackerel.io/api-docs/entry/host-metrics#post-graphdef.
source§impl Client
impl Client
sourcepub async fn create_host(
&self,
host_value: impl Borrow<HostValue>
) -> Result<HostId>
pub async fn create_host( &self, host_value: impl Borrow<HostValue> ) -> Result<HostId>
Creates a new host.
sourcepub async fn get_host_by_custom_identifier(
&self,
custom_identifier: impl AsRef<str>
) -> Result<Option<Host>>
pub async fn get_host_by_custom_identifier( &self, custom_identifier: impl AsRef<str> ) -> Result<Option<Host>>
Gets a host by the custom identifier.
See https://mackerel.io/api-docs/entry/hosts#get-by-custom-identifier.
sourcepub async fn update_host(
&self,
host_id: impl Into<HostId>,
host_value: impl Borrow<HostValue>
) -> Result<()>
pub async fn update_host( &self, host_id: impl Into<HostId>, host_value: impl Borrow<HostValue> ) -> Result<()>
Updates a host.
See https://mackerel.io/api-docs/entry/hosts#update-information.
sourcepub async fn update_host_status(
&self,
host_id: impl Into<HostId>,
host_status: HostStatus
) -> Result<()>
pub async fn update_host_status( &self, host_id: impl Into<HostId>, host_status: HostStatus ) -> Result<()>
Updates host status.
sourcepub async fn update_host_statuses(
&self,
host_ids: impl IntoIterator<Item = impl Into<HostId>>,
host_status: HostStatus
) -> Result<()>
pub async fn update_host_statuses( &self, host_ids: impl IntoIterator<Item = impl Into<HostId>>, host_status: HostStatus ) -> Result<()>
Updates host statuses.
sourcepub async fn update_host_roles(
&self,
host_id: impl Into<HostId>,
role_fullnames: impl IntoIterator<Item = impl Into<RoleFullname>>
) -> Result<()>
pub async fn update_host_roles( &self, host_id: impl Into<HostId>, role_fullnames: impl IntoIterator<Item = impl Into<RoleFullname>> ) -> Result<()>
Updates host roles.
sourcepub async fn retire_hosts(
&self,
host_ids: impl IntoIterator<Item = impl Into<HostId>>
) -> Result<()>
pub async fn retire_hosts( &self, host_ids: impl IntoIterator<Item = impl Into<HostId>> ) -> Result<()>
Retires hosts.
sourcepub async fn list_hosts(
&self,
list_hosts_params: impl Into<ListHostsParams>
) -> Result<Vec<Host>>
pub async fn list_hosts( &self, list_hosts_params: impl Into<ListHostsParams> ) -> Result<Vec<Host>>
Fetches hosts.
See https://mackerel.io/api-docs/entry/hosts#list.
// Fetches all the hosts (with working or standby status).
let hosts = client.list_hosts(()).await?;
// Fetches the hosts in the specified service and role.
let hosts = client.list_hosts(ServiceName::from("service0")).await?;
let hosts = client.list_hosts(RoleFullname::from("service0:role0")).await?;
let hosts = client.list_hosts((ServiceName::from("service0"), RoleName::from("role0"))).await?;
// Fetches the hosts with the specified name.
let hosts = client.list_hosts(ListHostsParams::host_name("example-host")).await?;
// Fetches the hosts with the specified statuses.
let hosts = client.list_hosts(
ListHostsParams::default().status(HostStatus::Working),
).await?;
let hosts = client.list_hosts(
ListHostsParams::service_name("service0").status(HostStatus::Working),
).await?;
let hosts = client.list_hosts(
ListHostsParams::service_name("service0")
.statuses([HostStatus::Working, HostStatus::Standby, HostStatus::Maintenance]),
).await?;
let hosts = client.list_hosts(
ListHostsParams::role_fullname("service0:role0").status(HostStatus::Working),
).await?;
let hosts = client.list_hosts(
ListHostsParams::service_role_name("service0", "role0").status(HostStatus::Working),
).await?;
let hosts = client.list_hosts(
ListHostsParams::service_role_names("service0", ["role0", "role1", "role2"])
.statuses([HostStatus::Working, HostStatus::Standby, HostStatus::Maintenance]),
).await?;
sourcepub async fn list_host_metric_names(
&self,
host_id: impl Into<HostId>
) -> Result<Vec<String>>
pub async fn list_host_metric_names( &self, host_id: impl Into<HostId> ) -> Result<Vec<String>>
Fetches host metric names.
sourcepub async fn list_host_monitored_statuses(
&self,
host_id: impl Into<HostId>
) -> Result<Vec<MonitoredStatus>>
pub async fn list_host_monitored_statuses( &self, host_id: impl Into<HostId> ) -> Result<Vec<MonitoredStatus>>
Fetches host monitoring statuses.
See https://mackerel.io/api-docs/entry/hosts#monitored-statuses.
source§impl Client
impl Client
sourcepub async fn list_invitations(&self) -> Result<Vec<Invitation>>
pub async fn list_invitations(&self) -> Result<Vec<Invitation>>
Fetches all the invitations.
sourcepub async fn create_invitation(
&self,
invitation_value: impl Borrow<InvitationValue>
) -> Result<Invitation>
pub async fn create_invitation( &self, invitation_value: impl Borrow<InvitationValue> ) -> Result<Invitation>
Creates a new invitation.
source§impl Client
impl Client
sourcepub async fn get_host_metadata(
&self,
host_id: impl Into<HostId>,
namespace: impl AsRef<str>
) -> Result<Value>
pub async fn get_host_metadata( &self, host_id: impl Into<HostId>, namespace: impl AsRef<str> ) -> Result<Value>
Retrieves a host metadata.
sourcepub async fn put_host_metadata(
&self,
host_id: impl Into<HostId>,
namespace: impl AsRef<str>,
metadata: impl Borrow<Value>
) -> Result<()>
pub async fn put_host_metadata( &self, host_id: impl Into<HostId>, namespace: impl AsRef<str>, metadata: impl Borrow<Value> ) -> Result<()>
Creates/Updates a host metadata.
sourcepub async fn delete_host_metadata(
&self,
host_id: impl Into<HostId>,
namespace: impl AsRef<str>
) -> Result<()>
pub async fn delete_host_metadata( &self, host_id: impl Into<HostId>, namespace: impl AsRef<str> ) -> Result<()>
Deletes a host metadata.
sourcepub async fn list_host_metadata(
&self,
host_id: impl Into<HostId>
) -> Result<Vec<Metadata>>
pub async fn list_host_metadata( &self, host_id: impl Into<HostId> ) -> Result<Vec<Metadata>>
Lists host metadata.
sourcepub async fn get_service_metadata(
&self,
service_name: impl Into<ServiceName>,
namespace: impl AsRef<str>
) -> Result<Value>
pub async fn get_service_metadata( &self, service_name: impl Into<ServiceName>, namespace: impl AsRef<str> ) -> Result<Value>
Retrieves a service metadata.
sourcepub async fn put_service_metadata(
&self,
service_name: impl Into<ServiceName>,
namespace: impl AsRef<str>,
metadata: impl Borrow<Value>
) -> Result<()>
pub async fn put_service_metadata( &self, service_name: impl Into<ServiceName>, namespace: impl AsRef<str>, metadata: impl Borrow<Value> ) -> Result<()>
Creates/Updates a service metadata.
sourcepub async fn delete_service_metadata(
&self,
service_name: impl Into<ServiceName>,
namespace: impl AsRef<str>
) -> Result<()>
pub async fn delete_service_metadata( &self, service_name: impl Into<ServiceName>, namespace: impl AsRef<str> ) -> Result<()>
Deletes a service metadata.
See https://mackerel.io/api-docs/entry/metadata#servicedelete.
sourcepub async fn list_service_metadata(
&self,
service_name: impl Into<ServiceName>
) -> Result<Vec<Metadata>>
pub async fn list_service_metadata( &self, service_name: impl Into<ServiceName> ) -> Result<Vec<Metadata>>
Lists service metadata.
See https://mackerel.io/api-docs/entry/metadata#servicelist.
sourcepub async fn get_role_metadata(
&self,
service_name: impl Into<ServiceName>,
role_name: impl Into<RoleName>,
namespace: impl AsRef<str>
) -> Result<Value>
pub async fn get_role_metadata( &self, service_name: impl Into<ServiceName>, role_name: impl Into<RoleName>, namespace: impl AsRef<str> ) -> Result<Value>
Retrieves a role metadata.
sourcepub async fn put_role_metadata(
&self,
service_name: impl Into<ServiceName>,
role_name: impl Into<RoleName>,
namespace: impl AsRef<str>,
metadata: impl Borrow<Value>
) -> Result<()>
pub async fn put_role_metadata( &self, service_name: impl Into<ServiceName>, role_name: impl Into<RoleName>, namespace: impl AsRef<str>, metadata: impl Borrow<Value> ) -> Result<()>
Creates/Updates a role metadata.
sourcepub async fn delete_role_metadata(
&self,
service_name: impl Into<ServiceName>,
role_name: impl Into<RoleName>,
namespace: impl AsRef<str>
) -> Result<()>
pub async fn delete_role_metadata( &self, service_name: impl Into<ServiceName>, role_name: impl Into<RoleName>, namespace: impl AsRef<str> ) -> Result<()>
Deletes a role metadata.
sourcepub async fn list_role_metadata(
&self,
service_name: impl Into<ServiceName>,
role_name: impl Into<RoleName>
) -> Result<Vec<Metadata>>
pub async fn list_role_metadata( &self, service_name: impl Into<ServiceName>, role_name: impl Into<RoleName> ) -> Result<Vec<Metadata>>
Lists role metadata.
source§impl Client
impl Client
sourcepub async fn post_host_metric_values(
&self,
host_metric_values: impl IntoIterator<Item = HostMetricValue>
) -> Result<()>
pub async fn post_host_metric_values( &self, host_metric_values: impl IntoIterator<Item = HostMetricValue> ) -> Result<()>
Posts host metric values.
sourcepub async fn list_host_metric_values(
&self,
host_id: impl Into<HostId>,
metric_name: impl AsRef<str>,
from: impl Into<DateTime<Utc>>,
to: impl Into<DateTime<Utc>>
) -> Result<Vec<MetricValue>>
pub async fn list_host_metric_values( &self, host_id: impl Into<HostId>, metric_name: impl AsRef<str>, from: impl Into<DateTime<Utc>>, to: impl Into<DateTime<Utc>> ) -> Result<Vec<MetricValue>>
Fetches host metric value.
sourcepub async fn list_latest_host_metric_values(
&self,
host_ids: impl IntoIterator<Item = impl Into<HostId>>,
metric_names: impl IntoIterator<Item = impl AsRef<str>>
) -> Result<HashMap<HostId, HashMap<String, Option<MetricValue>>>>
pub async fn list_latest_host_metric_values( &self, host_ids: impl IntoIterator<Item = impl Into<HostId>>, metric_names: impl IntoIterator<Item = impl AsRef<str>> ) -> Result<HashMap<HostId, HashMap<String, Option<MetricValue>>>>
Fetches latest host metric values of hosts.
See https://mackerel.io/api-docs/entry/host-metrics#get-latest.
sourcepub async fn post_service_metric_values(
&self,
service_name: impl Into<ServiceName>,
service_metric_values: impl IntoIterator<Item = ServiceMetricValue>
) -> Result<()>
pub async fn post_service_metric_values( &self, service_name: impl Into<ServiceName>, service_metric_values: impl IntoIterator<Item = ServiceMetricValue> ) -> Result<()>
Posts service metric values.
See https://mackerel.io/api-docs/entry/service-metrics#post.
sourcepub async fn list_service_metric_values(
&self,
service_name: impl Into<ServiceName>,
metric_name: impl AsRef<str>,
from: impl Into<DateTime<Utc>>,
to: impl Into<DateTime<Utc>>
) -> Result<Vec<MetricValue>>
pub async fn list_service_metric_values( &self, service_name: impl Into<ServiceName>, metric_name: impl AsRef<str>, from: impl Into<DateTime<Utc>>, to: impl Into<DateTime<Utc>> ) -> Result<Vec<MetricValue>>
Fetches service metric values.
source§impl Client
impl Client
sourcepub async fn list_monitors(&self) -> Result<Vec<Monitor>>
pub async fn list_monitors(&self) -> Result<Vec<Monitor>>
Fetches all the monitors.
sourcepub async fn create_monitor(
&self,
monitor_value: impl Borrow<MonitorValue>
) -> Result<Monitor>
pub async fn create_monitor( &self, monitor_value: impl Borrow<MonitorValue> ) -> Result<Monitor>
Creates a new monitor.
sourcepub async fn get_monitor(
&self,
monitor_id: impl Into<MonitorId>
) -> Result<Monitor>
pub async fn get_monitor( &self, monitor_id: impl Into<MonitorId> ) -> Result<Monitor>
Gets a monitor.
sourcepub async fn update_monitor(
&self,
monitor_id: impl Into<MonitorId>,
monitor_value: impl Borrow<MonitorValue>
) -> Result<Monitor>
pub async fn update_monitor( &self, monitor_id: impl Into<MonitorId>, monitor_value: impl Borrow<MonitorValue> ) -> Result<Monitor>
Updates a monitor.
source§impl Client
impl Client
sourcepub async fn list_notification_groups(&self) -> Result<Vec<NotificationGroup>>
pub async fn list_notification_groups(&self) -> Result<Vec<NotificationGroup>>
Fetches all the notification groups.
See https://mackerel.io/api-docs/entry/notification-groups#get.
sourcepub async fn create_notification_group(
&self,
notification_group_value: impl Borrow<NotificationGroupValue>
) -> Result<NotificationGroup>
pub async fn create_notification_group( &self, notification_group_value: impl Borrow<NotificationGroupValue> ) -> Result<NotificationGroup>
Creates a new notification group.
See https://mackerel.io/api-docs/entry/notification-groups#create.
sourcepub async fn update_notification_group(
&self,
notification_group_id: impl Into<NotificationGroupId>,
notification_group_value: impl Borrow<NotificationGroupValue>
) -> Result<NotificationGroup>
pub async fn update_notification_group( &self, notification_group_id: impl Into<NotificationGroupId>, notification_group_value: impl Borrow<NotificationGroupValue> ) -> Result<NotificationGroup>
Updates a notification group.
See https://mackerel.io/api-docs/entry/notification-groups#update.
sourcepub async fn delete_notification_group(
&self,
notification_group_id: impl Into<NotificationGroupId>
) -> Result<NotificationGroup>
pub async fn delete_notification_group( &self, notification_group_id: impl Into<NotificationGroupId> ) -> Result<NotificationGroup>
Deletes a notification group.
See https://mackerel.io/api-docs/entry/notification-groups#delete.
source§impl Client
impl Client
sourcepub async fn get_organization(&self) -> Result<Organization>
pub async fn get_organization(&self) -> Result<Organization>
Retrieve the information on the organization.
source§impl Client
impl Client
sourcepub async fn list_roles(
&self,
service_name: impl Into<ServiceName>
) -> Result<Vec<Role>>
pub async fn list_roles( &self, service_name: impl Into<ServiceName> ) -> Result<Vec<Role>>
Fetches the roles in the specified service.
sourcepub async fn create_role(
&self,
service_name: impl Into<ServiceName>,
role: impl Borrow<Role>
) -> Result<Role>
pub async fn create_role( &self, service_name: impl Into<ServiceName>, role: impl Borrow<Role> ) -> Result<Role>
Creates a new role.
sourcepub async fn delete_role(
&self,
service_name: impl Into<ServiceName>,
role_name: impl Into<RoleName>
) -> Result<Role>
pub async fn delete_role( &self, service_name: impl Into<ServiceName>, role_name: impl Into<RoleName> ) -> Result<Role>
Deletes a role.
source§impl Client
impl Client
sourcepub async fn list_services(&self) -> Result<Vec<Service>>
pub async fn list_services(&self) -> Result<Vec<Service>>
Fetches all the services.
sourcepub async fn create_service(
&self,
service: impl Borrow<Service>
) -> Result<Service>
pub async fn create_service( &self, service: impl Borrow<Service> ) -> Result<Service>
Creates a new service.
sourcepub async fn delete_service(
&self,
service_name: impl Into<ServiceName>
) -> Result<Service>
pub async fn delete_service( &self, service_name: impl Into<ServiceName> ) -> Result<Service>
Deletes a service.
sourcepub async fn list_service_metric_names(
&self,
service_name: impl Into<ServiceName>
) -> Result<Vec<String>>
pub async fn list_service_metric_names( &self, service_name: impl Into<ServiceName> ) -> Result<Vec<String>>
Fetches service metric names.
See https://mackerel.io/api-docs/entry/services#metric-names.