Skip to content

Commit

Permalink
feat(client-compute-optimizer): In this launch, we add support for sh…
Browse files Browse the repository at this point in the history
…owing integration status with external metric providers such as Instana, Datadog ...etc in GetEC2InstanceRecommendations and ExportEC2InstanceRecommendations apis
  • Loading branch information
awstools committed May 18, 2023
1 parent b61a48c commit c6f5b24
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface ExportEC2InstanceRecommendationsCommandOutput
* },
* ],
* fieldsToExport: [ // ExportableInstanceFields
* "AccountId" || "InstanceArn" || "InstanceName" || "Finding" || "FindingReasonCodes" || "LookbackPeriodInDays" || "CurrentInstanceType" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsEbsReadOpsPerSecondMaximum" || "UtilizationMetricsEbsWriteOpsPerSecondMaximum" || "UtilizationMetricsEbsReadBytesPerSecondMaximum" || "UtilizationMetricsEbsWriteBytesPerSecondMaximum" || "UtilizationMetricsDiskReadOpsPerSecondMaximum" || "UtilizationMetricsDiskWriteOpsPerSecondMaximum" || "UtilizationMetricsDiskReadBytesPerSecondMaximum" || "UtilizationMetricsDiskWriteBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkPacketsInPerSecondMaximum" || "UtilizationMetricsNetworkPacketsOutPerSecondMaximum" || "CurrentOnDemandPrice" || "CurrentStandardOneYearNoUpfrontReservedPrice" || "CurrentStandardThreeYearNoUpfrontReservedPrice" || "CurrentVCpus" || "CurrentMemory" || "CurrentStorage" || "CurrentNetwork" || "RecommendationOptionsInstanceType" || "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" || "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" || "RecommendationOptionsPlatformDifferences" || "RecommendationOptionsPerformanceRisk" || "RecommendationOptionsVcpus" || "RecommendationOptionsMemory" || "RecommendationOptionsStorage" || "RecommendationOptionsNetwork" || "RecommendationOptionsOnDemandPrice" || "RecommendationOptionsStandardOneYearNoUpfrontReservedPrice" || "RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice" || "RecommendationsSourcesRecommendationSourceArn" || "RecommendationsSourcesRecommendationSourceType" || "LastRefreshTimestamp" || "CurrentPerformanceRisk" || "RecommendationOptionsSavingsOpportunityPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrency" || "RecommendationOptionsEstimatedMonthlySavingsValue" || "EffectiveRecommendationPreferencesCpuVendorArchitectures" || "EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics" || "EffectiveRecommendationPreferencesInferredWorkloadTypes" || "InferredWorkloadTypes" || "RecommendationOptionsMigrationEffort" || "EffectiveRecommendationPreferencesExternalMetricsSource" || "InstanceState" || "Tags",
* "AccountId" || "InstanceArn" || "InstanceName" || "Finding" || "FindingReasonCodes" || "LookbackPeriodInDays" || "CurrentInstanceType" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsEbsReadOpsPerSecondMaximum" || "UtilizationMetricsEbsWriteOpsPerSecondMaximum" || "UtilizationMetricsEbsReadBytesPerSecondMaximum" || "UtilizationMetricsEbsWriteBytesPerSecondMaximum" || "UtilizationMetricsDiskReadOpsPerSecondMaximum" || "UtilizationMetricsDiskWriteOpsPerSecondMaximum" || "UtilizationMetricsDiskReadBytesPerSecondMaximum" || "UtilizationMetricsDiskWriteBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkPacketsInPerSecondMaximum" || "UtilizationMetricsNetworkPacketsOutPerSecondMaximum" || "CurrentOnDemandPrice" || "CurrentStandardOneYearNoUpfrontReservedPrice" || "CurrentStandardThreeYearNoUpfrontReservedPrice" || "CurrentVCpus" || "CurrentMemory" || "CurrentStorage" || "CurrentNetwork" || "RecommendationOptionsInstanceType" || "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" || "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" || "RecommendationOptionsPlatformDifferences" || "RecommendationOptionsPerformanceRisk" || "RecommendationOptionsVcpus" || "RecommendationOptionsMemory" || "RecommendationOptionsStorage" || "RecommendationOptionsNetwork" || "RecommendationOptionsOnDemandPrice" || "RecommendationOptionsStandardOneYearNoUpfrontReservedPrice" || "RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice" || "RecommendationsSourcesRecommendationSourceArn" || "RecommendationsSourcesRecommendationSourceType" || "LastRefreshTimestamp" || "CurrentPerformanceRisk" || "RecommendationOptionsSavingsOpportunityPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrency" || "RecommendationOptionsEstimatedMonthlySavingsValue" || "EffectiveRecommendationPreferencesCpuVendorArchitectures" || "EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics" || "EffectiveRecommendationPreferencesInferredWorkloadTypes" || "InferredWorkloadTypes" || "RecommendationOptionsMigrationEffort" || "EffectiveRecommendationPreferencesExternalMetricsSource" || "InstanceState" || "Tags" || "ExternalMetricStatusCode" || "ExternalMetricStatusReason",
* ],
* s3DestinationConfig: { // S3DestinationConfig
* bucket: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ export interface GetEC2InstanceRecommendationsCommandOutput
* // value: "STRING_VALUE",
* // },
* // ],
* // externalMetricStatus: { // ExternalMetricStatus
* // statusCode: "NO_EXTERNAL_METRIC_SET" || "INTEGRATION_SUCCESS" || "DATADOG_INTEGRATION_ERROR" || "DYNATRACE_INTEGRATION_ERROR" || "NEWRELIC_INTEGRATION_ERROR" || "INSTANA_INTEGRATION_ERROR" || "INSUFFICIENT_DATADOG_METRICS" || "INSUFFICIENT_DYNATRACE_METRICS" || "INSUFFICIENT_NEWRELIC_METRICS" || "INSUFFICIENT_INSTANA_METRICS",
* // statusReason: "STRING_VALUE",
* // },
* // },
* // ],
* // errors: [ // GetRecommendationErrors
Expand Down
53 changes: 53 additions & 0 deletions clients/client-compute-optimizer/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,8 @@ export const ExportableInstanceField = {
"EffectiveRecommendationPreferencesExternalMetricsSource",
EFFECTIVE_RECOMMENDATION_PREFERENCES_INFERRED_WORKLOAD_TYPES:
"EffectiveRecommendationPreferencesInferredWorkloadTypes",
EXTERNAL_METRIC_STATUS_CODE: "ExternalMetricStatusCode",
EXTERNAL_METRIC_STATUS_REASON: "ExternalMetricStatusReason",
FINDING: "Finding",
Finding_Reason_Codes: "FindingReasonCodes",
INFERRED_WORKLOAD_TYPES: "InferredWorkloadTypes",
Expand Down Expand Up @@ -2942,6 +2944,50 @@ export interface GetEC2InstanceRecommendationsRequest {
recommendationPreferences?: RecommendationPreferences;
}

/**
* @public
* @enum
*/
export const ExternalMetricStatusCode = {
DATADOG_INTEGRATION_ERROR: "DATADOG_INTEGRATION_ERROR",
DYNATRACE_INTEGRATION_ERROR: "DYNATRACE_INTEGRATION_ERROR",
INSTANA_INTEGRATION_ERROR: "INSTANA_INTEGRATION_ERROR",
INSUFFICIENT_DATADOG_METRICS: "INSUFFICIENT_DATADOG_METRICS",
INSUFFICIENT_DYNATRACE_METRICS: "INSUFFICIENT_DYNATRACE_METRICS",
INSUFFICIENT_INSTANA_METRICS: "INSUFFICIENT_INSTANA_METRICS",
INSUFFICIENT_NEWRELIC_METRICS: "INSUFFICIENT_NEWRELIC_METRICS",
INTEGRATION_SUCCESS: "INTEGRATION_SUCCESS",
NEWRELIC_INTEGRATION_ERROR: "NEWRELIC_INTEGRATION_ERROR",
NO_EXTERNAL_METRIC_SET: "NO_EXTERNAL_METRIC_SET",
} as const;

/**
* @public
*/
export type ExternalMetricStatusCode = (typeof ExternalMetricStatusCode)[keyof typeof ExternalMetricStatusCode];

/**
* @public
* <p>
* Describes Compute Optimizer's integration status with your chosen external metric provider. For example, Datadog.
* </p>
*/
export interface ExternalMetricStatus {
/**
* <p>
* The status code for Compute Optimizer's integration with an external metrics provider.
* </p>
*/
statusCode?: ExternalMetricStatusCode | string;

/**
* <p>
* The reason for Compute Optimizer's integration status with your external metric provider.
* </p>
*/
statusReason?: string;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -3577,6 +3623,13 @@ export interface InstanceRecommendation {
* </p>
*/
tags?: Tag[];

/**
* <p>
* An object that describes Compute Optimizer's integration status with your external metrics provider.
* </p>
*/
externalMetricStatus?: ExternalMetricStatus;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,8 @@ const de_EstimatedMonthlySavings = (output: any, context: __SerdeContext): Estim

// de_ExternalMetricsPreference omitted.

// de_ExternalMetricStatus omitted.

/**
* deserializeAws_json1_0GetAutoScalingGroupRecommendationsResponse
*/
Expand Down Expand Up @@ -2630,6 +2632,7 @@ const de_InstanceRecommendation = (output: any, context: __SerdeContext): Instan
currentInstanceType: __expectString,
currentPerformanceRisk: __expectString,
effectiveRecommendationPreferences: _json,
externalMetricStatus: _json,
finding: __expectString,
findingReasonCodes: _json,
inferredWorkloadTypes: _json,
Expand Down
106 changes: 106 additions & 0 deletions codegen/sdk-codegen/aws-models/compute-optimizer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3626,6 +3626,18 @@
"traits": {
"smithy.api#enumValue": "Tags"
}
},
"EXTERNAL_METRIC_STATUS_CODE": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "ExternalMetricStatusCode"
}
},
"EXTERNAL_METRIC_STATUS_REASON": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "ExternalMetricStatusReason"
}
}
}
},
Expand Down Expand Up @@ -3999,6 +4011,94 @@
"target": "com.amazonaws.computeoptimizer#ExportableVolumeField"
}
},
"com.amazonaws.computeoptimizer#ExternalMetricStatus": {
"type": "structure",
"members": {
"statusCode": {
"target": "com.amazonaws.computeoptimizer#ExternalMetricStatusCode",
"traits": {
"smithy.api#documentation": "<p>\n The status code for Compute Optimizer's integration with an external metrics provider.\n </p>"
}
},
"statusReason": {
"target": "com.amazonaws.computeoptimizer#ExternalMetricStatusReason",
"traits": {
"smithy.api#documentation": "<p>\n The reason for Compute Optimizer's integration status with your external metric provider.\n </p>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>\n Describes Compute Optimizer's integration status with your chosen external metric provider. For example, Datadog.\n </p>"
}
},
"com.amazonaws.computeoptimizer#ExternalMetricStatusCode": {
"type": "enum",
"members": {
"NO_EXTERNAL_METRIC_SET": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "NO_EXTERNAL_METRIC_SET"
}
},
"INTEGRATION_SUCCESS": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "INTEGRATION_SUCCESS"
}
},
"DATADOG_INTEGRATION_ERROR": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "DATADOG_INTEGRATION_ERROR"
}
},
"DYNATRACE_INTEGRATION_ERROR": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "DYNATRACE_INTEGRATION_ERROR"
}
},
"NEWRELIC_INTEGRATION_ERROR": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "NEWRELIC_INTEGRATION_ERROR"
}
},
"INSTANA_INTEGRATION_ERROR": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "INSTANA_INTEGRATION_ERROR"
}
},
"INSUFFICIENT_DATADOG_METRICS": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "INSUFFICIENT_DATADOG_METRICS"
}
},
"INSUFFICIENT_DYNATRACE_METRICS": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "INSUFFICIENT_DYNATRACE_METRICS"
}
},
"INSUFFICIENT_NEWRELIC_METRICS": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "INSUFFICIENT_NEWRELIC_METRICS"
}
},
"INSUFFICIENT_INSTANA_METRICS": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "INSUFFICIENT_INSTANA_METRICS"
}
}
}
},
"com.amazonaws.computeoptimizer#ExternalMetricStatusReason": {
"type": "string"
},
"com.amazonaws.computeoptimizer#ExternalMetricsPreference": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -5583,6 +5683,12 @@
"traits": {
"smithy.api#documentation": "<p>\n A list of tags assigned to your Amazon EC2 instance recommendations.\n </p>"
}
},
"externalMetricStatus": {
"target": "com.amazonaws.computeoptimizer#ExternalMetricStatus",
"traits": {
"smithy.api#documentation": "<p>\n An object that describes Compute Optimizer's integration status with your external metrics provider.\n </p>"
}
}
},
"traits": {
Expand Down

0 comments on commit c6f5b24

Please sign in to comment.