pub struct SyntheticsAPI { /* private fields */ }
Expand description

Datadog Synthetic Monitoring uses simulated user requests and browser rendering to help you ensure uptime, identify regional issues, and track your application performance. Synthetic tests come in two different flavors, API tests and browser tests. You can use Datadog’s API to manage both test types programmatically.

For more information, see the Synthetic Monitoring documentation.

Implementations§

source§

impl SyntheticsAPI

source

pub fn new() -> Self

source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v1_synthetics_ListLocations.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.list_locations().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_ListGlobalVariables.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.list_global_variables().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_GetTest.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_test("public_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_GetSyntheticsDefaultLocations.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_synthetics_default_locations().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_GetSyntheticsDefaultLocations_746853380.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_synthetics_default_locations().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_GetAPITest.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_api_test("public_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

source

pub async fn create_global_variable( &self, body: SyntheticsGlobalVariableRequest, ) -> Result<SyntheticsGlobalVariable, Error<CreateGlobalVariableError>>

Create a Synthetic global variable.

Examples found in repository?
examples/v1_synthetics_CreateGlobalVariable_3298562511.rs (line 16)
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
async fn main() {
    let body = SyntheticsGlobalVariableRequest::new(
        "".to_string(),
        "GLOBAL_VARIABLE_FIDO_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
        vec![],
    )
    .is_fido(true);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_global_variable(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_CreateGlobalVariable_3397718516.rs (line 31)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
async fn main() {
    let body = SyntheticsGlobalVariableRequest::new(
        "".to_string(),
        "GLOBAL_VARIABLE_TOTP_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
        vec![],
    )
    .is_totp(true)
    .value(
        SyntheticsGlobalVariableValue::new()
            .options(
                SyntheticsGlobalVariableOptions::new().totp_parameters(
                    SyntheticsGlobalVariableTOTPParameters::new()
                        .digits(6)
                        .refresh_interval(30),
                ),
            )
            .secure(false)
            .value("".to_string()),
    );
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_global_variable(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateGlobalVariable_1068962881.rs (line 33)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
async fn main() {
    // there is a valid "synthetics_api_test_multi_step" in the system
    let synthetics_api_test_multi_step_public_id =
        std::env::var("SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID").unwrap();
    let body = SyntheticsGlobalVariableRequest::new(
        "".to_string(),
        "GLOBAL_VARIABLE_FROM_TEST_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
        vec![],
    )
    .parse_test_options(
        SyntheticsGlobalVariableParseTestOptions::new(
            SyntheticsGlobalVariableParseTestOptionsType::LOCAL_VARIABLE,
        )
        .local_variable_name("EXTRACTED_VALUE".to_string()),
    )
    .parse_test_public_id(synthetics_api_test_multi_step_public_id.clone())
    .value(
        SyntheticsGlobalVariableValue::new()
            .secure(false)
            .value("".to_string()),
    );
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_global_variable(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateGlobalVariable.rs (line 42)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
async fn main() {
    let body = SyntheticsGlobalVariableRequest::new(
        "Example description".to_string(),
        "MY_VARIABLE".to_string(),
        vec!["team:front".to_string(), "test:workflow-1".to_string()],
    )
    .attributes(
        SyntheticsGlobalVariableAttributes::new()
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
    )
    .parse_test_options(
        SyntheticsGlobalVariableParseTestOptions::new(
            SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
        )
        .field("content-type".to_string())
        .local_variable_name("LOCAL_VARIABLE".to_string())
        .parser(
            SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::REGEX)
                .value(".*".to_string()),
        ),
    )
    .parse_test_public_id("abc-def-123".to_string())
    .value(
        SyntheticsGlobalVariableValue::new()
            .secure(true)
            .value("value".to_string()),
    );
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_global_variable(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn create_global_variable_with_http_info( &self, body: SyntheticsGlobalVariableRequest, ) -> Result<ResponseContent<SyntheticsGlobalVariable>, Error<CreateGlobalVariableError>>

Create a Synthetic global variable.

source

pub async fn create_private_location( &self, body: SyntheticsPrivateLocation, ) -> Result<SyntheticsPrivateLocationCreationResponse, Error<CreatePrivateLocationError>>

Create a new Synthetic private location.

Examples found in repository?
examples/v1_synthetics_CreatePrivateLocation.rs (line 21)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn main() {
    // there is a valid "role" in the system
    let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
    let body = SyntheticsPrivateLocation::new(
        "Test Example-Synthetic description".to_string(),
        "Example-Synthetic".to_string(),
        vec!["test:examplesynthetic".to_string()],
    )
    .metadata(
        SyntheticsPrivateLocationMetadata::new().restricted_roles(vec![role_data_id.clone()]),
    );
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_private_location(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn create_private_location_with_http_info( &self, body: SyntheticsPrivateLocation, ) -> Result<ResponseContent<SyntheticsPrivateLocationCreationResponse>, Error<CreatePrivateLocationError>>

Create a new Synthetic private location.

source

pub async fn create_synthetics_api_test( &self, body: SyntheticsAPITest, ) -> Result<SyntheticsAPITest, Error<CreateSyntheticsAPITestError>>

Create a Synthetic API test.

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_1072503741.rs (line 45)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new()
            .assertions(vec![SyntheticsAssertion::SyntheticsAssertionTarget(
                Box::new(SyntheticsAssertionTarget::new(
                    SyntheticsAssertionOperator::IS_IN_MORE_DAYS_THAN,
                    Value::from(10),
                    SyntheticsAssertionType::CERTIFICATE,
                )),
            )])
            .request(
                SyntheticsTestRequest::new()
                    .host("datadoghq.com".to_string())
                    .port("443".to_string()),
            ),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_ssl_test_payload.json".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(true)
            .check_certificate_revocation(true)
            .tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::SSL)
    .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_CreateSyntheticsAPITest_2472747642.rs (line 67)
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new()
            .assertions(vec![
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::IS,
                        Value::from("message"),
                        SyntheticsAssertionType::RECEIVED_MESSAGE,
                    ),
                )),
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::LESS_THAN,
                        Value::from(2000),
                        SyntheticsAssertionType::RESPONSE_TIME,
                    ),
                )),
            ])
            .config_variables(vec![])
            .request(
                SyntheticsTestRequest::new()
                    .message("message".to_string())
                    .url("ws://datadoghq.com".to_string()),
            ),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_test_websocket_payload.json".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(false)
            .allow_insecure(true)
            .follow_redirects(true)
            .min_failure_duration(10)
            .min_location_failed(1)
            .monitor_name("Example-Synthetic".to_string())
            .monitor_priority(5)
            .retry(
                SyntheticsTestOptionsRetry::new()
                    .count(3)
                    .interval(10.0 as f64),
            )
            .tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::WEBSOCKET)
    .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsAPITest_3829801148.rs (line 68)
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new()
            .assertions(vec![
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::IS,
                        Value::from("message"),
                        SyntheticsAssertionType::RECEIVED_MESSAGE,
                    ),
                )),
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::LESS_THAN,
                        Value::from(2000),
                        SyntheticsAssertionType::RESPONSE_TIME,
                    ),
                )),
            ])
            .config_variables(vec![])
            .request(
                SyntheticsTestRequest::new()
                    .host("https://datadoghq.com".to_string())
                    .message("message".to_string())
                    .port("443".to_string()),
            ),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_test_udp_payload.json".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(false)
            .allow_insecure(true)
            .follow_redirects(true)
            .min_failure_duration(10)
            .min_location_failed(1)
            .monitor_name("Example-Synthetic".to_string())
            .monitor_priority(5)
            .retry(
                SyntheticsTestOptionsRetry::new()
                    .count(3)
                    .interval(10.0 as f64),
            )
            .tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::UDP)
    .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsAPITest_1402674167.rs (line 71)
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new()
            .assertions(vec![
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::IS,
                        Value::from(1),
                        SyntheticsAssertionType::GRPC_HEALTHCHECK_STATUS,
                    ),
                )),
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::IS,
                        Value::from("proto target"),
                        SyntheticsAssertionType::GRPC_PROTO,
                    ),
                )),
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::IS,
                        Value::from("123"),
                        SyntheticsAssertionType::GRPC_METADATA,
                    )
                    .property("property".to_string()),
                )),
            ])
            .request(
                SyntheticsTestRequest::new()
                    .host("localhost".to_string())
                    .message("".to_string())
                    .metadata(BTreeMap::from([]))
                    .method("GET".to_string())
                    .port("50051".to_string())
                    .service("Hello".to_string()),
            ),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_grpc_test_payload.json".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .min_failure_duration(0)
            .min_location_failed(1)
            .monitor_name("Example-Synthetic".to_string())
            .monitor_options(SyntheticsTestOptionsMonitorOptions::new().renotify_interval(0))
            .tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::GRPC)
    .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsAPITest.rs (line 79)
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new()
            .assertions(vec![SyntheticsAssertion::SyntheticsAssertionTarget(
                Box::new(SyntheticsAssertionTarget::new(
                    SyntheticsAssertionOperator::LESS_THAN,
                    Value::from(1000),
                    SyntheticsAssertionType::RESPONSE_TIME,
                )),
            )])
            .request(
                SyntheticsTestRequest::new()
                    .method("GET".to_string())
                    .url("https://example.com".to_string()),
            ),
        vec!["aws:eu-west-3".to_string()],
        "Notification message".to_string(),
        "Example test name".to_string(),
        SyntheticsTestOptions::new()
            .ci(SyntheticsTestCiOptions::new()
                .execution_rule(SyntheticsTestExecutionRule::BLOCKING))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
            .monitor_options(SyntheticsTestOptionsMonitorOptions::new())
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
            .retry(SyntheticsTestOptionsRetry::new())
            .rum_settings(
                SyntheticsBrowserTestRumSettings::new(true)
                    .application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
                    .client_token_id(12345),
            )
            .scheduling(
                SyntheticsTestOptionsScheduling::new()
                    .timeframes(vec![
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(1)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(3)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                    ])
                    .timezone("America/New_York".to_string()),
            ),
        SyntheticsAPITestType::API,
    )
    .status(SyntheticsTestPauseStatus::LIVE)
    .subtype(SyntheticsTestDetailsSubType::HTTP)
    .tags(vec!["env:production".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsAPITest_1241981394.rs (line 164)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new()
            .assertions(vec![
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::IS,
                        Value::from("text/html"),
                        SyntheticsAssertionType::HEADER,
                    )
                    .property("{{ PROPERTY }}".to_string()),
                )),
                SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
                    SyntheticsAssertionTarget::new(
                        SyntheticsAssertionOperator::LESS_THAN,
                        Value::from(2000),
                        SyntheticsAssertionType::RESPONSE_TIME,
                    )
                    .timings_scope(SyntheticsAssertionTimingsScope::WITHOUT_DNS),
                )),
                SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(Box::new(
                    SyntheticsAssertionJSONPathTarget::new(
                        SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
                        SyntheticsAssertionType::BODY,
                    )
                    .target(
                        SyntheticsAssertionJSONPathTargetTarget::new()
                            .json_path("topKey".to_string())
                            .operator("isNot".to_string())
                            .target_value(Value::from("0")),
                    ),
                )),
                SyntheticsAssertion::SyntheticsAssertionXPathTarget(Box::new(
                    SyntheticsAssertionXPathTarget::new(
                        SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
                        SyntheticsAssertionType::BODY,
                    )
                    .target(
                        SyntheticsAssertionXPathTargetTarget::new()
                            .operator("contains".to_string())
                            .target_value(Value::from("0"))
                            .x_path("target-xpath".to_string()),
                    ),
                )),
            ])
            .config_variables(vec![SyntheticsConfigVariable::new(
                "PROPERTY".to_string(),
                SyntheticsConfigVariableType::TEXT,
            )
            .example("content-type".to_string())
            .pattern("content-type".to_string())])
            .request(
                SyntheticsTestRequest::new()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthClient(
                        Box::new(
                            SyntheticsBasicAuthOauthClient::new(
                                "https://datadog-token.com".to_string(),
                                "client-id".to_string(),
                                "client-secret".to_string(),
                                SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
                                SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
                            )
                            .audience("audience".to_string())
                            .resource("resource".to_string())
                            .scope("yoyo".to_string()),
                        ),
                    ))
                    .body_type(SyntheticsTestRequestBodyType::APPLICATION_OCTET_STREAM)
                    .certificate(
                        SyntheticsTestRequestCertificate::new()
                            .cert(
                                SyntheticsTestRequestCertificateItem::new()
                                    .content("cert-content".to_string())
                                    .filename("cert-filename".to_string())
                                    .updated_at("2020-10-16T09:23:24.857Z".to_string()),
                            )
                            .key(
                                SyntheticsTestRequestCertificateItem::new()
                                    .content("key-content".to_string())
                                    .filename("key-filename".to_string())
                                    .updated_at("2020-10-16T09:23:24.857Z".to_string()),
                            ),
                    )
                    .files(vec![SyntheticsTestRequestBodyFile::new()
                        .content("file content".to_string())
                        .name("file name".to_string())
                        .original_file_name("image.png".to_string())
                        .type_("file type".to_string())])
                    .headers(BTreeMap::from([(
                        "unique".to_string(),
                        "examplesynthetic".to_string(),
                    )]))
                    .method("GET".to_string())
                    .persist_cookies(true)
                    .proxy(
                        SyntheticsTestRequestProxy::new("https://datadoghq.com".to_string())
                            .headers(BTreeMap::from([])),
                    )
                    .timeout(10.0 as f64)
                    .url("https://datadoghq.com".to_string()),
            ),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(false)
            .allow_insecure(true)
            .follow_redirects(true)
            .http_version(SyntheticsTestOptionsHTTPVersion::HTTP2)
            .min_failure_duration(10)
            .min_location_failed(1)
            .monitor_name("Example-Synthetic".to_string())
            .monitor_priority(5)
            .retry(
                SyntheticsTestOptionsRetry::new()
                    .count(3)
                    .interval(10.0 as f64),
            )
            .tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::HTTP)
    .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn create_synthetics_api_test_with_http_info( &self, body: SyntheticsAPITest, ) -> Result<ResponseContent<SyntheticsAPITest>, Error<CreateSyntheticsAPITestError>>

Create a Synthetic API test.

source

pub async fn create_synthetics_browser_test( &self, body: SyntheticsBrowserTest, ) -> Result<SyntheticsBrowserTest, Error<CreateSyntheticsBrowserTestError>>

Create a Synthetic browser test.

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsBrowserTest.rs (line 74)
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
async fn main() {
    let body = SyntheticsBrowserTest::new(
        SyntheticsBrowserTestConfig::new(
            vec![],
            SyntheticsTestRequest::new()
                .method("GET".to_string())
                .url("https://datadoghq.com".to_string()),
        )
        .config_variables(vec![SyntheticsConfigVariable::new(
            "PROPERTY".to_string(),
            SyntheticsConfigVariableType::TEXT,
        )
        .example("content-type".to_string())
        .pattern("content-type".to_string())
        .secure(true)])
        .set_cookie("name:test".to_string())
        .variables(vec![SyntheticsBrowserVariable::new(
            "TEST_VARIABLE".to_string(),
            SyntheticsBrowserVariableType::TEXT,
        )
        .example("secret".to_string())
        .pattern("secret".to_string())
        .secure(true)]),
        vec!["aws:us-east-2".to_string()],
        "Test message".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(false)
            .allow_insecure(true)
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .disable_cors(true)
            .enable_profiling(true)
            .enable_security_testing(true)
            .follow_redirects(true)
            .min_failure_duration(10)
            .min_location_failed(1)
            .no_screenshot(true)
            .retry(
                SyntheticsTestOptionsRetry::new()
                    .count(2)
                    .interval(10.0 as f64),
            )
            .tick_every(300),
        SyntheticsBrowserTestType::BROWSER,
    )
    .steps(vec![SyntheticsStep::new()
        .allow_failure(false)
        .is_critical(true)
        .name("Refresh page".to_string())
        .params(BTreeMap::new())
        .type_(SyntheticsStepType::REFRESH)])
    .tags(vec!["testing:browser".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_browser_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_CreateSyntheticsBrowserTest_2932742688.rs (line 75)
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
async fn main() {
    let body = SyntheticsBrowserTest::new(
        SyntheticsBrowserTestConfig::new(
            vec![],
            SyntheticsTestRequest::new()
                .certificate_domains(vec!["https://datadoghq.com".to_string()])
                .method("GET".to_string())
                .url("https://datadoghq.com".to_string()),
        )
        .config_variables(vec![SyntheticsConfigVariable::new(
            "PROPERTY".to_string(),
            SyntheticsConfigVariableType::TEXT,
        )
        .example("content-type".to_string())
        .pattern("content-type".to_string())])
        .set_cookie("name:test".to_string()),
        vec!["aws:us-east-2".to_string()],
        "Test message".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(false)
            .allow_insecure(true)
            .ci(SyntheticsTestCiOptions::new().execution_rule(SyntheticsTestExecutionRule::SKIPPED))
            .device_ids(vec![SyntheticsDeviceID::TABLET])
            .disable_cors(true)
            .disable_csp(true)
            .follow_redirects(true)
            .ignore_server_certificate_error(true)
            .initial_navigation_timeout(200)
            .min_failure_duration(10)
            .min_location_failed(1)
            .no_screenshot(true)
            .retry(
                SyntheticsTestOptionsRetry::new()
                    .count(2)
                    .interval(10.0 as f64),
            )
            .rum_settings(
                SyntheticsBrowserTestRumSettings::new(true)
                    .application_id("mockApplicationId".to_string())
                    .client_token_id(12345),
            )
            .tick_every(300),
        SyntheticsBrowserTestType::BROWSER,
    )
    .steps(vec![SyntheticsStep::new()
        .allow_failure(false)
        .is_critical(true)
        .name("Refresh page".to_string())
        .params(BTreeMap::new())
        .type_(SyntheticsStepType::REFRESH)])
    .tags(vec!["testing:browser".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_browser_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs (line 79)
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
async fn main() {
    let body = SyntheticsBrowserTest::new(
        SyntheticsBrowserTestConfig::new(
            vec![],
            SyntheticsTestRequest::new()
                .method("GET".to_string())
                .url("https://datadoghq.com".to_string()),
        )
        .config_variables(vec![SyntheticsConfigVariable::new(
            "PROPERTY".to_string(),
            SyntheticsConfigVariableType::TEXT,
        )
        .example("content-type".to_string())
        .pattern("content-type".to_string())])
        .set_cookie("name:test".to_string()),
        vec!["aws:us-east-2".to_string()],
        "Test message".to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new()
            .accept_self_signed(false)
            .allow_insecure(true)
            .device_ids(vec![SyntheticsDeviceID::TABLET])
            .disable_cors(true)
            .follow_redirects(true)
            .min_failure_duration(10)
            .min_location_failed(1)
            .no_screenshot(true)
            .retry(
                SyntheticsTestOptionsRetry::new()
                    .count(2)
                    .interval(10.0 as f64),
            )
            .scheduling(
                SyntheticsTestOptionsScheduling::new()
                    .timeframes(vec![
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(1)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(3)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                    ])
                    .timezone("America/New_York".to_string()),
            )
            .tick_every(300),
        SyntheticsBrowserTestType::BROWSER,
    )
    .steps(vec![SyntheticsStep::new()
        .allow_failure(false)
        .is_critical(true)
        .name("Refresh page".to_string())
        .params(BTreeMap::new())
        .type_(SyntheticsStepType::REFRESH)])
    .tags(vec!["testing:browser".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_browser_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn create_synthetics_browser_test_with_http_info( &self, body: SyntheticsBrowserTest, ) -> Result<ResponseContent<SyntheticsBrowserTest>, Error<CreateSyntheticsBrowserTestError>>

Create a Synthetic browser test.

source

pub async fn delete_global_variable( &self, variable_id: String, ) -> Result<(), Error<DeleteGlobalVariableError>>

Delete a Synthetic global variable.

Examples found in repository?
examples/v1_synthetics_DeleteGlobalVariable.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.delete_global_variable("variable_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn delete_global_variable_with_http_info( &self, variable_id: String, ) -> Result<ResponseContent<()>, Error<DeleteGlobalVariableError>>

Delete a Synthetic global variable.

source

pub async fn delete_private_location( &self, location_id: String, ) -> Result<(), Error<DeletePrivateLocationError>>

Delete a Synthetic private location.

Examples found in repository?
examples/v1_synthetics_DeletePrivateLocation.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.delete_private_location("location_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn delete_private_location_with_http_info( &self, location_id: String, ) -> Result<ResponseContent<()>, Error<DeletePrivateLocationError>>

Delete a Synthetic private location.

source

pub async fn delete_tests( &self, body: SyntheticsDeleteTestsPayload, ) -> Result<SyntheticsDeleteTestsResponse, Error<DeleteTestsError>>

Delete multiple Synthetic tests by ID.

Examples found in repository?
examples/v1_synthetics_DeleteTests.rs (line 14)
7
8
9
10
11
12
13
14
15
16
17
18
19
20
async fn main() {
    // there is a valid "synthetics_api_test" in the system
    let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
    let body =
        SyntheticsDeleteTestsPayload::new().public_ids(vec![synthetics_api_test_public_id.clone()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.delete_tests(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn delete_tests_with_http_info( &self, body: SyntheticsDeleteTestsPayload, ) -> Result<ResponseContent<SyntheticsDeleteTestsResponse>, Error<DeleteTestsError>>

Delete multiple Synthetic tests by ID.

source

pub async fn edit_global_variable( &self, variable_id: String, body: SyntheticsGlobalVariableRequest, ) -> Result<SyntheticsGlobalVariable, Error<EditGlobalVariableError>>

Edit a Synthetic global variable.

Examples found in repository?
examples/v1_synthetics_EditGlobalVariable.rs (line 43)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
async fn main() {
    let body = SyntheticsGlobalVariableRequest::new(
        "Example description".to_string(),
        "MY_VARIABLE".to_string(),
        vec!["team:front".to_string(), "test:workflow-1".to_string()],
    )
    .attributes(
        SyntheticsGlobalVariableAttributes::new()
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
    )
    .parse_test_options(
        SyntheticsGlobalVariableParseTestOptions::new(
            SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
        )
        .field("content-type".to_string())
        .local_variable_name("LOCAL_VARIABLE".to_string())
        .parser(
            SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::REGEX)
                .value(".*".to_string()),
        ),
    )
    .parse_test_public_id("abc-def-123".to_string())
    .value(
        SyntheticsGlobalVariableValue::new()
            .secure(true)
            .value("value".to_string()),
    );
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .edit_global_variable("variable_id".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn edit_global_variable_with_http_info( &self, variable_id: String, body: SyntheticsGlobalVariableRequest, ) -> Result<ResponseContent<SyntheticsGlobalVariable>, Error<EditGlobalVariableError>>

Edit a Synthetic global variable.

source

pub async fn get_api_test( &self, public_id: String, ) -> Result<SyntheticsAPITest, Error<GetAPITestError>>

Get the detailed configuration associated with a Synthetic API test.

Examples found in repository?
examples/v1_synthetics_GetAPITest.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_api_test("public_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_api_test_with_http_info( &self, public_id: String, ) -> Result<ResponseContent<SyntheticsAPITest>, Error<GetAPITestError>>

Get the detailed configuration associated with a Synthetic API test.

source

pub async fn get_api_test_latest_results( &self, public_id: String, params: GetAPITestLatestResultsOptionalParams, ) -> Result<SyntheticsGetAPITestLatestResultsResponse, Error<GetAPITestLatestResultsError>>

Get the last 150 test results summaries for a given Synthetic API test.

Examples found in repository?
examples/v1_synthetics_GetAPITestLatestResults.rs (lines 11-14)
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .get_api_test_latest_results(
            "hwb-332-3xe".to_string(),
            GetAPITestLatestResultsOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_api_test_latest_results_with_http_info( &self, public_id: String, params: GetAPITestLatestResultsOptionalParams, ) -> Result<ResponseContent<SyntheticsGetAPITestLatestResultsResponse>, Error<GetAPITestLatestResultsError>>

Get the last 150 test results summaries for a given Synthetic API test.

source

pub async fn get_api_test_result( &self, public_id: String, result_id: String, ) -> Result<SyntheticsAPITestResultFull, Error<GetAPITestResultError>>

Get a specific full result from a given Synthetic API test.

Examples found in repository?
examples/v1_synthetics_GetAPITestResult.rs (line 10)
6
7
8
9
10
11
12
13
14
15
16
17
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .get_api_test_result("hwb-332-3xe".to_string(), "3420446318379485707".to_string())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_GetAPITestResult_1321866518.rs (lines 17-20)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn main() {
    // there is a "synthetics_api_test_with_wrong_dns" in the system
    let synthetics_api_test_with_wrong_dns_public_id =
        std::env::var("SYNTHETICS_API_TEST_WITH_WRONG_DNS_PUBLIC_ID").unwrap();

    // the "synthetics_api_test_with_wrong_dns" is triggered
    let synthetics_api_test_with_wrong_dns_result_results_0_result_id =
        std::env::var("SYNTHETICS_API_TEST_WITH_WRONG_DNS_RESULT_RESULTS_0_RESULT_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .get_api_test_result(
            synthetics_api_test_with_wrong_dns_public_id.clone(),
            synthetics_api_test_with_wrong_dns_result_results_0_result_id.clone(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_api_test_result_with_http_info( &self, public_id: String, result_id: String, ) -> Result<ResponseContent<SyntheticsAPITestResultFull>, Error<GetAPITestResultError>>

Get a specific full result from a given Synthetic API test.

source

pub async fn get_browser_test( &self, public_id: String, ) -> Result<SyntheticsBrowserTest, Error<GetBrowserTestError>>

Get the detailed configuration (including steps) associated with a Synthetic browser test.

Examples found in repository?
examples/v1_synthetics_GetBrowserTest.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_browser_test("public_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_browser_test_with_http_info( &self, public_id: String, ) -> Result<ResponseContent<SyntheticsBrowserTest>, Error<GetBrowserTestError>>

Get the detailed configuration (including steps) associated with a Synthetic browser test.

source

pub async fn get_browser_test_latest_results( &self, public_id: String, params: GetBrowserTestLatestResultsOptionalParams, ) -> Result<SyntheticsGetBrowserTestLatestResultsResponse, Error<GetBrowserTestLatestResultsError>>

Get the last 150 test results summaries for a given Synthetic browser test.

Examples found in repository?
examples/v1_synthetics_GetBrowserTestLatestResults.rs (lines 11-14)
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .get_browser_test_latest_results(
            "2yy-sem-mjh".to_string(),
            GetBrowserTestLatestResultsOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_browser_test_latest_results_with_http_info( &self, public_id: String, params: GetBrowserTestLatestResultsOptionalParams, ) -> Result<ResponseContent<SyntheticsGetBrowserTestLatestResultsResponse>, Error<GetBrowserTestLatestResultsError>>

Get the last 150 test results summaries for a given Synthetic browser test.

source

pub async fn get_browser_test_result( &self, public_id: String, result_id: String, ) -> Result<SyntheticsBrowserTestResultFull, Error<GetBrowserTestResultError>>

Get a specific full result from a given Synthetic browser test.

Examples found in repository?
examples/v1_synthetics_GetBrowserTestResult.rs (line 10)
6
7
8
9
10
11
12
13
14
15
16
17
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .get_browser_test_result("2yy-sem-mjh".to_string(), "5671719892074090418".to_string())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_browser_test_result_with_http_info( &self, public_id: String, result_id: String, ) -> Result<ResponseContent<SyntheticsBrowserTestResultFull>, Error<GetBrowserTestResultError>>

Get a specific full result from a given Synthetic browser test.

source

pub async fn get_global_variable( &self, variable_id: String, ) -> Result<SyntheticsGlobalVariable, Error<GetGlobalVariableError>>

Get the detailed configuration of a global variable.

Examples found in repository?
examples/v1_synthetics_GetGlobalVariable.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_global_variable("variable_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_global_variable_with_http_info( &self, variable_id: String, ) -> Result<ResponseContent<SyntheticsGlobalVariable>, Error<GetGlobalVariableError>>

Get the detailed configuration of a global variable.

source

pub async fn get_private_location( &self, location_id: String, ) -> Result<SyntheticsPrivateLocation, Error<GetPrivateLocationError>>

Get a Synthetic private location.

Examples found in repository?
examples/v1_synthetics_GetPrivateLocation.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_private_location("location_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_private_location_with_http_info( &self, location_id: String, ) -> Result<ResponseContent<SyntheticsPrivateLocation>, Error<GetPrivateLocationError>>

Get a Synthetic private location.

source

pub async fn get_synthetics_ci_batch( &self, batch_id: String, ) -> Result<SyntheticsBatchDetails, Error<GetSyntheticsCIBatchError>>

Get a batch’s updated details.

Examples found in repository?
examples/v1_synthetics_GetSyntheticsCIBatch.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_synthetics_ci_batch("batch_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_synthetics_ci_batch_with_http_info( &self, batch_id: String, ) -> Result<ResponseContent<SyntheticsBatchDetails>, Error<GetSyntheticsCIBatchError>>

Get a batch’s updated details.

source

pub async fn get_synthetics_default_locations( &self, ) -> Result<Vec<String>, Error<GetSyntheticsDefaultLocationsError>>

Get the default locations settings.

Examples found in repository?
examples/v1_synthetics_GetSyntheticsDefaultLocations.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_synthetics_default_locations().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_GetSyntheticsDefaultLocations_746853380.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_synthetics_default_locations().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_synthetics_default_locations_with_http_info( &self, ) -> Result<ResponseContent<Vec<String>>, Error<GetSyntheticsDefaultLocationsError>>

Get the default locations settings.

source

pub async fn get_test( &self, public_id: String, ) -> Result<SyntheticsTestDetails, Error<GetTestError>>

Get the detailed configuration associated with a Synthetic test.

Examples found in repository?
examples/v1_synthetics_GetTest.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.get_test("public_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_test_with_http_info( &self, public_id: String, ) -> Result<ResponseContent<SyntheticsTestDetails>, Error<GetTestError>>

Get the detailed configuration associated with a Synthetic test.

source

pub async fn list_global_variables( &self, ) -> Result<SyntheticsListGlobalVariablesResponse, Error<ListGlobalVariablesError>>

Get the list of all Synthetic global variables.

Examples found in repository?
examples/v1_synthetics_ListGlobalVariables.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.list_global_variables().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn list_global_variables_with_http_info( &self, ) -> Result<ResponseContent<SyntheticsListGlobalVariablesResponse>, Error<ListGlobalVariablesError>>

Get the list of all Synthetic global variables.

source

pub async fn list_locations( &self, ) -> Result<SyntheticsLocations, Error<ListLocationsError>>

Get the list of public and private locations available for Synthetic tests. No arguments required.

Examples found in repository?
examples/v1_synthetics_ListLocations.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.list_locations().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn list_locations_with_http_info( &self, ) -> Result<ResponseContent<SyntheticsLocations>, Error<ListLocationsError>>

Get the list of public and private locations available for Synthetic tests. No arguments required.

source

pub async fn list_tests( &self, params: ListTestsOptionalParams, ) -> Result<SyntheticsListTestsResponse, Error<ListTestsError>>

Get the list of all Synthetic tests.

Examples found in repository?
examples/v1_synthetics_ListTests.rs (line 11)
8
9
10
11
12
13
14
15
16
17
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.list_tests(ListTestsOptionalParams::default()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_ListTests_2779190961.rs (line 10)
7
8
9
10
11
12
13
14
15
16
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.list_tests(ListTestsOptionalParams::default()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub fn list_tests_with_pagination( &self, params: ListTestsOptionalParams, ) -> impl Stream<Item = Result<SyntheticsTestDetails, Error<ListTestsError>>> + '_

Examples found in repository?
examples/v1_synthetics_ListTests_1938827783.rs (line 13)
10
11
12
13
14
15
16
17
18
19
20
21
22
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let response = api.list_tests_with_pagination(ListTestsOptionalParams::default().page_size(2));
    pin_mut!(response);
    while let Some(resp) = response.next().await {
        if let Ok(value) = resp {
            println!("{:#?}", value);
        } else {
            println!("{:#?}", resp.unwrap_err());
        }
    }
}
source

pub async fn list_tests_with_http_info( &self, params: ListTestsOptionalParams, ) -> Result<ResponseContent<SyntheticsListTestsResponse>, Error<ListTestsError>>

Get the list of all Synthetic tests.

source

pub async fn patch_test( &self, public_id: String, body: SyntheticsPatchTestBody, ) -> Result<SyntheticsTestDetails, Error<PatchTestError>>

Patch the configuration of a Synthetic test with partial data.

Examples found in repository?
examples/v1_synthetics_PatchTest.rs (line 25)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
async fn main() {
    // there is a valid "synthetics_api_test" in the system
    let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
    let body = SyntheticsPatchTestBody::new().data(vec![
        SyntheticsPatchTestOperation::new()
            .op(SyntheticsPatchTestOperationName::REPLACE)
            .path("/name".to_string())
            .value(Value::from("New test name")),
        SyntheticsPatchTestOperation::new()
            .op(SyntheticsPatchTestOperationName::REMOVE)
            .path("/config/assertions/0".to_string()),
    ]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .patch_test(synthetics_api_test_public_id.clone(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn patch_test_with_http_info( &self, public_id: String, body: SyntheticsPatchTestBody, ) -> Result<ResponseContent<SyntheticsTestDetails>, Error<PatchTestError>>

Patch the configuration of a Synthetic test with partial data.

source

pub async fn trigger_ci_tests( &self, body: SyntheticsCITestBody, ) -> Result<SyntheticsTriggerCITestsResponse, Error<TriggerCITestsError>>

Trigger a set of Synthetic tests for continuous integration.

Examples found in repository?
examples/v1_synthetics_TriggerCITests.rs (line 37)
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
async fn main() {
    let body =
        SyntheticsCITestBody::new().tests(vec![SyntheticsCITest::new("aaa-aaa-aaa".to_string())
            .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string())
                    .type_(SyntheticsBasicAuthWebType::WEB),
            )))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .locations(vec!["aws:eu-west-3".to_string()])
            .metadata(
                SyntheticsCIBatchMetadata::new()
                    .ci(SyntheticsCIBatchMetadataCI::new()
                        .pipeline(SyntheticsCIBatchMetadataPipeline::new())
                        .provider(SyntheticsCIBatchMetadataProvider::new()))
                    .git(SyntheticsCIBatchMetadataGit::new()),
            )
            .retry(SyntheticsTestOptionsRetry::new())]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.trigger_ci_tests(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn trigger_ci_tests_with_http_info( &self, body: SyntheticsCITestBody, ) -> Result<ResponseContent<SyntheticsTriggerCITestsResponse>, Error<TriggerCITestsError>>

Trigger a set of Synthetic tests for continuous integration.

source

pub async fn trigger_tests( &self, body: SyntheticsTriggerBody, ) -> Result<SyntheticsTriggerCITestsResponse, Error<TriggerTestsError>>

Trigger a set of Synthetic tests.

Examples found in repository?
examples/v1_synthetics_TriggerTests.rs (line 16)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
async fn main() {
    // there is a valid "synthetics_api_test" in the system
    let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
    let body = SyntheticsTriggerBody::new(vec![SyntheticsTriggerTest::new(
        synthetics_api_test_public_id.clone(),
    )]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.trigger_tests(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn trigger_tests_with_http_info( &self, body: SyntheticsTriggerBody, ) -> Result<ResponseContent<SyntheticsTriggerCITestsResponse>, Error<TriggerTestsError>>

Trigger a set of Synthetic tests.

source

pub async fn update_api_test( &self, public_id: String, body: SyntheticsAPITest, ) -> Result<SyntheticsAPITest, Error<UpdateAPITestError>>

Edit the configuration of a Synthetic API test.

Examples found in repository?
examples/v1_synthetics_UpdateAPITest.rs (line 134)
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
async fn main() {
    // there is a valid "synthetics_api_test" in the system
    let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
    let body =
        SyntheticsAPITest::new(
            SyntheticsAPITestConfig::new()
                .assertions(
                    vec![
                        SyntheticsAssertion::SyntheticsAssertionTarget(
                            Box::new(
                                SyntheticsAssertionTarget::new(
                                    SyntheticsAssertionOperator::IS,
                                    Value::from("text/html"),
                                    SyntheticsAssertionType::HEADER,
                                ).property("{{ PROPERTY }}".to_string()),
                            ),
                        ),
                        SyntheticsAssertion::SyntheticsAssertionTarget(
                            Box::new(
                                SyntheticsAssertionTarget::new(
                                    SyntheticsAssertionOperator::LESS_THAN,
                                    Value::from(2000),
                                    SyntheticsAssertionType::RESPONSE_TIME,
                                ),
                            ),
                        ),
                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
                            Box::new(
                                SyntheticsAssertionJSONPathTarget::new(
                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
                                    SyntheticsAssertionType::BODY,
                                ).target(
                                    SyntheticsAssertionJSONPathTargetTarget::new()
                                        .json_path("topKey".to_string())
                                        .operator("isNot".to_string())
                                        .target_value(Value::from("0")),
                                ),
                            ),
                        ),
                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
                            Box::new(
                                SyntheticsAssertionJSONSchemaTarget::new(
                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
                                    SyntheticsAssertionType::BODY,
                                ).target(
                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
                                        .json_schema(
                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
                                        )
                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
                                ),
                            ),
                        )
                    ],
                )
                .config_variables(
                    vec![
                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
                            .example("content-type".to_string())
                            .pattern("content-type".to_string())
                    ],
                )
                .request(
                    SyntheticsTestRequest::new()
                        .certificate(
                            SyntheticsTestRequestCertificate::new()
                                .cert(
                                    SyntheticsTestRequestCertificateItem::new()
                                        .filename("cert-filename".to_string())
                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
                                )
                                .key(
                                    SyntheticsTestRequestCertificateItem::new()
                                        .filename("key-filename".to_string())
                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
                                ),
                        )
                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
                        .method("GET".to_string())
                        .timeout(10.0 as f64)
                        .url("https://datadoghq.com".to_string()),
                ),
            vec!["aws:us-east-2".to_string()],
            "BDD test payload: synthetics_api_test_payload.json".to_string(),
            "Example-Synthetic-updated".to_string(),
            SyntheticsTestOptions::new()
                .accept_self_signed(false)
                .allow_insecure(true)
                .follow_redirects(true)
                .min_failure_duration(10)
                .min_location_failed(1)
                .monitor_name("Test-TestSyntheticsAPITestLifecycle-1623076664".to_string())
                .monitor_priority(5)
                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
                .tick_every(60),
            SyntheticsAPITestType::API,
        )
            .status(SyntheticsTestPauseStatus::LIVE)
            .subtype(SyntheticsTestDetailsSubType::HTTP)
            .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .update_api_test(synthetics_api_test_public_id.clone(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn update_api_test_with_http_info( &self, public_id: String, body: SyntheticsAPITest, ) -> Result<ResponseContent<SyntheticsAPITest>, Error<UpdateAPITestError>>

Edit the configuration of a Synthetic API test.

source

pub async fn update_browser_test( &self, public_id: String, body: SyntheticsBrowserTest, ) -> Result<SyntheticsBrowserTest, Error<UpdateBrowserTestError>>

Edit the configuration of a Synthetic browser test.

Examples found in repository?
examples/v1_synthetics_UpdateBrowserTest.rs (line 109)
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
async fn main() {
    let body = SyntheticsBrowserTest::new(
        SyntheticsBrowserTestConfig::new(
            vec![],
            SyntheticsTestRequest::new()
                .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                    SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string())
                        .type_(SyntheticsBasicAuthWebType::WEB),
                )))
                .body_type(SyntheticsTestRequestBodyType::TEXT_PLAIN)
                .call_type(SyntheticsTestCallType::UNARY)
                .certificate(
                    SyntheticsTestRequestCertificate::new()
                        .cert(SyntheticsTestRequestCertificateItem::new())
                        .key(SyntheticsTestRequestCertificateItem::new()),
                )
                .certificate_domains(vec![])
                .files(vec![SyntheticsTestRequestBodyFile::new()])
                .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
                .proxy(SyntheticsTestRequestProxy::new(
                    "https://example.com".to_string(),
                ))
                .service("Greeter".to_string())
                .url("https://example.com".to_string()),
        )
        .config_variables(vec![SyntheticsConfigVariable::new(
            "VARIABLE_NAME".to_string(),
            SyntheticsConfigVariableType::TEXT,
        )
        .secure(false)])
        .variables(vec![SyntheticsBrowserVariable::new(
            "VARIABLE_NAME".to_string(),
            SyntheticsBrowserVariableType::TEXT,
        )]),
        vec!["aws:eu-west-3".to_string()],
        "".to_string(),
        "Example test name".to_string(),
        SyntheticsTestOptions::new()
            .ci(SyntheticsTestCiOptions::new()
                .execution_rule(SyntheticsTestExecutionRule::BLOCKING))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
            .monitor_options(SyntheticsTestOptionsMonitorOptions::new())
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
            .retry(SyntheticsTestOptionsRetry::new())
            .rum_settings(
                SyntheticsBrowserTestRumSettings::new(true)
                    .application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
                    .client_token_id(12345),
            )
            .scheduling(
                SyntheticsTestOptionsScheduling::new()
                    .timeframes(vec![
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(1)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(3)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                    ])
                    .timezone("America/New_York".to_string()),
            ),
        SyntheticsBrowserTestType::BROWSER,
    )
    .status(SyntheticsTestPauseStatus::LIVE)
    .steps(vec![
        SyntheticsStep::new().type_(SyntheticsStepType::ASSERT_ELEMENT_CONTENT)
    ])
    .tags(vec!["env:prod".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.update_browser_test("public_id".to_string(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn update_browser_test_with_http_info( &self, public_id: String, body: SyntheticsBrowserTest, ) -> Result<ResponseContent<SyntheticsBrowserTest>, Error<UpdateBrowserTestError>>

Edit the configuration of a Synthetic browser test.

source

pub async fn update_private_location( &self, location_id: String, body: SyntheticsPrivateLocation, ) -> Result<SyntheticsPrivateLocation, Error<UpdatePrivateLocationError>>

Edit a Synthetic private location.

Examples found in repository?
examples/v1_synthetics_UpdatePrivateLocation.rs (line 21)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
async fn main() {
    let body = SyntheticsPrivateLocation::new(
        "Description of private location".to_string(),
        "New private location".to_string(),
        vec!["team:front".to_string()],
    )
    .metadata(
        SyntheticsPrivateLocationMetadata::new()
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
    );
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .update_private_location("location_id".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn update_private_location_with_http_info( &self, location_id: String, body: SyntheticsPrivateLocation, ) -> Result<ResponseContent<SyntheticsPrivateLocation>, Error<UpdatePrivateLocationError>>

Edit a Synthetic private location.

source

pub async fn update_test_pause_status( &self, public_id: String, body: SyntheticsUpdateTestPauseStatusPayload, ) -> Result<bool, Error<UpdateTestPauseStatusError>>

Pause or start a Synthetic test by changing the status.

Examples found in repository?
examples/v1_synthetics_UpdateTestPauseStatus.rs (line 15)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
async fn main() {
    let body =
        SyntheticsUpdateTestPauseStatusPayload::new().new_status(SyntheticsTestPauseStatus::LIVE);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .update_test_pause_status("public_id".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn update_test_pause_status_with_http_info( &self, public_id: String, body: SyntheticsUpdateTestPauseStatusPayload, ) -> Result<ResponseContent<bool>, Error<UpdateTestPauseStatusError>>

Pause or start a Synthetic test by changing the status.

Trait Implementations§

source§

impl Clone for SyntheticsAPI

source§

fn clone(&self) -> SyntheticsAPI

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SyntheticsAPI

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SyntheticsAPI

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more