#[non_exhaustive]pub struct ServiceDefinitionV2Dot2 {Show 16 fields
pub application: Option<String>,
pub ci_pipeline_fingerprints: Option<Vec<String>>,
pub contacts: Option<Vec<ServiceDefinitionV2Dot2Contact>>,
pub dd_service: String,
pub description: Option<String>,
pub extensions: Option<BTreeMap<String, Value>>,
pub integrations: Option<ServiceDefinitionV2Dot2Integrations>,
pub languages: Option<Vec<String>>,
pub lifecycle: Option<String>,
pub links: Option<Vec<ServiceDefinitionV2Dot2Link>>,
pub schema_version: ServiceDefinitionV2Dot2Version,
pub tags: Option<Vec<String>>,
pub team: Option<String>,
pub tier: Option<String>,
pub type_: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Service definition v2.2 for providing service metadata and integrations.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.application: Option<String>
Identifier for a group of related services serving a product feature, which the service is a part of.
ci_pipeline_fingerprints: Option<Vec<String>>
A set of CI fingerprints.
contacts: Option<Vec<ServiceDefinitionV2Dot2Contact>>
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.
description: Option<String>
A short description of the service.
extensions: Option<BTreeMap<String, Value>>
Extensions to v2.2 schema.
integrations: Option<ServiceDefinitionV2Dot2Integrations>
Third party integrations that Datadog supports.
languages: Option<Vec<String>>
The service’s programming language. Datadog recognizes the following languages: dotnet
, go
, java
, js
, php
, python
, ruby
, and c++
.
lifecycle: Option<String>
The current life cycle phase of the service.
links: Option<Vec<ServiceDefinitionV2Dot2Link>>
A list of links related to the services.
schema_version: ServiceDefinitionV2Dot2Version
Schema version being used.
A set of custom tags.
team: Option<String>
Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.
tier: Option<String>
Importance of the service.
type_: Option<String>
The type of service.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceDefinitionV2Dot2
impl ServiceDefinitionV2Dot2
Sourcepub fn new(
dd_service: String,
schema_version: ServiceDefinitionV2Dot2Version,
) -> ServiceDefinitionV2Dot2
pub fn new( dd_service: String, schema_version: ServiceDefinitionV2Dot2Version, ) -> ServiceDefinitionV2Dot2
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 application(self, value: String) -> Self
pub fn application(self, value: String) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 ci_pipeline_fingerprints(self, value: Vec<String>) -> Self
pub fn ci_pipeline_fingerprints(self, value: Vec<String>) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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<ServiceDefinitionV2Dot2Contact>) -> Self
pub fn contacts(self, value: Vec<ServiceDefinitionV2Dot2Contact>) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 description(self, value: String) -> Self
pub fn description(self, value: String) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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: ServiceDefinitionV2Dot2Integrations) -> Self
pub fn integrations(self, value: ServiceDefinitionV2Dot2Integrations) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 languages(self, value: Vec<String>) -> Self
pub fn languages(self, value: Vec<String>) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 lifecycle(self, value: String) -> Self
pub fn lifecycle(self, value: String) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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<ServiceDefinitionV2Dot2Link>) -> Self
pub fn links(self, value: Vec<ServiceDefinitionV2Dot2Link>) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "service-exampleservicedefinition".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
24 "contact@datadoghq.com".to_string(),
25 "email".to_string(),
26 )
27 .name("Team Email".to_string())])
28 .extensions(BTreeMap::from([(
29 "myorgextension".to_string(),
30 Value::from("extensionvalue"),
31 )]))
32 .integrations(
33 ServiceDefinitionV2Dot2Integrations::new()
34 .opsgenie(
35 ServiceDefinitionV2Dot2Opsgenie::new(
36 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
37 .to_string(),
38 )
39 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
40 )
41 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
42 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
43 )),
44 )
45 .links(vec![
46 ServiceDefinitionV2Dot2Link::new(
47 "Runbook".to_string(),
48 "runbook".to_string(),
49 "https://my-runbook".to_string(),
50 ),
51 ServiceDefinitionV2Dot2Link::new(
52 "Source Code".to_string(),
53 "repo".to_string(),
54 "https://github.com/DataDog/schema".to_string(),
55 )
56 .provider("GitHub".to_string()),
57 ServiceDefinitionV2Dot2Link::new(
58 "Architecture".to_string(),
59 "doc".to_string(),
60 "https://my-runbook".to_string(),
61 )
62 .provider("Gigoogle drivetHub".to_string()),
63 ])
64 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
65 .team("my-team".to_string()),
66 ));
67 let configuration = datadog::Configuration::new();
68 let api = ServiceDefinitionAPI::with_config(configuration);
69 let resp = api.create_or_update_service_definitions(body).await;
70 if let Ok(value) = resp {
71 println!("{:#?}", value);
72 } else {
73 println!("{:#?}", resp.unwrap_err());
74 }
75}
More examples
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 tier(self, value: String) -> Self
pub fn tier(self, value: String) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 type_(self, value: String) -> Self
pub fn type_(self, value: String) -> Self
Examples found in repository?
17async fn main() {
18 let body = ServiceDefinitionsCreateRequest::ServiceDefinitionV2Dot2(Box::new(
19 ServiceDefinitionV2Dot2::new(
20 "my-service".to_string(),
21 ServiceDefinitionV2Dot2Version::V2_2,
22 )
23 .application("my-app".to_string())
24 .ci_pipeline_fingerprints(vec!["j88xdEy0J5lc".to_string(), "eZ7LMljCk8vo".to_string()])
25 .contacts(vec![ServiceDefinitionV2Dot2Contact::new(
26 "https://teams.microsoft.com/myteam".to_string(),
27 "slack".to_string(),
28 )
29 .name("My team channel".to_string())])
30 .description("My service description".to_string())
31 .extensions(BTreeMap::from([(
32 "myorg/extension".to_string(),
33 Value::from("extensionValue"),
34 )]))
35 .integrations(
36 ServiceDefinitionV2Dot2Integrations::new()
37 .opsgenie(
38 ServiceDefinitionV2Dot2Opsgenie::new(
39 "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
40 .to_string(),
41 )
42 .region(ServiceDefinitionV2Dot2OpsgenieRegion::US),
43 )
44 .pagerduty(ServiceDefinitionV2Dot2Pagerduty::new().service_url(
45 "https://my-org.pagerduty.com/service-directory/PMyService".to_string(),
46 )),
47 )
48 .languages(vec![
49 "dotnet".to_string(),
50 "go".to_string(),
51 "java".to_string(),
52 "js".to_string(),
53 "php".to_string(),
54 "python".to_string(),
55 "ruby".to_string(),
56 "c++".to_string(),
57 ])
58 .lifecycle("sandbox".to_string())
59 .links(vec![ServiceDefinitionV2Dot2Link::new(
60 "Runbook".to_string(),
61 "runbook".to_string(),
62 "https://my-runbook".to_string(),
63 )
64 .provider("Github".to_string())])
65 .tags(vec!["my:tag".to_string(), "service:tag".to_string()])
66 .team("my-team".to_string())
67 .tier("High".to_string())
68 .type_("web".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 ServiceDefinitionV2Dot2
impl Clone for ServiceDefinitionV2Dot2
Source§fn clone(&self) -> ServiceDefinitionV2Dot2
fn clone(&self) -> ServiceDefinitionV2Dot2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more