|
| 1 | +//! EC2 capacity manager operations (extracted from the rest long-tail module). |
| 2 | +
|
| 3 | +#![allow(clippy::too_many_lines)] |
| 4 | + |
| 5 | +use super::*; |
| 6 | + |
| 7 | +pub(crate) fn create_capacity_manager_data_export( |
| 8 | + _svc: &Ec2Service, |
| 9 | + req: &AwsRequest, |
| 10 | +) -> Result<AwsResponse, AwsServiceError> { |
| 11 | + require(&req.query_params, "S3BucketName")?; |
| 12 | + require(&req.query_params, "Schedule")?; |
| 13 | + require(&req.query_params, "OutputFormat")?; |
| 14 | + validate_enum(&req.query_params, "Schedule", &["hourly"])?; |
| 15 | + validate_enum(&req.query_params, "OutputFormat", &["csv", "parquet"])?; |
| 16 | + Ok(Ec2Service::respond( |
| 17 | + "CreateCapacityManagerDataExport", |
| 18 | + &req.request_id, |
| 19 | + "", |
| 20 | + )) |
| 21 | +} |
| 22 | + |
| 23 | +pub(crate) fn delete_capacity_manager_data_export( |
| 24 | + _svc: &Ec2Service, |
| 25 | + req: &AwsRequest, |
| 26 | +) -> Result<AwsResponse, AwsServiceError> { |
| 27 | + require(&req.query_params, "CapacityManagerDataExportId")?; |
| 28 | + Ok(Ec2Service::respond( |
| 29 | + "DeleteCapacityManagerDataExport", |
| 30 | + &req.request_id, |
| 31 | + "", |
| 32 | + )) |
| 33 | +} |
| 34 | + |
| 35 | +pub(crate) fn describe_capacity_manager_data_exports( |
| 36 | + _svc: &Ec2Service, |
| 37 | + req: &AwsRequest, |
| 38 | +) -> Result<AwsResponse, AwsServiceError> { |
| 39 | + validate_max_results(&req.query_params, 1, 1000)?; |
| 40 | + Ok(Ec2Service::respond( |
| 41 | + "DescribeCapacityManagerDataExports", |
| 42 | + &req.request_id, |
| 43 | + "", |
| 44 | + )) |
| 45 | +} |
| 46 | + |
| 47 | +pub(crate) fn disable_capacity_manager( |
| 48 | + _svc: &Ec2Service, |
| 49 | + req: &AwsRequest, |
| 50 | +) -> Result<AwsResponse, AwsServiceError> { |
| 51 | + Ok(Ec2Service::respond( |
| 52 | + "DisableCapacityManager", |
| 53 | + &req.request_id, |
| 54 | + "", |
| 55 | + )) |
| 56 | +} |
| 57 | + |
| 58 | +pub(crate) fn enable_capacity_manager( |
| 59 | + _svc: &Ec2Service, |
| 60 | + req: &AwsRequest, |
| 61 | +) -> Result<AwsResponse, AwsServiceError> { |
| 62 | + Ok(Ec2Service::respond( |
| 63 | + "EnableCapacityManager", |
| 64 | + &req.request_id, |
| 65 | + "", |
| 66 | + )) |
| 67 | +} |
| 68 | + |
| 69 | +pub(crate) fn get_capacity_manager_attributes( |
| 70 | + _svc: &Ec2Service, |
| 71 | + req: &AwsRequest, |
| 72 | +) -> Result<AwsResponse, AwsServiceError> { |
| 73 | + Ok(Ec2Service::respond( |
| 74 | + "GetCapacityManagerAttributes", |
| 75 | + &req.request_id, |
| 76 | + "", |
| 77 | + )) |
| 78 | +} |
| 79 | + |
| 80 | +pub(crate) fn get_capacity_manager_metric_data( |
| 81 | + _svc: &Ec2Service, |
| 82 | + req: &AwsRequest, |
| 83 | +) -> Result<AwsResponse, AwsServiceError> { |
| 84 | + validate_int_range(&req.query_params, "Period", 3600, i64::MAX)?; |
| 85 | + require(&req.query_params, "StartTime")?; |
| 86 | + require(&req.query_params, "EndTime")?; |
| 87 | + require(&req.query_params, "Period")?; |
| 88 | + Ok(Ec2Service::respond( |
| 89 | + "GetCapacityManagerMetricData", |
| 90 | + &req.request_id, |
| 91 | + "", |
| 92 | + )) |
| 93 | +} |
| 94 | + |
| 95 | +pub(crate) fn get_capacity_manager_metric_dimensions( |
| 96 | + _svc: &Ec2Service, |
| 97 | + req: &AwsRequest, |
| 98 | +) -> Result<AwsResponse, AwsServiceError> { |
| 99 | + require(&req.query_params, "StartTime")?; |
| 100 | + require(&req.query_params, "EndTime")?; |
| 101 | + Ok(Ec2Service::respond( |
| 102 | + "GetCapacityManagerMetricDimensions", |
| 103 | + &req.request_id, |
| 104 | + "", |
| 105 | + )) |
| 106 | +} |
| 107 | + |
| 108 | +pub(crate) fn get_capacity_manager_monitored_tag_keys( |
| 109 | + _svc: &Ec2Service, |
| 110 | + req: &AwsRequest, |
| 111 | +) -> Result<AwsResponse, AwsServiceError> { |
| 112 | + validate_max_results(&req.query_params, 1, 1000)?; |
| 113 | + Ok(Ec2Service::respond( |
| 114 | + "GetCapacityManagerMonitoredTagKeys", |
| 115 | + &req.request_id, |
| 116 | + "", |
| 117 | + )) |
| 118 | +} |
| 119 | + |
| 120 | +pub(crate) fn update_capacity_manager_monitored_tag_keys( |
| 121 | + _svc: &Ec2Service, |
| 122 | + req: &AwsRequest, |
| 123 | +) -> Result<AwsResponse, AwsServiceError> { |
| 124 | + Ok(Ec2Service::respond( |
| 125 | + "UpdateCapacityManagerMonitoredTagKeys", |
| 126 | + &req.request_id, |
| 127 | + "", |
| 128 | + )) |
| 129 | +} |
| 130 | + |
| 131 | +pub(crate) fn update_capacity_manager_organizations_access( |
| 132 | + _svc: &Ec2Service, |
| 133 | + req: &AwsRequest, |
| 134 | +) -> Result<AwsResponse, AwsServiceError> { |
| 135 | + require(&req.query_params, "OrganizationsAccess")?; |
| 136 | + Ok(Ec2Service::respond( |
| 137 | + "UpdateCapacityManagerOrganizationsAccess", |
| 138 | + &req.request_id, |
| 139 | + "", |
| 140 | + )) |
| 141 | +} |
0 commit comments