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
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api
.create_open_api(
CreateOpenAPIOptionalParams::default()
.openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "managed_api" in the system
let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
.expect("Invalid UUID");
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api.get_open_api(managed_api_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "managed_api" in the system
let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
.expect("Invalid UUID");
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api.delete_open_api(managed_api_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() {
// there is a valid "managed_api" in the system
let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
.expect("Invalid UUID");
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api
.update_open_api(
managed_api_data_id.clone(),
UpdateOpenAPIOptionalParams::default()
.openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api
.create_open_api(
CreateOpenAPIOptionalParams::default()
.openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "managed_api" in the system
let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
.expect("Invalid UUID");
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api.delete_open_api(managed_api_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "managed_api" in the system
let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
.expect("Invalid UUID");
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api.get_open_api(managed_api_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() {
// there is a valid "managed_api" in the system
let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
.expect("Invalid UUID");
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateOpenAPI", true);
let api = APIManagementAPI::with_config(configuration);
let resp = api
.update_open_api(
managed_api_data_id.clone(),
UpdateOpenAPIOptionalParams::default()
.openapi_spec_file(fs::read("openapi-spec.yaml").unwrap()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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 moresource§impl Debug for APIManagementAPI
impl Debug for APIManagementAPI
Auto Trait Implementations§
impl Freeze for APIManagementAPI
impl !RefUnwindSafe for APIManagementAPI
impl Send for APIManagementAPI
impl Sync for APIManagementAPI
impl Unpin for APIManagementAPI
impl !UnwindSafe for APIManagementAPI
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
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)
clone_to_uninit)