OrgConnectionsAPI

Struct OrgConnectionsAPI 

Source
pub struct OrgConnectionsAPI { /* private fields */ }
Expand description

Manage connections between organizations. Org connections allow for controlled sharing of data between different Datadog organizations. See the Cross-Organization Visibiltiy page for more information.

Implementations§

Source§

impl OrgConnectionsAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_org-connections_ListOrgConnections.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrgConnectionsAPI::with_config(configuration);
9    let resp = api.list_org_connections().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_org-connections_DeleteOrgConnections.rs (line 12)
6async fn main() {
7    // there is a valid "org_connection" in the system
8    let org_connection_data_id =
9        uuid::Uuid::parse_str(&std::env::var("ORG_CONNECTION_DATA_ID").unwrap())
10            .expect("Invalid UUID");
11    let configuration = datadog::Configuration::new();
12    let api = OrgConnectionsAPI::with_config(configuration);
13    let resp = api
14        .delete_org_connections(org_connection_data_id.clone())
15        .await;
16    if let Ok(value) = resp {
17        println!("{:#?}", value);
18    } else {
19        println!("{:#?}", resp.unwrap_err());
20    }
21}
examples/v2_org-connections_CreateOrgConnections.rs (line 28)
15async fn main() {
16    let body = OrgConnectionCreateRequest::new(OrgConnectionCreate::new(
17        OrgConnectionCreateAttributes::new(vec![OrgConnectionTypeEnum::LOGS]),
18        OrgConnectionCreateRelationships::new(
19            OrgConnectionOrgRelationship::new().data(
20                OrgConnectionOrgRelationshipData::new()
21                    .id("83999dcd-7f97-11f0-8de1-1ecf66f1aa85".to_string())
22                    .type_(OrgConnectionOrgRelationshipDataType::ORGS),
23            ),
24        ),
25        OrgConnectionType::ORG_CONNECTION,
26    ));
27    let configuration = datadog::Configuration::new();
28    let api = OrgConnectionsAPI::with_config(configuration);
29    let resp = api.create_org_connections(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
examples/v2_org-connections_UpdateOrgConnections.rs (line 25)
11async fn main() {
12    // there is a valid "org_connection" in the system
13    let org_connection_data_id =
14        uuid::Uuid::parse_str(&std::env::var("ORG_CONNECTION_DATA_ID").unwrap())
15            .expect("Invalid UUID");
16    let body = OrgConnectionUpdateRequest::new(OrgConnectionUpdate::new(
17        OrgConnectionUpdateAttributes::new(vec![
18            OrgConnectionTypeEnum::LOGS,
19            OrgConnectionTypeEnum::METRICS,
20        ]),
21        org_connection_data_id.clone(),
22        OrgConnectionType::ORG_CONNECTION,
23    ));
24    let configuration = datadog::Configuration::new();
25    let api = OrgConnectionsAPI::with_config(configuration);
26    let resp = api
27        .update_org_connections(org_connection_data_id.clone(), body)
28        .await;
29    if let Ok(value) = resp {
30        println!("{:#?}", value);
31    } else {
32        println!("{:#?}", resp.unwrap_err());
33    }
34}
Source

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

Source

pub async fn create_org_connections( &self, body: OrgConnectionCreateRequest, ) -> Result<OrgConnectionResponse, Error<CreateOrgConnectionsError>>

Create a new org connection between the current org and a target org.

Examples found in repository?
examples/v2_org-connections_CreateOrgConnections.rs (line 29)
15async fn main() {
16    let body = OrgConnectionCreateRequest::new(OrgConnectionCreate::new(
17        OrgConnectionCreateAttributes::new(vec![OrgConnectionTypeEnum::LOGS]),
18        OrgConnectionCreateRelationships::new(
19            OrgConnectionOrgRelationship::new().data(
20                OrgConnectionOrgRelationshipData::new()
21                    .id("83999dcd-7f97-11f0-8de1-1ecf66f1aa85".to_string())
22                    .type_(OrgConnectionOrgRelationshipDataType::ORGS),
23            ),
24        ),
25        OrgConnectionType::ORG_CONNECTION,
26    ));
27    let configuration = datadog::Configuration::new();
28    let api = OrgConnectionsAPI::with_config(configuration);
29    let resp = api.create_org_connections(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
Source

pub async fn create_org_connections_with_http_info( &self, body: OrgConnectionCreateRequest, ) -> Result<ResponseContent<OrgConnectionResponse>, Error<CreateOrgConnectionsError>>

Create a new org connection between the current org and a target org.

Source

pub async fn delete_org_connections( &self, connection_id: Uuid, ) -> Result<(), Error<DeleteOrgConnectionsError>>

Delete an existing org connection.

Examples found in repository?
examples/v2_org-connections_DeleteOrgConnections.rs (line 14)
6async fn main() {
7    // there is a valid "org_connection" in the system
8    let org_connection_data_id =
9        uuid::Uuid::parse_str(&std::env::var("ORG_CONNECTION_DATA_ID").unwrap())
10            .expect("Invalid UUID");
11    let configuration = datadog::Configuration::new();
12    let api = OrgConnectionsAPI::with_config(configuration);
13    let resp = api
14        .delete_org_connections(org_connection_data_id.clone())
15        .await;
16    if let Ok(value) = resp {
17        println!("{:#?}", value);
18    } else {
19        println!("{:#?}", resp.unwrap_err());
20    }
21}
Source

pub async fn delete_org_connections_with_http_info( &self, connection_id: Uuid, ) -> Result<ResponseContent<()>, Error<DeleteOrgConnectionsError>>

Delete an existing org connection.

Source

pub async fn list_org_connections( &self, ) -> Result<OrgConnectionListResponse, Error<ListOrgConnectionsError>>

Returns a list of org connections.

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

pub async fn list_org_connections_with_http_info( &self, ) -> Result<ResponseContent<OrgConnectionListResponse>, Error<ListOrgConnectionsError>>

Returns a list of org connections.

Source

pub async fn update_org_connections( &self, connection_id: Uuid, body: OrgConnectionUpdateRequest, ) -> Result<OrgConnectionResponse, Error<UpdateOrgConnectionsError>>

Update an existing org connection.

Examples found in repository?
examples/v2_org-connections_UpdateOrgConnections.rs (line 27)
11async fn main() {
12    // there is a valid "org_connection" in the system
13    let org_connection_data_id =
14        uuid::Uuid::parse_str(&std::env::var("ORG_CONNECTION_DATA_ID").unwrap())
15            .expect("Invalid UUID");
16    let body = OrgConnectionUpdateRequest::new(OrgConnectionUpdate::new(
17        OrgConnectionUpdateAttributes::new(vec![
18            OrgConnectionTypeEnum::LOGS,
19            OrgConnectionTypeEnum::METRICS,
20        ]),
21        org_connection_data_id.clone(),
22        OrgConnectionType::ORG_CONNECTION,
23    ));
24    let configuration = datadog::Configuration::new();
25    let api = OrgConnectionsAPI::with_config(configuration);
26    let resp = api
27        .update_org_connections(org_connection_data_id.clone(), body)
28        .await;
29    if let Ok(value) = resp {
30        println!("{:#?}", value);
31    } else {
32        println!("{:#?}", resp.unwrap_err());
33    }
34}
Source

pub async fn update_org_connections_with_http_info( &self, connection_id: Uuid, body: OrgConnectionUpdateRequest, ) -> Result<ResponseContent<OrgConnectionResponse>, Error<UpdateOrgConnectionsError>>

Update an existing org connection.

Trait Implementations§

Source§

impl Clone for OrgConnectionsAPI

Source§

fn clone(&self) -> OrgConnectionsAPI

Returns a duplicate 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 OrgConnectionsAPI

Source§

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

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

impl Default for OrgConnectionsAPI

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,