Struct datadog_api_client::datadogV1::model::model_synthetics_variable_parser::SyntheticsVariableParser
source · #[non_exhaustive]pub struct SyntheticsVariableParser {
pub type_: SyntheticsGlobalVariableParserType,
pub value: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}Expand description
Details of the parser to use for the global variable.
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.type_: SyntheticsGlobalVariableParserTypeType of parser for a Synthetic global variable from a synthetics test.
value: Option<String>Regex or JSON path used for the parser. Not used with type raw.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl SyntheticsVariableParser
impl SyntheticsVariableParser
sourcepub fn new(
type_: SyntheticsGlobalVariableParserType,
) -> SyntheticsVariableParser
pub fn new( type_: SyntheticsGlobalVariableParserType, ) -> SyntheticsVariableParser
Examples found in repository?
examples/v1_synthetics_CreateGlobalVariable.rs (line 30)
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());
}
}More examples
examples/v1_synthetics_EditGlobalVariable.rs (line 30)
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());
}
}examples/v1_synthetics_CreateSyntheticsAPITest_1279271422.rs (lines 75-77)
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 142 143 144 145 146 147 148 149 150 151 152 153
async fn main() {
let body =
SyntheticsAPITest::new(
SyntheticsAPITestConfig::new()
.config_variables(
vec![
SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
.example("content-type".to_string())
.pattern("content-type".to_string())
],
)
.steps(
vec![
SyntheticsAPIStep::SyntheticsAPITestStep(
Box::new(
SyntheticsAPITestStep::new(
vec![
SyntheticsAssertion::SyntheticsAssertionTarget(
Box::new(
SyntheticsAssertionTarget::new(
SyntheticsAssertionOperator::IS,
Value::from(200),
SyntheticsAssertionType::STATUS_CODE,
),
),
)
],
"request is sent".to_string(),
SyntheticsTestRequest::new()
.http_version(SyntheticsTestOptionsHTTPVersion::HTTP2)
.method("GET".to_string())
.timeout(10.0 as f64)
.url("https://datadoghq.com".to_string()),
SyntheticsAPITestStepSubtype::HTTP,
)
.allow_failure(true)
.extracted_values(
vec![
SyntheticsParsingOptions::new()
.field("server".to_string())
.name("EXTRACTED_VALUE".to_string())
.parser(
SyntheticsVariableParser::new(
SyntheticsGlobalVariableParserType::RAW,
),
)
.secure(true)
.type_(SyntheticsLocalVariableParsingOptionsType::HTTP_HEADER)
],
)
.is_critical(true)
.retry(SyntheticsTestOptionsRetry::new().count(5).interval(1000.0 as f64)),
),
),
SyntheticsAPIStep::SyntheticsAPIWaitStep(
Box::new(
SyntheticsAPIWaitStep::new("Wait".to_string(), SyntheticsAPIWaitStepSubtype::WAIT, 1),
),
),
SyntheticsAPIStep::SyntheticsAPITestStep(
Box::new(
SyntheticsAPITestStep::new(
vec![
SyntheticsAssertion::SyntheticsAssertionTarget(
Box::new(
SyntheticsAssertionTarget::new(
SyntheticsAssertionOperator::LESS_THAN,
Value::from(1000),
SyntheticsAssertionType::RESPONSE_TIME,
),
),
)
],
"GRPC CALL".to_string(),
SyntheticsTestRequest::new()
.call_type(SyntheticsTestCallType::UNARY)
.compressed_json_descriptor(
"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==".to_string(),
)
.host("grpcbin.test.k6.io".to_string())
.message("{}".to_string())
.metadata(BTreeMap::from([]))
.method("Index".to_string())
.port("9000".to_string())
.service("grpcbin.GRPCBin".to_string()),
SyntheticsAPITestStepSubtype::GRPC,
)
.allow_failure(false)
.extracted_values(vec![])
.is_critical(true)
.retry(SyntheticsTestOptionsRetry::new().count(0).interval(300.0 as f64)),
),
)
],
),
vec!["aws:us-east-2".to_string()],
"BDD test payload: synthetics_api_test_multi_step_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(1000.0 as f64))
.tick_every(60),
SyntheticsAPITestType::API,
)
.subtype(SyntheticsTestDetailsSubType::MULTI)
.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());
}
}sourcepub fn value(self, value: String) -> Self
pub fn value(self, value: String) -> Self
Examples found in repository?
examples/v1_synthetics_CreateGlobalVariable.rs (line 31)
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());
}
}More examples
examples/v1_synthetics_EditGlobalVariable.rs (line 31)
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());
}
}pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
source§impl Clone for SyntheticsVariableParser
impl Clone for SyntheticsVariableParser
source§fn clone(&self) -> SyntheticsVariableParser
fn clone(&self) -> SyntheticsVariableParser
Returns a copy 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 SyntheticsVariableParser
impl Debug for SyntheticsVariableParser
source§impl<'de> Deserialize<'de> for SyntheticsVariableParser
impl<'de> Deserialize<'de> for SyntheticsVariableParser
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 SyntheticsVariableParser
impl PartialEq for SyntheticsVariableParser
source§impl Serialize for SyntheticsVariableParser
impl Serialize for SyntheticsVariableParser
impl StructuralPartialEq for SyntheticsVariableParser
Auto Trait Implementations§
impl Freeze for SyntheticsVariableParser
impl RefUnwindSafe for SyntheticsVariableParser
impl Send for SyntheticsVariableParser
impl Sync for SyntheticsVariableParser
impl Unpin for SyntheticsVariableParser
impl UnwindSafe for SyntheticsVariableParser
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)