pub struct APIManagementAPI { /* private fields */ }
Expand description
Configure your API endpoints through the Datadog API.
Implementations§
Source§impl APIManagementAPI
impl APIManagementAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
8async fn main() {
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.CreateOpenAPI", true);
11 let api = APIManagementAPI::with_config(configuration);
12 let resp = api
13 .create_open_api(
14 CreateOpenAPIOptionalParams::default()
15 .openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
6async fn main() {
7 // there is a valid "managed_api" in the system
8 let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
9 .expect("Invalid UUID");
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.GetOpenAPI", true);
12 let api = APIManagementAPI::with_config(configuration);
13 let resp = api.get_open_api(managed_api_data_id.clone()).await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
6async fn main() {
7 // there is a valid "managed_api" in the system
8 let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
9 .expect("Invalid UUID");
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.DeleteOpenAPI", true);
12 let api = APIManagementAPI::with_config(configuration);
13 let resp = api.delete_open_api(managed_api_data_id.clone()).await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
8async fn main() {
9 // there is a valid "managed_api" in the system
10 let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
11 .expect("Invalid UUID");
12 let mut configuration = datadog::Configuration::new();
13 configuration.set_unstable_operation_enabled("v2.UpdateOpenAPI", true);
14 let api = APIManagementAPI::with_config(configuration);
15 let resp = api
16 .update_open_api(
17 managed_api_data_id.clone(),
18 UpdateOpenAPIOptionalParams::default()
19 .openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
20 )
21 .await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_open_api(
&self,
params: CreateOpenAPIOptionalParams,
) -> Result<CreateOpenAPIResponse, Error<CreateOpenAPIError>>
pub async fn create_open_api( &self, params: CreateOpenAPIOptionalParams, ) -> Result<CreateOpenAPIResponse, Error<CreateOpenAPIError>>
Create a new API from the OpenAPI specification given. See the API Catalog documentation for additional information about the possible metadata. It returns the created API ID.
Examples found in repository?
8async fn main() {
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.CreateOpenAPI", true);
11 let api = APIManagementAPI::with_config(configuration);
12 let resp = api
13 .create_open_api(
14 CreateOpenAPIOptionalParams::default()
15 .openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn create_open_api_with_http_info(
&self,
params: CreateOpenAPIOptionalParams,
) -> Result<ResponseContent<CreateOpenAPIResponse>, Error<CreateOpenAPIError>>
pub async fn create_open_api_with_http_info( &self, params: CreateOpenAPIOptionalParams, ) -> Result<ResponseContent<CreateOpenAPIResponse>, Error<CreateOpenAPIError>>
Create a new API from the OpenAPI specification given. See the API Catalog documentation for additional information about the possible metadata. It returns the created API ID.
Sourcepub async fn delete_open_api(
&self,
id: Uuid,
) -> Result<(), Error<DeleteOpenAPIError>>
pub async fn delete_open_api( &self, id: Uuid, ) -> Result<(), Error<DeleteOpenAPIError>>
Delete a specific API by ID.
Examples found in repository?
6async fn main() {
7 // there is a valid "managed_api" in the system
8 let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
9 .expect("Invalid UUID");
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.DeleteOpenAPI", true);
12 let api = APIManagementAPI::with_config(configuration);
13 let resp = api.delete_open_api(managed_api_data_id.clone()).await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn delete_open_api_with_http_info(
&self,
id: Uuid,
) -> Result<ResponseContent<()>, Error<DeleteOpenAPIError>>
pub async fn delete_open_api_with_http_info( &self, id: Uuid, ) -> Result<ResponseContent<()>, Error<DeleteOpenAPIError>>
Delete a specific API by ID.
Sourcepub async fn get_open_api(
&self,
id: Uuid,
) -> Result<Vec<u8>, Error<GetOpenAPIError>>
pub async fn get_open_api( &self, id: Uuid, ) -> Result<Vec<u8>, Error<GetOpenAPIError>>
Retrieve information about a specific API in OpenAPI format file.
Examples found in repository?
6async fn main() {
7 // there is a valid "managed_api" in the system
8 let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
9 .expect("Invalid UUID");
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.GetOpenAPI", true);
12 let api = APIManagementAPI::with_config(configuration);
13 let resp = api.get_open_api(managed_api_data_id.clone()).await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn get_open_api_with_http_info(
&self,
id: Uuid,
) -> Result<ResponseContent<Vec<u8>>, Error<GetOpenAPIError>>
pub async fn get_open_api_with_http_info( &self, id: Uuid, ) -> Result<ResponseContent<Vec<u8>>, Error<GetOpenAPIError>>
Retrieve information about a specific API in OpenAPI format file.
Sourcepub async fn list_apis(
&self,
params: ListAPIsOptionalParams,
) -> Result<ListAPIsResponse, Error<ListAPIsError>>
pub async fn list_apis( &self, params: ListAPIsOptionalParams, ) -> Result<ListAPIsResponse, Error<ListAPIsError>>
List APIs and their IDs.
Sourcepub async fn list_apis_with_http_info(
&self,
params: ListAPIsOptionalParams,
) -> Result<ResponseContent<ListAPIsResponse>, Error<ListAPIsError>>
pub async fn list_apis_with_http_info( &self, params: ListAPIsOptionalParams, ) -> Result<ResponseContent<ListAPIsResponse>, Error<ListAPIsError>>
List APIs and their IDs.
Sourcepub async fn update_open_api(
&self,
id: Uuid,
params: UpdateOpenAPIOptionalParams,
) -> Result<UpdateOpenAPIResponse, Error<UpdateOpenAPIError>>
pub async fn update_open_api( &self, id: Uuid, params: UpdateOpenAPIOptionalParams, ) -> Result<UpdateOpenAPIResponse, Error<UpdateOpenAPIError>>
Update information about a specific API. The given content will replace all API content of the given ID. The ID is returned by the create API, or can be found in the URL in the API catalog UI.
Examples found in repository?
8async fn main() {
9 // there is a valid "managed_api" in the system
10 let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
11 .expect("Invalid UUID");
12 let mut configuration = datadog::Configuration::new();
13 configuration.set_unstable_operation_enabled("v2.UpdateOpenAPI", true);
14 let api = APIManagementAPI::with_config(configuration);
15 let resp = api
16 .update_open_api(
17 managed_api_data_id.clone(),
18 UpdateOpenAPIOptionalParams::default()
19 .openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
20 )
21 .await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
Sourcepub async fn update_open_api_with_http_info(
&self,
id: Uuid,
params: UpdateOpenAPIOptionalParams,
) -> Result<ResponseContent<UpdateOpenAPIResponse>, Error<UpdateOpenAPIError>>
pub async fn update_open_api_with_http_info( &self, id: Uuid, params: UpdateOpenAPIOptionalParams, ) -> Result<ResponseContent<UpdateOpenAPIResponse>, Error<UpdateOpenAPIError>>
Update information about a specific API. The given content will replace all API content of the given ID. The ID is returned by the create API, or can be found in the URL in the API catalog UI.
Trait Implementations§
Source§impl Clone for APIManagementAPI
impl Clone for APIManagementAPI
Source§fn clone(&self) -> APIManagementAPI
fn clone(&self) -> APIManagementAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more