pub struct IncidentServicesAPI { /* private fields */ }Expand description
Create, update, delete, and retrieve services which can be associated with incidents. See the Incident Management page for more information.
Implementations§
source§impl IncidentServicesAPI
impl IncidentServicesAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
// there is a valid "service" in the system
let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api.delete_incident_service(service_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
async fn main() {
// there is a valid "service" in the system
let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api
.get_incident_service(
service_data_id.clone(),
GetIncidentServiceOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = IncidentServiceCreateRequest::new(
IncidentServiceCreateData::new(IncidentServiceType::SERVICES).attributes(
IncidentServiceCreateAttributes::new("Example-Incident-Service".to_string()),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api.create_incident_service(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
async fn main() {
// there is a valid "service" in the system
let service_data_attributes_name = std::env::var("SERVICE_DATA_ATTRIBUTES_NAME").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListIncidentServices", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api
.list_incident_services(
ListIncidentServicesOptionalParams::default()
.filter(service_data_attributes_name.clone()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
async fn main() {
// there is a valid "service" in the system
let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap();
let body = IncidentServiceUpdateRequest::new(
IncidentServiceUpdateData::new(IncidentServiceType::SERVICES).attributes(
IncidentServiceUpdateAttributes::new("service name-updated".to_string()),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api
.update_incident_service(service_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn create_incident_service(
&self,
body: IncidentServiceCreateRequest,
) -> Result<IncidentServiceResponse, Error<CreateIncidentServiceError>>
pub async fn create_incident_service( &self, body: IncidentServiceCreateRequest, ) -> Result<IncidentServiceResponse, Error<CreateIncidentServiceError>>
Creates a new incident service.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = IncidentServiceCreateRequest::new(
IncidentServiceCreateData::new(IncidentServiceType::SERVICES).attributes(
IncidentServiceCreateAttributes::new("Example-Incident-Service".to_string()),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api.create_incident_service(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_incident_service_with_http_info(
&self,
body: IncidentServiceCreateRequest,
) -> Result<ResponseContent<IncidentServiceResponse>, Error<CreateIncidentServiceError>>
pub async fn create_incident_service_with_http_info( &self, body: IncidentServiceCreateRequest, ) -> Result<ResponseContent<IncidentServiceResponse>, Error<CreateIncidentServiceError>>
Creates a new incident service.
sourcepub async fn delete_incident_service(
&self,
service_id: String,
) -> Result<(), Error<DeleteIncidentServiceError>>
pub async fn delete_incident_service( &self, service_id: String, ) -> Result<(), Error<DeleteIncidentServiceError>>
Deletes an existing incident service.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
// there is a valid "service" in the system
let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api.delete_incident_service(service_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_incident_service_with_http_info(
&self,
service_id: String,
) -> Result<ResponseContent<()>, Error<DeleteIncidentServiceError>>
pub async fn delete_incident_service_with_http_info( &self, service_id: String, ) -> Result<ResponseContent<()>, Error<DeleteIncidentServiceError>>
Deletes an existing incident service.
sourcepub async fn get_incident_service(
&self,
service_id: String,
params: GetIncidentServiceOptionalParams,
) -> Result<IncidentServiceResponse, Error<GetIncidentServiceError>>
pub async fn get_incident_service( &self, service_id: String, params: GetIncidentServiceOptionalParams, ) -> Result<IncidentServiceResponse, Error<GetIncidentServiceError>>
Get details of an incident service. If the include[users] query parameter is provided,
the included attribute will contain the users related to these incident services.
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
async fn main() {
// there is a valid "service" in the system
let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api
.get_incident_service(
service_data_id.clone(),
GetIncidentServiceOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_incident_service_with_http_info(
&self,
service_id: String,
params: GetIncidentServiceOptionalParams,
) -> Result<ResponseContent<IncidentServiceResponse>, Error<GetIncidentServiceError>>
pub async fn get_incident_service_with_http_info( &self, service_id: String, params: GetIncidentServiceOptionalParams, ) -> Result<ResponseContent<IncidentServiceResponse>, Error<GetIncidentServiceError>>
Get details of an incident service. If the include[users] query parameter is provided,
the included attribute will contain the users related to these incident services.
sourcepub async fn list_incident_services(
&self,
params: ListIncidentServicesOptionalParams,
) -> Result<IncidentServicesResponse, Error<ListIncidentServicesError>>
pub async fn list_incident_services( &self, params: ListIncidentServicesOptionalParams, ) -> Result<IncidentServicesResponse, Error<ListIncidentServicesError>>
Get all incident services uploaded for the requesting user’s organization. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
async fn main() {
// there is a valid "service" in the system
let service_data_attributes_name = std::env::var("SERVICE_DATA_ATTRIBUTES_NAME").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListIncidentServices", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api
.list_incident_services(
ListIncidentServicesOptionalParams::default()
.filter(service_data_attributes_name.clone()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn list_incident_services_with_http_info(
&self,
params: ListIncidentServicesOptionalParams,
) -> Result<ResponseContent<IncidentServicesResponse>, Error<ListIncidentServicesError>>
pub async fn list_incident_services_with_http_info( &self, params: ListIncidentServicesOptionalParams, ) -> Result<ResponseContent<IncidentServicesResponse>, Error<ListIncidentServicesError>>
Get all incident services uploaded for the requesting user’s organization. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.
sourcepub async fn update_incident_service(
&self,
service_id: String,
body: IncidentServiceUpdateRequest,
) -> Result<IncidentServiceResponse, Error<UpdateIncidentServiceError>>
pub async fn update_incident_service( &self, service_id: String, body: IncidentServiceUpdateRequest, ) -> Result<IncidentServiceResponse, Error<UpdateIncidentServiceError>>
Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
async fn main() {
// there is a valid "service" in the system
let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap();
let body = IncidentServiceUpdateRequest::new(
IncidentServiceUpdateData::new(IncidentServiceType::SERVICES).attributes(
IncidentServiceUpdateAttributes::new("service name-updated".to_string()),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateIncidentService", true);
let api = IncidentServicesAPI::with_config(configuration);
let resp = api
.update_incident_service(service_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_incident_service_with_http_info(
&self,
service_id: String,
body: IncidentServiceUpdateRequest,
) -> Result<ResponseContent<IncidentServiceResponse>, Error<UpdateIncidentServiceError>>
pub async fn update_incident_service_with_http_info( &self, service_id: String, body: IncidentServiceUpdateRequest, ) -> Result<ResponseContent<IncidentServiceResponse>, Error<UpdateIncidentServiceError>>
Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update.
Trait Implementations§
source§impl Clone for IncidentServicesAPI
impl Clone for IncidentServicesAPI
source§fn clone(&self) -> IncidentServicesAPI
fn clone(&self) -> IncidentServicesAPI
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for IncidentServicesAPI
impl Debug for IncidentServicesAPI
Auto Trait Implementations§
impl Freeze for IncidentServicesAPI
impl !RefUnwindSafe for IncidentServicesAPI
impl Send for IncidentServicesAPI
impl Sync for IncidentServicesAPI
impl Unpin for IncidentServicesAPI
impl !UnwindSafe for IncidentServicesAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)