#[non_exhaustive]pub struct NotebookSplitBy {
pub keys: Vec<String>,
pub tags: Vec<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Object describing how to split the graph to display multiple visualizations per request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.keys: Vec<String>
Keys to split on.
Tags to split on.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl NotebookSplitBy
impl NotebookSplitBy
Sourcepub fn new(keys: Vec<String>, tags: Vec<String>) -> NotebookSplitBy
pub fn new(keys: Vec<String>, tags: Vec<String>) -> NotebookSplitBy
Examples found in repository?
examples/v1_notebooks_CreateNotebook.rs (line 71)
31async fn main() {
32 let body = NotebookCreateRequest::new(NotebookCreateData::new(
33 NotebookCreateDataAttributes::new(
34 vec![
35 NotebookCellCreateRequest::new(
36 NotebookCellCreateRequestAttributes::NotebookMarkdownCellAttributes(Box::new(
37 NotebookMarkdownCellAttributes::new(NotebookMarkdownCellDefinition::new(
38 r#"## Some test markdown
39
40```js
41var x, y;
42x = 5;
43y = 6;
44```"#
45 .to_string(),
46 NotebookMarkdownCellDefinitionType::MARKDOWN,
47 )),
48 )),
49 NotebookCellResourceType::NOTEBOOK_CELLS,
50 ),
51 NotebookCellCreateRequest::new(
52 NotebookCellCreateRequestAttributes::NotebookTimeseriesCellAttributes(
53 Box::new(
54 NotebookTimeseriesCellAttributes::new(
55 TimeseriesWidgetDefinition::new(
56 vec![TimeseriesWidgetRequest::new()
57 .display_type(WidgetDisplayType::LINE)
58 .q("avg:system.load.1{*}".to_string())
59 .style(
60 WidgetRequestStyle::new()
61 .line_type(WidgetLineType::SOLID)
62 .line_width(WidgetLineWidth::NORMAL)
63 .palette("dog_classic".to_string()),
64 )],
65 TimeseriesWidgetDefinitionType::TIMESERIES,
66 )
67 .show_legend(true)
68 .yaxis(WidgetAxis::new().scale("linear".to_string())),
69 )
70 .graph_size(NotebookGraphSize::MEDIUM)
71 .split_by(NotebookSplitBy::new(vec![], vec![]))
72 .time(None),
73 ),
74 ),
75 NotebookCellResourceType::NOTEBOOK_CELLS,
76 ),
77 ],
78 "Example-Notebook".to_string(),
79 NotebookGlobalTime::NotebookRelativeTime(Box::new(NotebookRelativeTime::new(
80 WidgetLiveSpan::PAST_ONE_HOUR,
81 ))),
82 )
83 .status(NotebookStatus::PUBLISHED),
84 NotebookResourceType::NOTEBOOKS,
85 ));
86 let configuration = datadog::Configuration::new();
87 let api = NotebooksAPI::with_config(configuration);
88 let resp = api.create_notebook(body).await;
89 if let Ok(value) = resp {
90 println!("{:#?}", value);
91 } else {
92 println!("{:#?}", resp.unwrap_err());
93 }
94}
More examples
examples/v1_notebooks_UpdateNotebook.rs (line 79)
32async fn main() {
33 // there is a valid "notebook" in the system
34 let notebook_data_id: i64 = std::env::var("NOTEBOOK_DATA_ID").unwrap().parse().unwrap();
35 let body = NotebookUpdateRequest::new(NotebookUpdateData::new(
36 NotebookUpdateDataAttributes::new(
37 vec![
38 NotebookUpdateCell::NotebookCellCreateRequest(Box::new(
39 NotebookCellCreateRequest::new(
40 NotebookCellCreateRequestAttributes::NotebookMarkdownCellAttributes(
41 Box::new(NotebookMarkdownCellAttributes::new(
42 NotebookMarkdownCellDefinition::new(
43 r#"## Some test markdown
44
45```js
46var x, y;
47x = 5;
48y = 6;
49```"#
50 .to_string(),
51 NotebookMarkdownCellDefinitionType::MARKDOWN,
52 ),
53 )),
54 ),
55 NotebookCellResourceType::NOTEBOOK_CELLS,
56 ),
57 )),
58 NotebookUpdateCell::NotebookCellCreateRequest(Box::new(
59 NotebookCellCreateRequest::new(
60 NotebookCellCreateRequestAttributes::NotebookTimeseriesCellAttributes(
61 Box::new(
62 NotebookTimeseriesCellAttributes::new(
63 TimeseriesWidgetDefinition::new(
64 vec![TimeseriesWidgetRequest::new()
65 .display_type(WidgetDisplayType::LINE)
66 .q("avg:system.load.1{*}".to_string())
67 .style(
68 WidgetRequestStyle::new()
69 .line_type(WidgetLineType::SOLID)
70 .line_width(WidgetLineWidth::NORMAL)
71 .palette("dog_classic".to_string()),
72 )],
73 TimeseriesWidgetDefinitionType::TIMESERIES,
74 )
75 .show_legend(true)
76 .yaxis(WidgetAxis::new().scale("linear".to_string())),
77 )
78 .graph_size(NotebookGraphSize::MEDIUM)
79 .split_by(NotebookSplitBy::new(vec![], vec![]))
80 .time(None),
81 ),
82 ),
83 NotebookCellResourceType::NOTEBOOK_CELLS,
84 ),
85 )),
86 ],
87 "Example-Notebook-updated".to_string(),
88 NotebookGlobalTime::NotebookRelativeTime(Box::new(NotebookRelativeTime::new(
89 WidgetLiveSpan::PAST_ONE_HOUR,
90 ))),
91 )
92 .status(NotebookStatus::PUBLISHED),
93 NotebookResourceType::NOTEBOOKS,
94 ));
95 let configuration = datadog::Configuration::new();
96 let api = NotebooksAPI::with_config(configuration);
97 let resp = api.update_notebook(notebook_data_id.clone(), body).await;
98 if let Ok(value) = resp {
99 println!("{:#?}", value);
100 } else {
101 println!("{:#?}", resp.unwrap_err());
102 }
103}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for NotebookSplitBy
impl Clone for NotebookSplitBy
Source§fn clone(&self) -> NotebookSplitBy
fn clone(&self) -> NotebookSplitBy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NotebookSplitBy
impl Debug for NotebookSplitBy
Source§impl<'de> Deserialize<'de> for NotebookSplitBy
impl<'de> Deserialize<'de> for NotebookSplitBy
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NotebookSplitBy
impl PartialEq for NotebookSplitBy
Source§impl Serialize for NotebookSplitBy
impl Serialize for NotebookSplitBy
impl StructuralPartialEq for NotebookSplitBy
Auto Trait Implementations§
impl Freeze for NotebookSplitBy
impl RefUnwindSafe for NotebookSplitBy
impl Send for NotebookSplitBy
impl Sync for NotebookSplitBy
impl Unpin for NotebookSplitBy
impl UnwindSafe for NotebookSplitBy
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
Mutably borrows from an owned value. Read more