#[non_exhaustive]pub struct ServiceDefinitionV2 {
pub contacts: Option<Vec<ServiceDefinitionV2Contact>>,
pub dd_service: String,
pub dd_team: Option<String>,
pub docs: Option<Vec<ServiceDefinitionV2Doc>>,
pub extensions: Option<BTreeMap<String, Value>>,
pub integrations: Option<ServiceDefinitionV2Integrations>,
pub links: Option<Vec<ServiceDefinitionV2Link>>,
pub repos: Option<Vec<ServiceDefinitionV2Repo>>,
pub schema_version: ServiceDefinitionV2Version,
pub tags: Option<Vec<String>>,
pub team: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Service definition V2 for providing service metadata and integrations.
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.contacts: Option<Vec<ServiceDefinitionV2Contact>>
A list of contacts related to the services.
dd_service: String
Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.
dd_team: Option<String>
Experimental feature. A Team handle that matches a Team in the Datadog Teams product.
docs: Option<Vec<ServiceDefinitionV2Doc>>
A list of documentation related to the services.
extensions: Option<BTreeMap<String, Value>>
Extensions to V2 schema.
integrations: Option<ServiceDefinitionV2Integrations>
Third party integrations that Datadog supports.
links: Option<Vec<ServiceDefinitionV2Link>>
A list of links related to the services.
repos: Option<Vec<ServiceDefinitionV2Repo>>
A list of code repositories related to the services.
schema_version: ServiceDefinitionV2Version
Schema version being used.
A set of custom tags.
team: Option<String>
Team that owns the service.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2
impl ServiceDefinitionV2
Sourcepub fn new(
dd_service: String,
schema_version: ServiceDefinitionV2Version,
) -> ServiceDefinitionV2
pub fn new( dd_service: String, schema_version: ServiceDefinitionV2Version, ) -> ServiceDefinitionV2
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 23-26)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn contacts(self, value: Vec<ServiceDefinitionV2Contact>) -> Self
pub fn contacts(self, value: Vec<ServiceDefinitionV2Contact>) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 27-35)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn dd_team(self, value: String) -> Self
pub fn dd_team(self, value: String) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (line 36)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn docs(self, value: Vec<ServiceDefinitionV2Doc>) -> Self
pub fn docs(self, value: Vec<ServiceDefinitionV2Doc>) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 37-41)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn extensions(self, value: BTreeMap<String, Value>) -> Self
pub fn extensions(self, value: BTreeMap<String, Value>) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 42-45)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn integrations(self, value: ServiceDefinitionV2Integrations) -> Self
pub fn integrations(self, value: ServiceDefinitionV2Integrations) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 46-56)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn links(self, value: Vec<ServiceDefinitionV2Link>) -> Self
pub fn links(self, value: Vec<ServiceDefinitionV2Link>) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 57-61)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn repos(self, value: Vec<ServiceDefinitionV2Repo>) -> Self
pub fn repos(self, value: Vec<ServiceDefinitionV2Repo>) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (lines 62-66)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (line 67)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
Sourcepub fn team(self, value: String) -> Self
pub fn team(self, value: String) -> Self
Examples found in repository?
examples/v2_service-definition_CreateOrUpdateServiceDefinitions_1808735248.rs (line 68)
21async fn main() {
22 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2(Box::new(
23 ServiceDefinitionV2::new(
24 "service-exampleservicedefinition".to_string(),
25 ServiceDefinitionV2Version::V2,
26 )
27 .contacts(vec![ServiceDefinitionV2Contact::ServiceDefinitionV2Email(
28 Box::new(
29 ServiceDefinitionV2Email::new(
30 "contact@datadoghq.com".to_string(),
31 ServiceDefinitionV2EmailType::EMAIL,
32 )
33 .name("Team Email".to_string()),
34 ),
35 )])
36 .dd_team("my-team".to_string())
37 .docs(vec![ServiceDefinitionV2Doc::new(
38 "Architecture".to_string(),
39 "https://gdrive/mydoc".to_string(),
40 )
41 .provider("google drive".to_string())])
42 .extensions(BTreeMap::from([(
43 "myorgextension".to_string(),
44 Value::from("extensionvalue"),
45 )]))
46 .integrations(
47 ServiceDefinitionV2Integrations::new()
48 .opsgenie(
49 ServiceDefinitionV2Opsgenie::new(
50 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
51 .to_string(),
52 )
53 .region(ServiceDefinitionV2OpsgenieRegion::US),
54 )
55 .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService".to_string()),
56 )
57 .links(vec![ServiceDefinitionV2Link::new(
58 "Runbook".to_string(),
59 ServiceDefinitionV2LinkType::RUNBOOK,
60 "https://my-runbook".to_string(),
61 )])
62 .repos(vec![ServiceDefinitionV2Repo::new(
63 "Source Code".to_string(),
64 "https://github.com/DataDog/schema".to_string(),
65 )
66 .provider("GitHub".to_string())])
67 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
68 .team("my-team".to_string()),
69 ));
70 let configuration = datadog::Configuration::new();
71 let api = ServiceDefinitionAPI::with_config(configuration);
72 let resp = api.create_or_update_service_definitions(body).await;
73 if let Ok(value) = resp {
74 println!("{:#?}", value);
75 } else {
76 println!("{:#?}", resp.unwrap_err());
77 }
78}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ServiceDefinitionV2
impl Clone for ServiceDefinitionV2
Source§fn clone(&self) -> ServiceDefinitionV2
fn clone(&self) -> ServiceDefinitionV2
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 ServiceDefinitionV2
impl Debug for ServiceDefinitionV2
Source§impl<'de> Deserialize<'de> for ServiceDefinitionV2
impl<'de> Deserialize<'de> for ServiceDefinitionV2
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 ServiceDefinitionV2
impl PartialEq for ServiceDefinitionV2
Source§impl Serialize for ServiceDefinitionV2
impl Serialize for ServiceDefinitionV2
impl StructuralPartialEq for ServiceDefinitionV2
Auto Trait Implementations§
impl Freeze for ServiceDefinitionV2
impl RefUnwindSafe for ServiceDefinitionV2
impl Send for ServiceDefinitionV2
impl Sync for ServiceDefinitionV2
impl Unpin for ServiceDefinitionV2
impl UnwindSafe for ServiceDefinitionV2
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